Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2020-05-28 05:59:51 +0000
committerSarika Sinha2020-06-02 11:20:56 +0000
commit5e2ee41758355d9ed945a8ec9ba5be31396dac75 (patch)
tree800fa74617b7ab97c1af423bed7aa774cee8fd99
parent9746b04bceedb83f12158e4e219054cb966815b5 (diff)
downloadeclipse.jdt.debug-R4_16_maintenance.tar.gz
eclipse.jdt.debug-R4_16_maintenance.tar.xz
eclipse.jdt.debug-R4_16_maintenance.zip
Bug 561967 - [Tests] 3 tests failing on cen64-gtk3 since I20200406-0350S4_16_0_RC2R4_16I20200604-0540I20200603-0600I20200602-1800R4_16_maintenance
user.home can be empty in testClasspathOnlyJarUsedForLongClasspathOnJava8 Change-Id: Ic500d0c08f5045d7f4a1303820d0668e53f38736
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/ClasspathShortenerTests.java8
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java10
2 files changed, 14 insertions, 4 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 e150c4336..22a124740 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
@@ -209,8 +209,12 @@ public class ClasspathShortenerTests extends AbstractDebugTest {
assertArrayEquals(new String[] { JAVA_8_PATH, ENCODING_ARG, "-cp", 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 testClasspathEnvVariableUsedForLongClasspathOnJava8OnWindows() {
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java
index b3f4e8ae9..467029e66 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/launching/LongModulePathTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 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
@@ -38,6 +38,7 @@ import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.debug.core.IJavaThread;
import org.eclipse.jdt.debug.testplugin.JavaProjectHelper;
import org.eclipse.jdt.debug.tests.AbstractDebugTest;
+import org.eclipse.jdt.debug.tests.TestUtil;
import org.eclipse.jdt.internal.launching.LaunchingPlugin;
import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
@@ -82,6 +83,10 @@ public class LongModulePathTests extends AbstractDebugTest {
* When JVM > 9, an argument file for the modulepath is created when modulepath is too long
*/
public void testVeryLongModulepathWithArgumentFile() throws Exception {
+ // Disabled for OS other than Win due to Bug 561967
+ if (!Platform.getOS().equals(Platform.OS_WIN32)) {
+ return;
+ }
// Given
javaProject = createJavaProjectClone("testVeryLongModulePath", CLASSPATH_PROJECT_CONTENT_PATH.toString(), JavaProjectHelper.JAVA_SE_9_EE_NAME, true);
useComplianceFromExecutionEnvironment(javaProject);
@@ -89,7 +94,8 @@ public class LongModulePathTests extends AbstractDebugTest {
launchConfiguration = createLaunchConfigurationStopInMain(javaProject, MAIN_TYPE_NAME);
int minModulePathLength = 300000;
setLongModulepath(javaProject, minModulePathLength);
- waitForBuild();
+ TestUtil.waitForJobs("testVeryLongModulePath", 100, 10000);
+ TestUtil.runEventLoop();
// When
thread = launchAndSuspend(launchConfiguration);

Back to the top