-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consume PIT Maven artifacts through TP #195
Labels
impacts: dev 💻
Has an effect on contributors' work
Comments
I'm experiencing class loading problems in tests, e.g.,
Maybe due to public class MutationCoverageReport {
public static void main(final String[] args) {
final PluginServices plugins = PluginServices.makeForContextLoader(); and public static PluginServices makeForContextLoader() {
return new PluginServices(IsolationUtils.getContextClassLoader());
} |
In PitRunnerTests I changed the way we load jars private static List<String> classPathWithPitestAndJUnit() throws IOException {
final String jarDir = "lib";
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<EquinoxBundle> 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<String> locations = pitestWrappedBundles.stream()
.map(b -> b.getLocation())
.collect(Collectors.toList());
// hack, exclude JUnit 5?
locations.remove(locations.size() - 1);
List<String> 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;
} but again that does not work |
Another symptom that something is wrong with classloading is this test
which retrieves an empty set... |
LorenzoBettini
added a commit
that referenced
this issue
Jul 28, 2022
Still not working Task-Url: #195
LorenzoBettini
added a commit
that referenced
this issue
Jul 28, 2022
For the moment, I'm stopping working on that; maybe in the future, I'll get back to that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now that PDE (and Tycho) support specifying Maven artifacts directly in the .target file
The text was updated successfully, but these errors were encountered: