summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2013-05-06 12:50:08 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-05-06 15:04:31 (EDT)
commit1867f3c9a772f1c1394c185355445f4e77e3498e (patch)
tree7129e674eeb1cdcb4bd3ee9685d8756036dc4dc9
parent0cf64edcd3cfb67ffe67f0731964dc2bac5293bb (diff)
downloadeclipse.pde.ui-1867f3c9a772f1c1394c185355445f4e77e3498e.zip
eclipse.pde.ui-1867f3c9a772f1c1394c185355445f4e77e3498e.tar.gz
eclipse.pde.ui-1867f3c9a772f1c1394c185355445f4e77e3498e.tar.bz2
Bug 407012 - Expand tag tests for @noreferenceI20130507-0000I20130506-2000refs/changes/41/12541/2
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java38
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java19
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java86
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumTagTests.java58
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/valid/test1.java (renamed from apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/test1.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/valid/test2.java (renamed from apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/test2.java)4
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test1.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test5.java3
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/enum/valid/test1.java (renamed from apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/enum/test2.java)6
-rw-r--r--apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/interface/valid/test8.java38
11 files changed, 196 insertions, 67 deletions
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java
index e68bcf9..3f3f6bf 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidAnnotationTagTests.java
@@ -62,44 +62,6 @@ public class InvalidAnnotationTagTests extends TagTest {
return CompilerOptions.VERSION_1_5;
}
-
- public void testInvalidAnnotationTag1I() {
- x1(true);
- }
-
- public void testInvalidAnnotationTag1F() {
- x1(false);
- }
-
- /**
- * Tests having an @noreference tag on a variety of annotations in package a.b.c
- */
- private void x1(boolean inc) {
- /*setExpectedProblemIds(getDefaultProblemSet(4));
- setExpectedMessageArgs("@noreference", BuilderMessages.TagValidator_an_annotation, 4);*/
- String typename = "test1.java";
- deployTagTest(typename, inc, false);
- }
-
-
- public void testInvalidAnnotationTag2I() {
- x2(true);
- }
-
- public void testInvalidAnnotationTag2F() {
- x2(false);
- }
-
- /**
- * Tests having an @noreference tag on an annotation in the default package
- */
- private void x2(boolean inc) {
- /*setExpectedProblemIds(getDefaultProblemSet(1));
- setExpectedMessageArgs("@noreference", BuilderMessages.TagValidator_an_annotation, 1);*/
- String typename = "test2.java";
- deployTagTest(typename, inc, true);
- }
-
public void testInvalidAnnotationTag3I() {
x3(true);
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java
index e2dc107..ebfc64b 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/InvalidEnumTagTests.java
@@ -88,25 +88,6 @@ public class InvalidEnumTagTests extends TagTest {
deployTagTest("test1.java", inc, false);
}
- public void testInvalidEnumTag2I() {
- x2(true);
- }
-
- public void testInvalidEnumTag2F() {
- x2(false);
- }
-
- /**
- * Tests having an @noreference tag on an enum in the default package
- */
- private void x2(boolean inc) {
- /*setExpectedProblemIds(getDefaultProblemSet(1));
- setExpectedMessageArgs(new String[][] {
- {"@noreference", BuilderMessages.TagValidator_an_enum}
- });*/
- deployTagTest("test2.java", inc, true);
- }
-
public void testInvalidEnumTag3I() {
x3(true);
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java
index 9a35f5a..5a6707a 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/TagTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -72,7 +72,9 @@ public abstract class TagTest extends ApiBuilderTest {
ValidFieldTagTests.class,
InvalidMethodTagTests.class,
ValidMethodTagTests.class,
+ ValidEnumTagTests.class,
InvalidEnumTagTests.class,
+ ValidAnnotationTagTests.class,
InvalidAnnotationTagTests.class,
InvalidDuplicateTagsTests.class
};
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java
new file mode 100644
index 0000000..b6105ef
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidAnnotationTagTests.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.pde.api.tools.builder.tests.tags;
+
+import junit.framework.Test;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+
+/**
+ * Tests that the builder accepts valid tags on annotations
+ */
+public class ValidAnnotationTagTests extends InvalidAnnotationTagTests {
+
+ /**
+ * Constructor
+ * @param name
+ */
+ public ValidAnnotationTagTests(String name) {
+ super(name);
+ }
+
+ /**
+ * @return the tests for this class
+ */
+ public static Test suite() {
+ return buildTestSuite(ValidAnnotationTagTests.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.pde.api.tools.builder.tests.ApiBuilderTests#getTestSourcePath()
+ */
+ protected IPath getTestSourcePath() {
+ return super.getTestSourcePath().append("valid");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.pde.api.tools.builder.tests.ApiBuilderTest#getTestCompliance()
+ */
+ protected String getTestCompliance() {
+ return CompilerOptions.VERSION_1_5;
+ }
+
+
+ public void testInvalidAnnotationTag1I() {
+ x1(true);
+ }
+
+ public void testInvalidAnnotationTag1F() {
+ x1(false);
+ }
+
+ /**
+ * Tests having an @noreference tag on a variety of annotations in package a.b.c
+ */
+ private void x1(boolean inc) {
+ String typename = "test1.java";
+ deployTagTest(typename, inc, false);
+ }
+
+
+ public void testInvalidAnnotationTag2I() {
+ x2(true);
+ }
+
+ public void testInvalidAnnotationTag2F() {
+ x2(false);
+ }
+
+ /**
+ * Tests having an @noreference tag on an annotation in the default package
+ */
+ private void x2(boolean inc) {
+ String typename = "test2.java";
+ deployTagTest(typename, inc, true);
+ }
+
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumTagTests.java b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumTagTests.java
new file mode 100644
index 0000000..b2d9519
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/src/org/eclipse/pde/api/tools/builder/tests/tags/ValidEnumTagTests.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.pde.api.tools.builder.tests.tags;
+
+import junit.framework.Test;
+
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Tests that the builder accepts valid tags on enums
+ */
+public class ValidEnumTagTests extends InvalidEnumTagTests {
+
+ /**
+ * Constructor
+ * @param name
+ */
+ public ValidEnumTagTests(String name) {
+ super(name);
+ }
+
+ /**
+ * @return the tests for this class
+ */
+ public static Test suite() {
+ return buildTestSuite(ValidEnumTagTests.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.pde.api.tools.builder.tests.ApiBuilderTests#getTestSourcePath()
+ */
+ protected IPath getTestSourcePath() {
+ return super.getTestSourcePath().append("valid");
+ }
+
+ public void testValidEnumTag1I() {
+ x1(true);
+ }
+
+ public void testInvalidEnumTag1F() {
+ x1(false);
+ }
+
+ /**
+ * Tests having an @noreference tag on an enum in the default package
+ */
+ private void x1(boolean inc) {
+ deployTagTest("test1.java", inc, true);
+ }
+}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/test1.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/valid/test1.java
index fc87a69..e15eb22 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/test1.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/valid/test1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -11,7 +11,7 @@
package a.b.c;
/**
- * Tests invalid @noreference tags on nested inner annotations
+ * Tests valid @noreference tags on nested inner annotations
* @noreference
*/
public @interface test1 {
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/test2.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/valid/test2.java
index 3b1016a..dcde6c9 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/test2.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/annotation/valid/test2.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -11,7 +11,7 @@
/**
- * Test unsupported @noreference tag on an annotation in the default package
+ * Test supported @noreference tag on an annotation in the default package
* @noreference
*/
public @interface test2 {
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test1.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test1.java
index b11693f..787ddbf 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test1.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -14,6 +14,7 @@ package a.b.c;
* Test valid tags on a class
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
+ * @noreference This class is not intended to be referenced by clients
*/
public class test1 {
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test5.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test5.java
index 681d2fd..79f0e04 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test5.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/class/valid/test5.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -15,6 +15,7 @@ package a.b.c;
* Test valid tags on class in the default package
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
+ * @noreference This class is not intended to be referenced by clients
*/
public class test5 {
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/enum/test2.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/enum/valid/test1.java
index 1a2a4ae..2092754 100644
--- a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/enum/test2.java
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/enum/valid/test1.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 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
@@ -11,9 +11,9 @@
/**
- * Test unsupported @noreference tag on an annotation in the default package
+ * Test supported @noreference tag on an annotation in the default package
* @noreference
*/
-public enum test2 {
+public enum test1 {
}
diff --git a/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/interface/valid/test8.java b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/interface/valid/test8.java
new file mode 100644
index 0000000..da06f00
--- /dev/null
+++ b/apitools/org.eclipse.pde.api.tools.tests/test-builder/tags/interface/valid/test8.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package a.b.c;
+
+/**
+ * Test supported @noreference tag on an interface
+ * @noreference
+ */
+public interface test6 {
+
+ /**
+ * @noreference
+ */
+ public interface inner {
+
+ }
+
+ public interface inner1 {
+ /**
+ * @noreference
+ */
+ public interface inner2 {
+
+ }
+ }
+
+ interface inner2 {
+
+ }
+} \ No newline at end of file