Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2017-07-05 06:41:07 +0000
committerManoj Palat2017-07-05 06:41:07 +0000
commit5ce7453e49b2a207bcdf54002f9512a6a81eadb5 (patch)
treedcb4ebc2c316a4747d0e3a3340745f4373f31b41
parent47823422eba45476fbb1c7ac6844f82de383c7c6 (diff)
downloadeclipse.jdt.core-5ce7453e49b2a207bcdf54002f9512a6a81eadb5.tar.gz
eclipse.jdt.core-5ce7453e49b2a207bcdf54002f9512a6a81eadb5.tar.xz
eclipse.jdt.core-5ce7453e49b2a207bcdf54002f9512a6a81eadb5.zip
Fix for Bug 518668: [9][test] ASTConverter tests failure
-rw-r--r--org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jarbin0 -> 21072 bytes
-rw-r--r--org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zipbin0 -> 9267 bytes
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java32
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java10
4 files changed, 26 insertions, 16 deletions
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar
new file mode 100644
index 0000000000..6f2af93c90
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9.jar
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip
new file mode 100644
index 0000000000..d46027f686
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.model/JCL/converterJclMin9src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
index 8604b5cf50..f6fd5c0b5e 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter9Test.java
@@ -37,6 +37,8 @@ public class ASTConverter9Test extends ConverterTestSetup {
ICompilationUnit workingCopy;
private static boolean isJRE9 = false;
+ private static final String jcl9lib = "CONVERTER_JCL9_LIB";
+
public void setUpSuite() throws Exception {
super.setUpSuite();
@@ -50,7 +52,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
static {
// TESTS_NUMBERS = new int[] { 19 };
// TESTS_RANGE = new int[] { 1, -1 };
-// TESTS_NAMES = new String[] {"testBug515875_005"};
+// TESTS_NAMES = new String[] {"testBug515875_002"};
}
public static Test suite() {
String javaVersion = System.getProperty("java.version");
@@ -197,7 +199,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
public void testBug512023_0001() throws Exception {
try {
- IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String content =
@@ -329,7 +331,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
public void testBug515875_001() throws Exception {
try {
- IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String content =
@@ -372,7 +374,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
public void testBug515875_002() throws Exception {
try {
- IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {"JCL19_LIB"}, "bin", "9");
+ IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String fileContent =
@@ -387,7 +389,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
"package pack1;\n" +
"public class X11 implements pack22.I22{}\n");
- IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String secondFile =
@@ -429,11 +431,11 @@ public class ASTConverter9Test extends ConverterTestSetup {
IModuleBinding[] reqs = moduleBinding.getRequiredModules();
assertTrue("Null requires", reqs != null);
- assertTrue("incorrect number of requires modules", reqs.length == 1);
- IModuleBinding req11 = reqs[0];
- assertTrue("incorrect name for requires modules", req11.getName().equals("second"));
+ assertTrue("incorrect number of requires modules", reqs.length == 2);
+ assertTrue("incorrect name for requires modules", reqs[0].getName().equals("java.base"));
+ assertTrue("incorrect name for requires modules", reqs[1].getName().equals("second"));
- IPackageBinding[] secPacks = req11.getExportedPackages();
+ IPackageBinding[] secPacks = reqs[1].getExportedPackages();
assertTrue("Packages Exported in second module null", secPacks != null);
assertTrue("Incorrect number of exported packages in second module", secPacks.length == 1);
IPackageBinding pack22 = secPacks[0];
@@ -465,7 +467,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
public void testBug515875_003() throws Exception {
try {
- IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String fileContent =
@@ -479,7 +481,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
"package pack1;\n" +
"public class X11 implements pack22.I22{}\n");
- IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String secondFile =
@@ -521,7 +523,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
public void testBug515875_004() throws Exception {
try {
- IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String fileContent =
@@ -535,7 +537,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
"package pack1;\n" +
"public class X11 implements pack22.I22{}\n");
- IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String secondFile =
@@ -582,7 +584,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
public void testBug515875_005() throws Exception {
try {
- IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project1 = createJavaProject("ConverterTests9", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project1.open(null);
addClasspathEntry(project1, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String fileContent =
@@ -601,7 +603,7 @@ public class ASTConverter9Test extends ConverterTestSetup {
"package pack1;\n" +
"public class X12 implements pack22.I22{}\n");
- IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {"JCL18_LIB"}, "bin", "9");
+ IJavaProject project2 = createJavaProject("second", new String[] {"src"}, new String[] {jcl9lib}, "bin", "9");
project2.open(null);
addClasspathEntry(project2, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.MODULE_PATH")));
String secondFile =
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
index bf682918f5..c39b1fbe46 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java
@@ -143,7 +143,7 @@ public abstract class ConverterTestSetup extends AbstractASTTests {
new IPath[] {getConverterJCLPath("1.7"), getConverterJCLSourcePath("1.7"), getConverterJCLRootSourcePath()},
null);
}
- } else if ("1.8".equals(compliance) || "9".equals(compliance)) {
+ } else if ("1.8".equals(compliance)) {
if (JavaCore.getClasspathVariable("CONVERTER_JCL18_LIB") == null) {
setupExternalJCL("converterJclMin1.8");
JavaCore.setClasspathVariables(
@@ -151,6 +151,14 @@ public abstract class ConverterTestSetup extends AbstractASTTests {
new IPath[] {getConverterJCLPath("1.8"), getConverterJCLSourcePath("1.8"), getConverterJCLRootSourcePath()},
null);
}
+ } else if ("9".equals(compliance)) {
+ if (JavaCore.getClasspathVariable("CONVERTER_JCL9_LIB") == null) {
+ setupExternalJCL("converterJclMin9");
+ JavaCore.setClasspathVariables(
+ new String[] {"CONVERTER_JCL9_LIB", "CONVERTER_JCL9_SRC", "CONVERTER_JCL9_SRCROOT"},
+ new IPath[] {getConverterJCLPath("9"), getConverterJCLSourcePath("9"), getConverterJCLRootSourcePath()},
+ null);
+ }
} else if (JavaCore.getClasspathVariable("CONVERTER_JCL_LIB") == null) {
setupExternalJCL("converterJclMin");
JavaCore.setClasspathVariables(

Back to the top