• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / jmockit1 / 496

15 Nov 2025 05:33PM UTC coverage: 72.192% (-0.008%) from 72.2%
496

push

github

web-flow
Merge pull request #412 from hazendaz/renovate/major-spring-core

Update spring core to v7 (major)

5677 of 8360 branches covered (67.91%)

Branch coverage included in aggregate %.

11922 of 16018 relevant lines covered (74.43%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.22
/coverageTests/src/main/java/integration/tests/other/control/structures/SwitchStatements.java
1
/*
2
 * MIT License
3
 * Copyright (c) 2006-2025 JMockit developers
4
 * See LICENSE file for full license text.
5
 */
6
package integration.tests.other.control.structures;
7

8
public final class SwitchStatements {
1✔
9
    void switchStatementWithSparseCasesAndDefault(char c) {
10
        switch (c) {
1!
11
            case 'A':
12
                System.gc();
1✔
13
                break;
1✔
14
            case 'f': {
15
                boolean b = true;
×
16
                System.gc();
×
17
                System.runFinalization();
×
18
                break;
×
19
            }
20
            case '\0':
21
                return;
1✔
22
            default:
23
                throw new IllegalArgumentException();
×
24
        }
25
    }
1✔
26

27
    void anotherSwitchStatementWithSparseCasesAndDefault(char c) {
28
        switch (c) {
1!
29
            case 'B':
30
                System.gc();
×
31
                break;
×
32
            default:
33
                System.runFinalization();
1✔
34
        }
35
    }
1✔
36

37
    void switchStatementWithCompactCasesAndDefault(int i) {
38
        switch (i) {
1!
39
            case 1:
40
                System.gc();
×
41
                break;
×
42
            case 2: {
43
                boolean b = true;
1✔
44
                System.gc();
1✔
45
                System.runFinalization();
1✔
46
                break;
1✔
47
            }
48
            case 4:
49
                return;
1✔
50
            default:
51
                throw new IllegalArgumentException();
×
52
        }
53
    }
1✔
54

55
    void anotherSwitchStatementWithCompactCasesAndDefault(int i) {
56
        // @formatter:off
57
        switch (i) {
1✔
58
            case 1: System.gc(); break;
1✔
59
            default: System.runFinalization();
1✔
60
        }
61
        // @formatter:on
62
    }
1✔
63

64
    void switchStatementWithSparseCasesAndNoDefault(char c) {
65
        switch (c) {
1!
66
            case 'A':
67
                System.gc();
×
68
                break;
×
69
            case 'f':
70
                System.runFinalization();
1✔
71
                break;
72
        }
73
    }
1✔
74

75
    boolean switchStatementWithCompactCasesAndNoDefault(int i) {
76
        boolean b = true;
1✔
77

78
        // @formatter:off
79
        switch (i) {
1!
80
            case 1: System.gc(); return b;
×
81
            case 2: System.runFinalization(); return b;
×
82
            case 4: b = false;
1✔
83
        }
84
        // @formatter:on
85

86
        return b;
1✔
87
    }
88

89
    char switchStatementWithExitInAllCases(int i) {
90
        switch (i) {
1!
91
            case 1:
92
                return 'a';
1✔
93
            case 2:
94
                return 'b';
1✔
95
            default:
96
                throw new IllegalArgumentException();
×
97
        }
98
    }
99

100
    int switchOnString(String s, boolean b) {
101
        switch (s) {
1✔
102
            case "A":
103
                return 1;
1✔
104
            default:
105
                return b ? 2 : 3;
1!
106
        }
107
    }
108
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc