diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
commit | dd828f42a5c83b4270d4fbf6fce2da1878f1e84a (patch) | |
tree | fdd4b68fa1020f2b6426034c94823419a7236200 /annotation/src/test/java | |
parent | fdb2704414a9ed92394ada0d1395e4db86889465 (diff) | |
download | libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.zip libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.gz libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'annotation/src/test/java')
5 files changed, 128 insertions, 11 deletions
diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java index b80f3a9..6bd4526 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.AnnotationFormatError; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.AnnotationFormatError; + /** * Test case of java.lang.annotation.AnnotationFormatError */ +@TestTargetClass(AnnotationFormatError.class) public class AnnotationFormatErrorTest extends TestCase { /** * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationFormatError", + methodArgs = {java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_String() { AnnotationFormatError e = new AnnotationFormatError("some message"); @@ -37,6 +52,15 @@ public class AnnotationFormatErrorTest extends TestCase { /** * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(Throwable) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationFormatError", + methodArgs = {java.lang.Throwable.class} + ) + }) public void test_constructorLjava_lang_Throwable() { IllegalArgumentException iae = new IllegalArgumentException(); AnnotationFormatError e = new AnnotationFormatError(iae); @@ -46,6 +70,15 @@ public class AnnotationFormatErrorTest extends TestCase { /** * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String,Throwable) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationFormatError", + methodArgs = {java.lang.String.class, java.lang.Throwable.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_StringLjava_lang_Throwable() { IllegalArgumentException iae = new IllegalArgumentException(); diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java index 9948e29..2675e06 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java @@ -17,14 +17,20 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.AnnotationTypeMismatchException; -import java.lang.reflect.Method; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.AnnotationTypeMismatchException; +import java.lang.reflect.Method; + /** * Test case of java.lang.annotation.AnnotationTypeMismatchException */ +@TestTargetClass(AnnotationTypeMismatchException.class) public class AnnotationTypeMismatchExceptionTest extends TestCase { /** @@ -33,6 +39,15 @@ public class AnnotationTypeMismatchExceptionTest extends TestCase { * @tests java.lang.annotation.AnnotationTypeMismatchException#AnnotationTypeMismatchException(Method, * String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationTypeMismatchException", + methodArgs = {java.lang.reflect.Method.class, java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_reflect_MethodLjava_lang_String() throws SecurityException, ClassNotFoundException { Method[] methods = Class.forName("java.lang.String").getMethods(); diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java index d81cabd..6447a9f 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java @@ -17,20 +17,35 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.ElementType; -import java.util.Arrays; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.ElementType; +import java.util.Arrays; + /** * Test case of java.lang.annotation.ElementType */ +@TestTargetClass(ElementType.class) public class ElementTypeTest extends TestCase { /** * @throws Exception * @tests java.lang.annotation.ElementType#valueOf(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_valueOfLjava_lang_String() throws Exception { assertSame(ElementType.ANNOTATION_TYPE, ElementType @@ -55,6 +70,15 @@ public class ElementTypeTest extends TestCase { * @throws Exception * @tests java.lang.annotation.ElementType#values() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "values", + methodArgs = {} + ) + }) @SuppressWarnings("nls") public void test_values() throws Exception { ElementType[] values = ElementType.values(); diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java index 0acd4fa..d6c8339 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java @@ -17,19 +17,31 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.IncompleteAnnotationException; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; -/** - * - */ +import java.lang.annotation.IncompleteAnnotationException; + +@TestTargetClass(IncompleteAnnotationException.class) public class IncompleteAnnotationExceptionTest extends TestCase { /* * Class under test for void IncompleteAnnotationException(String) * Regression for HARMONY-2477 */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies NullPointerException.", + targets = { + @TestTarget( + methodName = "IncompleteAnnotationException", + methodArgs = {java.lang.Class.class, java.lang.String.class} + ) + }) public void testNullType() { try { new IncompleteAnnotationException(null, "str"); @@ -44,6 +56,15 @@ public class IncompleteAnnotationExceptionTest extends TestCase { * @tests java.lang.annotation.IncompleteAnnotationException#IncompleteAnnotationException(Class, * String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "IncompleteAnnotationException", + methodArgs = {java.lang.Class.class, java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_Class_Ljava_lang_String() throws Exception { diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java index c4f7c03..adeb039 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java @@ -17,19 +17,34 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.RetentionPolicy; -import java.util.Arrays; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.RetentionPolicy; +import java.util.Arrays; + /** * Test case of java.lang.annotation.RetentionPolicy */ +@TestTargetClass(RetentionPolicy.class) public class RetentionPolicyTest extends TestCase { /** * @throws Exception * @tests java.lang.annotation.RetentionPolicy#valueOf(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_valueOfLjava_lang_String() throws Exception { assertSame(RetentionPolicy.CLASS, RetentionPolicy @@ -50,6 +65,15 @@ public class RetentionPolicyTest extends TestCase { * @throws Exception * @tests java.lang.annotation.RetentionPolicy#values() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "values", + methodArgs = {} + ) + }) @SuppressWarnings("nls") public void test_values() throws Exception { RetentionPolicy[] values = RetentionPolicy.values(); |