Skip to content
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

[test] jdi: fix .jar ClassPath for I-Build #496

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Vector;

import org.eclipse.debug.jdi.tests.program.MainClass;
import org.eclipse.jdi.Bootstrap;
import org.eclipse.jdi.internal.VirtualMachineImpl;

Expand Down Expand Up @@ -119,7 +121,16 @@ public AbstractJDITest(String name) {
static {
fTargetAddress = System.getProperty("java.home");
fVMLauncherName = "DefaultVMLauncher";
fClassPath = new File("./bin").getAbsolutePath();
try {
String cp = MainClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
System.out.println("MainClass path=" + cp);
if (new File(cp).isDirectory() && !cp.endsWith(File.separatorChar + "/bin/" + File.separatorChar)) {
cp += "bin/" + File.separatorChar;
}
fClassPath = new File(cp).getAbsolutePath();
} catch (URISyntaxException e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we need the name of the jar, not of any file inside. The proposed solution is basically a copy paste of org.eclipse.test.internal.AwtScreenshot.dumpAwtScreenshot(String). However i have not tested it and would like to just let it try on i-build

throw new RuntimeException(e);
}
fBootPath = "";
fVMType = "?";
}
Expand Down
Loading