@Test public void shouldReturnNullByDefault() { Configuration config = Configuration.create(new HashMap<>()); assertThat(JaCoCoArgumentsBuilder.getJaCoCoArgument(config)).isNull(); }
public static String getJaCoCoArgument(Configuration config) { String computeCoverage = config.getString("orchestrator.computeCoverage", "false"); if (!"true".equals(computeCoverage)) { return null; } String destFile = config.getString("orchestrator.coverageReportPath", "target/jacoco.exec"); destFile = FilenameUtils.separatorsToUnix(destFile); File jacocoLocation = config.locators().locate(agentLocation); if (jacocoLocation == null) { throw new IllegalStateException("Unable to locate jacoco: " + agentLocation + " in " + config.fileSystem().mavenLocalRepository()); } String agentPath = FilenameUtils.separatorsToUnix(jacocoLocation.getAbsolutePath()); return new StringBuilder("-javaagent:") .append(agentPath) .append("=destfile=").append(destFile).append(",") .append("append=true,") .append("excludes=").append(EXCLUDES).append(",") .append("includes=").append(INCLUDES) .toString(); }
JaCoCoArgumentsBuilder { public static String getJaCoCoArgument(Configuration config) { String computeCoverage = config.getString("orchestrator.computeCoverage", "false"); if (!"true".equals(computeCoverage)) { return null; } String destFile = config.getString("orchestrator.coverageReportPath", "target/jacoco.exec"); destFile = FilenameUtils.separatorsToUnix(destFile); File jacocoLocation = config.locators().locate(agentLocation); if (jacocoLocation == null) { throw new IllegalStateException("Unable to locate jacoco: " + agentLocation + " in " + config.fileSystem().mavenLocalRepository()); } String agentPath = FilenameUtils.separatorsToUnix(jacocoLocation.getAbsolutePath()); return new StringBuilder("-javaagent:") .append(agentPath) .append("=destfile=").append(destFile).append(",") .append("append=true,") .append("excludes=").append(EXCLUDES).append(",") .append("includes=").append(INCLUDES) .toString(); } }
JaCoCoArgumentsBuilder { public static String getJaCoCoArgument(Configuration config) { String computeCoverage = config.getString("orchestrator.computeCoverage", "false"); if (!"true".equals(computeCoverage)) { return null; } String destFile = config.getString("orchestrator.coverageReportPath", "target/jacoco.exec"); destFile = FilenameUtils.separatorsToUnix(destFile); File jacocoLocation = config.locators().locate(agentLocation); if (jacocoLocation == null) { throw new IllegalStateException("Unable to locate jacoco: " + agentLocation + " in " + config.fileSystem().mavenLocalRepository()); } String agentPath = FilenameUtils.separatorsToUnix(jacocoLocation.getAbsolutePath()); return new StringBuilder("-javaagent:") .append(agentPath) .append("=destfile=").append(destFile).append(",") .append("append=true,") .append("excludes=").append(EXCLUDES).append(",") .append("includes=").append(INCLUDES) .toString(); } private  JaCoCoArgumentsBuilder(); }
JaCoCoArgumentsBuilder { public static String getJaCoCoArgument(Configuration config) { String computeCoverage = config.getString("orchestrator.computeCoverage", "false"); if (!"true".equals(computeCoverage)) { return null; } String destFile = config.getString("orchestrator.coverageReportPath", "target/jacoco.exec"); destFile = FilenameUtils.separatorsToUnix(destFile); File jacocoLocation = config.locators().locate(agentLocation); if (jacocoLocation == null) { throw new IllegalStateException("Unable to locate jacoco: " + agentLocation + " in " + config.fileSystem().mavenLocalRepository()); } String agentPath = FilenameUtils.separatorsToUnix(jacocoLocation.getAbsolutePath()); return new StringBuilder("-javaagent:") .append(agentPath) .append("=destfile=").append(destFile).append(",") .append("append=true,") .append("excludes=").append(EXCLUDES).append(",") .append("includes=").append(INCLUDES) .toString(); } private  JaCoCoArgumentsBuilder(); static String getJaCoCoArgument(Configuration config); }
JaCoCoArgumentsBuilder { public static String getJaCoCoArgument(Configuration config) { String computeCoverage = config.getString("orchestrator.computeCoverage", "false"); if (!"true".equals(computeCoverage)) { return null; } String destFile = config.getString("orchestrator.coverageReportPath", "target/jacoco.exec"); destFile = FilenameUtils.separatorsToUnix(destFile); File jacocoLocation = config.locators().locate(agentLocation); if (jacocoLocation == null) { throw new IllegalStateException("Unable to locate jacoco: " + agentLocation + " in " + config.fileSystem().mavenLocalRepository()); } String agentPath = FilenameUtils.separatorsToUnix(jacocoLocation.getAbsolutePath()); return new StringBuilder("-javaagent:") .append(agentPath) .append("=destfile=").append(destFile).append(",") .append("append=true,") .append("excludes=").append(EXCLUDES).append(",") .append("includes=").append(INCLUDES) .toString(); } private  JaCoCoArgumentsBuilder(); static String getJaCoCoArgument(Configuration config);  }