Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayaprakash Arthanareeswaran2014-03-15 20:36:34 +0000
committerJayaprakash Arthanareeswaran2014-03-15 20:50:16 +0000
commita4ad2d57dad8cd0a00e5934bb21519b3cade23e0 (patch)
tree572a444da03674cc8b3f1c6c74f66be7d282fb27 /org.eclipse.jdt.compiler.tool.tests
parent25aed55a9c18e4d19bbfcdb990f7c354c6c9bf14 (diff)
downloadeclipse.jdt.core-a4ad2d57dad8cd0a00e5934bb21519b3cade23e0.tar.gz
eclipse.jdt.core-a4ad2d57dad8cd0a00e5934bb21519b3cade23e0.tar.xz
eclipse.jdt.core-a4ad2d57dad8cd0a00e5934bb21519b3cade23e0.zip
Bug 430451 - Tests fail in
org.eclipse.jdt.compiler.tool.tests.CompilerInvocationTests with JRE 1.8
Diffstat (limited to 'org.eclipse.jdt.compiler.tool.tests')
-rw-r--r--org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java
index 276565ea39..35ebe2cc28 100644
--- a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java
+++ b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerInvocationTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -302,6 +302,15 @@ class SubstringDetector extends java.util.logging.Logger {
return this.matchFound;
}
}
+protected void compareFileLocations(String[] expected, Iterator<? extends File> actual) {
+ int i = 0;
+ while(actual.hasNext() && i < expected.length) {
+ assertEquals("Path mismatch", expected[i], actual.next().toString());
+ i++;
+ }
+ assertEquals("Incorret no of files in path", i, expected.length);
+ assertFalse("Incorrect no of files in path", actual.hasNext());
+}
// most possibly basic test
public void test001_basic() {
runTest(
@@ -347,7 +356,7 @@ public void test002_dash_d_option() {
new String[] { /* classFileNames */
"X.class"
});
- assertEquals(OUTPUT_DIR, javacStandardJavaFileManager.getLocation(StandardLocation.CLASS_OUTPUT).toString());
+ compareFileLocations(new String[]{OUTPUT_DIR}, javacStandardJavaFileManager.getLocation(StandardLocation.CLASS_OUTPUT).iterator());
}
// exploring -d / FileManager interaction
// -d changes CLASS_OUTPUT location (OUTPUT_DIR subdirectory)
@@ -375,7 +384,7 @@ public void test003_dash_d_option() {
new String[] { /* classFileNames */
"bin/X.class"
});
- assertEquals(outputDir, javacStandardJavaFileManager.getLocation(StandardLocation.CLASS_OUTPUT).toString());
+ compareFileLocations(new String[]{outputDir}, javacStandardJavaFileManager.getLocation(StandardLocation.CLASS_OUTPUT).iterator());
}
// exploring -d / FileManager interaction
// ecj uses the output location from the javac standard Java file manager if it
@@ -439,7 +448,7 @@ public void test005_dash_d_option_custom_file_manager() {
new String[] { /* classFileNames */
"X.class"
});
- assertEquals(OUTPUT_DIR, customJavaFileManager.getLocation(StandardLocation.CLASS_OUTPUT).toString());
+ compareFileLocations(new String[]{OUTPUT_DIR}, customJavaFileManager.getLocation(StandardLocation.CLASS_OUTPUT).iterator());
assertFalse(customJavaFileManager.matchFound());
if (RUN_JAVAC && JAVAC_COMPILER != null) {
customJavaFileManager = new SetLocationDetector(javacJavaFileManager,

Back to the top