diff options
| author | Mike Rennie | 2013-03-20 03:07:12 +0000 |
|---|---|---|
| committer | Mike Rennie | 2013-03-20 03:07:12 +0000 |
| commit | 3e42568cc8bc38b275ac9d2eed1aa5a40cb6102d (patch) | |
| tree | b097ea3e79eeada3bc89c7eb7e093f6350ccd36f | |
| parent | 0efed9b3b1e396ea92e184eb987ef97fefa44339 (diff) | |
| download | eclipse.pde.ui-3e42568cc8bc38b275ac9d2eed1aa5a40cb6102d.tar.gz eclipse.pde.ui-3e42568cc8bc38b275ac9d2eed1aa5a40cb6102d.tar.xz eclipse.pde.ui-3e42568cc8bc38b275ac9d2eed1aa5a40cb6102d.zip | |
Bug 403258 - Use problem on... updated tests
2 files changed, 96 insertions, 17 deletions
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 9f7a45ed94..65a5e09257 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 @@ -329,7 +329,7 @@ public class ClassUsageTests extends UsageTest { * @throws Exception */ public void testLocalClassIllegalImplements1I() throws Exception { -// x19(true); + x19(true); } /** @@ -341,25 +341,21 @@ public class ClassUsageTests extends UsageTest { * @throws Exception */ public void testLocalClassIllegalImplements1F() throws Exception { -// x19(false); + x19(false); } private void x19(boolean inc) { 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}); + setExpectedProblemIds(new int[] {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"}) + new LineMapping(31, indId, new String[] {"local2", "x.y.z.testC11.method1()", "INoImpl5", "INoImpl2"}) }); setExpectedMessageArgs(new String[][] { {"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"} + {"local2", "x.y.z.testC11.method1()", "INoImpl5", "INoImpl2"}, }); deployUsageTest(typename, inc); } @@ -374,7 +370,7 @@ public class ClassUsageTests extends UsageTest { * @throws Exception */ public void testLocalClassIllegaImplements2I() throws Exception { -// x20(true); + x20(true); } /** @@ -387,19 +383,17 @@ public class ClassUsageTests extends UsageTest { * @throws Exception */ public void testLocalClassIllegalImplements2F() throws Exception { -// x20(false); + x20(false); } private void x20(boolean inc) { int indId = getProblemId(IApiProblem.ILLEGAL_IMPLEMENT, IApiProblem.INDIRECT_LOCAL_REFERENCE); - setExpectedProblemIds(new int[] {indId, indId}); + setExpectedProblemIds(new int[] {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"}), + new LineMapping(24, indId, new String[] {"local2", "x.y.z.testC12.method1()", "INoImpl5", "INoImpl2"}), }); setExpectedMessageArgs(new String[][] { - {"local2", "x.y.z.testC12.method1()", "INoImpl2", "INoImpl5"}, - {"local4", "x.y.z.testC12.inner1.method2()", "INoImpl2", "INoImpl5"} + {"local2", "x.y.z.testC12.method1()", "INoImpl5", "INoImpl2"} }); String typename = "testC12"; deployUsageTest(typename, inc); diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java index a396f757ae..4ec88951ef 100644 --- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java +++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/usage/Java5ClassUsageTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2013 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 @@ -521,4 +521,89 @@ public class Java5ClassUsageTests extends ClassUsageTests { }); deployUsageTest(typename, inc); } + + /** + * Tests that the correct markers are created and placed for classes with inner types + * 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 { + x18(true); + } + + /** + * Tests that the correct markers are created and placed for local types + * 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 { + x18(false); + } + + private void x18(boolean inc) { + 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()", "INoImpl5", "INoImpl2"}), + 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()", "INoImpl6", "INoImpl2"}) + }); + setExpectedMessageArgs(new String[][] { + {"local1", "x.y.z.testC11.method1()", "INoImpl2"}, + {"local2", "x.y.z.testC11.method1()", "INoImpl5", "INoImpl2"}, + {"local3", "x.y.z.testC11.inner1.method2()", "INoImpl3"}, + {"local4", "x.y.z.testC11.inner1.method2()", "INoImpl6", "INoImpl2"} + }); + deployUsageTest(typename, inc); + } + + /** + * Tests that the correct markers are created and placed for local types + * that illegally implement interfaces, where there are more than one local type in the + * 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 { + x19(true); + } + + /** + * Tests that the correct markers are created and placed for local types + * that illegally implement interfaces, where there are more than one local type in the + * 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 { + x19(false); + } + + private void x19(boolean inc) { + 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()", "INoImpl5", "INoImpl2"}), + new LineMapping(18, indId, new String[] {"local4", "x.y.z.testC12.inner1.method2()", "INoImpl5", "INoImpl2"}), + }); + setExpectedMessageArgs(new String[][] { + {"local2", "x.y.z.testC12.method1()", "INoImpl5", "INoImpl2"}, + {"local4", "x.y.z.testC12.inner1.method2()", "INoImpl5", "INoImpl2"} + }); + String typename = "testC12"; + deployUsageTest(typename, inc); + } } |
