Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2020-05-27 09:18:28 +0000
committerSarika Sinha2020-05-27 09:49:44 +0000
commit9746b04bceedb83f12158e4e219054cb966815b5 (patch)
tree4754873a19c0aca8cbd15efa02023f4e87b412e1
parent24c902dc95adaf885e41db96320cfc3c78af29d3 (diff)
downloadeclipse.jdt.debug-9746b04bceedb83f12158e4e219054cb966815b5.tar.gz
eclipse.jdt.debug-9746b04bceedb83f12158e4e219054cb966815b5.tar.xz
eclipse.jdt.debug-9746b04bceedb83f12158e4e219054cb966815b5.zip
user.home may not be available for docker image Change-Id: Ic0bba1be6889dad943f3c30fb166ba4be221cbd1
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ClasspathShortenerTests.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ClasspathShortenerTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ClasspathShortenerTests.java
index 6c7a43de2..e150c4336 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ClasspathShortenerTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ClasspathShortenerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018, 2019 Cedric Chabanois and others.
+ * Copyright (c) 2018, 2020 Cedric Chabanois and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -123,8 +123,12 @@ public class ClasspathShortenerTests extends AbstractDebugTest {
assertArrayEquals(new String[] { JAVA_10_PATH, ENCODING_ARG, "-classpath", classpathShortener.getProcessTempFiles().get(0).getAbsolutePath(),
MAIN_CLASS, "-arg1", "arg2" }, classpathShortener.getCmdLine());
List<File> classpathJars = getClasspathJarsFromJarManifest(classpathShortener.getProcessTempFiles().get(0));
- assertEquals(new File(userHomePath("/workspace/myProject/bin")), classpathJars.get(0).getCanonicalFile());
- assertEquals(new File(userHomePath("/workspace/myProject/lib/lib 1.jar")), classpathJars.get(1).getCanonicalFile());
+ String filePathSuffix = new File(userHomePath("/workspace/myProject/bin")).getPath();
+ int index = classpathJars.get(0).getCanonicalFile().getPath().lastIndexOf(filePathSuffix);
+ assertTrue("First Classpath jar file location not found", index != -1);
+ filePathSuffix = new File(userHomePath("/workspace/myProject/lib/lib 1.jar")).getPath();
+ index = classpathJars.get(1).getCanonicalFile().getPath().lastIndexOf(filePathSuffix);
+ assertTrue("Second Classpath jar file location not found", index != -1);
}
public void testArgFileUsedForLongClasspathOnJava9() throws Exception {

Back to the top