Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2022-04-05 07:13:36 +0000
committerAndrey Loskutov2022-04-05 07:48:47 +0000
commit7eeb9b4342d4d83f3a5a1d078a4e4dff0ab83bb2 (patch)
tree91ca6998d772dc6669788ac18098fe2e44260dbc
parent2c4f420d39cd348ce45c9f86fae237a1cef9547d (diff)
downloadeclipse.jdt.core-master.tar.gz
eclipse.jdt.core-master.tar.xz
eclipse.jdt.core-master.zip
Added timeout on Mac so the jar is considered as changed. Change-Id: Ibdd363ff847bbca4ff067a79719abdad05a473c1 Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/192494 Tested-by: JDT Bot <jdt-bot@eclipse.org> Reviewed-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java5
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java1
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java2
3 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java
index 7fa90820ee..4b24418344 100644
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java
+++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java
@@ -448,6 +448,11 @@ public void testChangeZIPArchive2() throws Exception {
fullBuild(projectPath);
expectingNoProblems();
+ if (Util.isMacOS()) {
+ // Wait a moment so the jar timestamp will be different
+ Thread.sleep(2000);
+ }
+
org.eclipse.jdt.core.tests.util.Util.createJar(
new String[] {
"p/X.java",
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
index b9f9454e90..c682c68856 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java
@@ -1073,6 +1073,7 @@ public static boolean isFileDeleted(File file) {
return !file.exists() && getParentChildFile(file) == null;
}
public static boolean isMacOS() {
+ // Alternative: "macosx".equals(System.getProperty("osgi.os"))
return System.getProperty("os.name").indexOf("Mac") != -1;
}
/**
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
index 47aa1e26c7..3787075229 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
@@ -3624,7 +3624,7 @@ public void testExtraLibraries11() throws Exception {
JavaCore.VERSION_1_4);
createFile("/P/lib2.jar", "");
startDeltas();
- if ("macosx".equals(System.getProperty("osgi.os"))) {
+ if (Util.isMacOS()) {
// necessary for filesystems with timestamps only upto seconds (eg. Mac)
// "lib1.jar" was created above and is modified below.
Thread.sleep(2000);

Back to the top