diff --git a/bundles/org.pitest.bundles/.classpath b/bundles/org.pitest.bundles/.classpath new file mode 100644 index 00000000..075009d7 --- /dev/null +++ b/bundles/org.pitest.bundles/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/bundles/org.pitest.bundles/.project b/bundles/org.pitest.bundles/.project new file mode 100644 index 00000000..2818c746 --- /dev/null +++ b/bundles/org.pitest.bundles/.project @@ -0,0 +1,28 @@ + + + org.pitest.bundles + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.pitest.bundles/.settings/org.eclipse.core.resources.prefs b/bundles/org.pitest.bundles/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/bundles/org.pitest.bundles/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/bundles/org.pitest.bundles/.settings/org.eclipse.jdt.core.prefs b/bundles/org.pitest.bundles/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..9d373aa5 --- /dev/null +++ b/bundles/org.pitest.bundles/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,21 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter= +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error diff --git a/bundles/org.pitest.bundles/.settings/org.eclipse.jdt.launching.prefs b/bundles/org.pitest.bundles/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000..d177941e --- /dev/null +++ b/bundles/org.pitest.bundles/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=ignore +org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore diff --git a/bundles/org.pitest.bundles/META-INF/MANIFEST.MF b/bundles/org.pitest.bundles/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5a26400e --- /dev/null +++ b/bundles/org.pitest.bundles/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Pitest Bundles +Bundle-SymbolicName: org.pitest.bundles;singleton:=true +Bundle-Version: 2.2.0.qualifier +Bundle-Vendor: Henry Coles +Automatic-Module-Name: org.pitest.bundles +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Require-Bundle: wrapped.org.pitest.pitest;visibility:=reexport, + wrapped.org.pitest.pitest-command-line;visibility:=reexport, + wrapped.org.pitest.pitest-entry;visibility:=reexport, + wrapped.org.pitest.pitest-html-report;visibility:=reexport, + org.junit;bundle-version="4.12.0" diff --git a/bundles/org.pitest.bundles/build.properties b/bundles/org.pitest.bundles/build.properties new file mode 100644 index 00000000..7594fab8 --- /dev/null +++ b/bundles/org.pitest.bundles/build.properties @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + . diff --git a/bundles/org.pitest.pitclipse.core/META-INF/MANIFEST.MF b/bundles/org.pitest.pitclipse.core/META-INF/MANIFEST.MF index c613868a..d455dc48 100644 --- a/bundles/org.pitest.pitclipse.core/META-INF/MANIFEST.MF +++ b/bundles/org.pitest.pitclipse.core/META-INF/MANIFEST.MF @@ -7,9 +7,9 @@ Bundle-Activator: org.pitest.pitclipse.core.PitCoreActivator Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.11.1,4.0.0)", org.eclipse.jdt.core;bundle-version="[3.11.2,4.0.0)", org.pitest.pitclipse.runner;bundle-version="[2.0.0,3.0.0)", - org.pitest;bundle-version="1.6.8", org.eclipse.core.resources;bundle-version="[3.10.1,4.0.0)", - org.eclipse.ui;bundle-version="[3.107.0,4.0.0)" + org.eclipse.ui;bundle-version="[3.107.0,4.0.0)", + org.pitest.bundles;visibility:=reexport Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: Pitest.org diff --git a/bundles/org.pitest.pitclipse.listeners/META-INF/MANIFEST.MF b/bundles/org.pitest.pitclipse.listeners/META-INF/MANIFEST.MF index c33c0a05..0de60b3c 100644 --- a/bundles/org.pitest.pitclipse.listeners/META-INF/MANIFEST.MF +++ b/bundles/org.pitest.pitclipse.listeners/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Pitclipse's Pitest Listeners Bundle-SymbolicName: org.pitest.pitclipse.listeners Bundle-Version: 2.2.0.qualifier -Fragment-Host: org.pitest;bundle-version="1.6.8" +Fragment-Host: org.pitest.bundles;bundle-version="1.6.8" Automatic-Module-Name: org.pitest.pitclipse.listeners Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.pitest.pitclipse.runner;bundle-version="2.0.0" diff --git a/bundles/org.pitest.pitclipse.runner/META-INF/MANIFEST.MF b/bundles/org.pitest.pitclipse.runner/META-INF/MANIFEST.MF index 93f5bbf0..4f1e6735 100644 --- a/bundles/org.pitest.pitclipse.runner/META-INF/MANIFEST.MF +++ b/bundles/org.pitest.pitclipse.runner/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Version: 2.2.0.qualifier Bundle-Vendor: Pitest.org Automatic-Module-Name: org.pitest.pitclipse.runner Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.pitest;bundle-version="1.6.8" +Require-Bundle: org.pitest.bundles;visibility:=reexport Export-Package: org.pitest.pitclipse.runner, org.pitest.pitclipse.runner.client, org.pitest.pitclipse.runner.config, diff --git a/features/org.pitest.feature/feature.xml b/features/org.pitest.feature/feature.xml index 23cde71a..87cbf2e1 100644 --- a/features/org.pitest.feature/feature.xml +++ b/features/org.pitest.feature/feature.xml @@ -218,15 +218,10 @@ - - + version="0.0.0" + unpack="false"/> diff --git a/releng/org.pitest.pitclipse.target/org.pitest.pitclipse.target.target b/releng/org.pitest.pitclipse.target/org.pitest.pitclipse.target.target index 17218039..35c6bb49 100644 --- a/releng/org.pitest.pitclipse.target/org.pitest.pitclipse.target.target +++ b/releng/org.pitest.pitclipse.target/org.pitest.pitclipse.target.target @@ -1,6 +1,6 @@ - + @@ -62,16 +62,34 @@ io.cucumber - cucumber-junit + cucumber-java 4.3.0 jar io.cucumber - cucumber-java + cucumber-junit 4.3.0 jar + + org.pitest + pitest-command-line + 1.6.8 + jar + + + org.pitest + pitest-html-report + 1.6.8 + jar + + + org.pitest + pitest-junit5-plugin + 0.14 + jar + diff --git a/tests/org.pitest.pitclipse.runner.tests/org.pitest.pitclipse.runner.tests.launch b/tests/org.pitest.pitclipse.runner.tests/org.pitest.pitclipse.runner.tests.launch index 93e03165..9e5b268e 100644 --- a/tests/org.pitest.pitclipse.runner.tests/org.pitest.pitclipse.runner.tests.launch +++ b/tests/org.pitest.pitclipse.runner.tests/org.pitest.pitclipse.runner.tests.launch @@ -24,7 +24,9 @@ - + + + diff --git a/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/PitRunnerTest.java b/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/PitRunnerTest.java index dde6dd28..286072b5 100644 --- a/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/PitRunnerTest.java +++ b/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/PitRunnerTest.java @@ -33,16 +33,21 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.core.runtime.Platform; +import org.eclipse.osgi.internal.framework.EquinoxBundle; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import org.junit.Before; import org.junit.Test; +import org.osgi.framework.Bundle; import org.pitest.mutationtest.MutationResultListenerFactory; import org.pitest.pitclipse.example.empty.EmptyClass; import org.pitest.pitclipse.runner.results.ObjectFactory; @@ -157,24 +162,41 @@ private static PitOptions options(String classUnderTest, List classesToM private static List classPathWithPitestAndJUnit() throws IOException { final String jarDir = "lib"; - return asList( - // TODO [Refactor] Pitest's classpath should be managed by the org.pitest bundle - getBundleFile(Platform.getBundle("org.pitest")).getCanonicalPath(), - getBundleFile(Platform.getBundle("org.pitest.pitclipse.runner")).getCanonicalPath(), - getBundleFile(Platform.getBundle("org.pitest.pitclipse.runner")).getCanonicalPath() + File.separator + BUILD_OUTPUT_DIR, - getBundleFile(Platform.getBundle("org.pitest")).getCanonicalPath() - + File.separator + jarDir + File.separator + "pitest.jar", - getBundleFile(Platform.getBundle("org.pitest")).getCanonicalPath() - + File.separator + jarDir + File.separator + "pitest-entry.jar", - getBundleFile(Platform.getBundle("org.pitest")).getCanonicalPath() - + File.separator + jarDir + File.separator + "pitest-command-line.jar", - getBundleFile(Platform.getBundle("org.pitest")).getCanonicalPath() - + File.separator + jarDir + File.separator + "pitest-html-report.jar", - getBundleFile(Platform.getBundle("com.google.guava")).getCanonicalPath(), - // Add .class files to mutate - new File(BUILD_OUTPUT_DIR).getAbsolutePath(), - // Add JUnit dependency - new File("lib/junit.jar").getAbsolutePath() - ); + EquinoxBundle pitestBundle = (EquinoxBundle) Platform.getBundle("org.pitest.bundles"); + Bundle[] bundles = Platform.getBundle("org.eclipse.core.runtime").getBundleContext().getBundles(); + System.out.println("symbolic name: " + pitestBundle.getSymbolicName()); + List pitestWrappedBundles = Stream.of(bundles) + .filter(b -> b instanceof EquinoxBundle) + .map(b -> (EquinoxBundle) b) + .filter(b -> b.getSymbolicName().startsWith("wrapped.org.pitest")) + .collect(Collectors.toList()); + List locations = pitestWrappedBundles.stream() + .map(b -> b.getLocation()) + .collect(Collectors.toList()); + // hack, exclude JUnit 5? + locations.remove(locations.size() - 1); + + + List classPath = new ArrayList<>(); + +// classPath.add(getBundleFile(pitestBundle).getCanonicalPath()); + + classPath.add(getBundleFile(Platform.getBundle("org.pitest.pitclipse.runner")).getCanonicalPath()); + classPath.add(getBundleFile(Platform.getBundle("org.pitest.pitclipse.runner")).getCanonicalPath() + File.separator + BUILD_OUTPUT_DIR); + + for (Bundle bundle : pitestWrappedBundles) { + classPath.add(getBundleFile(bundle).getCanonicalPath()); + } + + // Guava is needed + classPath.add(getBundleFile(Platform.getBundle("com.google.guava")).getCanonicalPath()); + + // Add .class files to mutate + classPath.add(new File(BUILD_OUTPUT_DIR).getAbsolutePath()); + + // Add JUnit dependency + classPath.add(new File("lib/junit.jar").getAbsolutePath()); + + return classPath; } } diff --git a/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListenerFactoryTest.java b/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListenerFactoryTest.java index cbb4428a..678f9d0d 100644 --- a/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListenerFactoryTest.java +++ b/tests/org.pitest.pitclipse.runner.tests/src/org/pitest/pitclipse/runner/results/summary/SummaryResultListenerFactoryTest.java @@ -33,7 +33,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) public class SummaryResultListenerFactoryTest { private final SummaryResultListenerFactory factory = new SummaryResultListenerFactory(); diff --git a/tests/org.pitest.pitclipse.ui.tests/META-INF/MANIFEST.MF b/tests/org.pitest.pitclipse.ui.tests/META-INF/MANIFEST.MF index 3bbcd8d0..92813a86 100644 --- a/tests/org.pitest.pitclipse.ui.tests/META-INF/MANIFEST.MF +++ b/tests/org.pitest.pitclipse.ui.tests/META-INF/MANIFEST.MF @@ -13,7 +13,6 @@ Require-Bundle: org.eclipse.swtbot.eclipse.finder, org.pitest.pitclipse.runner;bundle-version="2.0.0", org.apache.log4j;bundle-version="1.2.15", org.eclipse.swtbot.junit4_x, - org.pitest;bundle-version="1.6.8", org.objenesis;bundle-version="1.0.0", org.eclipse.ui, org.eclipse.core.runtime, @@ -29,4 +28,5 @@ Require-Bundle: org.eclipse.swtbot.eclipse.finder, wrapped.io.cucumber.cucumber-java;bundle-version="4.3.0", wrapped.io.cucumber.cucumber-junit;bundle-version="4.3.0", wrapped.io.cucumber.cucumber-core;bundle-version="4.3.0", - wrapped.io.cucumber.datatable;bundle-version="1.1.12" + wrapped.io.cucumber.datatable;bundle-version="1.1.12", + org.pitest.bundles