diff options
| author | Mike Rennie | 2013-03-19 16:13:51 +0000 |
|---|---|---|
| committer | Mike Rennie | 2013-03-19 16:13:51 +0000 |
| commit | 856bc4b097dac02c6c1703e17560d3ea22861b05 (patch) | |
| tree | 42fa3feb6742c7e8b2a421a9c143b71a7af48501 | |
| parent | 83655c5d1780a74e2d7c6b667c44ad80f8afb577 (diff) | |
| download | eclipse.pde.ui-856bc4b097dac02c6c1703e17560d3ea22861b05.tar.gz eclipse.pde.ui-856bc4b097dac02c6c1703e17560d3ea22861b05.tar.xz eclipse.pde.ui-856bc4b097dac02c6c1703e17560d3ea22861b05.zip | |
Bug 403258 - Use problem...tests
| -rw-r--r-- | apitools/org.eclipse.pde.api.tools.tests/API Tools Plugin Test Suite.launch | 5 | ||||
| -rw-r--r-- | apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/ClassUsageTests.java | 51 | ||||
| -rw-r--r-- | apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testC11.java (renamed from apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testc11.java) | 35 | ||||
| -rw-r--r-- | apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testC12.java (renamed from apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testc12.java) | 23 |
4 files changed, 53 insertions, 61 deletions
diff --git a/apitools/org.eclipse.pde.api.tools.tests/API Tools Plugin Test Suite.launch b/apitools/org.eclipse.pde.api.tools.tests/API Tools Plugin Test Suite.launch index 04495cacf3..cbb9f1d722 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/API Tools Plugin Test Suite.launch +++ b/apitools/org.eclipse.pde.api.tools.tests/API Tools Plugin Test Suite.launch @@ -26,13 +26,14 @@ <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> +<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.pde.api.tools.tests.ApiToolsPluginTestSuite"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.pde.api.tools.tests"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx384m -XX:MaxPermSize=128M"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m -XX:MaxPermSize=128M"/> <stringAttribute key="pde.version" value="3.3"/> <stringAttribute key="product" value="org.eclipse.sdk.ide"/> <booleanAttribute key="run_in_ui_thread" value="true"/> diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/ClassUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/ClassUsageTests.java index 90aecebfca..64643a6448 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/ClassUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/ClassUsageTests.java @@ -325,9 +325,10 @@ public class ClassUsageTests extends UsageTest { * that illegally implement interfaces * * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403258 + * @since 1.0.300 * @throws Exception */ - public void _testLocalClassIllegalImplements1I() throws Exception { + public void testLocalClassIllegalImplements1I() throws Exception { x19(true); } @@ -336,25 +337,29 @@ public class ClassUsageTests extends UsageTest { * that illegally implement interfaces * * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403258 + * @since 1.0.300 * @throws Exception */ - public void _testLocalClassIllegalImplements1F() throws Exception { + public void testLocalClassIllegalImplements1F() throws Exception { x19(false); } private void x19(boolean inc) { - setExpectedProblemIds(new int[] { - getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.LOCAL_TYPE), - getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE), - getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.LOCAL_TYPE), - getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE) + int localId = getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.LOCAL_TYPE); + int indId = getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE); + setExpectedProblemIds(new int[] {localId, indId, localId, indId}); + String typename = "testC11"; + setExpectedLineMappings(new LineMapping[] { + new LineMapping(29, localId, new String[] {"local1", "x.y.z.testC11.method1()", "INoImpl2"}), + new LineMapping(31, indId, new String[] {"local2", "x.y.z.testC11.method1()", "INoImpl2", "INoImpl5"}), + new LineMapping(21, localId, new String[] {"local3", "x.y.z.testC11.inner1.method2()", "INoImpl3"}), + new LineMapping(23, indId, new String[] {"local4", "x.y.z.testC11.inner1.method2()", "INoImpl2", "INoImpl6"}) }); - String typename = "testc11"; setExpectedMessageArgs(new String[][] { - {"local1", "x.y.z.testc11.method1()", "INoImpl2"}, - {"local2", "x.y.z.testc11.method1()", "INoImpl2", "INoImpl5"}, - {"local3", "x.y.z.outer.inner2.method2()", "INoImpl3"}, - {"local4", "x.y.z.outer.inner2.method2()", "INoImpl2", "INoImpl6"} + {"local1", "x.y.z.testC11.method1()", "INoImpl2"}, + {"local2", "x.y.z.testC11.method1()", "INoImpl2", "INoImpl5"}, + {"local3", "x.y.z.testC11.inner1.method2()", "INoImpl3"}, + {"local4", "x.y.z.testC11.inner1.method2()", "INoImpl2", "INoImpl6"} }); deployUsageTest(typename, inc); } @@ -365,9 +370,10 @@ public class ClassUsageTests extends UsageTest { * compilation unit indirectly implementing the same interface via the same proxy interface * * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403258 + * @since 1.0.300 * @throws Exception */ - public void _testLocalClassIllegaImplements2I() throws Exception { + public void testLocalClassIllegaImplements2I() throws Exception { x20(true); } @@ -377,22 +383,25 @@ public class ClassUsageTests extends UsageTest { * compilation unit indirectly implementing the same interface via the same proxy interface * * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=403258 + * @since 1.0.300 * @throws Exception */ - public void _testLocalClassIllegalImplements2F() throws Exception { + public void testLocalClassIllegalImplements2F() throws Exception { x20(false); } private void x20(boolean inc) { - setExpectedProblemIds(new int[] { - getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE), - getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE) - }); + int indId = getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE); + setExpectedProblemIds(new int[] {indId, indId}); + setExpectedLineMappings(new LineMapping[] { + new LineMapping(24, indId, new String[] {"local2", "x.y.z.testC12.method1()", "INoImpl2", "INoImpl5"}), + new LineMapping(18, indId, new String[] {"local4", "x.y.z.testC12.inner1.method2()", "INoImpl2", "INoImpl5"}), + }); setExpectedMessageArgs(new String[][] { - {"local2", "x.y.z.testc12.method1()", "INoImpl2", "INoImpl5"}, - {"local4", "x.y.z.outerc12.inner2.method2()", "INoImpl2", "INoImpl5"} + {"local2", "x.y.z.testC12.method1()", "INoImpl2", "INoImpl5"}, + {"local4", "x.y.z.testC12.inner1.method2()", "INoImpl2", "INoImpl5"} }); - String typename = "testc12"; + String typename = "testC12"; deployUsageTest(typename, inc); } diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testc11.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testC11.java index 0070182b8c..b6fbec57b0 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testc11.java +++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testC11.java @@ -14,34 +14,21 @@ import i.INoImpl3; import i.INoImpl5; import i.INoImpl6; -public class testc11 { - public void method1() { - class local1 implements INoImpl2 { //direct illegal implement - - } - local1 l1 = new local1(); - System.out.println(l1); - class local2 implements INoImpl5 { //indirect illegal implement - - } - local2 l2 = new local2(); - System.out.println(l2); - } -} - -class outer { - class inner2 { +public class testC11 { + + class inner1 { void method2() { class local3 implements INoImpl3 { //direct illegal implement - } - local3 l3 = new local3(); - System.out.println(l3); class local4 implements INoImpl6 { //indirect illegal implement - } - local4 l4 = new local4(); - System.out.println(l4); } } -} + + public void method1() { + class local1 implements INoImpl2 { //direct illegal implement + } + class local2 implements INoImpl5 { //indirect illegal implement + } + } +}
\ No newline at end of file diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testc12.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testC12.java index 37f41f5d67..c24dacb2e9 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testc12.java +++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/usage/class/testC12.java @@ -11,22 +11,17 @@ package x.y.z; import i.INoImpl5; -public class testc12 { - public void method1() { - class local2 implements INoImpl5 { //indirect illegal implement - } - local2 l2 = new local2(); - System.out.println(l2); - } -} - -class outerc12 { - class inner2 { +public class testC12 { + + class inner1 { void method2() { class local4 implements INoImpl5 { //indirect illegal implement } - local4 l4 = new local4(); - System.out.println(l4); } } -} + + public void method1() { + class local2 implements INoImpl5 { //indirect illegal implement + } + } +}
\ No newline at end of file |
