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

hazendaz / jmockit1 / 85

26 Apr 2025 06:37PM UTC coverage: 73.285% (-0.02%) from 73.308%
85

push

github

web-flow
Merge pull request #327 from hazendaz/paths

Use nio more per modernizer and update more tests to junit 5

5625 of 8178 branches covered (68.78%)

Branch coverage included in aggregate %.

5 of 43 new or added lines in 14 files covered. (11.63%)

3 existing lines in 3 files now uncovered.

11885 of 15715 relevant lines covered (75.63%)

0.76 hits per line

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

9.52
/main/src/main/java/mockit/coverage/Configuration.java
1
/*
2
 * Copyright (c) 2006 JMockit developers
3
 * This file is subject to the terms of the MIT license (see LICENSE.txt).
4
 */
5
package mockit.coverage;
6

7
import edu.umd.cs.findbugs.annotations.NonNull;
8
import edu.umd.cs.findbugs.annotations.Nullable;
9

10
import java.nio.file.Files;
11
import java.nio.file.Path;
12

13
public final class Configuration {
14
    private static final String COVERAGE_PREFIX = "coverage-";
15

16
    private Configuration() {
17
    }
18

19
    @Nullable
20
    public static String getProperty(@NonNull String nameSuffix) {
21
        return getProperty(nameSuffix, null);
1✔
22
    }
23

24
    public static String getProperty(@NonNull String nameSuffix, @Nullable String defaultValue) {
25
        return System.getProperty(COVERAGE_PREFIX + nameSuffix, defaultValue);
1✔
26
    }
27

28
    @Nullable
29
    public static String getOrChooseOutputDirectory(@NonNull String outputDir) {
30
        if (!outputDir.isEmpty()) {
×
31
            return outputDir;
×
32
        }
33

34
        return isTargetSubDirectoryAvailable() ? "target" : null;
×
35
    }
36

37
    private static boolean isTargetSubDirectoryAvailable() {
NEW
38
        return System.getProperty("basedir") != null || Files.exists(Path.of("target"));
×
39
    }
40

41
    @NonNull
42
    public static String getOrChooseOutputDirectory(@NonNull String outputDir, @NonNull String defaultDir) {
43
        if (!outputDir.isEmpty()) {
×
44
            return outputDir;
×
45
        }
46

47
        return isTargetSubDirectoryAvailable() ? "target/" + defaultDir : defaultDir;
×
48
    }
49
}
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