diff options
author | Elliott Hughes <enh@google.com> | 2010-02-22 16:47:08 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-02-22 16:47:08 -0800 |
commit | 703ef27278351bd0fd1d50cbd565826f217571da (patch) | |
tree | 0b6776cc75da2fb9c59bced377d1fbaf10677e3e /archive | |
parent | 8b7350e17c4a98aedc024dc593260d92154f0b1f (diff) | |
download | libcore-703ef27278351bd0fd1d50cbd565826f217571da.zip libcore-703ef27278351bd0fd1d50cbd565826f217571da.tar.gz libcore-703ef27278351bd0fd1d50cbd565826f217571da.tar.bz2 |
Remove useless annotation cruft from tests for: annotation, archive, concurrent, and suncompat.
22 files (and 4 modules) down, 1000 to go...
Diffstat (limited to 'archive')
19 files changed, 6 insertions, 1075 deletions
diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java index 067bf49..efeb128 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java @@ -17,26 +17,14 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; - import java.util.jar.Attributes; import junit.framework.TestCase; -@TestTargetClass(Attributes.Name.class) public class AttributesNameTest extends TestCase { /** * @tests java.util.jar.Attributes.Name#Name(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Name", - args = {java.lang.String.class} - ) public void test_AttributesName_Constructor() { // Regression for HARMONY-85 try { @@ -57,12 +45,6 @@ public class AttributesNameTest extends TestCase { assertNotNull(new Attributes.Name("Attr")); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public void test_equalsLjava_lang_Object() { Attributes.Name attr1 = new Attributes.Name("Attr"); Attributes.Name attr2 = new Attributes.Name("Attr"); @@ -72,12 +54,6 @@ public class AttributesNameTest extends TestCase { assertFalse(attr1.equals(attr2)); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public void test_hashCode() { Attributes.Name attr1 = new Attributes.Name("Attr1"); Attributes.Name attr2 = new Attributes.Name("Attr2"); @@ -85,12 +61,6 @@ public class AttributesNameTest extends TestCase { assertNotSame(attr1.hashCode(), attr2.hashCode()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public void test_toString() { String str1 = "Attr1"; String str2 = "Attr2"; diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java index 0b3d2cf..f437d20 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java @@ -17,11 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; - import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -31,7 +26,6 @@ import java.util.Set; import java.util.jar.Attributes; import junit.framework.TestCase; -@TestTargetClass(Attributes.class) public class AttributesTest extends TestCase { private Attributes a; @@ -47,12 +41,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#Attributes(java.util.jar.Attributes) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Attributes", - args = {java.util.jar.Attributes.class} - ) public void test_ConstructorLjava_util_jar_Attributes() { Attributes a2 = new Attributes(a); assertEquals(a, a2); @@ -63,12 +51,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#clear() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clear", - args = {} - ) public void test_clear() { a.clear(); assertNull("a) All entries should be null after clear", a.get("1")); @@ -81,12 +63,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#containsKey(java.lang.Object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "containsKey", - args = {java.lang.Object.class} - ) public void test_containsKeyLjava_lang_Object() { assertTrue("a) Should have returned false", !a.containsKey(new Integer( 1))); @@ -98,12 +74,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#containsValue(java.lang.Object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "containsValue", - args = {java.lang.Object.class} - ) public void test_containsValueLjava_lang_Object() { assertTrue("Should have returned false", !a.containsValue("One")); assertTrue("Should have returned true", a.containsValue("one")); @@ -112,12 +82,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#entrySet() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entrySet", - args = {} - ) public void test_entrySet() { Set<Map.Entry<Object, Object>> entrySet = a.entrySet(); Set<Object> keySet = new HashSet<Object>(); @@ -148,12 +112,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#get(java.lang.Object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getValue", - args = {java.lang.String.class} - ) public void test_getLjava_lang_Object() { assertEquals("a) Incorrect value returned", "one", a.getValue("1")); assertNull("b) Incorrect value returned", a.getValue("0")); @@ -168,12 +126,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#isEmpty() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "isEmpty", - args = {} - ) public void test_isEmpty() { assertTrue("Should not be empty", !a.isEmpty()); a.clear(); @@ -185,12 +137,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#keySet() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "keySet", - args = {} - ) public void test_keySet() { Set<?> s = a.keySet(); assertEquals(4, s.size()); @@ -207,12 +153,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#putAll(java.util.Map) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "putAll", - args = {java.util.Map.class} - ) public void test_putAllLjava_util_Map() { Attributes b = new Attributes(); b.putValue("3", "san"); @@ -245,12 +185,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#putAll(java.util.Map) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Regression test", - method = "putAll", - args = {java.util.Map.class} - ) public void test_putAllLjava_util_Map2() { // Regression for HARMONY-464 try { @@ -275,12 +209,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#remove(java.lang.Object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "remove", - args = {java.lang.Object.class} - ) public void test_removeLjava_lang_Object() { a.remove(new Attributes.Name("1")); a.remove(new Attributes.Name("3")); @@ -291,12 +219,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#size() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "size", - args = {} - ) public void test_size() { assertEquals("Incorrect size returned", 4, a.size()); a.clear(); @@ -306,12 +228,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#values() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "values", - args = {} - ) public void test_values() { Collection<?> valueCollection = a.values(); assertTrue("a) Should contain entry", valueCollection.contains("one")); @@ -323,12 +239,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#clone() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public void test_clone() { Attributes a2 = (Attributes) a.clone(); assertEquals(a, a2); @@ -339,12 +249,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes#equals(java.lang.Object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public void test_equalsLjava_lang_Object() { Attributes.Name n1 = new Attributes.Name("name"), n2 = new Attributes.Name( "Name"); @@ -361,12 +265,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes.put(java.lang.Object, java.lang.Object) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Regression test. Checks ClassCastException", - method = "put", - args = {java.lang.Object.class, java.lang.Object.class} - ) public void test_putLjava_lang_ObjectLjava_lang_Object() { Attributes atts = new Attributes(); assertNull("Assert 0: ", atts.put(Attributes.Name.CLASS_PATH, @@ -391,12 +289,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes.put(java.lang.Object, java.lang.Object) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "ClassCastException checking missed.", - method = "put", - args = {java.lang.Object.class, java.lang.Object.class} - ) public void test_putLjava_lang_ObjectLjava_lang_Object_Null() { Attributes attribute = new Attributes(); @@ -424,12 +316,6 @@ public class AttributesTest extends TestCase { /** * @tests java.util.jar.Attributes.hashCode() */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public void test_hashCode_consistent_with_map() { MockAttributes mockAttr = new MockAttributes(); mockAttr.putValue("1", "one"); @@ -442,34 +328,16 @@ public class AttributesTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Attributes", - args = {} - ) public void test_Constructor() { Attributes attr = new Attributes(); assertTrue(attr.size() >= 0); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Attributes", - args = {int.class} - ) public void test_ConstructorI() { Attributes attr = new Attributes(10); assertTrue(attr.size() >= 0); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "get", - args = {java.lang.Object.class} - ) public void test_getLjava_lang_Object_true() { assertEquals("a) Incorrect value returned", "one", a .get(new Attributes.Name("1"))); @@ -477,12 +345,6 @@ public class AttributesTest extends TestCase { assertNull("b) Incorrect value returned", a.get("1")); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getValue", - args = {java.util.jar.Attributes.Name.class} - ) public void test_getValueLjava_util_jar_Attributes_Name() { assertEquals("a) Incorrect value returned", "one", a .getValue(new Attributes.Name("1"))); @@ -490,12 +352,6 @@ public class AttributesTest extends TestCase { .getValue(new Attributes.Name("0"))); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public void test_hashCode() { Attributes b = (Attributes) a.clone(); b.putValue("33", "Thirty three"); @@ -505,12 +361,6 @@ public class AttributesTest extends TestCase { assertNotSame(a.hashCode(), b.hashCode()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "putValue", - args = {java.lang.String.class, java.lang.String.class} - ) public void test_putValueLjava_lang_StringLjava_lang_String() { Attributes b = new Attributes(); b.put(new Attributes.Name("1"), "one"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/DalvikExecTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/DalvikExecTest.java index 601fe42..a8c6148 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/DalvikExecTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/DalvikExecTest.java @@ -16,11 +16,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.AndroidOnly; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; import junit.framework.TestCase; import static tests.support.Support_Exec.execAndGetOutput; import tests.support.resource.Support_Resources; @@ -37,8 +32,6 @@ import java.util.jar.JarOutputStream; import java.util.jar.Manifest; -@TestTargetClass(JarOutputStream.class) -@AndroidOnly("dalvik vm specific") public class DalvikExecTest extends TestCase { String execDalvik1(String classpath, String mainClass, String arg1) @@ -78,15 +71,7 @@ public class DalvikExecTest extends TestCase { return execDalvik1(classpath, mainClass, null); } - @TestTargets ({ - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Execute an existing JAR on dalvikvm using -classpath option.", - clazz = Runtime.class, - method = "exec", - args = {java.lang.String[].class} - ) - }) + // Execute an existing JAR on dalvikvm using -classpath option.", public void test_execExistingJar () throws IOException, InterruptedException { String res; File jarFile; @@ -113,26 +98,7 @@ public class DalvikExecTest extends TestCase { } } - - @TestTargets ({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "putNextEntry", - args = {java.util.zip.ZipEntry.class} - ), - @TestTargetNew( - level = TestLevel.ADDITIONAL, - method = "JarOutputStream", - args = {java.io.OutputStream.class} - ), - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Create a temp file, fill it with contents according to Dalvik JAR format, and execute it on dalvikvm using -classpath option.", - clazz = Runtime.class, - method = "exec", - args = {java.lang.String[].class} - ) - }) + // Create a temp file, fill it with contents according to Dalvik JAR format, and execute it on dalvikvm using -classpath option.", public void test_execCreatedJar () throws IOException, InterruptedException { File jarFile = File.createTempFile("cts_dalvikExecTest_", ".jar"); jarFile.deleteOnExit(); @@ -171,24 +137,6 @@ public class DalvikExecTest extends TestCase { } - @TestTargets ({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "putNextEntry", - args = {java.util.zip.ZipEntry.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "JarOutputStream", - args = {java.io.OutputStream.class, java.util.jar.Manifest.class} - ), - @TestTargetNew( - level = TestLevel.ADDITIONAL, - clazz = Runtime.class, - method = "exec", - args = {java.lang.String[].class} - ) - }) /** * This test does quite the same as test_execCreatedJar, but includes a manifest. * Note however that the Dalvik JAR format does not require this manifest. diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java index 90144be..e179024 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarEntryTest.java @@ -17,11 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; - import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -35,7 +30,6 @@ import junit.framework.TestCase; import tests.support.resource.Support_Resources; -@TestTargetClass(JarEntry.class) public class JarEntryTest extends TestCase { private ZipEntry zipEntry; @@ -75,12 +69,6 @@ public class JarEntryTest extends TestCase { * @throws IOException * @tests java.util.jar.JarEntry#JarEntry(java.util.jar.JarEntry) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "JarEntry", - args = {java.util.jar.JarEntry.class} - ) public void test_ConstructorLjava_util_jar_JarEntry_on_null() throws IOException { JarEntry newJarEntry = new JarEntry(jarFile.getJarEntry(entryName)); assertNotNull(newJarEntry); @@ -97,12 +85,6 @@ public class JarEntryTest extends TestCase { /** * @tests java.util.jar.JarEntry#JarEntry(java.util.zip.ZipEntry) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarEntry", - args = {java.util.zip.ZipEntry.class} - ) public void test_ConstructorLjava_util_zip_ZipEntry() { assertNotNull("Jar file is null", jarFile); zipEntry = jarFile.getEntry(entryName); @@ -118,12 +100,6 @@ public class JarEntryTest extends TestCase { /** * @tests java.util.jar.JarEntry#getAttributes() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getAttributes", - args = {} - ) public void test_getAttributes() { JarFile attrJar = null; File file = null; @@ -165,12 +141,6 @@ public class JarEntryTest extends TestCase { /** * @tests java.util.jar.JarEntry#getCertificates() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertificates", - args = {} - ) public void test_getCertificates() throws Exception { zipEntry = jarFile.getEntry(entryName2); jarEntry = new JarEntry(zipEntry); @@ -206,12 +176,6 @@ public class JarEntryTest extends TestCase { /** * @tests java.util.jar.JarEntry#getCodeSigners() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCodeSigners", - args = {} - ) public void test_getCodeSigners() throws IOException { String jarFileName = "TestCodeSigners.jar"; Support_Resources.copyFile(resources, null, jarFileName); @@ -247,12 +211,6 @@ public class JarEntryTest extends TestCase { new JarEntry("aaa").getCodeSigners()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarEntry", - args = {java.lang.String.class} - ) public void test_ConstructorLjava_lang_String() { assertNotNull("Jar file is null", jarFile); zipEntry = jarFile.getEntry(entryName); @@ -279,12 +237,6 @@ public class JarEntryTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "JarEntry", - args = {java.util.jar.JarEntry.class} - ) public void test_ConstructorLjava_util_jar_JarEntry() { assertNotNull("Jar file is null", jarFile); JarEntry je = jarFile.getJarEntry(entryName); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExceptionTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExceptionTest.java index 7f48342..9a0caf4 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExceptionTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExceptionTest.java @@ -17,28 +17,16 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.jar.Manifest; import junit.framework.TestCase; import java.util.jar.JarException; -@TestTargetClass(JarException.class) public class JarExceptionTest extends TestCase { /** * @tests java.util.jar.JarException#JarException(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarException", - args = {} - ) public void test_Constructor() throws Exception { JarException ex = new JarException(); JarException ex1 = new JarException("Test string"); @@ -49,12 +37,6 @@ public class JarExceptionTest extends TestCase { assertSame(ex.getMessage(), ex2.getMessage()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarException", - args = {java.lang.String.class} - ) public void test_ConstructorLjava_lang_String() throws Exception { JarException ex1 = new JarException("Test string"); JarException ex2 = new JarException(null); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java index 01f5a8c..e2a11c7 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarExecTest.java @@ -17,10 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; import static tests.support.Support_Exec.execAndGetOutput; import static tests.support.Support_Exec.javaProcessBuilder; import tests.support.resource.Support_Resources; @@ -40,19 +36,11 @@ import java.util.jar.Manifest; * */ -@TestTargetClass(JarOutputStream.class) public class JarExecTest extends junit.framework.TestCase { /** * regression test for HARMONY-1562 issue * */ - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Regression functional test. Exception checking missed.", - method = "putNextEntry", - args = {java.util.zip.ZipEntry.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_1562() throws Exception { // create the manifest Manifest man = new Manifest(); @@ -87,13 +75,6 @@ public class JarExecTest extends junit.framework.TestCase { * * @throws Exception in case of troubles */ - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "JarOutputStream", - args = {java.io.OutputStream.class, java.util.jar.Manifest.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_jar_class_path() throws Exception { File fooJar = File.createTempFile("hyts_", ".jar"); File barJar = File.createTempFile("hyts_", ".jar"); @@ -159,13 +140,6 @@ public class JarExecTest extends junit.framework.TestCase { * * @throws Exception in case of troubles */ - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "JarOutputStream", - args = {java.io.OutputStream.class, java.util.jar.Manifest.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_main_class_in_another_jar() throws Exception { File fooJar = File.createTempFile("hyts_", ".jar"); File barJar = File.createTempFile("hyts_", ".jar"); @@ -201,13 +175,6 @@ public class JarExecTest extends junit.framework.TestCase { execAndGetOutput(builder).startsWith("FOOBAR")); } - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "JarOutputStream", - args = {java.io.OutputStream.class, java.util.jar.Manifest.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_classpath() throws Exception { File resources = Support_Resources.createTempFolder(); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java index d2a5110..67debfc 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java @@ -17,11 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.AndroidOnly; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import tests.support.Support_PlatformFile; @@ -47,7 +42,6 @@ import java.util.zip.ZipException; import java.util.zip.ZipFile; -@TestTargetClass(JarFile.class) public class JarFileTest extends TestCase { // BEGIN android-added @@ -112,12 +106,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#JarFile(java.io.File) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "JarFile", - args = {java.io.File.class} - ) public void test_ConstructorLjava_io_File() { try { JarFile jarFile = new JarFile(new File("Wrong.file")); @@ -149,12 +137,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#JarFile(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarFile", - args = {java.lang.String.class} - ) public void test_ConstructorLjava_lang_String() { try { JarFile jarFile = new JarFile("Wrong.file"); @@ -187,12 +169,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#JarFile(java.lang.String, boolean) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarFile", - args = {java.lang.String.class, boolean.class} - ) public void test_ConstructorLjava_lang_StringZ() { try { JarFile jarFile = new JarFile("Wrong.file", false); @@ -225,12 +201,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#JarFile(java.io.File, boolean) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarFile", - args = {java.io.File.class, boolean.class} - ) public void test_ConstructorLjava_io_FileZ() { try { JarFile jarFile = new JarFile(new File("Wrong.file"), true); @@ -262,12 +232,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#JarFile(java.io.File, boolean, int) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarFile", - args = {java.io.File.class, boolean.class, int.class} - ) public void test_ConstructorLjava_io_FileZI() { try { JarFile jarFile = new JarFile(new File("Wrong.file"), true, @@ -316,12 +280,6 @@ public class JarFileTest extends TestCase { * @tests java.util.jar.JarFile#JarFile(java.io.File) * @tests java.util.jar.JarFile#JarFile(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "JarFile", - args = {java.io.File.class} - ) public void testConstructor_file() throws IOException { File f = new File(resources, jarName); Support_Resources.copyFile(resources, null, jarName); @@ -334,12 +292,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#entries() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_entries() throws Exception { /* * Note only (and all of) the following should be contained in the file @@ -357,12 +309,6 @@ public class JarFileTest extends TestCase { assertEquals(6, i); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_entries2() throws Exception { Support_Resources.copyFile(resources, null, jarName); JarFile jarFile = new JarFile(new File(resources, jarName)); @@ -388,12 +334,6 @@ public class JarFileTest extends TestCase { * @throws IOException * @tests java.util.jar.JarFile#getJarEntry(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEntry", - args = {java.lang.String.class} - ) public void test_getEntryLjava_lang_String() throws IOException { try { Support_Resources.copyFile(resources, null, jarName); @@ -431,12 +371,6 @@ public class JarFileTest extends TestCase { * @throws IOException * @tests java.util.jar.JarFile#getJarEntry(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getJarEntry", - args = {java.lang.String.class} - ) public void test_getJarEntryLjava_lang_String() throws IOException { try { Support_Resources.copyFile(resources, null, jarName); @@ -474,12 +408,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#getJarEntry(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEntry", - args = {java.lang.String.class} - ) public void testGetJarEntry() throws Exception { Support_Resources.copyFile(resources, null, jarName); JarFile jarFile = new JarFile(new File(resources, jarName)); @@ -559,12 +487,6 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#getManifest() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getManifest", - args = {} - ) public void test_getManifest() { // Test for method java.util.jar.Manifest // java.util.jar.JarFile.getManifest() @@ -656,16 +578,9 @@ public class JarFileTest extends TestCase { /** * @tests java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "SecurityException and functionality checked.", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) - @AndroidOnly("This test doesn't pass on RI. If entry size is set up " + - "incorrectly, SecurityException is thrown. " + - "But SecurityException is thrown on RI only " + - "if jar file is signed incorreclty.") + // This test doesn't pass on RI. If entry size is set up incorrectly, + // SecurityException is thrown. But SecurityException is thrown on RI only + // if jar file is signed incorrectly. public void test_getInputStreamLjava_util_jar_JarEntry_subtest0() { File signedFile = null; try { @@ -734,12 +649,6 @@ public class JarFileTest extends TestCase { * The jar created by 1.4 which does not provide a * algorithm-Digest-Manifest-Main-Attributes entry in .SF file. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_Jar_created_before_java_5() throws IOException { String modifiedJarName = "Created_by_1_4.jar"; Support_Resources.copyFile(resources, null, modifiedJarName); @@ -753,12 +662,6 @@ public class JarFileTest extends TestCase { } /* The jar is intact, then everything is all right. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_JarFile_Integrate_Jar() throws IOException { String modifiedJarName = "Integrate.jar"; Support_Resources.copyFile(resources, null, modifiedJarName); @@ -774,12 +677,6 @@ public class JarFileTest extends TestCase { /** * The jar is intact, but the entry object is modified. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getInputStream", - args = {ZipEntry.class} - ) public void testJarVerificationModifiedEntry() throws IOException { Support_Resources.copyFile(resources, null, integrateJar); File f = new File(resources, integrateJar); @@ -805,12 +702,6 @@ public class JarFileTest extends TestCase { * If another entry is inserted into Manifest, no security exception will be * thrown out. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_JarFile_InsertEntry_in_Manifest_Jar() throws IOException { String modifiedJarName = "Inserted_Entry_Manifest.jar"; Support_Resources.copyFile(resources, null, modifiedJarName); @@ -831,12 +722,6 @@ public class JarFileTest extends TestCase { * If another entry is inserted into Manifest, no security exception will be * thrown out. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_Inserted_Entry_Manifest_with_DigestCode() throws IOException { String modifiedJarName = "Inserted_Entry_Manifest_with_DigestCode.jar"; @@ -858,12 +743,6 @@ public class JarFileTest extends TestCase { * throw security Exception, but it will anytime before the inputStream got * from getInputStream method has been read to end. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "SecurityException and functionality checked.", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_JarFile_Modified_Class() throws IOException { String modifiedJarName = "Modified_Class.jar"; Support_Resources.copyFile(resources, null, modifiedJarName); @@ -893,12 +772,6 @@ public class JarFileTest extends TestCase { * tampered manually. Hence the RI 5.0 JarFile.getInputStream of any * JarEntry will throw security exception. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "SecurityException and functionality checked.", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_JarFile_Modified_Manifest_MainAttributes() throws IOException { String modifiedJarName = "Modified_Manifest_MainAttributes.jar"; @@ -922,12 +795,6 @@ public class JarFileTest extends TestCase { * example Test.class in our jar, the jarFile.getInputStream will throw * Security Exception. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "SecurityException and functionality checked.", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_JarFile_Modified_Manifest_EntryAttributes() throws IOException { String modifiedJarName = "Modified_Manifest_EntryAttributes.jar"; @@ -950,12 +817,6 @@ public class JarFileTest extends TestCase { * If the content of the .SA file is modified, no matter what it resides, * JarFile.getInputStream of any JarEntry will throw Security Exception. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "SecurityException and functionality checked.", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_JarFile_Modified_SF_EntryAttributes() throws IOException { String modifiedJarName = "Modified_SF_EntryAttributes.jar"; Support_Resources.copyFile(resources, null, modifiedJarName); @@ -973,12 +834,6 @@ public class JarFileTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "close", - args = {} - ) public void test_close() throws IOException { String modifiedJarName = "Modified_SF_EntryAttributes.jar"; Support_Resources.copyFile(resources, null, modifiedJarName); @@ -996,12 +851,6 @@ public class JarFileTest extends TestCase { * @throws IOException * @tests java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_getInputStreamLjava_util_jar_JarEntry() throws IOException { File localFile = null; try { @@ -1074,13 +923,7 @@ public class JarFileTest extends TestCase { /** * The jar is intact, but the entry object is modified. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Regression test for issue introduced by HAROMNY-4569. " - + "signed archives containing files with size 0 could not get verified", - method = "getInputStream", - args = {ZipEntry.class} - ) + // Regression test for issue introduced by HARMONY-4569: signed archives containing files with size 0 could not get verified. public void testJarVerificationEmptyEntry() throws IOException { Support_Resources.copyFile(resources, null, emptyEntryJar); File f = new File(resources, emptyEntryJar); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java index 5befa77..06853e7 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarInputStreamTest.java @@ -17,10 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; import tests.support.resource.Support_Resources; import java.io.File; @@ -36,7 +32,6 @@ import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipException; -@TestTargetClass(JarInputStream.class) public class JarInputStreamTest extends junit.framework.TestCase { // a 'normal' jar file private String jarName; @@ -61,12 +56,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { /** * @tests java.util.jar.JarInputStream#JarInputStream(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarInputStream", - args = {java.io.InputStream.class} - ) public void test_ConstructorLjava_io_InputStream() { // Test for method java.util.jar.JarInputStream(java.io.InputStream) InputStream is = null; @@ -103,12 +92,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { /** * @tests java.util.jar.JarInputStream#getManifest() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getManifest", - args = {} - ) public void test_getManifest() { // Test for method java.util.jar.Manifest // java.util.jar.JarInputStream.getManifest() @@ -134,11 +117,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { /** * @tests java.util.jar.JarInputStream#getNextJarEntry() */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "getNextJarEntry", - args = {} - ) public void test_getNextJarEntry() throws Exception { final Set<String> desired = new HashSet<String>(Arrays .asList(new String[] { @@ -174,11 +152,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "getNextJarEntry", - args = {} - ) public void test_getNextJarEntry_Ex() throws Exception { final Set<String> desired = new HashSet<String>(Arrays .asList("foo/", "foo/bar/", "foo/bar/A.class", "Blah.txt")); @@ -213,12 +186,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Exceptions checking missed. Case2", - method = "getNextJarEntry", - args = {} - ) public void test_JarInputStream_Integrate_Jar_getNextEntry() throws IOException { String intJarName = Support_Resources.getURL("Integrate.jar"); @@ -234,12 +201,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "getNextEntry", - args = {} - ) public void test_JarInputStream_Modified_Class_getNextEntry() throws IOException { String modJarName = Support_Resources.getURL("Modified_Class.jar"); @@ -266,12 +227,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "getNextEntry", - args = {} - ) public void test_JarInputStream_Modified_Manifest_MainAttributes_getNextEntry() throws IOException { String modJarName = Support_Resources.getURL("Modified_Manifest_MainAttributes.jar"); @@ -292,12 +247,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "getNextEntry", - args = {} - ) public void test_JarInputStream_Modified_Manifest_EntryAttributes_getNextEntry() throws IOException { String modJarName = Support_Resources @@ -324,12 +273,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "getNextEntry", - args = {} - ) public void test_JarInputStream_Modified_SF_EntryAttributes_getNextEntry() throws IOException { String modJarName = Support_Resources @@ -356,12 +299,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "read", - args = {byte[].class} - ) public void test_JarInputStream_Modified_Class_read() throws IOException { String modJarName = Support_Resources.getURL("Modified_Class.jar"); InputStream is = new URL(modJarName).openConnection().getInputStream(); @@ -390,12 +327,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Exception checking missed.", - method = "read", - args = {byte[].class} - ) public void test_Integrate_Jar_read() throws IOException { String intJarName = Support_Resources.getURL("Integrate.jar"); InputStream is = new URL(intJarName).openConnection().getInputStream(); @@ -416,12 +347,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "read", - args = {byte[].class} - ) public void test_JarInputStream_Modified_Manifest_MainAttributes_read() throws IOException { String modJarName = Support_Resources @@ -452,12 +377,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IOException & ZipException checking missed.", - method = "read", - args = {byte[].class} - ) public void test_JarInputStream_Modified_SF_EntryAttributes_read() throws IOException { String modJarName = Support_Resources @@ -488,12 +407,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { jin.close(); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "JarInputStream", - args = {java.io.InputStream.class, boolean.class} - ) public void test_ConstructorLjava_io_InputStreamZ() { // Test for method java.util.jar.JarInputStream(java.io.InputStream) InputStream is = null; @@ -527,11 +440,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "close", - args = {} - ) public void test_closeAfterException() throws Exception { File resources = Support_Resources.createTempFolder(); Support_Resources.copyFile(resources, null, "Broken_entry.jar"); @@ -553,11 +461,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "getNextEntry", - args = {} - ) public void test_getNextEntry() throws Exception { File resources = Support_Resources.createTempFolder(); Support_Resources.copyFile(resources, null, "Broken_entry.jar"); @@ -591,12 +494,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "createZipEntry", - args = {java.lang.String.class} - ) public void test_createZipEntryLjava_lang_String() throws Exception { File resources = Support_Resources.createTempFolder(); Support_Resources.copyFile(resources, null, "Broken_entry.jar"); @@ -605,11 +502,6 @@ public class JarInputStreamTest extends junit.framework.TestCase { assertNotNull(mjis.createZipEntry("New entry")); } - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "read", - args = {byte[].class, int.class, int.class} - ) public void test_read$ZII() throws Exception { File resources = Support_Resources.createTempFolder(); Support_Resources.copyFile(resources, null, "Broken_entry_data.jar"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java index b2ecdec..72dfcab 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarOutputStreamTest.java @@ -17,11 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -36,17 +31,11 @@ import java.util.zip.ZipEntry; import tests.support.resource.Support_Resources; -@TestTargetClass(JarOutputStream.class) public class JarOutputStreamTest extends junit.framework.TestCase { /** * @tests java.util.jar.JarOutputStream#putNextEntry(java.util.zip.ZipEntry) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "putNextEntry", - args = {java.util.zip.ZipEntry.class} - ) public void test_putNextEntryLjava_util_zip_ZipEntry() throws Exception { // testClass file`s actual extension is .class, since having .class // extension files in source dir causes @@ -133,12 +122,6 @@ public class JarOutputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Checks IOException", - method = "JarOutputStream", - args = {java.io.OutputStream.class, java.util.jar.Manifest.class} - ) public void test_JarOutputStreamLjava_io_OutputStreamLjava_util_jar_Manifest() throws IOException { File fooJar = File.createTempFile("hyts_", ".jar"); @@ -161,12 +144,6 @@ public class JarOutputStreamTest extends junit.framework.TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Can not check IOException", - method = "JarOutputStream", - args = {java.io.OutputStream.class} - ) public void test_JarOutputStreamLjava_io_OutputStream() throws IOException { File fooJar = File.createTempFile("hyts_", ".jar"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java index a00e480..0834fb1 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java @@ -16,11 +16,6 @@ */ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -38,7 +33,6 @@ import junit.framework.TestCase; import tests.support.resource.Support_Resources; -@TestTargetClass(Manifest.class) public class ManifestTest extends TestCase { private final String jarName = "hyts_patch.jar"; @@ -88,12 +82,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#Manifest() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Manifest", - args = {} - ) public void test_Constructor() { // Test for method java.util.jar.Manifest() Manifest emptyManifest = new Manifest(); @@ -106,12 +94,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#Manifest(java.util.jar.Manifest) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "Manifest", - args = {java.util.jar.Manifest.class} - ) public void testCopyingConstructor() throws IOException { Manifest firstManifest = new Manifest(new URL(Support_Resources .getURL(MANIFEST_NAME)).openStream()); @@ -122,12 +104,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#Manifest(Manifest) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "Manifest", - args = {java.util.jar.Manifest.class} - ) public void test_ConstructorLjava_util_jar_Manifest() { // Test for method java.util.jar.Manifest() Manifest emptyManifest = new Manifest(); @@ -173,12 +149,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#Manifest(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "IOException checking missed.", - method = "Manifest", - args = {java.io.InputStream.class} - ) public void test_ConstructorLjava_io_InputStream() throws IOException { Manifest m = getManifest(attJarName); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -214,12 +184,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#clear() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clear", - args = {} - ) public void test_clear() { m2.clear(); assertTrue("Should have no entries", m2.getEntries().isEmpty()); @@ -227,12 +191,6 @@ public class ManifestTest extends TestCase { .isEmpty()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public void test_clone() throws IOException { Manifest emptyManifest = new Manifest(); Manifest emptyClone = (Manifest) emptyManifest.clone(); @@ -250,12 +208,6 @@ public class ManifestTest extends TestCase { checkManifest(manifestClone); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public void test_equals() throws IOException { Manifest manifest1 = new Manifest(new URL(Support_Resources.getURL( "manifest/hyts_MANIFEST.MF")).openStream()); @@ -269,12 +221,6 @@ public class ManifestTest extends TestCase { assertFalse(manifest1.equals(this)); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public void test_hashCode() throws IOException { Manifest manifest1 = new Manifest(new URL(Support_Resources .getURL("manifest/hyts_MANIFEST.MF")).openStream()); @@ -286,12 +232,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#getAttributes(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getAttributes", - args = {String.class} - ) public void test_getAttributesLjava_lang_String() { assertNull("Should not exist", m2.getAttributes("Doesn't Exist")); @@ -302,12 +242,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#getEntries() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEntries", - args = {} - ) public void test_getEntries() { Map<String, Attributes> myMap = m2.getEntries(); assertNull("Shouldn't exist", myMap.get("Doesn't exist")); @@ -319,12 +253,6 @@ public class ManifestTest extends TestCase { /** * @tests java.util.jar.Manifest#getMainAttributes() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getMainAttributes", - args = {} - ) public void test_getMainAttributes() { // Test for method java.util.jar.Attributes // java.util.jar.Manifest.getMainAttributes() @@ -333,12 +261,6 @@ public class ManifestTest extends TestCase { Attributes.Name.MANIFEST_VERSION)); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "write", - args = {java.io.OutputStream.class} - ) public void test_writeLjava_io_OutputStream() throws IOException { byte b[] = null; Manifest manifest1 = null; @@ -385,12 +307,6 @@ public class ManifestTest extends TestCase { * @see <a * href="http://issues.apache.org/jira/browse/HARMONY-5662">HARMONY-5662</a> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "Manifest", - args = {InputStream.class} - ) public void testNul() throws IOException { String manifestContent = "Manifest-Version: 1.0\nCreated-By: nasty gcc tool\n\n\0"; @@ -413,11 +329,6 @@ public class ManifestTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "Manifest", - args = {InputStream.class} - ) public void testDecoding() throws IOException { Manifest m = getManifest(attJarName); final byte[] bVendor = new byte[] { (byte) 0xd0, (byte) 0x9C, @@ -564,12 +475,6 @@ public class ManifestTest extends TestCase { /** * @tests {@link java.util.jar.Manifest#read(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "", - method = "read", - args = {InputStream.class} - ) public void testRead() { // Regression for HARMONY-89 InputStream is = new InputStreamImpl(); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200PackerTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200PackerTest.java index 0d72108..5e4b668 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200PackerTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200PackerTest.java @@ -16,11 +16,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import tests.support.resource.Support_Resources; @@ -37,29 +32,14 @@ import java.util.jar.JarInputStream; import java.util.jar.Pack200; import java.util.jar.Pack200.Packer; -@TestTargetClass(Pack200.Packer.class) public class Pack200PackerTest extends TestCase { Packer packer; Map properties; - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "properties", - args = {} - ) - @KnownFailure("No Implementation in Android!") public void testProperties() { assertTrue(properties.size()>0); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "pack", - args = {java.util.jar.JarFile.class, java.io.OutputStream.class} - ) - @KnownFailure("No Implementation in Android!") public void testPackJarFileOutputStream() throws IOException { File resources = Support_Resources.createTempFolder(); //Use junit4.jar file for testing pack200 compressing rate. @@ -93,13 +73,6 @@ public class Pack200PackerTest extends TestCase { assertTrue(packFile2.length()>packFile3.length()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "pack", - args = {java.util.jar.JarInputStream.class, java.io.OutputStream.class} - ) - @KnownFailure("No Implementation in Android!") public void testPackJarInputStreamOutputStream() throws IOException { File resources = Support_Resources.createTempFolder(); //Use junit4.jar file for testing pack200 compressing rate. @@ -142,13 +115,6 @@ public class Pack200PackerTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "addPropertyChangeListener", - args = {java.beans.PropertyChangeListener.class} - ) - @KnownFailure("No Implementation in Android!") public void testAddPropertyChangeListener() { MyPCL pcl = new MyPCL(); packer.addPropertyChangeListener(pcl); @@ -157,13 +123,6 @@ public class Pack200PackerTest extends TestCase { assertTrue(pcl.isCalled()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "removePropertyChangeListener", - args = {java.beans.PropertyChangeListener.class} - ) - @KnownFailure("No Implementation in Android!") public void testRemovePropertyChangeListener() { MyPCL pcl = new MyPCL(); packer.addPropertyChangeListener(pcl); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200Test.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200Test.java index 9fb3cf9..0e2b688 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200Test.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200Test.java @@ -16,27 +16,14 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.jar.Pack200; -@TestTargetClass(Pack200.class) public class Pack200Test extends TestCase { - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "newPacker", - args = {} - ) - @KnownFailure("No Implementation in Android!") public void testNewPacker() { Method[] methodsInt = Pack200.Packer.class.getDeclaredMethods(); Method[] methodsImpl = Pack200.newPacker().getClass() @@ -68,13 +55,6 @@ public class Pack200Test extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "newUnpacker", - args = {} - ) - @KnownFailure("No Implementation in Android!") public void testNewUnpacker() { assertNotNull(Pack200.newUnpacker().getClass()); Method[] methodsInt = Pack200.Unpacker.class.getDeclaredMethods(); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200UnpackerTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200UnpackerTest.java index c1f9813..249a7cf 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200UnpackerTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/Pack200UnpackerTest.java @@ -16,11 +16,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import tests.support.resource.Support_Resources; @@ -38,29 +33,14 @@ import java.util.jar.Pack200; import java.util.jar.Pack200.Packer; import java.util.jar.Pack200.Unpacker; -@TestTargetClass(Pack200.Unpacker.class) public class Pack200UnpackerTest extends TestCase { Unpacker unpacker; Map properties; - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "properties", - args = {} - ) - @KnownFailure("No Implementation in Android!") public void testProperties() { assertTrue(properties.size()>0); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "unpack", - args = {java.io.File.class, java.util.jar.JarOutputStream.class} - ) - @KnownFailure("No Implementation in Android!") public void testUnpackInputStreamJarOutputStream() throws IOException { File resources = Support_Resources.createTempFolder(); //Use junit4.jar file for testing pack200 compressing rate. @@ -115,13 +95,6 @@ public class Pack200UnpackerTest extends TestCase { assertEquals(jarEntries, new JarFile(jarFile3).size()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "unpack", - args = {java.io.InputStream.class, java.util.jar.JarOutputStream.class} - ) - @KnownFailure("No Implementation in Android!") public void testUnpackFileJarOutputStream() throws IOException { File resources = Support_Resources.createTempFolder(); //Use junit4.jar file for testing pack200 compressing rate. @@ -191,13 +164,6 @@ public class Pack200UnpackerTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "addPropertyChangeListener", - args = {java.beans.PropertyChangeListener.class} - ) - @KnownFailure("No Implementation in Android!") public void testAddPropertyChangeListener() { MyPCL pcl = new MyPCL(); unpacker.addPropertyChangeListener(pcl); @@ -206,13 +172,6 @@ public class Pack200UnpackerTest extends TestCase { assertTrue(pcl.isCalled()); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "removePropertyChangeListener", - args = {java.beans.PropertyChangeListener.class} - ) - @KnownFailure("No Implementation in Android!") public void testRemovePropertyChangeListener() { MyPCL pcl = new MyPCL(); unpacker.addPropertyChangeListener(pcl); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ZipExecTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ZipExecTest.java index 013974c..5ce657b 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ZipExecTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ZipExecTest.java @@ -17,10 +17,6 @@ package org.apache.harmony.archive.tests.java.util.jar; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; import static tests.support.Support_Exec.javaProcessBuilder; import static tests.support.Support_Exec.execAndGetOutput; import tests.support.resource.Support_Resources; @@ -42,15 +38,7 @@ import java.util.zip.ZipOutputStream; * some tests are just copy of JarExecTest ones */ -@TestTargetClass(ZipOutputStream.class) public class ZipExecTest extends junit.framework.TestCase { - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Regression functional test. Exception checking missed.", - method = "putNextEntry", - args = {java.util.zip.ZipEntry.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_1562() throws Exception { Manifest man = new Manifest(); Attributes att = man.getMainAttributes(); @@ -86,13 +74,6 @@ public class ZipExecTest extends junit.framework.TestCase { * * @throws Exception in case of troubles */ - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "ZipOutputStream", - args = {java.io.OutputStream.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_zip_class_path() throws Exception { File fooZip = File.createTempFile("hyts_", ".zip"); File barZip = File.createTempFile("hyts_", ".zip"); @@ -160,13 +141,6 @@ public class ZipExecTest extends junit.framework.TestCase { } - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "ZipOutputStream", - args = {java.io.OutputStream.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_zip_jar_mix() throws Exception { File fooJar = File.createTempFile("hyts_", ".jar"); File barZip = File.createTempFile("hyts_", ".zip"); @@ -201,13 +175,6 @@ public class ZipExecTest extends junit.framework.TestCase { execAndGetOutput(builder).startsWith("FOOBAR")); } - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "ZipOutputStream", - args = {java.io.OutputStream.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_zip_jar_mix_1() throws Exception { File fooZip = File.createTempFile("hyts_", ".zip"); File barJar = File.createTempFile("hyts_", ".jar"); @@ -251,13 +218,6 @@ public class ZipExecTest extends junit.framework.TestCase { * * @throws Exception in case of troubles */ - @TestTargetNew( - level = TestLevel.ADDITIONAL, - notes = "Functional test.", - method = "ZipOutputStream", - args = {java.io.OutputStream.class} - ) - @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") public void test_main_class_in_another_zip() throws Exception { File fooZip = File.createTempFile("hyts_", ".zip"); File barZip = File.createTempFile("hyts_", ".zip"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java index 31974d1..9a56226 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/CheckedOutputStreamTest.java @@ -17,11 +17,6 @@ package org.apache.harmony.archive.tests.java.util.zip; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -29,19 +24,12 @@ import java.util.zip.Adler32; import java.util.zip.CRC32; import java.util.zip.CheckedOutputStream; -@TestTargetClass(CheckedOutputStream.class) public class CheckedOutputStreamTest extends junit.framework.TestCase { /** * @tests java.util.zip.CheckedOutputStream#CheckedOutputStream(java.io.OutputStream, * java.util.zip.Checksum) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CheckedOutputStream", - args = {java.io.OutputStream.class, java.util.zip.Checksum.class} - ) public void test_ConstructorLjava_io_OutputStreamLjava_util_zip_Checksum() { // test method java.util.zip.checkedOutputStream.constructor try { @@ -62,12 +50,6 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase { /** * @tests java.util.zip.CheckedOutputStream#getChecksum() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getChecksum", - args = {} - ) public void test_getChecksum() { // test method java.util.zip.checkedOutputStream.getChecksum() byte byteArray[] = {1, 2, 3, 'e', 'r', 't', 'g', 3, 6}; @@ -100,12 +82,6 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase { /** * @tests java.util.zip.CheckedOutputStream#write(int) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "write", - args = {int.class} - ) public void test_writeI() { // test method java.util.zip.checkedOutputStream.writeI() CheckedOutputStream chkOut = null; @@ -137,12 +113,6 @@ public class CheckedOutputStreamTest extends junit.framework.TestCase { /** * @tests java.util.zip.CheckedOutputStream#write(byte[], int, int) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "write", - args = {byte[].class, int.class, int.class} - ) public void test_write$BII() { // test method java.util.zip.checkOutputStream.writeBII() CheckedOutputStream chkOut = null; diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DataFormatExceptionTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DataFormatExceptionTest.java index 6561bbd..929227d 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DataFormatExceptionTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DataFormatExceptionTest.java @@ -16,35 +16,17 @@ package org.apache.harmony.archive.tests.java.util.zip; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.util.zip.DataFormatException; -@TestTargetClass(DataFormatException.class) public class DataFormatExceptionTest extends TestCase { - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "DataFormatException", - args = {} - ) public void testDataFormatException() { DataFormatException dfe = new DataFormatException(); assertEquals(dfe.getMessage(), null); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "DataFormatException", - args = {java.lang.String.class} - ) public void testDataFormatExceptionString() { DataFormatException dfe = new DataFormatException("Test"); assertEquals(dfe.getMessage(), "Test"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipExceptionTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipExceptionTest.java index eb04777..9f3be8d 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipExceptionTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipExceptionTest.java @@ -16,35 +16,17 @@ package org.apache.harmony.archive.tests.java.util.zip; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.util.zip.ZipException; -@TestTargetClass(ZipException.class) public class ZipExceptionTest extends TestCase { - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ZipException", - args = {} - ) public void testZipException() { ZipException zz = new ZipException(); assertEquals(zz.getMessage(), null); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ZipException", - args = {java.lang.String.class} - ) public void testZipExceptionLjava_lang_String() { ZipException zz = new ZipException("Test"); assertEquals(zz.getMessage(), "Test"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java index 646510c..7ff4f98 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java @@ -17,10 +17,6 @@ package org.apache.harmony.archive.tests.java.util.zip; -import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; import tests.support.Support_PlatformFile; import tests.support.resource.Support_Resources; import tests.util.TestEnvironment; @@ -38,7 +34,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -@TestTargetClass(ZipFile.class) public class ZipFileTest extends junit.framework.TestCase { public byte[] getAllBytesFromStream(InputStream is) throws IOException { @@ -77,12 +72,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.util.zip.ZipFile#ZipFile(java.io.File) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "setUp procedure checks this type of constructor.", - method = "ZipFile", - args = {java.io.File.class} - ) public void test_ConstructorLjava_io_File() { // Test for method java.util.zip.ZipFile(java.io.File) assertTrue("Used to test", true); @@ -91,11 +80,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.util.zip.ZipFile#ZipFile(java.io.File, int) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "ZipFile", - args = {java.io.File.class, int.class} - ) public void test_ConstructorLjava_io_FileI() throws IOException { zfile.close(); // about to reopen the same temp file File file = new File(tempFileName); @@ -136,12 +120,6 @@ public class ZipFileTest extends junit.framework.TestCase { * @throws IOException * @tests java.util.zip.ZipFile#ZipFile(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Test contains empty brackets.", - method = "ZipFile", - args = {java.lang.String.class} - ) public void test_ConstructorLjava_lang_String() throws IOException { System.setProperty("user.dir", System.getProperty("java.io.tmpdir")); @@ -181,12 +159,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.util.zip.ZipFile#finalize() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "finalize", - args = {} - ) public void test_finalize() throws IOException { InputStream in = Support_Resources.getStream("hyts_ZipFile.zip"); File file = Support_Resources.createTempFile(".jar"); @@ -217,11 +189,6 @@ public class ZipFileTest extends junit.framework.TestCase { * @throws IOException * @tests java.util.zip.ZipFile#close() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "close", - args = {} - ) public void test_close() throws IOException { // Test for method void java.util.zip.ZipFile.close() File fl = new File(tempFileName); @@ -252,12 +219,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.util.zip.ZipFile#entries() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "entries", - args = {} - ) public void test_entries() throws Exception { // Test for method java.util.Enumeration java.util.zip.ZipFile.entries() Enumeration<? extends ZipEntry> enumer = zfile.entries(); @@ -292,11 +253,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.util.zip.ZipFile#getEntry(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "getEntry", - args = {java.lang.String.class} - ) public void test_getEntryLjava_lang_String() throws IOException { // Test for method java.util.zip.ZipEntry // java.util.zip.ZipFile.getEntry(java.lang.String) @@ -325,11 +281,6 @@ public class ZipFileTest extends junit.framework.TestCase { 0, r)); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "getEntry", - args = {java.lang.String.class} - ) public void test_getEntryLjava_lang_String_AndroidOnly() throws IOException { java.util.zip.ZipEntry zentry = zfile.getEntry("File1.txt"); assertNotNull("Could not obtain ZipEntry", zentry); @@ -351,12 +302,6 @@ public class ZipFileTest extends junit.framework.TestCase { assertEquals("Must not be able to read directory data", -1, data); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "IllegalStateException checking.", - method = "getEntry", - args = {java.lang.String.class} - ) public void test_getEntryLjava_lang_String_Ex() throws IOException { java.util.zip.ZipEntry zentry = zfile.getEntry("File1.txt"); assertNotNull("Could not obtain ZipEntry", zentry); @@ -373,12 +318,6 @@ public class ZipFileTest extends junit.framework.TestCase { * @throws IOException * @tests java.util.zip.ZipFile#getInputStream(java.util.zip.ZipEntry) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_getInputStreamLjava_util_zip_ZipEntry() throws IOException { // Test for method java.io.InputStream // java.util.zip.ZipFile.getInputStream(java.util.zip.ZipEntry) @@ -417,12 +356,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.util.zip.ZipFile#getName() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getName", - args = {} - ) public void test_getName() { // Test for method java.lang.String java.util.zip.ZipFile.getName() assertTrue("Returned incorrect name: " + zfile.getName(), zfile @@ -433,11 +366,6 @@ public class ZipFileTest extends junit.framework.TestCase { * @throws IOException * @tests java.util.zip.ZipFile#size() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "size", - args = {} - ) public void test_size() throws IOException { assertEquals(6, zfile.size()); zfile.close(); @@ -451,11 +379,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.io.InputStream#reset() */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_reset() throws IOException { // read an uncompressed entry ZipEntry zentry = zfile.getEntry("File1.txt"); @@ -502,11 +425,6 @@ public class ZipFileTest extends junit.framework.TestCase { /** * @tests java.io.InputStream#reset() */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "getInputStream", - args = {java.util.zip.ZipEntry.class} - ) public void test_reset_subtest0() throws IOException { // read an uncompressed entry ZipEntry zentry = zfile.getEntry("File1.txt"); diff --git a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java index c5efedc..02ddd08 100644 --- a/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java +++ b/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java @@ -17,10 +17,6 @@ package org.apache.harmony.archive.tests.java.util.zip; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import tests.support.resource.Support_Resources; @@ -37,7 +33,6 @@ import java.util.zip.ZipException; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; -@TestTargetClass(ZipInputStream.class) public class ZipInputStreamTest extends TestCase { // the file hyts_zipFile.zip used in setup needs to included as a resource private ZipEntry zentry; @@ -84,12 +79,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#ZipInputStream(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ZipInputStream", - args = {java.io.InputStream.class} - ) public void test_ConstructorLjava_io_InputStream() throws Exception { zentry = zis.getNextEntry(); zis.closeEntry(); @@ -98,12 +87,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#close() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "close", - args = {} - ) public void test_close() { try { zis.close(); @@ -118,12 +101,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#close() */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Checks calling method two times", - method = "close", - args = {} - ) public void test_close2() throws Exception { // Regression for HARMONY-1101 zis.close(); @@ -134,12 +111,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#closeEntry() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "closeEntry", - args = {} - ) public void test_closeEntry() throws Exception { zentry = zis.getNextEntry(); zis.closeEntry(); @@ -169,11 +140,6 @@ public class ZipInputStreamTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "close", - args = {} - ) public void test_closeAfterException() throws Exception { File resources = Support_Resources.createTempFolder(); Support_Resources.copyFile(resources, null, "Broken_manifest.jar"); @@ -203,11 +169,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#getNextEntry() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "getNextEntry", - args = {} - ) public void test_getNextEntry() throws Exception { assertNotNull("getNextEntry failed", zis.getNextEntry()); @@ -239,11 +200,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#read(byte[], int, int) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "read", - args = {byte[].class, int.class, int.class} - ) public void test_read$BII() throws Exception { zentry = zis.getNextEntry(); byte[] rbuf = new byte[(int) zentry.getSize()]; @@ -279,11 +235,6 @@ public class ZipInputStreamTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "read", - args = {byte[].class, int.class, int.class} - ) public void testReadOneByteAtATime() throws IOException { InputStream in = new FilterInputStream(Support_Resources.getStream("hyts_ZipFile.zip")) { @Override @@ -307,11 +258,6 @@ public class ZipInputStreamTest extends TestCase { /** * @tests java.util.zip.ZipInputStream#skip(long) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "skip", - args = {long.class} - ) public void test_skipJ() throws Exception { zentry = zis.getNextEntry(); byte[] rbuf = new byte[(int) zentry.getSize()]; @@ -365,11 +311,6 @@ public class ZipInputStreamTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "available", - args = {} - ) public void test_available() throws Exception { File resources = Support_Resources.createTempFolder(); @@ -422,12 +363,6 @@ public class ZipInputStreamTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "createZipEntry", - args = {java.lang.String.class} - ) public void test_createZipEntryLjava_lang_String() throws Exception { File resources = Support_Resources.createTempFolder(); |