JacocoProfile implements Profile, Option { public static JacocoProfile enabled(String parameters) { return new JacocoProfile(parameters, true); } @OptionsByType.Default  JacocoProfile(String parameters);  JacocoProfile(String parameters, boolean enabled); static JacocoProfile enabled(String parameters); static JacocoProfile disabled(); static JacocoProfile fromSystemProperty(); static JacocoProfile fromSystemProperty(String extraParams); @Override void onLaunching(Platform      platform,
                            MetaClass     metaClass,
                            OptionsByType optionsByType); @Override void onLaunched(Platform      platform,
                           Application   application,
                           OptionsByType optionsByType); @Override void onClosing(Platform      platform,
                          Application   application,
                          OptionsByType optionsByType);  }
@Test public void shouldEstablishJaCoCoProfileUsingAnOption() throws Exception { String jacocoDestinationFileName = "jacoco-${bedrock.runtime.id}.exec"; File destinationFile = new File(System.getProperty("java.io.tmpdir"), jacocoDestinationFileName); JacocoProfile profile = JacocoProfile.enabled("destfile=" + destinationFile); LocalPlatform platform = LocalPlatform.get(); File telemetricsFile; try (JavaApplication application = platform.launch(JavaApplication.class, ClassName.of(SleepingApplication.class), IPv4Preferred.yes(), profile)) { ExpressionEvaluator evaluator = new ExpressionEvaluator(application.getOptions()); telemetricsFile = new File(System.getProperty("java.io.tmpdir"), evaluator.evaluate(jacocoDestinationFileName, String.class)); } assertThat(telemetricsFile.exists(), is(true)); assertThat(telemetricsFile.length(), is(greaterThan(0L))); }