diff options
Diffstat (limited to 'luni/src/test/java/tests/security')
88 files changed, 125 insertions, 4963 deletions
diff --git a/luni/src/test/java/tests/security/AccessControllerTest.java b/luni/src/test/java/tests/security/AccessControllerTest.java index 5973d30..e031b5e 100644 --- a/luni/src/test/java/tests/security/AccessControllerTest.java +++ b/luni/src/test/java/tests/security/AccessControllerTest.java @@ -16,11 +16,6 @@ package tests.security; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; - import java.lang.reflect.Field; import java.security.AccessController; import java.security.BasicPermission; @@ -32,7 +27,6 @@ import java.security.ProtectionDomain; import junit.framework.TestCase; -@TestTargetClass(AccessController.class) public class AccessControllerTest extends TestCase { private static void setProtectionDomain(Class<?> c, ProtectionDomain pd){ @@ -68,16 +62,6 @@ public class AccessControllerTest extends TestCase { super.setUp(); } - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that checkPermission does not throw a SecurityException " + - "if all classes on the call stack refer to a protection domain " + - "which contains the necessary permissions.", - method = "checkPermission", - args = {Permission.class} - ) - }) public void test_do_privileged2() { // add TestPermission to T0, T1, T2 c0.add(p); diff --git a/luni/src/test/java/tests/security/CertPathBuilderTest.java b/luni/src/test/java/tests/security/CertPathBuilderTest.java index 1c82999..6660390 100644 --- a/luni/src/test/java/tests/security/CertPathBuilderTest.java +++ b/luni/src/test/java/tests/security/CertPathBuilderTest.java @@ -15,9 +15,6 @@ */ package tests.security; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; import java.security.cert.CertPath; import java.security.cert.CertPathBuilder; import java.security.cert.CertPathBuilderResult; @@ -42,29 +39,6 @@ public abstract class CertPathBuilderTest extends TestCase { public abstract CertPathParameters getCertPathParameters() throws Exception; public abstract void validateCertPath(CertPath path); - @TestTargets({ - @TestTargetNew( - level=TestLevel.ADDITIONAL, - method="getInstance", - args={String.class} - ), - @TestTargetNew( - level=TestLevel.ADDITIONAL, - method="build", - args={CertPathParameters.class} - ), - @TestTargetNew( - level=TestLevel.ADDITIONAL, - clazz=CertPathBuilderResult.class, - method="getCertPath", - args={} - ), - @TestTargetNew( - level=TestLevel.COMPLETE, - method="method", - args={} - ) - }) public void testCertPathBuilder() throws Exception { CertPathBuilder pathBuilder = CertPathBuilder.getInstance( algorithmName); diff --git a/luni/src/test/java/tests/security/CertPathValidatorTest.java b/luni/src/test/java/tests/security/CertPathValidatorTest.java index 2821f47..eb2e196 100644 --- a/luni/src/test/java/tests/security/CertPathValidatorTest.java +++ b/luni/src/test/java/tests/security/CertPathValidatorTest.java @@ -15,9 +15,6 @@ */ package tests.security; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; import java.security.cert.CertPath; import java.security.cert.CertPathParameters; import java.security.cert.CertPathValidator; @@ -37,23 +34,6 @@ public abstract class CertPathValidatorTest extends TestCase { public abstract CertPath getCertPath(); public abstract void validateResult(CertPathValidatorResult validatorResult); - @TestTargets({ - @TestTargetNew( - level=TestLevel.ADDITIONAL, - method="getInstance", - args={String.class} - ), - @TestTargetNew( - level=TestLevel.ADDITIONAL, - method="validate", - args={CertPath.class, CertPathParameters.class} - ), - @TestTargetNew( - level=TestLevel.COMPLETE, - method="method", - args={} - ) - }) public void testCertPathValidator() throws Exception { CertPathValidator certPathValidator = CertPathValidator.getInstance( algorithmName); diff --git a/luni/src/test/java/tests/security/CertificateFactoryTest.java b/luni/src/test/java/tests/security/CertificateFactoryTest.java index 1bfa2aa..ca267a9 100644 --- a/luni/src/test/java/tests/security/CertificateFactoryTest.java +++ b/luni/src/test/java/tests/security/CertificateFactoryTest.java @@ -15,9 +15,6 @@ */ package tests.security; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.security.cert.Certificate; @@ -39,23 +36,6 @@ public abstract class CertificateFactoryTest extends TestCase { super.setUp(); } - @TestTargets({ - @TestTargetNew( - level=TestLevel.ADDITIONAL, - method="getInstance", - args={String.class} - ), - @TestTargetNew( - level=TestLevel.ADDITIONAL, - method="generateCertificate", - args={InputStream.class} - ), - @TestTargetNew( - level=TestLevel.COMPLETE, - method="method", - args={} - ) - }) public void testCertificateFactory() throws Exception { CertificateFactory certificateFactory = CertificateFactory.getInstance( algorithmName); diff --git a/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java b/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java index c4fac46..d3b7735 100644 --- a/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java +++ b/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java @@ -17,27 +17,15 @@ package tests.security.acl; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.acl.AclNotFoundException; -@TestTargetClass(AclNotFoundException.class) public class AclNotFoundException2Test extends TestCase { /** - * @tests java.security.acl.AclNotFoundException#AclNotFoundException() + * java.security.acl.AclNotFoundException#AclNotFoundException() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "AclNotFoundException", - args = {} - ) public void test_Constructor() { // Test for method java.security.acl.AclNotFoundException() try { diff --git a/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java b/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java index 8dc6753..a4c389e 100644 --- a/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java +++ b/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.acl; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.acl.AclNotFoundException; @@ -35,17 +30,10 @@ import java.security.acl.AclNotFoundException; * Unit test for AclNotFoundException. * */ -@TestTargetClass(AclNotFoundException.class) public class AclNotFoundExceptionTest extends TestCase { /** * check default constructor */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "AclNotFoundException", - args = {} - ) public void testAclNotFoundException() { assertNotNull(new AclNotFoundException()); assertNull(new AclNotFoundException().getMessage()); diff --git a/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java b/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java index e11e633..8b7d9a1 100644 --- a/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java +++ b/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java @@ -17,27 +17,15 @@ package tests.security.acl; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.acl.LastOwnerException; -@TestTargetClass(LastOwnerException.class) public class LastOwnerException2Test extends TestCase { /** - * @tests java.security.acl.LastOwnerException#LastOwnerException() + * java.security.acl.LastOwnerException#LastOwnerException() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "LastOwnerException", - args = {} - ) public void test_Constructor() { // Test for method java.security.acl.LastOwnerException() try { diff --git a/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java b/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java index 7ca2aad..5632ec7 100644 --- a/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java +++ b/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java @@ -17,27 +17,15 @@ package tests.security.acl; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.acl.NotOwnerException; -@TestTargetClass(NotOwnerException.class) public class NotOwnerException2Test extends TestCase { /** - * @tests java.security.acl.NotOwnerException#NotOwnerException() + * java.security.acl.NotOwnerException#NotOwnerException() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "NotOwnerException", - args = {} - ) public void test_Constructor() { // Test for method java.security.acl.NotOwnerException() try { diff --git a/luni/src/test/java/tests/security/cert/CRLExceptionTest.java b/luni/src/test/java/tests/security/cert/CRLExceptionTest.java index 1de4982..c542a2a 100644 --- a/luni/src/test/java/tests/security/cert/CRLExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CRLExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CRLException; @@ -35,7 +30,6 @@ import java.security.cert.CRLException; * Tests for <code>CRLException</code> class constructors and methods. * */ -@TestTargetClass(CRLException.class) public class CRLExceptionTest extends TestCase { private static String[] msgs = { @@ -49,12 +43,6 @@ public class CRLExceptionTest extends TestCase { * Test for <code>CRLException()</code> constructor Assertion: constructs * CRLException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CRLException", - args = {} - ) public void testCRLException01() { CRLException tE = new CRLException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -66,12 +54,6 @@ public class CRLExceptionTest extends TestCase { * constructs CRLException with detail message msg. Parameter * <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CRLException", - args = {java.lang.String.class} - ) public void testCRLException02() { CRLException tE; for (int i = 0; i < msgs.length; i++) { @@ -86,12 +68,6 @@ public class CRLExceptionTest extends TestCase { * Test for <code>CRLException(String)</code> constructor Assertion: * constructs CRLException when <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CRLException", - args = {java.lang.String.class} - ) public void testCRLException03() { String msg = null; CRLException tE = new CRLException(msg); @@ -103,12 +79,6 @@ public class CRLExceptionTest extends TestCase { * Test for <code>CRLException(Throwable)</code> constructor Assertion: * constructs CRLException when <code>cause</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CRLException", - args = {java.lang.Throwable.class} - ) public void testCRLException04() { Throwable cause = null; CRLException tE = new CRLException(cause); @@ -120,12 +90,6 @@ public class CRLExceptionTest extends TestCase { * Test for <code>CRLException(Throwable)</code> constructor Assertion: * constructs CRLException when <code>cause</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CRLException", - args = {java.lang.Throwable.class} - ) public void testCRLException05() { CRLException tE = new CRLException(tCause); if (tE.getMessage() != null) { @@ -144,12 +108,6 @@ public class CRLExceptionTest extends TestCase { * Assertion: constructs CRLException when <code>cause</code> is null * <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CRLException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCRLException06() { CRLException tE = new CRLException(null, null); assertNull("getMessage() must return null", tE.getMessage()); @@ -161,12 +119,6 @@ public class CRLExceptionTest extends TestCase { * Assertion: constructs CRLException when <code>cause</code> is null * <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the second parameter.", - method = "CRLException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCRLException07() { CRLException tE; for (int i = 0; i < msgs.length; i++) { @@ -182,12 +134,6 @@ public class CRLExceptionTest extends TestCase { * Assertion: constructs CRLException when <code>cause</code> is not null * <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the first parameter.", - method = "CRLException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCRLException08() { CRLException tE = new CRLException(null, tCause); if (tE.getMessage() != null) { @@ -206,12 +152,6 @@ public class CRLExceptionTest extends TestCase { * Assertion: constructs CRLException when <code>cause</code> is not null * <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CRLException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCRLException09() { CRLException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/cert/CRLTest.java b/luni/src/test/java/tests/security/cert/CRLTest.java index 1d09239..be8ddcd 100644 --- a/luni/src/test/java/tests/security/cert/CRLTest.java +++ b/luni/src/test/java/tests/security/cert/CRLTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CRL; @@ -38,7 +33,6 @@ import org.apache.harmony.security.tests.support.SpiEngUtils; * Tests for <code>java.security.cert.CRL</code> fields and methods * */ -@TestTargetClass(CRL.class) public class CRLTest extends TestCase { public static final String[] validValues = { "X.509", "x.509" }; @@ -52,12 +46,6 @@ public class CRLTest extends TestCase { /** * Test for <code>CRL(String type)</code> constructor<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CRL", - args = {java.lang.String.class} - ) public final void testConstructor() { for (int i = 0; i< validValues.length; i++) { CRL crl = new MyCRL(validValues[i]); @@ -81,12 +69,6 @@ public class CRLTest extends TestCase { * Test #1 for <code>getType()</code> method<br> * Assertion: returns <code>CRL</code> type */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getType", - args = {} - ) public final void testGetType01() { CRL crl = new MyCRL("TEST_TYPE"); assertEquals("TEST_TYPE", crl.getType()); @@ -96,12 +78,6 @@ public class CRLTest extends TestCase { * Test #2 for <code>getType()</code> method<br> * Assertion: returns <code>CRL</code> type */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "getType", - args = {} - ) public final void testGetType02() { CRL crl = new MyCRL(null); assertNull(crl.getType()); @@ -116,12 +92,6 @@ public class CRLTest extends TestCase { /** * Test for <code>toString()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString() { CRL crl = new MyCRL("TEST_TYPE"); crl.toString(); @@ -130,12 +100,6 @@ public class CRLTest extends TestCase { /** * Test for <code>isRevoked()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "isRevoked", - args = {java.security.cert.Certificate.class} - ) public final void testIsRevoked() { CRL crl = new MyCRL("TEST_TYPE"); crl.isRevoked(null); diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java b/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java index 6d6d527..aae021b 100644 --- a/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java +++ b/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java @@ -23,9 +23,6 @@ package tests.security.cert; import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; import org.apache.harmony.security.tests.support.SpiEngUtils; import org.apache.harmony.security.tests.support.cert.MyCertPathBuilderSpi; @@ -51,7 +48,6 @@ import junit.framework.TestCase; * methods. * */ -@TestTargetClass(CertPathBuilder.class) public class CertPathBuilder1Test extends TestCase { public static final String srvCertPathBuilder = "CertPathBuilder"; @@ -97,14 +93,8 @@ public class CertPathBuilder1Test extends TestCase { } /** - * @tests java.security.cert.CertPathBuilder#getDefaultType() + * java.security.cert.CertPathBuilder#getDefaultType() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getDefaultType", - args = {} - ) public void test_getDefaultType() throws Exception { // Regression for HARMONY-2785 @@ -121,12 +111,6 @@ public class CertPathBuilder1Test extends TestCase { * throws NoSuchAlgorithmException when algorithm is not correct * or it is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies NoSuchAlgorithmException.", - method = "getInstance", - args = {java.lang.String.class} - ) public void testCertPathBuilder02() throws NoSuchAlgorithmException { try { CertPathBuilder.getInstance(null); @@ -146,12 +130,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>getInstance(String algorithm)</code> method * Assertion: returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies positive functionality.", - method = "getInstance", - args = {java.lang.String.class} - ) public void testCertPathBuilder03() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); @@ -168,12 +146,6 @@ public class CertPathBuilder1Test extends TestCase { * * FIXME: verify what exception will be thrown if provider is empty */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathBuilder04() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -200,12 +172,6 @@ public class CertPathBuilder1Test extends TestCase { * Assertion: * throws NoSuchProviderException when provider has invalid value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance throws NoSuchProviderException when provider has invalid value.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathBuilder05() throws NoSuchAlgorithmException { if (!PKIXSupport) { @@ -228,12 +194,6 @@ public class CertPathBuilder1Test extends TestCase { * throws NullPointerException when algorithm is null * throws NoSuchAlgorithmException when algorithm is not correct */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException when algorithm is null; verifies NoSuchAlgorithmException when algorithm is not correct.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathBuilder06() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -258,12 +218,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>getInstance(String algorithm, String provider)</code> method * Assertion: returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathBuilder07() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -282,12 +236,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>getInstance(String algorithm, Provider provider)</code> method * Assertion: throws IllegalArgumentException when provider is null */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that getInstance method throws IllegalArgumentException when provider is null method.", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testCertPathBuilder08() throws NoSuchAlgorithmException { if (!PKIXSupport) { @@ -310,12 +258,6 @@ public class CertPathBuilder1Test extends TestCase { * throws NullPointerException when algorithm is null * throws NoSuchAlgorithmException when algorithm is not correct */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that getInstance method throws NullPointerException when algorithm is null, throws NoSuchAlgorithmException when algorithm is not correct.", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testCertPathBuilder09() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -339,12 +281,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>getInstance(String algorithm, String provider)</code> method * Assertion: returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance returns CertPathBuilder object.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathBuilder10() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -362,12 +298,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>build(CertPathParameters params)</code> method * Assertion: throws InvalidAlgorithmParameterException params is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that build method throws InvalidAlgorithmParameterException if a parameter is null.", - method = "build", - args = {java.security.cert.CertPathParameters.class} - ) public void testCertPathBuilder11() throws NoSuchAlgorithmException, NoSuchProviderException, CertPathBuilderException { @@ -386,12 +316,6 @@ public class CertPathBuilder1Test extends TestCase { } } - @TestTargetNew( - level=TestLevel.PARTIAL_COMPLETE, - notes = "Verifies normal case", - method="build", - args={CertPathParameters.class} - ) // Test passed on RI @KnownFailure(value="expired certificate bug 2322662") public void testBuild() throws Exception { @@ -414,12 +338,6 @@ public class CertPathBuilder1Test extends TestCase { * <code>CertPathBuilder</code> constructor * Assertion: returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPathBuilder", - args = {java.security.cert.CertPathBuilderSpi.class, java.security.Provider.class, java.lang.String.class} - ) public void testCertPathBuilder12() throws CertificateException, NoSuchProviderException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, @@ -452,12 +370,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>getAlgorithm()</code> method Assertion: returns * CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getAlgorithm", - args = {} - ) public void testCertPathBuilder13() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); @@ -493,12 +405,6 @@ public class CertPathBuilder1Test extends TestCase { * Test for <code>getProvider()</code> method Assertion: returns * CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getProvider", - args = {} - ) public void testCertPathBuilder14() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java b/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java index ed1dcbb..ffc5d08 100644 --- a/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java +++ b/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import tests.security.cert.myCertPathBuilder.MyProvider; @@ -45,7 +40,6 @@ import org.apache.harmony.security.tests.support.SpiEngUtils; * Tests for CertPathBuilder class constructors and methods * */ -@TestTargetClass(CertPathBuilder.class) public class CertPathBuilder2Test extends TestCase { private static final String defaultAlg = "CertPB"; private static final String CertPathBuilderProviderClass = "org.apache.harmony.security.tests.support.cert.MyCertPathBuilderSpi"; @@ -115,12 +109,6 @@ public class CertPathBuilder2Test extends TestCase { * throws NoSuchAlgorithmException when algorithm is not correct * returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class} - ) public void testGetInstance01() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, CertPathBuilderException { try { @@ -155,12 +143,6 @@ public class CertPathBuilder2Test extends TestCase { * throws NoSuchProviderException when provider is available; * returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testGetInstance02() throws NoSuchAlgorithmException, NoSuchProviderException, IllegalArgumentException, InvalidAlgorithmParameterException, CertPathBuilderException { @@ -225,12 +207,6 @@ public class CertPathBuilder2Test extends TestCase { * throws NoSuchAlgorithmException when algorithm is not correct * returns CertPathBuilder object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testGetInstance03() throws NoSuchAlgorithmException, IllegalArgumentException, InvalidAlgorithmParameterException, CertPathBuilderException { diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java b/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java index 00b0362..f1694de 100644 --- a/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertPathBuilderException; @@ -37,7 +32,6 @@ import java.security.cert.CertPathBuilderException; * methods. * */ -@TestTargetClass(CertPathBuilderException.class) public class CertPathBuilderExceptionTest extends TestCase { private static String[] msgs = { @@ -51,12 +45,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * Test for <code>CertPathBuilderException()</code> constructor Assertion: * constructs CertPathBuilderException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPathBuilderException", - args = {} - ) public void testCertPathBuilderException01() { CertPathBuilderException tE = new CertPathBuilderException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -68,12 +56,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * Assertion: constructs CertPathBuilderException with detail message msg. * Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertPathBuilderException", - args = {java.lang.String.class} - ) public void testCertPathBuilderException02() { CertPathBuilderException tE; for (int i = 0; i < msgs.length; i++) { @@ -89,12 +71,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * Assertion: constructs CertPathBuilderException when <code>msg</code> is * null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertPathBuilderException", - args = {java.lang.String.class} - ) public void testCertPathBuilderException03() { String msg = null; CertPathBuilderException tE = new CertPathBuilderException(msg); @@ -107,12 +83,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * Assertion: constructs CertPathBuilderException when <code>cause</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertPathBuilderException", - args = {java.lang.Throwable.class} - ) public void testCertPathBuilderException04() { Throwable cause = null; CertPathBuilderException tE = new CertPathBuilderException(cause); @@ -125,12 +95,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * Assertion: constructs CertPathBuilderException when <code>cause</code> * is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertPathBuilderException", - args = {java.lang.Throwable.class} - ) public void testCertPathBuilderException05() { CertPathBuilderException tE = new CertPathBuilderException(tCause); if (tE.getMessage() != null) { @@ -149,12 +113,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * constructor Assertion: constructs CertPathBuilderException when * <code>cause</code> is null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertPathBuilderException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathBuilderException06() { CertPathBuilderException tE = new CertPathBuilderException(null, null); assertNull("getMessage() must return null", tE.getMessage()); @@ -166,12 +124,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * constructor Assertion: constructs CertPathBuilderException when * <code>cause</code> is null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the second parameter.", - method = "CertPathBuilderException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathBuilderException07() { CertPathBuilderException tE; for (int i = 0; i < msgs.length; i++) { @@ -187,12 +139,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * constructor Assertion: constructs CertPathBuilderException when * <code>cause</code> is not null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the first parameter.", - method = "CertPathBuilderException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathBuilderException08() { CertPathBuilderException tE = new CertPathBuilderException(null, tCause); if (tE.getMessage() != null) { @@ -211,12 +157,6 @@ public class CertPathBuilderExceptionTest extends TestCase { * constructor Assertion: constructs CertPathBuilderException when * <code>cause</code> is not null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "CertPathBuilderException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathBuilderException09() { CertPathBuilderException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java b/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java index dc173dc..b5615cc 100644 --- a/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java +++ b/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.InvalidAlgorithmParameterException; @@ -41,27 +36,12 @@ import org.apache.harmony.security.tests.support.cert.MyCertPathBuilderSpi; * Tests for <code>CertPathBuilderSpi</code> class constructors and methods. * */ -@TestTargetClass(CertPathBuilderSpi.class) public class CertPathBuilderSpiTest extends TestCase { /** * Test for <code>CertPathBuilderSpi</code> constructor Assertion: * constructs CertPathBuilderSpi */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPathBuilderSpi", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineBuild", - args = {java.security.cert.CertPathParameters.class} - ) - }) public void testCertPathBuilderSpi01() throws CertPathBuilderException, InvalidAlgorithmParameterException { CertPathBuilderSpi certPathBuilder = new MyCertPathBuilderSpi(); diff --git a/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java b/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java index 6f3f2bd..4dac8c3 100644 --- a/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java +++ b/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java @@ -1,9 +1,5 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.cert.MyCertPath; @@ -12,7 +8,6 @@ import org.apache.harmony.security.tests.support.cert.MyCertPath.MyCertPathRep; import java.io.ObjectStreamException; import java.security.cert.CertPath; -@TestTargetClass(CertPath.class) public class CertPathCertPathRepTest extends TestCase { private static final byte[] testEncoding = new byte[] { (byte) 1, (byte) 2, @@ -30,12 +25,6 @@ public class CertPathCertPathRepTest extends TestCase { * Test for <code>CertPath.CertPathRep(String type, byte[] data)</code> * method<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPath.CertPathRep.CertPathRep", - args = { String.class, byte[].class} - ) public final void testCertPathCertPathRep() { MyCertPath cp = new MyCertPath(testEncoding); MyCertPathRep rep = cp.new MyCertPathRep("MyEncoding", testEncoding); @@ -50,12 +39,6 @@ public class CertPathCertPathRepTest extends TestCase { } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Checks ObjectStreamException", - method = "CertPath.CertPathRep.readResolve", - args = {} - ) public final void testReadResolve() { MyCertPath cp = new MyCertPath(testEncoding); MyCertPathRep rep = cp.new MyCertPathRep("MyEncoding", testEncoding); diff --git a/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java b/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java index f4bbea8..f3554d6 100644 --- a/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java +++ b/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.InvalidAlgorithmParameterException; @@ -49,7 +44,6 @@ import org.apache.harmony.security.tests.support.SpiEngUtils; * methods. * */ -@TestTargetClass(CertPathValidator.class) public class CertPathValidator1Test extends TestCase { public static final String srvCertPathValidator = "CertPathValidator"; @@ -100,12 +94,6 @@ public class CertPathValidator1Test extends TestCase { * Test for <code>getDefaultType()</code> method * Assertion: returns security property "certpathvalidator.type" or "PKIX" */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getDefaultType", - args = {} - ) public void testCertPathValidator01() { if (!PKIXSupport) { fail(NotSupportMsg); @@ -138,12 +126,6 @@ public class CertPathValidator1Test extends TestCase { * throws NullPointerException when algorithm is null * throws NoSuchAlgorithmException when algorithm is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NoSuchAlgorithmException.", - method = "getInstance", - args = {java.lang.String.class} - ) public void testCertPathValidator02() { try { CertPathValidator.getInstance(null); @@ -163,12 +145,6 @@ public class CertPathValidator1Test extends TestCase { * Test for <code>getInstance(String algorithm)</code> method * Assertion: returns CertPathValidator object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getInstance", - args = {java.lang.String.class} - ) public void testCertPathValidator03() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); @@ -186,12 +162,6 @@ public class CertPathValidator1Test extends TestCase { * * FIXME: verify what exception will be thrown if provider is empty */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance method throws IllegalArgumentException when provider parameter is null or empty.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathValidator04() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -217,12 +187,6 @@ public class CertPathValidator1Test extends TestCase { * Assertion: * throws NoSuchProviderException when provider has invalid value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance method throws NoSuchProviderException when provider parameter has invalid value.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathValidator05() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); @@ -246,12 +210,6 @@ public class CertPathValidator1Test extends TestCase { * throws NullPointerException when algorithm is null * throws NoSuchAlgorithmException when algorithm is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance method throws NullPointerException when algorithm is null, and NoSuchAlgorithmException when algorithm is not available", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathValidator06() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -276,12 +234,6 @@ public class CertPathValidator1Test extends TestCase { * Test for <code>getInstance(String algorithm, String provider)</code> method * Assertion: returns CertPathValidator object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance mwthod returns CertPathValidator object.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathValidator07() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -303,12 +255,6 @@ public class CertPathValidator1Test extends TestCase { * Test for <code>getInstance(String algorithm, Provider provider)</code> method * Assertion: throws IllegalArgumentException when provider is null */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that getInstance method throws IllegalArgumentException when provider parameter is null.", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testCertPathValidator08() throws NoSuchAlgorithmException { if (!PKIXSupport) { @@ -331,12 +277,6 @@ public class CertPathValidator1Test extends TestCase { * throws NullPointerException when algorithm is null * throws NoSuchAlgorithmException when algorithm is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance method throws NullPointerException when algorithm is null, and NoSuchAlgorithmException when algorithm is not available.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathValidator09() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -361,12 +301,6 @@ public class CertPathValidator1Test extends TestCase { * Test for <code>getInstance(String algorithm, String provider)</code> method * Assertion: returns CertPathValidator object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getInstance method returns CertPathValidator object.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertPathValidator10() throws NoSuchAlgorithmException, NoSuchProviderException { if (!PKIXSupport) { @@ -389,12 +323,6 @@ public class CertPathValidator1Test extends TestCase { * Assertion: throws InvalidAlgorithmParameterException params is not * instance of PKIXParameters or null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that validate method throws InvalidAlgorithmParameterException if param is not instance of PKIXParameters or null.", - method = "validate", - args = {java.security.cert.CertPath.class, java.security.cert.CertPathParameters.class} - ) public void testCertPathValidator11() throws NoSuchAlgorithmException, NoSuchProviderException, CertPathValidatorException { if (!PKIXSupport) { @@ -424,12 +352,6 @@ public class CertPathValidator1Test extends TestCase { * <code>CertPathValidator</code> constructor * Assertion: returns CertPathValidator object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPathValidator", - args = {java.security.cert.CertPathValidatorSpi.class, java.security.Provider.class, java.lang.String.class} - ) public void testCertPathValidator12() throws CertificateException, NoSuchProviderException, NoSuchAlgorithmException, CertPathValidatorException, InvalidAlgorithmParameterException { @@ -461,12 +383,6 @@ public class CertPathValidator1Test extends TestCase { /** * Test for <code>getAlgorithm()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getAlgorithm", - args = {} - ) public void testCertPathValidator13() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); @@ -496,12 +412,6 @@ public class CertPathValidator1Test extends TestCase { /** * Test for <code>getProvider()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getProvider", - args = {} - ) public void testCertPathValidator14() throws NoSuchAlgorithmException { if (!PKIXSupport) { fail(NotSupportMsg); diff --git a/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java b/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java index 3f513cc..8f5b6d5 100644 --- a/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java +++ b/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java @@ -22,10 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.SpiEngUtils; @@ -46,7 +42,6 @@ import java.security.cert.PKIXParameters; /** * Tests for CertPathValidator class constructors and methods */ -@TestTargetClass(CertPathValidator.class) public class CertPathValidator2Test extends TestCase { private static final String defaultAlg = "CertPB"; @@ -110,9 +105,6 @@ public class CertPathValidator2Test extends TestCase { * NoSuchAlgorithmException when algorithm is not available returns * CertPathValidator object */ - @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getInstance", args = { - java.lang.String.class - }) public void testGetInstance01() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, CertPathValidatorException { try { @@ -146,9 +138,6 @@ public class CertPathValidator2Test extends TestCase { * NoSuchProviderException when provider is available; returns * CertPathValidator object */ - @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getInstance", args = { - java.lang.String.class, java.lang.String.class - }) public void testGetInstance02() throws NoSuchAlgorithmException, NoSuchProviderException, IllegalArgumentException, InvalidAlgorithmParameterException, CertPathValidatorException { @@ -207,9 +196,6 @@ public class CertPathValidator2Test extends TestCase { * IllegalArgumentException when provider is null; returns CertPathValidator * object */ - @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getInstance", args = { - java.lang.String.class, java.security.Provider.class - }) public void testGetInstance03() throws NoSuchAlgorithmException, IllegalArgumentException, InvalidAlgorithmParameterException, CertPathValidatorException { try { @@ -244,9 +230,6 @@ public class CertPathValidator2Test extends TestCase { } } - @TestTargetNew(level = TestLevel.PARTIAL_COMPLETE, method = "validate", args = { - CertPath.class, CertPathParameters.class - }) public void testValidate() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException { MyCertPath mCP = new MyCertPath(new byte[0]); CertPathParameters params = new PKIXParameters(TestUtils.getTrustAnchorSet()); diff --git a/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java b/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java index a4986a5..78410cc 100644 --- a/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java +++ b/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java @@ -23,10 +23,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.SpiEngUtils; @@ -47,7 +43,6 @@ import java.security.cert.PKIXParameters; * Tests for <code>CertPathValidator</code> class methods. * */ -@TestTargetClass(CertPathValidator.class) public class CertPathValidator3Test extends TestCase { private static final String defaultType = CertPathBuilder1Test.defaultType; @@ -91,12 +86,6 @@ public class CertPathValidator3Test extends TestCase { * certpath is not X.509 type * */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies exceptions.", - method = "validate", - args = {java.security.cert.CertPath.class, java.security.cert.CertPathParameters.class} - ) public void testValidate01() throws InvalidAlgorithmParameterException, CertPathValidatorException { if (!PKIXSupport) { fail(NotSupportMsg); diff --git a/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java b/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java index 62e486e..1eac1f7 100644 --- a/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertPath; @@ -43,7 +38,6 @@ import java.util.Vector; * methods. * */ -@TestTargetClass(CertPathValidatorException.class) public class CertPathValidatorExceptionTest extends TestCase { private static String[] msgs = { @@ -57,12 +51,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * Test for <code>CertPathValidatorException()</code> constructor * Assertion: constructs CertPathValidatorException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPathValidatorException", - args = {} - ) public void testCertPathValidatorException01() { CertPathValidatorException tE = new CertPathValidatorException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -74,12 +62,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * Assertion: constructs CertPathValidatorException with detail message msg. * Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertPathValidatorException", - args = {java.lang.String.class} - ) public void testCertPathValidatorException02() { CertPathValidatorException tE; for (int i = 0; i < msgs.length; i++) { @@ -95,12 +77,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * Assertion: constructs CertPathValidatorException when <code>msg</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertPathValidatorException", - args = {java.lang.String.class} - ) public void testCertPathValidatorException03() { String msg = null; CertPathValidatorException tE = new CertPathValidatorException(msg); @@ -113,12 +89,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * Assertion: constructs CertPathValidatorException when <code>cause</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertPathValidatorException", - args = {java.lang.Throwable.class} - ) public void testCertPathValidatorException04() { Throwable cause = null; CertPathValidatorException tE = new CertPathValidatorException(cause); @@ -131,12 +101,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * Assertion: constructs CertPathValidatorException when <code>cause</code> * is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertPathValidatorException", - args = {java.lang.Throwable.class} - ) public void testCertPathValidatorException05() { CertPathValidatorException tE = new CertPathValidatorException(tCause); if (tE.getMessage() != null) { @@ -155,12 +119,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * constructor Assertion: constructs CertPathValidatorException when * <code>cause</code> is null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathValidatorException06() { CertPathValidatorException tE = new CertPathValidatorException(null, null); @@ -173,12 +131,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * constructor Assertion: constructs CertPathValidatorException when * <code>cause</code> is null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the second parameter.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathValidatorException07() { CertPathValidatorException tE; for (int i = 0; i < msgs.length; i++) { @@ -194,12 +146,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * constructor Assertion: constructs CertPathValidatorException when * <code>cause</code> is not null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the first parameter.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathValidatorException08() { CertPathValidatorException tE = new CertPathValidatorException(null, tCause); @@ -219,12 +165,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * constructor Assertion: constructs CertPathValidatorException when * <code>cause</code> is not null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertPathValidatorException09() { CertPathValidatorException tE; for (int i = 0; i < msgs.length; i++) { @@ -252,12 +192,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * <code>cause</code> is null <code>msg</code> is null * <code>certPath</code> is null <code>index</code> is -1 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class} - ) public void testCertPathValidatorException10() { CertPathValidatorException tE = new CertPathValidatorException(null, null, null, -1); @@ -275,12 +209,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * <code>certPath</code> is null <code>index</code> not -1 throws: * IllegalArgumentException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that IllegalArgumentException is thrown.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class} - ) public void testCertPathValidatorException11() { int[] indx = { 0, 1, 100, Integer.MAX_VALUE, Integer.MIN_VALUE }; for (int j = 0; j < indx.length; j++) { @@ -304,12 +232,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * <code>cause</code> not null <code>msg</code> not null * <code>certPath</code> is null <code>index</code> is -1 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IndexOutOfBoundsException.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class} - ) public void testCertPathValidatorException12() { CertPathValidatorException tE; @@ -347,12 +269,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * <code>certPath</code> not null <code>index</code>< -1 || >= * certPath.getCertificates().size() throws: IndexOutOfBoundsException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IndexOutOfBoundsException.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class} - ) public void testCertPathValidatorException13() { myCertPath mcp = new myCertPath("X.509", ""); CertPath cp = mcp.get("X.509"); @@ -380,12 +296,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * <code>certPath</code> not null <code>index</code>< * certPath.getCertificates().size() */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IndexOutOfBoundsException.", - method = "CertPathValidatorException", - args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class} - ) public void testCertPathValidatorException14() { CertPathValidatorException tE; myCertPath mcp = new myCertPath("X.509", ""); @@ -424,12 +334,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * Test for <code>getCertPath()</code>. Returns the certification path * that was being validated when the exception was thrown. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Verifies that getCertPath method returns the certification paththat was being validated when the exception was thrown.", - method = "getCertPath", - args = {} - ) public void testCertPathValidatorException15() { CertPathValidatorException tE = new CertPathValidatorException(); assertNull("getCertPath() must return null.", tE.getCertPath()); @@ -486,12 +390,6 @@ public class CertPathValidatorExceptionTest extends TestCase { * that the list of certificates in a CertPath is zero based. If no index * has been set, -1 is returned. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIndex", - args = {} - ) public void testCertPathValidatorException16() { CertPathValidatorException tE = new CertPathValidatorException(); assertEquals("getIndex() must be equals -1", -1, tE.getIndex()); diff --git a/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java b/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java index 8db597b..f69a3e5 100644 --- a/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java +++ b/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.InvalidAlgorithmParameterException; @@ -41,27 +36,12 @@ import org.apache.harmony.security.tests.support.cert.MyCertPathValidatorSpi; * Tests for <code>CertPathValidatorSpi</code> class constructors and methods. * */ -@TestTargetClass(CertPathValidatorSpi.class) public class CertPathValidatorSpiTest extends TestCase { /** * Test for <code>CertPathValidatorSpi</code> constructor Assertion: * constructs CertPathValidatorSpi */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertPathValidatorSpi", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineValidate", - args = {java.security.cert.CertPath.class, java.security.cert.CertPathParameters.class} - ) - }) public void testCertPathValidatorSpi01() throws CertPathValidatorException, InvalidAlgorithmParameterException { CertPathValidatorSpi certPathValid = new MyCertPathValidatorSpi(); diff --git a/luni/src/test/java/tests/security/cert/CertStore1Test.java b/luni/src/test/java/tests/security/cert/CertStore1Test.java index 6da8175..1c290e4 100644 --- a/luni/src/test/java/tests/security/cert/CertStore1Test.java +++ b/luni/src/test/java/tests/security/cert/CertStore1Test.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.SpiEngUtils; @@ -51,7 +46,6 @@ import java.util.Collection; * methods. * */ -@TestTargetClass(CertStore.class) public class CertStore1Test extends TestCase { public static final String srvCertStore = "CertStore"; @@ -133,12 +127,6 @@ public class CertStore1Test extends TestCase { * Test for <code>getDefaultType()</code> method * Assertion: returns security property "certstore.type" or "LDAP" */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getDefaultType", - args = {} - ) public void testCertStore01() { if (!LDAPSupport) { return; @@ -163,12 +151,6 @@ public class CertStore1Test extends TestCase { * <code>CertStore</code> constructor * Assertion: returns CertStore object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertStore", - args = {java.security.cert.CertStoreSpi.class, java.security.Provider.class, java.lang.String.class, java.security.cert.CertStoreParameters.class} - ) public void testCertStore02() throws InvalidAlgorithmParameterException, CertStoreException { if (!initParams()) { return; @@ -202,12 +184,6 @@ public class CertStore1Test extends TestCase { * throws NullPointerException when type is null * throws NoSuchAlgorithmException when type is incorrect; */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies NoSuchAlgorithmException and NullPointerException. InvalidAlgorithmParameterException checking missed", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class} - ) public void testCertStore03() throws InvalidAlgorithmParameterException { if (!initParams()) { return; @@ -231,12 +207,6 @@ public class CertStore1Test extends TestCase { * Test for <code>getInstance(String type, CertStoreParameters params)</code> method * Assertion: return CertStore object */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "InvalidAlgorithmParameterException checking missed", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class} - ) public void testCertStore05() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException { if (!initParams()) { @@ -255,12 +225,6 @@ public class CertStore1Test extends TestCase { * Assertion: throws IllegalArgumentException when provider is null or empty * */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies IllegalArgumentException. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class} - ) public void testCertStore06() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { @@ -286,12 +250,6 @@ public class CertStore1Test extends TestCase { * <code>getInstance(String type, CertStoreParameters params, String provider)</code> * Assertion: throws NoSuchProviderException when provider has invalid value */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies NoSuchProviderException. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class} - ) public void testCertStore07() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException { if (!initParams()) { @@ -314,12 +272,6 @@ public class CertStore1Test extends TestCase { * throws NullPointerException when type is null * throws NoSuchAlgorithmException when type is incorrect; */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies NoSuchAlgorithmException and NullPointerException. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class} - ) public void testCertStore08() throws InvalidAlgorithmParameterException, NoSuchProviderException { if (!initParams()) { @@ -345,12 +297,6 @@ public class CertStore1Test extends TestCase { * <code>getInstance(String type, CertStoreParameters params, String provider)</code> * Assertion: return CertStore object */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies positive case. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class} - ) public void testCertStore10() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { if (!initParams()) { @@ -369,12 +315,6 @@ public class CertStore1Test extends TestCase { * <code>getInstance(String type, CertStoreParameters params, Provider provider)</code> * Assertion: throws IllegalArgumentException when provider is null */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that getInstance throws IllegalArgumentException when provider is null. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.security.Provider.class} - ) public void testCertStore11() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException { if (!initParams()) { @@ -395,12 +335,6 @@ public class CertStore1Test extends TestCase { * throws NullPointerException when type is null * throws NoSuchAlgorithmException when type is incorrect; */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies NullPointerException and NoSuchAlgorithmException. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.security.Provider.class} - ) public void testCertStore12() throws InvalidAlgorithmParameterException { if (!initParams()) { return; @@ -425,12 +359,6 @@ public class CertStore1Test extends TestCase { * <code>getInstance(String type, CertStoreParameters params, Provider provider)</code> * Assertion: return CertStore object */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies positive case. InvalidAlgorithmParameterException checking missed.", - method = "getInstance", - args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.security.Provider.class} - ) public void testCertStore14() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException { if (!initParams()) { @@ -449,20 +377,6 @@ public class CertStore1Test extends TestCase { * <code>getCRLs(CRLSelector selector)</code> * Assertion: returns empty Collection when selector is null */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that these methods return empty Collection when selector is null.", - method = "getCertificates", - args = {java.security.cert.CertSelector.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that these methods return empty Collection when selector is null.", - method = "getCRLs", - args = {java.security.cert.CRLSelector.class} - ) - }) public void testCertStore15() throws CertStoreException { if (!initParams()) { return; @@ -481,11 +395,6 @@ public class CertStore1Test extends TestCase { /** * Test for <code>getType()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "getType", - args = {} - ) public void testCertStore16() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { if (!initParams()) { @@ -518,12 +427,6 @@ public class CertStore1Test extends TestCase { /** * Test for <code>getProvider()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getProvider", - args = {} - ) public void testCertStore17() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { if (!initParams()) { @@ -555,12 +458,6 @@ public class CertStore1Test extends TestCase { /** * Test for <code>getCertStoreParameters()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertStoreParameters", - args = {} - ) public void testCertStore18() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { if (!initParams()) { diff --git a/luni/src/test/java/tests/security/cert/CertStore2Test.java b/luni/src/test/java/tests/security/cert/CertStore2Test.java index a5346c8..5b852d7 100644 --- a/luni/src/test/java/tests/security/cert/CertStore2Test.java +++ b/luni/src/test/java/tests/security/cert/CertStore2Test.java @@ -1,9 +1,5 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import java.security.InvalidAlgorithmParameterException; @@ -22,7 +18,6 @@ import java.security.cert.Certificate; import java.util.ArrayList; import java.util.Collection; -@TestTargetClass(CertStore.class) public class CertStore2Test extends TestCase { private static final String CERT_STORE_PROVIDER_NAME = "TestCertStoreProvider"; @@ -42,11 +37,6 @@ public class CertStore2Test extends TestCase { Security.removeProvider(CERT_STORE_PROVIDER_NAME); } - @TestTargetNew( - level=TestLevel.COMPLETE, - method="getInstance", - args={String.class, CertStoreParameters.class} - ) public void testGetInstanceStringCertStoreParameters() { try { CertStoreParameters parameters = new MyCertStoreParameters(); @@ -91,11 +81,6 @@ public class CertStore2Test extends TestCase { } } - @TestTargetNew( - level=TestLevel.COMPLETE, - method="getInstance", - args={String.class, CertStoreParameters.class, String.class} - ) public void testGetInstanceStringCertStoreParametersString() { try { CertStoreParameters parameters = new MyCertStoreParameters(); @@ -167,11 +152,6 @@ public class CertStore2Test extends TestCase { } - @TestTargetNew( - level=TestLevel.COMPLETE, - method="getInstance", - args={String.class, CertStoreParameters.class, Provider.class} - ) public void testGetInstanceStringCertStoreParametersProvider() { try { CertStoreParameters parameters = new MyCertStoreParameters(); @@ -220,11 +200,6 @@ public class CertStore2Test extends TestCase { } - @TestTargetNew( - level=TestLevel.COMPLETE, - method="getCertificates", - args={CertSelector.class} - ) public void testGetCertificates() { CertStore certStore = null; try { @@ -260,11 +235,6 @@ public class CertStore2Test extends TestCase { } } - @TestTargetNew( - level=TestLevel.COMPLETE, - method="getCRLs", - args={CRLSelector.class} - ) public void testGetCRLs() { CertStore certStore = null; try { diff --git a/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java b/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java index fce8a9c..5736a02 100644 --- a/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertStoreException; @@ -35,7 +30,6 @@ import java.security.cert.CertStoreException; * Tests for <code>CertStoreException</code> class constructors and methods. * */ -@TestTargetClass(CertStoreException.class) public class CertStoreExceptionTest extends TestCase { private static String[] msgs = { @@ -49,12 +43,6 @@ public class CertStoreExceptionTest extends TestCase { * Test for <code>CertStoreException()</code> constructor Assertion: * constructs CertStoreException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertStoreException", - args = {} - ) public void testCertStoreException01() { CertStoreException tE = new CertStoreException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -66,12 +54,6 @@ public class CertStoreExceptionTest extends TestCase { * constructs CertStoreException with detail message msg. Parameter * <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertStoreException", - args = {java.lang.String.class} - ) public void testCertStoreException02() { CertStoreException tE; for (int i = 0; i < msgs.length; i++) { @@ -86,12 +68,6 @@ public class CertStoreExceptionTest extends TestCase { * Test for <code>CertStoreException(String)</code> constructor Assertion: * constructs CertStoreException when <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null asa parameter.", - method = "CertStoreException", - args = {java.lang.String.class} - ) public void testCertStoreException03() { String msg = null; CertStoreException tE = new CertStoreException(msg); @@ -104,12 +80,6 @@ public class CertStoreExceptionTest extends TestCase { * Assertion: constructs CertStoreException when <code>cause</code> is * null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertStoreException", - args = {java.lang.Throwable.class} - ) public void testCertStoreException04() { Throwable cause = null; CertStoreException tE = new CertStoreException(cause); @@ -122,12 +92,6 @@ public class CertStoreExceptionTest extends TestCase { * Assertion: constructs CertStoreException when <code>cause</code> is not * null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertStoreException", - args = {java.lang.Throwable.class} - ) public void testCertStoreException05() { CertStoreException tE = new CertStoreException(tCause); if (tE.getMessage() != null) { @@ -146,12 +110,6 @@ public class CertStoreExceptionTest extends TestCase { * Assertion: constructs CertStoreException when <code>cause</code> is * null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertStoreException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertStoreException06() { CertStoreException tE = new CertStoreException(null, null); assertNull("getMessage() must return null", tE.getMessage()); @@ -163,12 +121,6 @@ public class CertStoreExceptionTest extends TestCase { * Assertion: constructs CertStoreException when <code>cause</code> is * null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the second parameter.", - method = "CertStoreException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertStoreException07() { CertStoreException tE; for (int i = 0; i < msgs.length; i++) { @@ -184,12 +136,6 @@ public class CertStoreExceptionTest extends TestCase { * Assertion: constructs CertStoreException when <code>cause</code> is not * null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the first parameter.", - method = "CertStoreException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertStoreException08() { CertStoreException tE = new CertStoreException(null, tCause); if (tE.getMessage() != null) { @@ -208,12 +154,6 @@ public class CertStoreExceptionTest extends TestCase { * Assertion: constructs CertStoreException when <code>cause</code> is not * null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "CertStoreException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertStoreException09() { CertStoreException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java b/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java index 3d16bfa..393abee 100644 --- a/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java +++ b/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java @@ -23,11 +23,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -47,7 +42,6 @@ import org.apache.harmony.security.tests.support.cert.MyCertStoreSpi; * Tests for <code>CertStoreSpi</code> class constructors and methods. * */ -@TestTargetClass(CertStoreSpi.class) public class CertStoreSpiTest extends TestCase { @@ -55,26 +49,6 @@ public class CertStoreSpiTest extends TestCase { * Test for <code>CertStoreSpi</code> constructor Assertion: constructs * CertStoreSpi */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertStoreSpi", - args = {java.security.cert.CertStoreParameters.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGetCertificates", - args = {java.security.cert.CertSelector.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGetCRLs", - args = {java.security.cert.CRLSelector.class} - ) - }) public void testCertStoreSpi01() throws InvalidAlgorithmParameterException, CertStoreException { CertStoreSpi certStoreSpi = null; diff --git a/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java b/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java index 924b13b..7d973e7 100644 --- a/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java @@ -1,9 +1,5 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.cert.MyCertificate; @@ -14,7 +10,6 @@ import java.io.ObjectStreamException; import java.security.cert.Certificate; import java.util.Arrays; -@TestTargetClass(java.security.cert.Certificate.class) public class CertificateCertificateRepTest extends TestCase { private static final byte[] testEncoding = new byte[] { (byte) 1, (byte) 2, @@ -33,12 +28,6 @@ public class CertificateCertificateRepTest extends TestCase { * <code>Certificate.CertificateRep(String type, byte[] data)</code> * method<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Certificate.CertificateRep.CertificateRep", - args = { String.class, byte[].class} - ) public final void testCertificateCertificateRep() { MyCertificate c1 = new MyCertificate("TEST_TYPE", testEncoding); MyCertificateRep rep = c1.new MyCertificateRep("TEST_TYPE", new byte[] { @@ -67,12 +56,6 @@ public class CertificateCertificateRepTest extends TestCase { /** * Test for <code>readResolve()</code> method<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "Certificate.CertificateRep.readResolve", - args = {} - ) public final void testReadResolve() { MyCertificate c1 = new MyCertificate("TEST_TYPE", testEncoding); MyCertificateRep rep = c1.new MyCertificateRep("TEST_TYPE", new byte[] { diff --git a/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java b/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java index e8698b6..9896dc6 100644 --- a/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java @@ -17,25 +17,13 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import java.security.cert.CertificateEncodingException; -@TestTargetClass(CertificateEncodingException.class) public class CertificateEncodingException2Test extends junit.framework.TestCase { /** - * @tests java.security.cert.CertificateEncodingException#CertificateEncodingException() + * java.security.cert.CertificateEncodingException#CertificateEncodingException() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateEncodingException", - args = {} - ) public void test_Constructor() { // Test for method java.security.cert.CertificateEncodingException() try { diff --git a/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java index 048c095..fa66cdb 100644 --- a/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertificateEncodingException; @@ -37,7 +32,6 @@ import java.security.cert.CertificateEncodingException; * methods. * */ -@TestTargetClass(CertificateEncodingException.class) public class CertificateEncodingExceptionTest extends TestCase { private static String[] msgs = { @@ -51,12 +45,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * Test for <code>CertificateEncodingException()</code> constructor * Assertion: constructs CertificateEncodingException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateEncodingException", - args = {} - ) public void testCertificateEncodingException01() { CertificateEncodingException tE = new CertificateEncodingException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -68,12 +56,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * Assertion: constructs CertificateEncodingException with detail message * msg. Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateEncodingException", - args = {java.lang.String.class} - ) public void testCertificateEncodingException02() { CertificateEncodingException tE; for (int i = 0; i < msgs.length; i++) { @@ -89,12 +71,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * Assertion: constructs CertificateEncodingException when <code>msg</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateEncodingException", - args = {java.lang.String.class} - ) public void testCertificateEncodingException03() { String msg = null; CertificateEncodingException tE = new CertificateEncodingException(msg); @@ -107,12 +83,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateEncodingException when * <code>cause</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateEncodingException", - args = {java.lang.Throwable.class} - ) public void testCertificateEncodingException04() { Throwable cause = null; CertificateEncodingException tE = new CertificateEncodingException( @@ -126,12 +96,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateEncodingException when * <code>cause</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateEncodingException", - args = {java.lang.Throwable.class} - ) public void testCertificateEncodingException05() { CertificateEncodingException tE = new CertificateEncodingException( tCause); @@ -151,12 +115,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateEncodingException when * <code>cause</code> is null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertificateEncodingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateEncodingException06() { CertificateEncodingException tE = new CertificateEncodingException( null, null); @@ -169,12 +127,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateEncodingException when * <code>cause</code> is null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the second parameter.", - method = "CertificateEncodingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateEncodingException07() { CertificateEncodingException tE; for (int i = 0; i < msgs.length; i++) { @@ -190,12 +142,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateEncodingException when * <code>cause</code> is not null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the first parameter.", - method = "CertificateEncodingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateEncodingException08() { CertificateEncodingException tE = new CertificateEncodingException( null, tCause); @@ -215,12 +161,6 @@ public class CertificateEncodingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateEncodingException when * <code>cause</code> is not null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateEncodingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateEncodingException09() { CertificateEncodingException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/cert/CertificateException2Test.java b/luni/src/test/java/tests/security/cert/CertificateException2Test.java index a3769c4..27f9d0e 100644 --- a/luni/src/test/java/tests/security/cert/CertificateException2Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateException2Test.java @@ -17,25 +17,13 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import java.security.cert.CertificateException; -@TestTargetClass(CertificateException.class) public class CertificateException2Test extends junit.framework.TestCase { /** - * @tests java.security.cert.CertificateException#CertificateException() + * java.security.cert.CertificateException#CertificateException() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateException", - args = {} - ) public void test_Constructor() { // Test for method java.security.cert.CertificateException() try { @@ -52,14 +40,8 @@ public class CertificateException2Test extends junit.framework.TestCase { } /** - * @tests java.security.cert.CertificateException#CertificateException(java.lang.String) + * java.security.cert.CertificateException#CertificateException(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Null/empty/invalid parameters checking missed", - method = "CertificateException", - args = {java.lang.String.class} - ) public void test_ConstructorLjava_lang_String() { // Test for method // java.security.cert.CertificateException(java.lang.String) diff --git a/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java index b88db00..e28a6d2 100644 --- a/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertificateException; @@ -36,7 +31,6 @@ import java.security.cert.CertificateException; * Tests for <code>CertificateException</code> class constructors and methods. * */ -@TestTargetClass(CertificateException.class) public class CertificateExceptionTest extends TestCase { private static String[] msgs = { @@ -50,12 +44,6 @@ public class CertificateExceptionTest extends TestCase { * Test for <code>CertificateException()</code> constructor Assertion: * constructs CertificateException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateException", - args = {} - ) public void testCertificateException01() { CertificateException tE = new CertificateException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -67,12 +55,6 @@ public class CertificateExceptionTest extends TestCase { * Assertion: constructs CertificateException with detail message msg. * Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateException", - args = {java.lang.String.class} - ) public void testCertificateException02() { CertificateException tE; for (int i = 0; i < msgs.length; i++) { @@ -88,12 +70,6 @@ public class CertificateExceptionTest extends TestCase { * Assertion: constructs CertificateException when <code>msg</code> is * null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateException", - args = {java.lang.String.class} - ) public void testCertificateException03() { String msg = null; CertificateException tE = new CertificateException(msg); @@ -106,12 +82,6 @@ public class CertificateExceptionTest extends TestCase { * Assertion: constructs CertificateException when <code>cause</code> is * null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateException", - args = {java.lang.Throwable.class} - ) public void testCertificateException04() { Throwable cause = null; CertificateException tE = new CertificateException(cause); @@ -124,12 +94,6 @@ public class CertificateExceptionTest extends TestCase { * Assertion: constructs CertificateException when <code>cause</code> is * not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateException", - args = {java.lang.Throwable.class} - ) public void testCertificateException05() { CertificateException tE = new CertificateException(tCause); if (tE.getMessage() != null) { @@ -148,12 +112,6 @@ public class CertificateExceptionTest extends TestCase { * constructor Assertion: constructs CertificateException when * <code>cause</code> is null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertificateException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateException06() { CertificateException tE = new CertificateException(null, null); assertNull("getMessage() must return null", tE.getMessage()); @@ -165,12 +123,6 @@ public class CertificateExceptionTest extends TestCase { * constructor Assertion: constructs CertificateException when * <code>cause</code> is null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as Throwable parameter.", - method = "CertificateException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateException07() { CertificateException tE; for (int i = 0; i < msgs.length; i++) { @@ -186,12 +138,6 @@ public class CertificateExceptionTest extends TestCase { * constructor Assertion: constructs CertificateException when * <code>cause</code> is not null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies as String parameter.", - method = "CertificateException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateException08() { CertificateException tE = new CertificateException(null, tCause); if (tE.getMessage() != null) { @@ -210,12 +156,6 @@ public class CertificateExceptionTest extends TestCase { * constructor Assertion: constructs CertificateException when * <code>cause</code> is not null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateException09() { CertificateException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java index d6ee648..bf6f1dd 100644 --- a/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertificateExpiredException; @@ -36,7 +31,6 @@ import java.security.cert.CertificateExpiredException; * Tests for <code>DigestException</code> class constructors and methods. * */ -@TestTargetClass(CertificateExpiredException.class) public class CertificateExpiredExceptionTest extends TestCase { static String[] msgs = { @@ -50,12 +44,6 @@ public class CertificateExpiredExceptionTest extends TestCase { * Test for <code>CertificateExpiredException()</code> constructor * Assertion: constructs CertificateExpiredException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateExpiredException", - args = {} - ) public void testCertificateExpiredException01() { CertificateExpiredException tE = new CertificateExpiredException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -67,12 +55,6 @@ public class CertificateExpiredExceptionTest extends TestCase { * Assertion: constructs CertificateExpiredException with detail message * msg. Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateExpiredException", - args = {java.lang.String.class} - ) public void testCertificateExpiredException02() { CertificateExpiredException tE; for (int i = 0; i < msgs.length; i++) { @@ -88,12 +70,6 @@ public class CertificateExpiredExceptionTest extends TestCase { * Assertion: constructs CertificateExpiredException when <code>msg</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateExpiredException", - args = {java.lang.String.class} - ) public void testCertificateExpiredException03() { String msg = null; CertificateExpiredException tE = new CertificateExpiredException(msg); diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java index 4fa6c62..d808f59 100644 --- a/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java @@ -21,11 +21,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.SpiEngUtils; @@ -56,7 +51,6 @@ import java.util.Vector; * Tests for <code>CertificateFactory</code> class methods and constructor * */ -@TestTargetClass(CertificateFactory.class) public class CertificateFactory1Test extends TestCase { public static final String srvCertificateFactory = "CertificateFactory"; @@ -110,12 +104,6 @@ public class CertificateFactory1Test extends TestCase { * Test for <code>getInstance(String type)</code> method * Assertion: returns CertificateFactory if type is X.509 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "getInstance", - args = {java.lang.String.class} - ) public void testCertificateFactory01() throws CertificateException { if (!X509Support) { fail(NotSupportMsg); @@ -134,12 +122,6 @@ public class CertificateFactory1Test extends TestCase { * throws NullPointerException when type is null * throws CertificateException when type is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "getInstance", - args = {java.lang.String.class} - ) public void testCertificateFactory02() { try { CertificateFactory.getInstance(null); @@ -161,12 +143,6 @@ public class CertificateFactory1Test extends TestCase { * Test for <code>getInstance(String type, String provider)</code> method * Assertion: throws IllegalArgumentException when provider is null or empty */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException. IllegalArgumentException was checked instead of NoSuchProviderException", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertificateFactory03() throws CertificateException, NoSuchProviderException { if (!X509Support) { @@ -194,12 +170,6 @@ public class CertificateFactory1Test extends TestCase { * throws NullPointerException when type is null * throws CertificateException when type is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException and NullPointerException.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertificateFactory04() throws NoSuchProviderException { if (!X509Support) { fail(NotSupportMsg); @@ -228,12 +198,6 @@ public class CertificateFactory1Test extends TestCase { * Assertion: returns CertificateFactory when type and provider have valid * values */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality.", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void testCertificateFactory05() throws CertificateException, NoSuchProviderException { if (!X509Support) { @@ -255,12 +219,6 @@ public class CertificateFactory1Test extends TestCase { * method * Assertion: throws IllegalArgumentException when provider is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testCertificateFactory06() throws CertificateException { if (!X509Support) { fail(NotSupportMsg); @@ -283,12 +241,6 @@ public class CertificateFactory1Test extends TestCase { * throws NullPointerException when type is null * throws CertificateException when type is not available */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testCertificateFactory07() { if (!X509Support) { fail(NotSupportMsg); @@ -318,12 +270,6 @@ public class CertificateFactory1Test extends TestCase { * Assertion: returns CertificateFactorythrows when type and provider * have valid values */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality of getInstance method.", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testCertificateFactory08() throws CertificateException { if (!X509Support) { fail(NotSupportMsg); @@ -343,12 +289,6 @@ public class CertificateFactory1Test extends TestCase { * Test for <code>getCertPathEncodings()</code> method * Assertion: returns encodings */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertPathEncodings", - args = {} - ) public void testCertificateFactory09() { if (!X509Support) { fail(NotSupportMsg); @@ -399,32 +339,6 @@ public class CertificateFactory1Test extends TestCase { * Assertion: throw CertificateException and CRLException when * inStream is null or empty */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies methods with null and empty InputStream.", - method = "generateCertificate", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies methods with null and empty InputStream.", - method = "generateCertificates", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies methods with null and empty InputStream.", - method = "generateCRL", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies methods with null and empty InputStream.", - method = "generateCRLs", - args = {java.io.InputStream.class} - ) - }) public void testCertificateFactory10() { if (!X509Support) { fail(NotSupportMsg); @@ -504,32 +418,6 @@ public class CertificateFactory1Test extends TestCase { * Assertion: throw CertificateException and CRLException when inStream * contains incompatible datas */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality of methods.", - method = "generateCertificate", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality of methods.", - method = "generateCertificates", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality of methods.", - method = "generateCRL", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality of methods.", - method = "generateCRLs", - args = {java.io.InputStream.class} - ) - }) public void testCertificateFactory11() throws IOException { if (!X509Support) { fail(NotSupportMsg); @@ -590,20 +478,6 @@ public class CertificateFactory1Test extends TestCase { * Assertion: throws CertificateException when inStream is null or * when isStream contains invalid datas */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "generateCertPath", - args = {java.io.InputStream.class, java.lang.String.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "generateCertPath", - args = {java.io.InputStream.class} - ) - }) public void testCertificateFactory12() { if (!X509Support) { fail(NotSupportMsg); @@ -652,20 +526,6 @@ public class CertificateFactory1Test extends TestCase { * methods * Assertion: throw CertificateException when isStream contains invalid datas */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "generateCertPath", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "generateCertPath", - args = {java.io.InputStream.class, java.lang.String.class} - ) - }) // Test passed on RI public void testCertificateFactory13() throws IOException { if (!X509Support) { @@ -707,12 +567,6 @@ public class CertificateFactory1Test extends TestCase { * Test for <code>generateCertPath(List certificates)</code> method * Assertion: throw NullPointerException certificates is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException. Valid parameters checking missed.", - method = "generateCertPath", - args = {java.util.List.class} - ) public void testCertificateFactory14() throws CertificateException { if (!X509Support) { fail(NotSupportMsg); @@ -734,12 +588,6 @@ public class CertificateFactory1Test extends TestCase { * Test for <code>generateCertPath(List certificates)</code> method * Assertion: returns empty CertPath if certificates is empty */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that generateCertPath method returns empty CertPath if certificates is empty. Valid parameters checking missed.", - method = "generateCertPath", - args = {java.util.List.class} - ) public void testCertificateFactory15() throws CertificateException { if (!X509Support) { fail(NotSupportMsg); @@ -760,12 +608,6 @@ public class CertificateFactory1Test extends TestCase { * Assertion: throws CertificateException when certificates contains * incorrect Certificate */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException. Valid parameters checking missed.", - method = "generateCertPath", - args = {java.util.List.class} - ) public void testCertificateFactory16() { if (!X509Support) { fail(NotSupportMsg); @@ -789,12 +631,6 @@ public class CertificateFactory1Test extends TestCase { * Test for <code>CertificateFactory</code> constructor * Assertion: returns CertificateFactory object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CRLException and NullPointerException.", - method = "generateCRLs", - args = {java.io.InputStream.class} - ) public void testCertificateFactory17() throws CRLException { if (!X509Support) { fail(NotSupportMsg); @@ -824,12 +660,6 @@ public class CertificateFactory1Test extends TestCase { /** * Test for <code>getType()</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getType", - args = {} - ) public void testCertificateFactory18() throws CertificateException { if (!X509Support) { fail(NotSupportMsg); @@ -858,12 +688,6 @@ public class CertificateFactory1Test extends TestCase { } @SuppressWarnings("cast") - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateFactory", - args = {java.security.cert.CertificateFactorySpi.class, java.security.Provider.class, java.lang.String.class} - ) public void testCertificateFactory19() { if (!X509Support) { fail(NotSupportMsg); diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java index e491ba6..18fc79f 100644 --- a/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java @@ -22,10 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.SpiEngUtils; @@ -50,7 +46,6 @@ import java.util.List; * Tests for CertificateFactory class constructors and methods * */ -@TestTargetClass(CertificateFactory.class) public class CertificateFactory2Test extends TestCase { private static final String defaultAlg = "CertFac"; private static final String CertificateFactoryProviderClass = "org.apache.harmony.security.tests.support.cert.MyCertificateFactorySpi"; @@ -315,60 +310,24 @@ public class CertificateFactory2Test extends TestCase { checkResult(cerF, mode); } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class} - ) public void testGetInstance01() throws CertificateException, CRLException { GetInstance01(true); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testGetInstance02() throws CertificateException, NoSuchProviderException, IllegalArgumentException, CRLException { GetInstance02(true); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testGetInstance03() throws CertificateException, IllegalArgumentException, CRLException { GetInstance03(true); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class} - ) public void testGetInstance04() throws CertificateException, CRLException { GetInstance01(false); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testGetInstance05() throws CertificateException, NoSuchProviderException, IllegalArgumentException, CRLException { GetInstance02(false); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.security.Provider.class} - ) public void testGetInstance06() throws CertificateException, IllegalArgumentException, CRLException { GetInstance03(false); diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java index 9163933..f908b69 100644 --- a/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java @@ -22,10 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.SpiEngUtils; @@ -46,7 +42,6 @@ import java.util.Vector; /** * Tests for <code>CertificateFactory</code> class methods */ -@TestTargetClass(CertificateFactory.class) public class CertificateFactory3Test extends TestCase { private static String defaultProviderName = null; @@ -88,12 +83,6 @@ public class CertificateFactory3Test extends TestCase { * Test for <code>generateCertificate(InputStream inStream)</code> method * Assertion: returns Certificate */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "generateCertificate", - args = {java.io.InputStream.class} - ) public void testGenerateCertificate() throws Exception { CertificateFactory[] certFs = initCertFs(); assertNotNull("CertificateFactory objects were not created", certFs); @@ -110,12 +99,6 @@ public class CertificateFactory3Test extends TestCase { * Test for <code>generateCertificates(InputStream inStream)</code> method * Assertion: returns Collection which consists of 1 Certificate */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "generateCertificates", - args = {java.io.InputStream.class} - ) public void testGenerateCertificates() throws Exception { CertificateFactory[] certFs = initCertFs(); assertNotNull("CertificateFactory objects were not created", certFs); @@ -136,12 +119,6 @@ public class CertificateFactory3Test extends TestCase { * Test for <code>generateCertPath(List certificates)</code> method * Assertion: returns CertPath with 1 Certificate */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "generateCertPath", - args = {java.util.List.class} - ) public void testGenerateCertPath01() throws Exception { CertificateFactory[] certFs = initCertFs(); assertNotNull("CertificateFactory objects were not created", certFs); @@ -167,12 +144,6 @@ public class CertificateFactory3Test extends TestCase { * <code>generateCertPath(InputStream inStream, String encoding)</code> * method Assertion: returns CertPath with 1 Certificate */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "generateCertPath", - args = {java.io.InputStream.class, java.lang.String.class} - ) public void testGenerateCertPath02() throws Exception { CertificateFactory[] certFs = initCertFs(); assertNotNull("CertificateFactory objects were not created", certFs); @@ -193,12 +164,6 @@ public class CertificateFactory3Test extends TestCase { * Test for <code>generateCertPath(InputStream inStream)</code> method * Assertion: returns CertPath with 1 Certificate */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "generateCertPath", - args = {java.io.InputStream.class} - ) public void testGenerateCertPath03() throws Exception { String certPathEncoding = "PkiPath"; CertificateFactory[] certFs = initCertFs(); diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java index 65f3868..060a4a2 100644 --- a/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java @@ -17,10 +17,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import tests.support.resource.Support_Resources; @@ -42,7 +38,6 @@ import java.security.cert.CertificateFactory; import java.util.Collection; import java.util.List; -@TestTargetClass(CertificateFactory.class) public class CertificateFactory4Test extends TestCase { private static final String BASE_URL = Support_GetResource @@ -57,14 +52,8 @@ public class CertificateFactory4Test extends TestCase { private static final String[] CRLCOLLECTION_URLS = new String[] { "Bug94404-PKCS7.crl" }; /** - * @tests java.security.cert.CertificateFactory#generateCertificate(java.io.InputStream) + * java.security.cert.CertificateFactory#generateCertificate(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "generateCertificate", - args = {java.io.InputStream.class} - ) public void test_generateCertificateLjava_io_InputStream() throws Exception { // Test 1 // Test for method java.security.cert.Certificate @@ -94,14 +83,8 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCertificates(java.io.InputStream) + * java.security.cert.CertificateFactory#generateCertificates(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IOException.", - method = "generateCertificates", - args = {java.io.InputStream.class} - ) public void test_generateCertificatesLjava_io_InputStream() throws Exception { CertificateFactory fact = CertificateFactory.getInstance("X.509"); @@ -123,14 +106,8 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCRL(java.io.InputStream) + * java.security.cert.CertificateFactory#generateCRL(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IOException.", - method = "generateCRL", - args = {java.io.InputStream.class} - ) public void test_generateCRLLjava_io_InputStream() throws Exception { CertificateFactory fact = CertificateFactory.getInstance("X.509"); for (int i = 0; i < CRL_URLS.length; i++) { @@ -150,14 +127,8 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCRLs(java.io.InputStream) + * java.security.cert.CertificateFactory#generateCRLs(java.io.InputStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IOException.", - method = "generateCRLs", - args = {java.io.InputStream.class} - ) public void test_generateCRLsLjava_io_InputStream() throws Exception { CertificateFactory fact = CertificateFactory.getInstance("X.509"); for (int i = 0; i < CRLCOLLECTION_URLS.length; i++) { @@ -175,14 +146,8 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#getInstance(java.lang.String) + * java.security.cert.CertificateFactory#getInstance(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify CertificateException.", - method = "getInstance", - args = {java.lang.String.class} - ) public void test_getInstanceLjava_lang_String() throws Exception { // Test for method java.security.cert.CertificateFactory // java.security.cert.CertificateFactory.getInstance(java.lang.String) @@ -191,15 +156,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#getInstance(java.lang.String, + * java.security.cert.CertificateFactory#getInstance(java.lang.String, * java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getInstance", - args = {java.lang.String.class, java.lang.String.class} - ) public void test_getInstanceLjava_lang_StringLjava_lang_String() throws Exception { // Test for method java.security.cert.CertificateFactory @@ -228,14 +187,8 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#getProvider() + * java.security.cert.CertificateFactory#getProvider() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getProvider", - args = {} - ) public void test_getProvider() throws Exception { // Test for method java.security.Provider // java.security.cert.CertificateFactory.getProvider() @@ -244,15 +197,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCRLs(InputStream + * java.security.cert.CertificateFactory#generateCRLs(InputStream * inStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "generateCRLs", - args = {java.io.InputStream.class} - ) public void testGenerateCRLs2() throws Exception { // Regression for HARMONY-814 try { @@ -263,15 +210,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCertificate(InputStream + * java.security.cert.CertificateFactory#generateCertificate(InputStream * inStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter,s and CertificateException.", - method = "generateCertificate", - args = {java.io.InputStream.class} - ) public void testGenerateCertificate() throws Exception { // Regression for HARMONY-814 try { @@ -281,15 +222,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCertificates(InputStream + * java.security.cert.CertificateFactory#generateCertificates(InputStream * inStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "generateCertificates", - args = {java.io.InputStream.class} - ) public void testGenerateCertificates2() throws Exception { // Regression for HARMONY-814 try { @@ -299,15 +234,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCertPath(InputStream + * java.security.cert.CertificateFactory#generateCertPath(InputStream * inStream, String encoding) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as InputStream parameter.", - method = "generateCertPath", - args = {java.io.InputStream.class, java.lang.String.class} - ) public void testGenerateCertPath1() throws Exception { // Regression for HARMONY-814 try { @@ -318,15 +247,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCertPath(List<? + * java.security.cert.CertificateFactory#generateCertPath(List<? * extends Certificate> certificates) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "generateCertPath", - args = {java.util.List.class} - ) public void testGenerateCertPath2() throws Exception { // Regression for HARMONY-814 try { @@ -337,15 +260,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCertPath(InputStream + * java.security.cert.CertificateFactory#generateCertPath(InputStream * inStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "generateCertPath", - args = {java.io.InputStream.class} - ) public void testGenerateCertPath3() throws Exception { // Regression for HARMONY-814 try { @@ -356,15 +273,9 @@ public class CertificateFactory4Test extends TestCase { } /** - * @tests java.security.cert.CertificateFactory#generateCRL(InputStream + * java.security.cert.CertificateFactory#generateCRL(InputStream * inStream) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "generateCRL", - args = {java.io.InputStream.class} - ) public void testGenerateCRL() throws Exception { // Regression for HARMONY-814 try { diff --git a/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java b/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java index 1c27991..9e3f1ad 100644 --- a/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java @@ -23,11 +23,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.cert.MyCertificateFactorySpi; @@ -49,19 +44,12 @@ import java.util.List; * Tests for <code>CertificateFactorySpi</code> class constructors and methods * */ -@TestTargetClass(CertificateFactorySpi.class) public class CertificateFactorySpiTest extends TestCase { /** * Test for <code>CertificateFactorySpi</code> constructor * Assertion: constructs CertificateFactorySpi */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies exceptions.", - method = "CertificateFactorySpi", - args = {} - ) public void testCertificateFactorySpi01() throws CertificateException, CRLException { CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi(); @@ -123,20 +111,6 @@ public class CertificateFactorySpiTest extends TestCase { * Test for <code>CertificateFactorySpi</code> constructor * Assertion: constructs CertificateFactorySpi */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateFactorySpi", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGetCertPathEncodings", - args = {} - ) - }) public void testCertificateFactorySpi02() throws CertificateException, CRLException { CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi(); @@ -207,12 +181,6 @@ public class CertificateFactorySpiTest extends TestCase { * Test for <code>CertificateFactorySpi</code> constructor * Assertion: constructs CertificateFactorySpi */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateFactorySpi", - args = {} - ) public void testCertificateFactorySpi03() throws CertificateException, CRLException { CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi(); @@ -280,12 +248,6 @@ public class CertificateFactorySpiTest extends TestCase { * Assertion: Generates a <code>CertPath</code> object and initializes it * with the data read from the <code>InputStream</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that engineGenerateCertPath method returns null.", - method = "engineGenerateCertPath", - args = {java.io.InputStream.class} - ) public void testEngineGenerateCertPathLjava_io_InputStream01() { CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi(); @@ -305,12 +267,6 @@ public class CertificateFactorySpiTest extends TestCase { * Assertion: Generates a <code>CertPath</code> object and initializes it * with the data read from the <code>InputStream</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies UnsupportedOperationException.", - method = "engineGenerateCertPath", - args = {java.io.InputStream.class} - ) public void testEngineGenerateCertPathLjava_io_InputStream02() { CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi(); @@ -332,12 +288,6 @@ public class CertificateFactorySpiTest extends TestCase { * method. Assertion: generates a <code>CertPath</code> object and * initializes it with the data read from the <code>InputStream</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies CertificateException.", - method = "engineGenerateCertPath", - args = {java.io.InputStream.class, java.lang.String.class} - ) public void testEngineGenerateCertPathLjava_io_InputStream_Ljava_lang_String01() { CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi(); MyCertificateFactorySpi.putMode(true); @@ -364,12 +314,6 @@ public class CertificateFactorySpiTest extends TestCase { * method. Assertion: generates a <code>CertPath</code> object and * initializes it with the data read from the <code>InputStream</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies UnsupportedOperationException.", - method = "engineGenerateCertPath", - args = {java.io.InputStream.class, java.lang.String.class} - ) public void testEngineGenerateCertPathLjava_io_InputStream_Ljava_lang_String02() { CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi(); @@ -391,12 +335,6 @@ public class CertificateFactorySpiTest extends TestCase { * method Assertion: generates a <code>CertPath</code> object and * initializes it with a <code>List</code> of <code>Certificates</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that engineGenerateCertPath method returns null.", - method = "engineGenerateCertPath", - args = {java.util.List.class} - ) public void testEngineGenerateCertPathLJava_util_List01() { CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi(); MyCertificateFactorySpi.putMode(true); @@ -423,12 +361,6 @@ public class CertificateFactorySpiTest extends TestCase { * method Assertion: generates a <code>CertPath</code> object and * initializes it with a <code>List</code> of <code>Certificates</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies UnsupportedOperationException.", - method = "engineGenerateCertPath", - args = {java.util.List.class} - ) public void testEngineGenerateCertPathLJava_util_List02() { CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi(); @@ -444,32 +376,6 @@ public class CertificateFactorySpiTest extends TestCase { } } - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGenerateCRL", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGenerateCRLs", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGenerateCertificate", - args = {java.io.InputStream.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "engineGenerateCertificates", - args = {java.io.InputStream.class} - ) - }) public void testAbstractMethods() { CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi(); ByteArrayInputStream bais = new ByteArrayInputStream(new byte[3]); diff --git a/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java index 361be29..4ea5e8f 100644 --- a/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertificateNotYetValidException; @@ -36,7 +31,6 @@ import java.security.cert.CertificateNotYetValidException; * Tests for <code>DigestException</code> class constructors and methods. * */ -@TestTargetClass(CertificateNotYetValidException.class) public class CertificateNotYetValidExceptionTest extends TestCase { static String[] msgs = { @@ -51,12 +45,6 @@ public class CertificateNotYetValidExceptionTest extends TestCase { * Assertion: constructs CertificateNotYetValidException with no detail * message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateNotYetValidException", - args = {} - ) public void testCertificateNotYetValidException01() { CertificateNotYetValidException tE = new CertificateNotYetValidException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -68,12 +56,6 @@ public class CertificateNotYetValidExceptionTest extends TestCase { * constructor Assertion: constructs CertificateNotYetValidException with * detail message msg. Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateNotYetValidException", - args = {java.lang.String.class} - ) public void testCertificateNotYetValidException02() { CertificateNotYetValidException tE; for (int i = 0; i < msgs.length; i++) { @@ -89,12 +71,6 @@ public class CertificateNotYetValidExceptionTest extends TestCase { * constructor Assertion: constructs CertificateNotYetValidException when * <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateNotYetValidException", - args = {java.lang.String.class} - ) public void testCertificateNotYetValidException03() { String msg = null; CertificateNotYetValidException tE = new CertificateNotYetValidException( diff --git a/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java index af57c20..cc1f254 100644 --- a/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertificateParsingException; @@ -37,7 +32,6 @@ import java.security.cert.CertificateParsingException; * methods. * */ -@TestTargetClass(CertificateParsingException.class) public class CertificateParsingExceptionTest extends TestCase { private static String[] msgs = { @@ -51,12 +45,6 @@ public class CertificateParsingExceptionTest extends TestCase { * Test for <code>CertificateParsingException()</code> constructor * Assertion: constructs CertificateParsingException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "CertificateParsingException", - args = {} - ) public void testCertificateParsingException01() { CertificateParsingException tE = new CertificateParsingException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -68,12 +56,6 @@ public class CertificateParsingExceptionTest extends TestCase { * Assertion: constructs CertificateParsingException with detail message * msg. Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateParsingException", - args = {java.lang.String.class} - ) public void testCertificateParsingException02() { CertificateParsingException tE; for (int i = 0; i < msgs.length; i++) { @@ -89,12 +71,6 @@ public class CertificateParsingExceptionTest extends TestCase { * Assertion: constructs CertificateParsingException when <code>msg</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateParsingException", - args = {java.lang.String.class} - ) public void testCertificateParsingException03() { String msg = null; CertificateParsingException tE = new CertificateParsingException(msg); @@ -107,12 +83,6 @@ public class CertificateParsingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateParsingException when * <code>cause</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CertificateParsingException", - args = {java.lang.Throwable.class} - ) public void testCertificateParsingException04() { Throwable cause = null; CertificateParsingException tE = new CertificateParsingException(cause); @@ -125,12 +95,6 @@ public class CertificateParsingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateParsingException when * <code>cause</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CertificateParsingException", - args = {java.lang.Throwable.class} - ) public void testCertificateParsingException05() { CertificateParsingException tE = new CertificateParsingException(tCause); if (tE.getMessage() != null) { @@ -149,12 +113,6 @@ public class CertificateParsingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateParsingException when * <code>cause</code> is null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "CertificateParsingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateParsingException06() { CertificateParsingException tE = new CertificateParsingException(null, null); @@ -167,12 +125,6 @@ public class CertificateParsingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateParsingException when * <code>cause</code> is null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the second parameter.", - method = "CertificateParsingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateParsingException07() { CertificateParsingException tE; for (int i = 0; i < msgs.length; i++) { @@ -188,12 +140,6 @@ public class CertificateParsingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateParsingException when * <code>cause</code> is not null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as the first parameter.", - method = "CertificateParsingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateParsingException08() { CertificateParsingException tE = new CertificateParsingException(null, tCause); @@ -213,12 +159,6 @@ public class CertificateParsingExceptionTest extends TestCase { * constructor Assertion: constructs CertificateParsingException when * <code>cause</code> is not null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality.", - method = "CertificateParsingException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testCertificateParsingException09() { CertificateParsingException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/cert/CertificateTest.java b/luni/src/test/java/tests/security/cert/CertificateTest.java index 94e1b7d..1fc0c68 100644 --- a/luni/src/test/java/tests/security/cert/CertificateTest.java +++ b/luni/src/test/java/tests/security/cert/CertificateTest.java @@ -26,10 +26,6 @@ package tests.security.cert; import dalvik.annotation.AndroidOnly; import dalvik.annotation.KnownFailure; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargets; import junit.framework.TestCase; @@ -59,7 +55,6 @@ import org.apache.harmony.testframework.serialization.SerializationTest; * Tests for <code>Certificate</code> fields and methods * */ -@TestTargetClass(Certificate.class) public class CertificateTest extends TestCase { /** * Meaningless cert encoding just for testing purposes @@ -74,12 +69,6 @@ public class CertificateTest extends TestCase { /** * Test for <code>Certificate(String type)</code> method<br> */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "", - method = "Certificate", - args = {java.lang.String.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testCertificate() { @@ -102,12 +91,6 @@ public class CertificateTest extends TestCase { * Assertion: returns hash of the <code>Certificate</code> instance * @throws CertificateEncodingException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testHashCode() throws CertificateEncodingException { @@ -125,12 +108,6 @@ public class CertificateTest extends TestCase { * Test for <code>hashCode()</code> method<br> * Assertion: hash code of equal objects should be the same */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testHashCodeEqualsObject() { @@ -146,12 +123,6 @@ public class CertificateTest extends TestCase { * Test for <code>getType()</code> method<br> * Assertion: returns this certificate type */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getType", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testGetType() { @@ -163,12 +134,6 @@ public class CertificateTest extends TestCase { * Test #1 for <code>equals(Object)</code> method<br> * Assertion: object equals to itself */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "equals", - args = {java.lang.Object.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testEqualsObject01() { @@ -181,12 +146,6 @@ public class CertificateTest extends TestCase { * Assertion: object equals to other <code>Certificate</code> * instance with the same state */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "equals", - args = {java.lang.Object.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testEqualsObject02() { @@ -199,12 +158,6 @@ public class CertificateTest extends TestCase { * Test for <code>equals(Object)</code> method<br> * Assertion: object not equals to <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies equals method with null as a parameter.", - method = "equals", - args = {java.lang.Object.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testEqualsObject03() { @@ -217,12 +170,6 @@ public class CertificateTest extends TestCase { * Assertion: object not equals to other which is not * instance of <code>Certificate</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies negative case.", - method = "equals", - args = {java.lang.Object.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testEqualsObject04() { @@ -240,12 +187,6 @@ public class CertificateTest extends TestCase { * This test just calls <code>getEncoded()</code> method<br> * @throws CertificateException */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "Can not verify CertificateEncodingException. indirectly tested", - method = "getEncoded", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") @KnownFailure("Assertion does not evaluate to true... Works in javax.Certificate") @@ -277,12 +218,6 @@ public class CertificateTest extends TestCase { * @throws NoSuchProviderException * @throws SignatureException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies only null as a parameter.", - method = "verify", - args = {java.security.PublicKey.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testVerifyPublicKey() @@ -304,12 +239,6 @@ public class CertificateTest extends TestCase { * @throws NoSuchProviderException * @throws SignatureException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies only null as parameters.", - method = "verify", - args = {java.security.PublicKey.class, java.lang.String.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testVerifyPublicKeyString() @@ -325,12 +254,6 @@ public class CertificateTest extends TestCase { /** * This test just calls <code>toString()</code> method<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testToString() { @@ -341,12 +264,6 @@ public class CertificateTest extends TestCase { /** * This test just calls <code>testGetPublicKey()</code> method<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicKey", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testGetPublicKey() { @@ -357,12 +274,6 @@ public class CertificateTest extends TestCase { /** * This test just calls <code>writeReplace()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify ObjectStreamException.", - method = "writeReplace", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testWriteReplace() { @@ -462,12 +373,6 @@ public class MyModifiablePublicKey implements PublicKey { * @throws NoSuchProviderException * @throws SignatureException */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "Test fails: ClassCastException when SignatureException is expected", - method = "verify", - args = {java.security.PublicKey.class, java.lang.String.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testVerifyPublicKeyString2() throws InvalidKeyException, @@ -530,12 +435,6 @@ public class MyModifiablePublicKey implements PublicKey { * @throws IOException * @throws InvalidAlgorithmParameterException */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "Can't test exception for cases where the algorithm is unknown", - method = "verify", - args = {java.security.PublicKey.class} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testVerifyPublicKey2() throws InvalidKeyException, @@ -571,12 +470,6 @@ public class MyModifiablePublicKey implements PublicKey { /** * This test just calls <code>writeReplace()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "writeReplace", - args = {} - ) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public final void testWriteReplace2() { @@ -590,28 +483,8 @@ public class MyModifiablePublicKey implements PublicKey { } /** - * @tests serialization/deserialization compatibility. + * serialization/deserialization compatibility. */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Verifies serialization/deserialization compatibility. And tests default constructor", - method = "!SerializationSelf", - args = {} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "writeReplace", - args = {} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "Certificate.CertificateRep.readResolve", - args = {} - ) - }) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public void testSerializationSelf() throws Exception { @@ -621,28 +494,8 @@ public class MyModifiablePublicKey implements PublicKey { } /** - * @tests serialization/deserialization compatibility with RI. + * serialization/deserialization compatibility with RI. */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Verifies serialization/deserialization compatibility.", - method = "!SerializationGolden", - args = {} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "writeReplace", - args = {} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "Certificate.CertificateRep.readResolve", - args = {} - ) - }) @AndroidOnly("Gets security providers with specific signature algorithm: " + "Security.getProviders(\"Signature.sha1WithRSAEncryption\")") public void testSerializationCompatibility() throws Exception { diff --git a/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java b/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java index b194c70..9e98c16 100644 --- a/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java +++ b/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertStoreParameters; @@ -40,7 +35,6 @@ import org.apache.harmony.security.tests.support.cert.MyCertificate; /** * Tests for <code>CollectionCertStoreParameters</code>. */ -@TestTargetClass(CollectionCertStoreParameters.class) public class CollectionCertStoreParametersTest extends TestCase { // @@ -50,12 +44,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #1 for <code>CollectionCertStoreParameters()</code> constructor<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CollectionCertStoreParameters", - args = {} - ) public final void testCollectionCertStoreParameters01() { CertStoreParameters cp = new CollectionCertStoreParameters(); assertTrue("isCollectionCertStoreParameters", @@ -65,12 +53,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #2 for <code>CollectionCertStoreParameters</code> constructor<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CollectionCertStoreParameters", - args = {} - ) @SuppressWarnings("unchecked") public final void testCollectionCertStoreParameters02() { CollectionCertStoreParameters cp = new CollectionCertStoreParameters(); @@ -90,12 +72,6 @@ public class CollectionCertStoreParametersTest extends TestCase { * Test #1 for <code>CollectionCertStoreParameters(Collection)</code> * constructor<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CollectionCertStoreParameters", - args = {java.util.Collection.class} - ) public final void testCollectionCertStoreParametersCollection01() { Vector<Certificate> certificates = new Vector<Certificate>(); certificates.add(new MyCertificate("TEST", new byte[] {})); @@ -106,12 +82,6 @@ public class CollectionCertStoreParametersTest extends TestCase { * Test #2 for <code>CollectionCertStoreParameters(Collection)</code> * constructor<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CollectionCertStoreParameters", - args = {java.util.Collection.class} - ) public final void testCollectionCertStoreParametersCollection02() { // just check that we able to create CollectionCertStoreParameters // object passing Collection containing Object which is not @@ -125,12 +95,6 @@ public class CollectionCertStoreParametersTest extends TestCase { * Test #3 for <code>CollectionCertStoreParameters(Collection)</code> * constructor<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "CollectionCertStoreParameters", - args = {java.util.Collection.class} - ) public final void testCollectionCertStoreParametersCollection03() { Vector<Certificate> certificates = new Vector<Certificate>(); // create using empty collection @@ -151,12 +115,6 @@ public class CollectionCertStoreParametersTest extends TestCase { * Test #4 for <code>CollectionCertStoreParameters(Collection)</code> * constructor<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "CollectionCertStoreParameters", - args = {java.util.Collection.class} - ) public final void testCollectionCertStoreParametersCollection04() { try { new CollectionCertStoreParameters(null); @@ -168,12 +126,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #1 for <code>clone()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void testClone01() { Vector<Certificate> certificates = new Vector<Certificate>(); certificates.add(new MyCertificate("TEST", new byte[] {(byte)4})); @@ -188,12 +140,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #2 for <code>clone()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void testClone02() { Vector<Certificate> certificates = new Vector<Certificate>(); certificates.add(new MyCertificate("TEST", new byte[] {(byte)4})); @@ -208,12 +154,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #3 for <code>clone()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void testClone03() { CollectionCertStoreParameters cp1 = new CollectionCertStoreParameters(); @@ -229,12 +169,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #1 for <code>toString()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString01() { CollectionCertStoreParameters cp = new CollectionCertStoreParameters(); @@ -245,12 +179,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #2 for <code>toString()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString02() { Vector<Certificate> certificates = new Vector<Certificate>(); certificates.add(new MyCertificate("TEST", new byte[] {(byte)4})); @@ -263,12 +191,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #1 for <code>getCollection()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getCollection", - args = {} - ) public final void testGetCollection01() { CollectionCertStoreParameters cp = new CollectionCertStoreParameters(); assertNotNull(cp.getCollection()); @@ -277,12 +199,6 @@ public class CollectionCertStoreParametersTest extends TestCase { /** * Test #2 for <code>getCollection()</code> method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getCollection", - args = {} - ) public final void testGetCollection02() { Vector certificates = new Vector(); CollectionCertStoreParameters cp = diff --git a/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java b/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java index 0a317dc..1963f30 100644 --- a/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java +++ b/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertStoreParameters; @@ -37,7 +32,6 @@ import java.security.cert.LDAPCertStoreParameters; * fields and methods * */ -@TestTargetClass(LDAPCertStoreParameters.class) public class LDAPCertStoreParametersTest extends TestCase { // @@ -49,12 +43,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code> * with the default parameter values (server name "localhost", port 389) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "LDAPCertStoreParameters", - args = {} - ) public final void testLDAPCertStoreParameters01() { CertStoreParameters cp = new LDAPCertStoreParameters(); assertTrue("isLDAPCertStoreParameters", @@ -66,12 +54,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code> * with the default parameter values (server name "localhost", port 389) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "LDAPCertStoreParameters", - args = {} - ) public final void testLDAPCertStoreParameters02() { LDAPCertStoreParameters cp = new LDAPCertStoreParameters(); assertEquals("host", "localhost", cp.getServerName()); @@ -83,12 +65,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code> * with the specified server name and a default port of 389 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "LDAPCertStoreParameters", - args = {java.lang.String.class} - ) public final void testLDAPCertStoreParametersString01() { CertStoreParameters cp = new LDAPCertStoreParameters("myhost"); assertTrue("isLDAPCertStoreParameters", @@ -100,12 +76,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code> * with the specified server name and a default port of 389 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "LDAPCertStoreParameters", - args = {java.lang.String.class} - ) public final void testLDAPCertStoreParametersString02() { String serverName = "myhost"; LDAPCertStoreParameters cp = new LDAPCertStoreParameters(serverName); @@ -118,12 +88,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: throws <code>NullPointerException</code> - * if <code>serverName</code> is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "LDAPCertStoreParameters", - args = {java.lang.String.class} - ) public final void testLDAPCertStoreParametersString03() { try { new LDAPCertStoreParameters(null); @@ -137,12 +101,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code> * with the specified parameter values */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "LDAPCertStoreParameters", - args = {java.lang.String.class, int.class} - ) public final void testLDAPCertStoreParametersStringint01() { CertStoreParameters cp = new LDAPCertStoreParameters("myhost", 1098); assertTrue("isLDAPCertStoreParameters", @@ -154,12 +112,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code> * with the specified parameter values */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "LDAPCertStoreParameters", - args = {java.lang.String.class, int.class} - ) public final void testLDAPCertStoreParametersStringint02() { String serverName = "myhost"; int portNumber = 1099; @@ -174,12 +126,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Assertion: throws <code>NullPointerException</code> - * if <code>serverName</code> is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "LDAPCertStoreParameters", - args = {java.lang.String.class, int.class} - ) public final void testLDAPCertStoreParametersStringint03() { try { new LDAPCertStoreParameters(null, 0); @@ -202,12 +148,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Test for <code>clone()</code> method<br> * Assertion: Returns a copy of this object */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void testClone() { LDAPCertStoreParameters cp1 = new LDAPCertStoreParameters("myhost", 1100); @@ -223,12 +163,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Test for <code>toString()</code> method<br> * Assertion: returns the formatted string describing parameters */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString() { LDAPCertStoreParameters cp1 = new LDAPCertStoreParameters("myhost", 1101); @@ -240,12 +174,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Test for <code>toString()</code> method<br> * Assertion: returns the port number */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPort", - args = {} - ) public final void testGetPort() { int portNumber = -1099; LDAPCertStoreParameters cp = @@ -257,12 +185,6 @@ public class LDAPCertStoreParametersTest extends TestCase { * Test for <code>toString()</code> method<br> * Assertion: returns the server name (never <code>null</code>) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getServerName", - args = {} - ) public final void testGetServerName() { LDAPCertStoreParameters cp = new LDAPCertStoreParameters("serverName"); diff --git a/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java b/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java index 2ef5c0c..f5e3538 100644 --- a/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java +++ b/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.io.ByteArrayInputStream; @@ -49,7 +44,6 @@ import org.apache.harmony.security.tests.support.cert.TestUtils; * Tests for <code>PKIXBuilderParameters</code> fields and methods * */ -@TestTargetClass(PKIXBuilderParameters.class) public class PKIXBuilderParametersTest extends TestCase { String certificate = "-----BEGIN CERTIFICATE-----\n" + "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n" @@ -89,12 +83,6 @@ public class PKIXBuilderParametersTest extends TestCase { * Assertion: creates an instance of <code>PKIXBuilderParameters</code> * @throws InvalidAlgorithmParameterException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "PKIXBuilderParameters", - args = {java.util.Set.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersSetCertSelector01() throws InvalidAlgorithmParameterException { Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet(); @@ -114,12 +102,6 @@ public class PKIXBuilderParametersTest extends TestCase { * Assertion: creates an instance of <code>PKIXBuilderParameters</code> * @throws InvalidAlgorithmParameterException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a CertSelector parameter.", - method = "PKIXBuilderParameters", - args = {java.util.Set.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersSetCertSelector02() throws InvalidAlgorithmParameterException { Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet(); @@ -139,12 +121,6 @@ public class PKIXBuilderParametersTest extends TestCase { * subsequent modifications * @throws InvalidAlgorithmParameterException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a CertSelector parameter.", - method = "PKIXBuilderParameters", - args = {java.util.Set.class, java.security.cert.CertSelector.class} - ) @SuppressWarnings("unchecked") public final void testPKIXBuilderParametersSetCertSelector03() throws InvalidAlgorithmParameterException { @@ -172,12 +148,6 @@ public class PKIXBuilderParametersTest extends TestCase { * Assertion: <code>NullPointerException</code> - * if the specified <code>Set</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "PKIXBuilderParameters", - args = {java.util.Set.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersSetCertSelector04() throws Exception { try { // pass null @@ -194,12 +164,6 @@ public class PKIXBuilderParametersTest extends TestCase { * if the specified <code>Set</code> is empty * (<code>trustAnchors.isEmpty() == true</code>) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "PKIXBuilderParameters", - args = {java.util.Set.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersSetCertSelector05() { try { // use empty set @@ -215,12 +179,6 @@ public class PKIXBuilderParametersTest extends TestCase { * Assertion: <code>NullPointerException</code> - if the * <code>keystore</code> is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Veirifies null as a KeyStore parameter.", - method = "PKIXBuilderParameters", - args = {java.security.KeyStore.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersKeyStoreCertSelector01() throws Exception { try { @@ -237,12 +195,6 @@ public class PKIXBuilderParametersTest extends TestCase { * Assertion: <code>KeyStoreException</code> - if the * <code>keystore</code> has not been initialized */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Veirifies null as a CertSelector parameter.", - method = "PKIXBuilderParameters", - args = {java.security.KeyStore.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersKeyStoreCertSelector02() throws Exception { KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType()); @@ -261,12 +213,6 @@ public class PKIXBuilderParametersTest extends TestCase { * <code>keystore</code> does not contain at least one trusted certificate * entry */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "PKIXBuilderParameters", - args = {java.security.KeyStore.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersKeyStoreCertSelector03() throws Exception { KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType()); @@ -285,12 +231,6 @@ public class PKIXBuilderParametersTest extends TestCase { * Assertion: <code>NullPointerException</code> - * if the <code>keystore</code> is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "PKIXBuilderParameters", - args = {java.security.KeyStore.class, java.security.cert.CertSelector.class} - ) public final void testPKIXBuilderParametersKeyStoreCertSelector04() throws Exception { KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType()); @@ -323,12 +263,6 @@ public class PKIXBuilderParametersTest extends TestCase { /** * Test for <code>getMaxPathLength()</code> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getMaxPathLength", - args = {} - ) public final void testGetMaxPathLength() throws Exception { KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType()); keyTest.load(null, null); @@ -357,12 +291,6 @@ public class PKIXBuilderParametersTest extends TestCase { /** * Test for <code>setMaxPathLength()</code> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setMaxPathLength", - args = {int.class} - ) public final void testSetMaxPathLength() throws Exception { KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType()); keyTest.load(null, null); @@ -406,12 +334,6 @@ public class PKIXBuilderParametersTest extends TestCase { /** * Test for <code>toString()</code> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString() throws Exception { KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType()); keyTest.load(null, null); diff --git a/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java b/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java index 2cb6891..e9b14b2 100644 --- a/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java +++ b/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java @@ -22,10 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.cert.MyCertPath; @@ -43,7 +39,6 @@ import java.security.spec.InvalidKeySpecException; * Tests for <code>PKIXCertPathBuilderResult</code> * */ -@TestTargetClass(PKIXCertPathBuilderResult.class) public class PKIXCertPathBuilderResultTest extends TestCase { /** * Cert path encoding stub @@ -81,11 +76,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "PKIXCertPathBuilderResult", - args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathBuilderResult01() throws InvalidKeySpecException, NoSuchAlgorithmException { @@ -109,11 +99,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "PKIXCertPathBuilderResult", - args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathBuilderResult02() throws InvalidKeySpecException, NoSuchAlgorithmException { @@ -136,11 +121,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * Assertion: <code>NullPointerException</code> * if certPath is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "PKIXCertPathBuilderResult", - args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathBuilderResult03() { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -165,11 +145,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * Assertion: <code>NullPointerException</code> * if trustAnchor is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "PKIXCertPathBuilderResult", - args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathBuilderResult04() { try { // pass null @@ -189,11 +164,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * Assertion: <code>NullPointerException</code> * if publicKey is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - method = "PKIXCertPathBuilderResult", - args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathBuilderResult05() { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -211,12 +181,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { } catch (NullPointerException e) { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void test_clone() { // Regression for HARMONY-2786. @@ -243,12 +207,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertPath", - args = {} - ) public final void testGetCertPath() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -274,12 +232,6 @@ public class PKIXCertPathBuilderResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString() throws InvalidKeySpecException, NoSuchAlgorithmException { diff --git a/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java b/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java index 8376e5f..44a2fa4 100644 --- a/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java +++ b/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.cert.CertPathValidatorException; @@ -43,18 +38,11 @@ import org.apache.harmony.security.tests.support.cert.TestUtils; * Tests for <code>PKIXCertPathChecker</code> * */ -@TestTargetClass(PKIXCertPathChecker.class) public class PKIXCertPathCheckerTest extends TestCase { // // Tests // - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "PKIXCertPathChecker", - args = {} - ) public final void testConstructor() { try { new MyPKIXCertPathChecker(); @@ -62,12 +50,6 @@ public class PKIXCertPathCheckerTest extends TestCase { fail("Unexpected exception " + e.getMessage()); } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void testClone() { PKIXCertPathChecker pc1 = TestUtils.getTestCertPathChecker(); PKIXCertPathChecker pc2 = (PKIXCertPathChecker) pc1.clone(); @@ -79,43 +61,19 @@ public class PKIXCertPathCheckerTest extends TestCase { // that are abstract in <code>PKIXCertPathChecker</code> // (So they just like signature tests) // - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "isForwardCheckingSupported", - args = {} - ) public final void testIsForwardCheckingSupported() { PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker(); pc.isForwardCheckingSupported(); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "init", - args = {boolean.class} - ) public final void testInit() throws CertPathValidatorException { PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker(); pc.init(true); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSupportedExtensions", - args = {} - ) public final void testGetSupportedExtensions() { PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker(); pc.getSupportedExtensions(); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "check", - args = {java.security.cert.Certificate.class, java.util.Collection.class} - ) public final void testCheck() throws CertPathValidatorException { PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker(); pc.check(new MyCertificate("", null), new HashSet<String>()); diff --git a/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java b/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java index c3de8dd..d578b53 100644 --- a/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java +++ b/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.NoSuchAlgorithmException; @@ -42,7 +37,6 @@ import org.apache.harmony.security.tests.support.cert.TestUtils; * Tests for <code>PKIXCertPathValidatorResult</code> * */ -@TestTargetClass(PKIXCertPathValidatorResult.class) public class PKIXCertPathValidatorResultTest extends TestCase { /** * PublicKey stub @@ -73,12 +67,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify NullPointerException.", - method = "PKIXCertPathValidatorResult", - args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathValidatorResult01() throws InvalidKeySpecException, NoSuchAlgorithmException { @@ -98,12 +86,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * Assertion: <code>NullPointerException</code> if * <code>TrustAnchor</code> parameter is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "PKIXCertPathValidatorResult", - args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathValidatorResult02() { try { // pass null @@ -122,12 +104,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * Assertion: <code>NullPointerException</code> if * <code>PublicKey</code> parameter is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "PKIXCertPathValidatorResult", - args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathValidatorResult03() { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -149,12 +125,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * PolicyNode, PublicKey)</code> constructor<br> * Assertion: <code>PolicyNode</code>can be <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "PKIXCertPathValidatorResult", - args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} - ) public final void testPKIXCertPathValidatorResult04() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -173,12 +143,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getTrustAnchor", - args = {} - ) public final void testGetTrustAnchor() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -202,12 +166,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicKey", - args = {} - ) public final void testGetPublicKey() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -234,12 +192,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getPolicyTree method returns the root node of the valid policy tree.", - method = "getPolicyTree", - args = {} - ) public final void testGetPolicyTree01() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -267,12 +219,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getPolicyTree method returns null if there are no valid policies.", - method = "getPolicyTree", - args = {} - ) public final void testGetPolicyTree02() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -297,12 +243,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public final void testClone() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -354,12 +294,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString01() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { @@ -381,12 +315,6 @@ public class PKIXCertPathValidatorResultTest extends TestCase { * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString02() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { diff --git a/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java b/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java index 4f7fbfc..a89c063 100644 --- a/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java +++ b/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java @@ -21,11 +21,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.io.IOException; @@ -36,7 +31,6 @@ import java.util.Arrays; * PolicyQualifierInfo test * */ -@TestTargetClass(PolicyQualifierInfo.class) public class PolicyQualifierInfoTest extends TestCase { @@ -46,12 +40,6 @@ public class PolicyQualifierInfoTest extends TestCase { * parameter does not represent a valid and parsable policy * qualifier info */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException and IOException.", - method = "PolicyQualifierInfo", - args = {byte[].class} - ) public final void test_Ctor() throws IOException { try { // pass null @@ -84,12 +72,6 @@ public class PolicyQualifierInfoTest extends TestCase { * parameter does not represent a valid and parsable policy * qualifier info */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IOException.", - method = "PolicyQualifierInfo", - args = {byte[].class} - ) public final void testPolicyQualifierInfo02() { // get valid encoding byte[] encoding = getDerEncoding(); @@ -124,12 +106,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "PolicyQualifierInfo", - args = {byte[].class} - ) public final void testPolicyQualifierInfo03() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -143,12 +119,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with encoded byte array copied on construction.", - method = "PolicyQualifierInfo", - args = {byte[].class} - ) public final void testPolicyQualifierInfo04() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -175,12 +145,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testGetEncoded01() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -198,12 +162,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testGetEncoded02() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -228,12 +186,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPolicyQualifier", - args = {} - ) public final void testGetPolicyQualifier01() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -254,12 +206,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPolicyQualifier", - args = {} - ) public final void testGetPolicyQualifier02() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -290,12 +236,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPolicyQualifierId", - args = {} - ) public final void testGetPolicyQualifierId() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); @@ -324,12 +264,6 @@ public class PolicyQualifierInfoTest extends TestCase { * * @throws IOException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString() throws IOException { // get valid encoding byte[] encoding = getDerEncoding(); diff --git a/luni/src/test/java/tests/security/cert/TrustAnchorTest.java b/luni/src/test/java/tests/security/cert/TrustAnchorTest.java index 49f188f..76324f0 100644 --- a/luni/src/test/java/tests/security/cert/TrustAnchorTest.java +++ b/luni/src/test/java/tests/security/cert/TrustAnchorTest.java @@ -22,10 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.TestCertUtils; @@ -46,7 +42,6 @@ import javax.security.auth.x500.X500Principal; /** * Unit tests for <code>TrustAnchor</code> */ -@TestTargetClass(TrustAnchor.class) public class TrustAnchorTest extends TestCase { private static final String keyAlg = "DSA"; // Sample of some valid CA name @@ -65,12 +60,6 @@ public class TrustAnchorTest extends TestCase { * Expected: must pass without any exceptions * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "TrustAnchor", - args = {java.lang.String.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorStringPublicKeybyteArray01() throws Exception { @@ -93,12 +82,6 @@ public class TrustAnchorTest extends TestCase { * Expected: must pass without any exceptions * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "TrustAnchor", - args = {java.lang.String.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorStringPublicKeybyteArray02() throws Exception { @@ -114,12 +97,6 @@ public class TrustAnchorTest extends TestCase { * Expected: modification must not change object internal state * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "TrustAnchor", - args = {java.lang.String.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorStringPublicKeybyteArray03() throws Exception { @@ -143,12 +120,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: pass <code>null</code> as mentioned parameter<br> * Expected: NullPointerException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies exceptions.", - method = "TrustAnchor", - args = {java.lang.String.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorStringPublicKeybyteArray04() throws Exception { @@ -197,12 +168,6 @@ public class TrustAnchorTest extends TestCase { * Expected: must pass without any exceptions * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "TrustAnchor", - args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorX500PrincipalPublicKeybyteArray01() throws Exception { @@ -226,12 +191,6 @@ public class TrustAnchorTest extends TestCase { * Expected: must pass without any exceptions * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "TrustAnchor", - args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorX500PrincipalPublicKeybyteArray02() throws Exception { @@ -249,12 +208,6 @@ public class TrustAnchorTest extends TestCase { * Expected: modification must not change object internal state * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies TrustAnchor with copied byte array.", - method = "TrustAnchor", - args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorX500PrincipalPublicKeybyteArray03() throws Exception { @@ -280,12 +233,6 @@ public class TrustAnchorTest extends TestCase { * Expected: NullPointerException * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "TrustAnchor", - args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class} - ) public final void testTrustAnchorX500PrincipalPublicKeybyteArray04() throws Exception { @@ -324,12 +271,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: valid parameters passed<br> * Expected: must pass without any exceptions */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "TrustAnchor", - args = {java.security.cert.X509Certificate.class, byte[].class} - ) public final void testTrustAnchorX509CertificatebyteArray01() throws CertificateException { @@ -379,12 +320,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: <code>null</code> as X509Certificate passed<br> * Expected: <code>NullPointerException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "TrustAnchor", - args = {java.security.cert.X509Certificate.class, byte[].class} - ) public final void testTrustAnchorX509CertificatebyteArray02() throws Exception { @@ -403,12 +338,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: <code>null</code> as nameConstraints passed<br> * Expected: must pass without any exceptions */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with null as nameConstraints parameter.", - method = "TrustAnchor", - args = {java.security.cert.X509Certificate.class, byte[].class} - ) public final void testTrustAnchorX509CertificatebyteArray03() throws Exception { CertificateFactory certFact = CertificateFactory.getInstance("X509"); @@ -431,12 +360,6 @@ public class TrustAnchorTest extends TestCase { * IllegalArgumentException * */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "TrustAnchor", - args = {java.security.cert.X509Certificate.class, byte[].class} - ) public final void testTrustAnchorX509CertificatebyteArray04() throws Exception { @@ -461,12 +384,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: both parameters are passed as null<br> * Expected: <code>NullPointerException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "TrustAnchor", - args = {java.security.cert.X509Certificate.class, byte[].class} - ) public final void testTrustAnchorX509CertificatebyteArray05() throws Exception { @@ -486,12 +403,6 @@ public class TrustAnchorTest extends TestCase { * Expected: the same name must be returned by the method<br> * */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCAPublicKey", - args = {} - ) public final void testGetCAPublicKey01() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); @@ -515,12 +426,6 @@ public class TrustAnchorTest extends TestCase { * Expected: the same name must be returned by the method<br> * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCAName", - args = {} - ) public final void testGetCAName01() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); @@ -544,11 +449,6 @@ public class TrustAnchorTest extends TestCase { * Expected: <code>null</code> as return value<br> * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "getTrustedCert", - args = {} - ) public final void testGetTrustedCer02() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); @@ -574,12 +474,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: valid parameters are passed to the constructors<br> * Expected: the valid parameters must be returned by the method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getNameConstraints", - args = {} - ) public final void testGetNameConstraints01() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); TrustAnchor ta1 = new TrustAnchor(validCaNameRfc2253, pk, @@ -607,12 +501,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: null parameters are passed to the constructors<br> * Expected: the null parameters must be returned by the method<br> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getNameConstraints returns null.", - method = "getNameConstraints", - args = {} - ) public final void testGetNameConstraints02() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); TrustAnchor ta1 = new TrustAnchor(validCaNameRfc2253, pk, null); @@ -638,12 +526,6 @@ public class TrustAnchorTest extends TestCase { * Test preconditions: valid parameters are passed to the constructors<br> * Expected: not null string<br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public final void testToString() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); TrustAnchor ta1 = new TrustAnchor(validCaNameRfc2253, pk, @@ -672,12 +554,6 @@ public class TrustAnchorTest extends TestCase { * by the method<br> * @throws InvalidKeySpecException */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCA", - args = {} - ) public final void testGetCA01() throws Exception { PublicKey pk = new TestKeyPair(keyAlg).getPublic(); diff --git a/luni/src/test/java/tests/security/cert/X509CRL2Test.java b/luni/src/test/java/tests/security/cert/X509CRL2Test.java index 0c21333..c986032 100644 --- a/luni/src/test/java/tests/security/cert/X509CRL2Test.java +++ b/luni/src/test/java/tests/security/cert/X509CRL2Test.java @@ -17,11 +17,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; - import junit.framework.TestCase; import java.io.ByteArrayInputStream; @@ -39,7 +34,6 @@ import java.util.Iterator; import java.util.Set; import java.util.Vector; -@TestTargetClass(X509CRL.class) public class X509CRL2Test extends TestCase { private X509Certificate pemCert = null; @@ -79,34 +73,8 @@ public class X509CRL2Test extends TestCase { } /** - * @tests java.security.cert.X509CRL#getExtensionValue(java.lang.String) + * java.security.cert.X509CRL#getExtensionValue(java.lang.String) */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getExtensionValue", - args = {java.lang.String.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCriticalExtensionOIDs", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getNonCriticalExtensionOIDs", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "hasUnsupportedCriticalExtension", - args = {} - ) - }) public void test_getExtensionValueLjava_lang_String() { try { setUp(); @@ -135,15 +103,9 @@ public class X509CRL2Test extends TestCase { } /** - * @tests java.security.cert.X509CRL#X509CRL() + * java.security.cert.X509CRL#X509CRL() */ @SuppressWarnings("cast") - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509CRL", - args = {} - ) public void test_X509CRL() { try { MyX509CRL crl = new MyX509CRL(); diff --git a/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java b/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java index 7d156dd..616caff 100644 --- a/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java +++ b/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -39,7 +34,6 @@ import java.util.Set; /** */ -@TestTargetClass(X509CRLEntry.class) public class X509CRLEntryTest extends TestCase { X509CRLEntry tbt_crlentry; @@ -100,12 +94,6 @@ public class X509CRLEntryTest extends TestCase { /** * X509CRLEntry() method testing. Tests for creating object. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509CRLEntry", - args = {} - ) public void testX509CRLEntry() { TBTCRLEntry tbt_crlentry = new TBTCRLEntry(); @@ -126,12 +114,6 @@ public class X509CRLEntryTest extends TestCase { * operation: it should be reflexive, symmetric, transitive, consistent * and should be false on null object. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public void testEquals() { TBTCRLEntry tbt_crlentry_1 = new TBTCRLEntry() { public byte[] getEncoded() { @@ -182,12 +164,6 @@ public class X509CRLEntryTest extends TestCase { * hashCode() method testing. Tests that for equal objects hash codes * are equal. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public void testHashCode() { TBTCRLEntry tbt_crlentry_1 = new TBTCRLEntry() { public byte[] getEncoded() { @@ -202,49 +178,11 @@ public class X509CRLEntryTest extends TestCase { * getCertificateIssuer() method testing. Tests if the method throws * appropriate exception. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertificateIssuer", - args = {} - ) public void testGetCertificateIssuer() { assertNull("The default implementation should return null.", tbt_crlentry.getCertificateIssuer()); } - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getRevocationDate", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSerialNumber", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "hasExtensions", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) - }) public void testAbstractMethods() { TBTCRLEntry tbt = new TBTCRLEntry() { public byte[] getEncoded() { diff --git a/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java b/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java index 8e451f0..f2e814d 100644 --- a/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java +++ b/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java @@ -1,10 +1,6 @@ package tests.security.cert; import dalvik.annotation.AndroidOnly; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; import junit.framework.TestCase; @@ -36,7 +32,7 @@ import java.util.Date; import java.util.Set; import javax.security.auth.x500.X500Principal; -@TestTargetClass(X509CRLSelector.class) + public class X509CRLSelector2Test extends TestCase { protected void setUp() throws Exception { @@ -51,12 +47,6 @@ public class X509CRLSelector2Test extends TestCase { * constructor testing. * */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509CRLSelector", - args = {} - ) public void testX509CRLSelector() { X509CRLSelector selector = new X509CRLSelector(); assertNull(selector.getDateAndTime()); @@ -72,19 +62,6 @@ public class X509CRLSelector2Test extends TestCase { * specified issuers match the selector, and if not specified issuer does * not match the selector. */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "addIssuer", - args = {javax.security.auth.x500.X500Principal.class} - ), - @TestTargetNew( - level=TestLevel.PARTIAL_COMPLETE, - method="match", - args={java.security.cert.CRL.class} - ) - }) public void testAddIssuerLjavax_security_auth_x500_X500Principal02() { X509CRLSelector selector = new X509CRLSelector(); X500Principal iss1 = new X500Principal("O=First Org."); @@ -107,12 +84,6 @@ public class X509CRLSelector2Test extends TestCase { * issuers match the selector, and if not specified issuer does not match * the selector. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify IOException.", - method = "addIssuerName", - args = {java.lang.String.class} - ) public void testAddIssuerNameLjava_lang_String03() { X509CRLSelector selector = new X509CRLSelector(); String iss1 = "O=First Org."; @@ -147,12 +118,6 @@ public class X509CRLSelector2Test extends TestCase { * match the selector, and if the internal collection of issuer names is * copied during initialization. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setIssuerNames", - args = {java.util.Collection.class} - ) @SuppressWarnings("unchecked") public void testSetIssuerNamesLjava_util_Collection02() { X509CRLSelector selector = new X509CRLSelector(); @@ -201,12 +166,6 @@ public class X509CRLSelector2Test extends TestCase { * criteria, if specified issuers match the selector, and if not specified * issuer does not match the selector. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setIssuers", - args = {java.util.Collection.class} - ) public void testSetIssuersLjava_util_Collection() { X509CRLSelector selector = new X509CRLSelector(); X500Principal iss1 = new X500Principal("O=First Org."); @@ -239,12 +198,6 @@ public class X509CRLSelector2Test extends TestCase { * issuers match the selector, and if not specified issuer does not match * the selector. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify IOException.", - method = "addIssuerName", - args = {byte[].class} - ) public void testAddIssuerName$B() { X509CRLSelector selector = new X509CRLSelector(); byte[] iss1 = new byte[] @@ -284,12 +237,6 @@ public class X509CRLSelector2Test extends TestCase { * criteria, if specified minCRL value matches the selector, and if CRL with * inappropriate crlNumber value does not match the selector. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setMinCRLNumber", - args = {java.math.BigInteger.class} - ) @AndroidOnly("Uses specific class: " + "org.apache.harmony.security.asn1.ASN1OctetString.") public void testSetMinCRLNumberLjava_math_BigInteger() { @@ -314,12 +261,6 @@ public class X509CRLSelector2Test extends TestCase { * criteria, if specified maxCRL value matches the selector, and if CRL with * inappropriate crlNumber value does not match the selector. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setMaxCRLNumber", - args = {java.math.BigInteger.class} - ) @AndroidOnly("Uses specific class: " + "org.apache.harmony.security.asn1.ASN1OctetString.") public void testSetMaxCRLNumberLjava_math_BigInteger() { @@ -343,12 +284,6 @@ public class X509CRLSelector2Test extends TestCase { * update dates match the selector in the case of null dateAndTime criteria, * if correct dates match and incorrect do not match the selector. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setDateAndTime", - args = {java.util.Date.class} - ) public void testSetDateAndTimeLjava_util_Date() { X509CRLSelector selector = new X509CRLSelector(); TestCRL crl = new TestCRL(new Date(200), new Date(300)); @@ -375,12 +310,6 @@ public class X509CRLSelector2Test extends TestCase { /** * setCertificateChecking(X509Certificate) method testing. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setCertificateChecking", - args = {java.security.cert.X509Certificate.class} - ) public void testSetCertificateCheckingLjava_X509Certificate() throws CertificateException { X509CRLSelector selector = new X509CRLSelector(); @@ -407,12 +336,6 @@ public class X509CRLSelector2Test extends TestCase { * of not specified issuers, if the returned collection corresponds to the * specified issuers and this collection is unmodifiable. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuers", - args = {} - ) public void testGetIssuers() { X509CRLSelector selector = new X509CRLSelector(); X500Principal iss1 = new X500Principal("O=First Org."); @@ -436,12 +359,6 @@ public class X509CRLSelector2Test extends TestCase { * case of not specified issuers, if the returned collection corresponds to * the specified issuers. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerNames", - args = {} - ) public void testGetIssuerNames() { X509CRLSelector selector = new X509CRLSelector(); byte[] iss1 = new byte[] @@ -470,12 +387,6 @@ public class X509CRLSelector2Test extends TestCase { * of not specified minCRL criteria, and if the returned value corresponds * to the specified one. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getMinCRL", - args = {} - ) public void testGetMinCRL() { X509CRLSelector selector = new X509CRLSelector(); assertNull("Initially the minCRL should be null.", selector.getMinCRL()); @@ -490,12 +401,6 @@ public class X509CRLSelector2Test extends TestCase { * of not specified maxCRL criteria, and if the returned value corresponds * to the specified one. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getMaxCRL", - args = {} - ) public void testGetMaxCRL() { X509CRLSelector selector = new X509CRLSelector(); assertNull("Initially the maxCRL should be null.", selector.getMaxCRL()); @@ -510,12 +415,6 @@ public class X509CRLSelector2Test extends TestCase { * case of not specified dateAndTime criteria, and if the returned value * corresponds to the specified one. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getDateAndTime", - args = {} - ) public void testGetDateAndTime() { X509CRLSelector selector = new X509CRLSelector(); assertNull("Initially the dateAndTime criteria should be null.", @@ -529,12 +428,6 @@ public class X509CRLSelector2Test extends TestCase { /** * getCertificateChecking() method testing. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertificateChecking", - args = {} - ) public void testGetCertificateCheckingLjava_X509Certificate() throws CertificateException { X509CRLSelector selector = new X509CRLSelector(); @@ -555,12 +448,6 @@ public class X509CRLSelector2Test extends TestCase { * match(CRL crl) method testing. Tests if the null object matches to the * selector or not. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify not null value as parameter.", - method = "match", - args = {java.security.cert.CRL.class} - ) public void testMatchLjava_security_cert_X509CRL() { X509CRLSelector selector = new X509CRLSelector(); assertFalse("The null object should not match", selector @@ -572,12 +459,6 @@ public class X509CRLSelector2Test extends TestCase { * crl which matche to the initial selector should match to the clone and * the change of clone should not cause the change of initial selector. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) @AndroidOnly("Uses specific classes: " + "org.apache.harmony.security.asn1.ASN1OctetString, " + "org.apache.harmony.security.asn1.ASN1Integer.") @@ -608,12 +489,6 @@ public class X509CRLSelector2Test extends TestCase { + "the changes of initial object", selector.getIssuerNames() .size() == 3); } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public void testToString() { X509CRLSelector selector = new X509CRLSelector(); X500Principal iss1 = new X500Principal("O=First Org."); diff --git a/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java b/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java index 31faaaf..096bfee 100644 --- a/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java +++ b/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java @@ -22,11 +22,6 @@ package tests.security.cert; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.io.IOException; @@ -36,18 +31,11 @@ import java.util.TreeSet; import javax.security.auth.x500.X500Principal; -@TestTargetClass(X509CRLSelector.class) public class X509CRLSelectorTest extends TestCase { /** - * @tests java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal) + * java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "addIssuer", - args = {javax.security.auth.x500.X500Principal.class} - ) public void test_addIssuerLjavax_security_auth_x500_X500Principal01() throws Exception { //Regression for HARMONY-465 @@ -61,14 +49,8 @@ public class X509CRLSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CRLSelector#addIssuerName(java.lang.String) + * java.security.cert.X509CRLSelector#addIssuerName(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IOException.", - method = "addIssuerName", - args = {java.lang.String.class} - ) public void test_addIssuerNameLjava_lang_String01() throws Exception { //Regression for HARMONY-465 X509CRLSelector obj = new X509CRLSelector(); @@ -89,14 +71,8 @@ public class X509CRLSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CRLSelector#addIssuerName(java.lang.String) + * java.security.cert.X509CRLSelector#addIssuerName(java.lang.String) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "addIssuerName", - args = {java.lang.String.class} - ) public void test_addIssuerNameLjava_lang_String02() throws IOException { // Regression for HARMONY-736 X509CRLSelector selector = new X509CRLSelector(); @@ -107,14 +83,8 @@ public class X509CRLSelectorTest extends TestCase { /** - * @tests java.security.cert.X509CRLSelector#addIssuerName(byte[]) + * java.security.cert.X509CRLSelector#addIssuerName(byte[]) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IOException.", - method = "addIssuerName", - args = {byte[].class} - ) public void test_addIssuerName$B_3() throws Exception { //Regression for HARMONY-465 X509CRLSelector obj = new X509CRLSelector(); @@ -127,14 +97,8 @@ public class X509CRLSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CRLSelector#addIssuerName(byte[]) + * java.security.cert.X509CRLSelector#addIssuerName(byte[]) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "addIssuerName", - args = {byte[].class} - ) public void test_addIssuerName$B_4() throws Exception { //Regression for HARMONY-465 X509CRLSelector obj = new X509CRLSelector(); @@ -147,14 +111,8 @@ public class X509CRLSelectorTest extends TestCase { } /** - * @tests setIssuerNames(Collection <?> names) + * setIssuerNames(Collection <?> names) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Regression test.", - method = "setIssuerNames", - args = {java.util.Collection.class} - ) public void test_setIssuerNamesLjava_util_Collection01() throws IOException { // Regression for HARMONY-737 X509CRLSelector selector = new X509CRLSelector(); diff --git a/luni/src/test/java/tests/security/cert/X509CRLTest.java b/luni/src/test/java/tests/security/cert/X509CRLTest.java index a460b89..c0163f3 100644 --- a/luni/src/test/java/tests/security/cert/X509CRLTest.java +++ b/luni/src/test/java/tests/security/cert/X509CRLTest.java @@ -23,10 +23,6 @@ package tests.security.cert; import dalvik.annotation.AndroidOnly; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.Test; import junit.framework.TestCase; @@ -56,7 +52,6 @@ import org.apache.harmony.security.tests.support.cert.TestUtils; import tests.security.cert.X509CRL2Test.MyX509CRL; /** */ -@TestTargetClass(X509CRL.class) public class X509CRLTest extends TestCase { private X509CRL tbt_crl; @@ -188,12 +183,6 @@ public class X509CRLTest extends TestCase { * getType() method testing. Tests that getType() method returns * the value "X.509" */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getType", - args = {} - ) public void testGetType() { assertEquals("The type of X509CRL should be X.509", tbt_crl.getType(), "X.509"); @@ -204,12 +193,6 @@ public class X509CRLTest extends TestCase { * operation: it should be reflexive, symmetric, transitive, consistent * and should be false on null object. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public void testEquals() { TBTCRL tbt_crl_1 = new TBTCRL() { public byte[] getEncoded() { @@ -258,12 +241,6 @@ public class X509CRLTest extends TestCase { * hashCode() method testing. Tests that for equal objects hash codes * are equal. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public void testHashCode() { TBTCRL tbt_crl_1 = new TBTCRL() { public byte[] getEncoded() { @@ -275,14 +252,8 @@ public class X509CRLTest extends TestCase { } /** - * @tests java.security.cert.X509CRL#getIssuerX500Principal() + * java.security.cert.X509CRL#getIssuerX500Principal() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerX500Principal", - args = {} - ) public void testGetIssuerX500Principal() { // return valid encoding TBTCRL crl = new TBTCRL() { @@ -299,12 +270,6 @@ public class X509CRLTest extends TestCase { * Check if the default implementation throws NullPointerException * on null input data. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getRevokedCertificate", - args = {java.security.cert.X509Certificate.class} - ) @AndroidOnly("Test filed on RI: getRevokedCertificate throws " + "RuntimeException.") public void testGetRevokedCertificate() { @@ -325,92 +290,6 @@ public class X509CRLTest extends TestCase { } } - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerDN", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getNextUpdate", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getRevokedCertificate", - args = {java.math.BigInteger.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getRevokedCertificates", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSigAlgName", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSigAlgOID", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSigAlgParams", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSignature", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getTBSCertList", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getThisUpdate", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getVersion", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "verify", - args = {java.security.PublicKey.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "verify", - args = {java.security.PublicKey.class, java.lang.String.class} - ) - }) public void testAbstractMethods() { TBTCRL crl = new TBTCRL() { public byte[] getEncoded() { @@ -439,12 +318,6 @@ public class X509CRLTest extends TestCase { } } - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509CRL", - args = {} - ) public void testX509CRL() { try { TBTCRL crl = new TBTCRL(); diff --git a/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java b/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java index 04d6c48..438bef9 100644 --- a/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java +++ b/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java @@ -17,10 +17,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.io.ByteArrayInputStream; @@ -83,7 +79,6 @@ import org.apache.harmony.security.x509.PrivateKeyUsagePeriod; /** * X509CertSelectorTest */ -@TestTargetClass(X509CertSelector.class) public class X509CertSelectorTest extends TestCase { byte[][] constraintBytes = new byte[][] { @@ -128,14 +123,8 @@ public class X509CertSelectorTest extends TestCase { 1, -128, 1, 0}}; /** - * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[]) + * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[]) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "IOException checking missed", - method = "addSubjectAlternativeName", - args = {int.class, byte[].class} - ) public void test_addSubjectAlternativeNameLintLbyte_array() throws IOException { // Regression for HARMONY-2487 int[] types = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; @@ -150,14 +139,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String) + * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies IOException.", - method = "addSubjectAlternativeName", - args = {int.class, java.lang.String.class} - ) public void test_addSubjectAlternativeNameLintLjava_lang_String() { // Regression for HARMONY-727 int[] types = { 0, 2, 3, 4, 5, 6, 7, 8 }; @@ -172,14 +155,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addPathToName(int, byte[]) + * java.security.cert.X509CertSelector#addPathToName(int, byte[]) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies NullPointerException.", - method = "addPathToName", - args = {int.class, byte[].class} - ) public void test_addPathToNameLintLbyte_array() throws IOException { // Regression for HARMONY-2487 int[] types = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; @@ -193,14 +170,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addPathToName(int, String) + * java.security.cert.X509CertSelector#addPathToName(int, String) */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies IOException.", - method = "addPathToName", - args = {int.class, java.lang.String.class} - ) public void test_addPathToNameLintLjava_lang_String() { // Regression for HARMONY-724 for (int type = 0; type <= 8; type++) { @@ -216,14 +187,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#X509CertSelector() + * java.security.cert.X509CertSelector#X509CertSelector() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509CertSelector", - args = {} - ) public void test_X509CertSelector() { X509CertSelector selector = null; try { @@ -236,14 +201,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#clone() + * java.security.cert.X509CertSelector#clone() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "clone", - args = {} - ) public void test_clone() throws Exception { X509CertSelector selector = new X509CertSelector(); X509CertSelector selector1 = (X509CertSelector) selector.clone(); @@ -295,14 +254,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getAuthorityKeyIdentifier() + * java.security.cert.X509CertSelector#getAuthorityKeyIdentifier() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getAuthorityKeyIdentifier", - args = {} - ) public void test_getAuthorityKeyIdentifier() { byte[] akid1 = new byte[] { 4, 5, 1, 2, 3, 4, 5 }; // random value byte[] akid2 = new byte[] { 4, 5, 5, 4, 3, 2, 1 }; // random value @@ -320,14 +273,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getBasicConstraints() + * java.security.cert.X509CertSelector#getBasicConstraints() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getBasicConstraints", - args = {} - ) public void test_getBasicConstraints() { X509CertSelector selector = new X509CertSelector(); int[] validValues = { 2, 1, 0, 1, 2, 3, 10, 20 }; @@ -338,14 +285,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getCertificate() + * java.security.cert.X509CertSelector#getCertificate() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertificate", - args = {} - ) public void test_getCertificate() throws CertificateException { X509CertSelector selector = new X509CertSelector(); CertificateFactory certFact = CertificateFactory.getInstance("X509"); @@ -368,14 +309,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getCertificateValid() + * java.security.cert.X509CertSelector#getCertificateValid() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCertificateValid", - args = {} - ) public void test_getCertificateValid() { Date date1 = new Date(100); Date date2 = new Date(200); @@ -400,14 +335,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getExtendedKeyUsage() + * java.security.cert.X509CertSelector#getExtendedKeyUsage() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getExtendedKeyUsage", - args = {} - ) public void test_getExtendedKeyUsage() { HashSet<String> ku = new HashSet<String>(Arrays .asList(new String[] { "1.3.6.1.5.5.7.3.1", @@ -436,14 +365,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getIssuer() + * java.security.cert.X509CertSelector#getIssuer() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuer", - args = {} - ) public void test_getIssuer() { X500Principal iss1 = new X500Principal("O=First Org."); X500Principal iss2 = new X500Principal("O=Second Org."); @@ -458,14 +381,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getIssuerAsBytes() + * java.security.cert.X509CertSelector#getIssuerAsBytes() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerAsBytes", - args = {} - ) public void test_getIssuerAsBytes() { byte[] name1 = new byte[] // manually obtained DER encoding of "O=First Org." issuer name; @@ -497,14 +414,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getIssuerAsString() + * java.security.cert.X509CertSelector#getIssuerAsString() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerAsString", - args = {} - ) public void test_getIssuerAsString() { String name1 = "O=First Org."; String name2 = "O=Second Org."; @@ -524,14 +435,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getKeyUsage() + * java.security.cert.X509CertSelector#getKeyUsage() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getKeyUsage", - args = {} - ) public void test_getKeyUsage() { boolean[] ku = new boolean[] { true, false, true, false, true, false, true, false, true }; @@ -548,14 +453,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getMatchAllSubjectAltNames() + * java.security.cert.X509CertSelector#getMatchAllSubjectAltNames() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getMatchAllSubjectAltNames", - args = {} - ) public void test_getMatchAllSubjectAltNames() { X509CertSelector selector = new X509CertSelector(); assertTrue("The matchAllNames initially should be true", selector @@ -566,14 +465,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getNameConstraints() + * java.security.cert.X509CertSelector#getNameConstraints() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getNameConstraints", - args = {} - ) public void test_getNameConstraints() throws IOException { // Used to generate following byte array @@ -612,14 +505,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getPathToNames() + * java.security.cert.X509CertSelector#getPathToNames() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPathToNames", - args = {} - ) public void test_getPathToNames() { try { GeneralName san0 = new GeneralName(new OtherName("1.2.3.4.5", @@ -666,14 +553,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getPolicy() + * java.security.cert.X509CertSelector#getPolicy() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPolicy", - args = {} - ) public void test_getPolicy() throws IOException { String[] policies1 = new String[] { "1.3.6.1.5.5.7.3.1", "1.3.6.1.5.5.7.3.2", "1.3.6.1.5.5.7.3.3", "1.3.6.1.5.5.7.3.4", @@ -698,14 +579,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getPrivateKeyValid() + * java.security.cert.X509CertSelector#getPrivateKeyValid() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrivateKeyValid", - args = {} - ) public void test_getPrivateKeyValid() { Date date1 = new Date(100); Date date2 = new Date(200); @@ -723,14 +598,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSerialNumber() + * java.security.cert.X509CertSelector#getSerialNumber() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSerialNumber", - args = {} - ) public void test_getSerialNumber() { BigInteger ser1 = new BigInteger("10000"); BigInteger ser2 = new BigInteger("10001"); @@ -745,14 +614,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubject() + * java.security.cert.X509CertSelector#getSubject() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubject", - args = {} - ) public void test_getSubject() { X500Principal sub1 = new X500Principal("O=First Org."); X500Principal sub2 = new X500Principal("O=Second Org."); @@ -767,14 +630,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubjectAlternativeNames() + * java.security.cert.X509CertSelector#getSubjectAlternativeNames() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectAlternativeNames", - args = {} - ) public void test_getSubjectAlternativeNames() { try { GeneralName san1 = new GeneralName(1, "rfc@822.Name"); @@ -804,14 +661,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubjectAsBytes() + * java.security.cert.X509CertSelector#getSubjectAsBytes() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectAsBytes", - args = {} - ) public void test_getSubjectAsBytes() { byte[] name1 = new byte[] // manually obtained DER encoding of "O=First Org." issuer name; @@ -843,14 +694,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubjectAsString() + * java.security.cert.X509CertSelector#getSubjectAsString() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectAsString", - args = {} - ) public void test_getSubjectAsString() { String name1 = "O=First Org."; String name2 = "O=Second Org."; @@ -870,14 +715,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubjectKeyIdentifier() + * java.security.cert.X509CertSelector#getSubjectKeyIdentifier() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectKeyIdentifier", - args = {} - ) public void test_getSubjectKeyIdentifier() { byte[] skid1 = new byte[] { 1, 2, 3, 4, 5 }; // random value byte[] skid2 = new byte[] { 4, 5, 5, 4, 3, 2, 1 }; // random value @@ -896,14 +735,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubjectPublicKey() + * java.security.cert.X509CertSelector#getSubjectPublicKey() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectPublicKey", - args = {} - ) public void test_getSubjectPublicKey() throws Exception { // SubjectPublicKeyInfo ::= SEQUENCE { @@ -934,14 +767,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#getSubjectPublicKeyAlgID() + * java.security.cert.X509CertSelector#getSubjectPublicKeyAlgID() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectPublicKeyAlgID", - args = {} - ) public void test_getSubjectPublicKeyAlgID() { X509CertSelector selector = new X509CertSelector(); @@ -976,14 +803,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#match(java.security.cert.Certificate) + * java.security.cert.X509CertSelector#match(java.security.cert.Certificate) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "match", - args = {java.security.cert.Certificate.class} - ) public void test_matchLjava_security_cert_Certificate() throws CertificateException { X509CertSelector selector = new X509CertSelector(); @@ -1008,14 +829,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setAuthorityKeyIdentifier(byte[]) + * java.security.cert.X509CertSelector#setAuthorityKeyIdentifier(byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setAuthorityKeyIdentifier", - args = {byte[].class} - ) public void test_setAuthorityKeyIdentifierLB$() throws CertificateException { X509CertSelector selector = new X509CertSelector(); @@ -1048,14 +863,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setBasicConstraints(int) + * java.security.cert.X509CertSelector#setBasicConstraints(int) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setBasicConstraints", - args = {int.class} - ) public void test_setBasicConstraintsLint() { X509CertSelector selector = new X509CertSelector(); int[] invalidValues = { -3, -4, -5, 1000000000 }; @@ -1076,14 +885,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setCertificate(java.security.cert.Certificate) + * java.security.cert.X509CertSelector#setCertificate(java.security.cert.Certificate) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setCertificate", - args = {java.security.cert.X509Certificate.class} - ) public void test_setCertificateLjava_security_cert_X509Certificate() throws CertificateException { @@ -1108,14 +911,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setCertificateValid(java.util.Date) + * java.security.cert.X509CertSelector#setCertificateValid(java.util.Date) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setCertificateValid", - args = {java.util.Date.class} - ) public void test_setCertificateValidLjava_util_Date() throws CertificateException { X509CertSelector selector = new X509CertSelector(); @@ -1139,14 +936,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setExtendedKeyUsage(Set<String>) + * java.security.cert.X509CertSelector#setExtendedKeyUsage(Set<String>) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setExtendedKeyUsage", - args = {java.util.Set.class} - ) public void test_setExtendedKeyUsageLjava_util_Set() throws CertificateException { HashSet<String> ku1 = new HashSet<String>(Arrays @@ -1188,14 +979,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setIssuer(byte[]) + * java.security.cert.X509CertSelector#setIssuer(byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setIssuer", - args = {byte[].class} - ) public void test_setIssuerLB$() throws CertificateException { byte[] name1 = new byte[] // manually obtained DER encoding of "O=First Org." issuer name; @@ -1239,14 +1024,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setIssuer(java.lang.String) + * java.security.cert.X509CertSelector#setIssuer(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setIssuer", - args = {java.lang.String.class} - ) public void test_setIssuerLjava_lang_String() throws CertificateException { String name1 = "O=First Org."; @@ -1285,14 +1064,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setIssuer(javax.security.auth.x500.X500Principal) + * java.security.cert.X509CertSelector#setIssuer(javax.security.auth.x500.X500Principal) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setIssuer", - args = {javax.security.auth.x500.X500Principal.class} - ) public void test_setIssuerLjavax_security_auth_x500_X500Principal() throws CertificateException { X500Principal iss1 = new X500Principal("O=First Org."); @@ -1316,14 +1089,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setKeyUsage(boolean) + * java.security.cert.X509CertSelector#setKeyUsage(boolean) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setKeyUsage", - args = {boolean[].class} - ) public void test_setKeyUsageZ() throws CertificateException { boolean[] ku1 = new boolean[] { true, true, true, true, true, true, true, true, true }; @@ -1355,14 +1122,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setMatchAllSubjectAltNames(boolean) + * java.security.cert.X509CertSelector#setMatchAllSubjectAltNames(boolean) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setMatchAllSubjectAltNames", - args = {boolean.class} - ) public void test_setMatchAllSubjectAltNamesZ() { TestCert cert = new TestCert(); X509CertSelector selector = new X509CertSelector(); @@ -1373,15 +1134,9 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setNameConstraints(byte[] + * java.security.cert.X509CertSelector#setNameConstraints(byte[] * bytes) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setNameConstraints", - args = {byte[].class} - ) public void test_setNameConstraintsLB$() throws IOException { // GeneralName[] name_constraints = new GeneralName[] { // new GeneralName(1, "822.Name"), @@ -1413,14 +1168,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setPathToNames(Collection<List<?>>) + * java.security.cert.X509CertSelector#setPathToNames(Collection<List<?>>) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setPathToNames", - args = {java.util.Collection.class} - ) public void test_setPathToNamesLjava_util_Collection() { try { GeneralName san0 = new GeneralName(new OtherName("1.2.3.4.5", @@ -1467,14 +1216,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setPolicy(Set<String>) + * java.security.cert.X509CertSelector#setPolicy(Set<String>) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setPolicy", - args = {java.util.Set.class} - ) public void test_setPolicyLjava_util_Set() throws IOException { String[] policies1 = new String[] { "1.3.6.1.5.5.7.3.1", "1.3.6.1.5.5.7.3.2", "1.3.6.1.5.5.7.3.3", "1.3.6.1.5.5.7.3.4", @@ -1510,14 +1253,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setPrivateKeyValid(java.util.Date) + * java.security.cert.X509CertSelector#setPrivateKeyValid(java.util.Date) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setPrivateKeyValid", - args = {java.util.Date.class} - ) public void test_setPrivateKeyValidLjava_util_Date() throws CertificateException { Date date1 = new Date(100000000); @@ -1546,14 +1283,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSerialNumber(java.math.BigInteger) + * java.security.cert.X509CertSelector#setSerialNumber(java.math.BigInteger) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSerialNumber", - args = {java.math.BigInteger.class} - ) public void test_setSerialNumberLjava_math_BigInteger() throws CertificateException { BigInteger ser1 = new BigInteger("10000"); @@ -1577,14 +1308,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubject(byte[]) + * java.security.cert.X509CertSelector#setSubject(byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubject", - args = {byte[].class} - ) public void test_setSubjectLB$() throws CertificateException { byte[] name1 = new byte[] // manually obtained DER encoding of "O=First Org." issuer name; @@ -1628,14 +1353,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubject(java.lang.String) + * java.security.cert.X509CertSelector#setSubject(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubject", - args = {java.lang.String.class} - ) public void test_setSubjectLjava_lang_String() throws CertificateException { String name1 = "O=First Org."; String name2 = "O=Second Org."; @@ -1673,14 +1392,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubject(javax.security.auth.x500.X500Principal) + * java.security.cert.X509CertSelector#setSubject(javax.security.auth.x500.X500Principal) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubject", - args = {javax.security.auth.x500.X500Principal.class} - ) public void test_setSubjectLjavax_security_auth_x500_X500Principal() throws CertificateException { X500Principal sub1 = new X500Principal("O=First Org."); @@ -1705,14 +1418,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubjectAlternativeNames(Collection<List<?>>) + * java.security.cert.X509CertSelector#setSubjectAlternativeNames(Collection<List<?>>) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubjectAlternativeNames", - args = {java.util.Collection.class} - ) public void test_setSubjectAlternativeNamesLjava_util_Collection() { try { @@ -1761,14 +1468,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubjectKeyIdentifier(byte[]) + * java.security.cert.X509CertSelector#setSubjectKeyIdentifier(byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubjectKeyIdentifier", - args = {byte[].class} - ) public void test_setSubjectKeyIdentifierLB$() throws CertificateException { byte[] skid1 = new byte[] { 1, 2, 3, 4, 5 }; // random value byte[] skid2 = new byte[] { 5, 4, 3, 2, 1 }; // random value @@ -1792,14 +1493,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubjectPublicKey(byte[]) + * java.security.cert.X509CertSelector#setSubjectPublicKey(byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubjectPublicKey", - args = {byte[].class} - ) public void test_setSubjectPublicKeyLB$() throws Exception { //SubjectPublicKeyInfo ::= SEQUENCE { @@ -1823,14 +1518,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubjectPublicKey(java.security.PublicKey key) + * java.security.cert.X509CertSelector#setSubjectPublicKey(java.security.PublicKey key) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubjectPublicKey", - args = {java.security.PublicKey.class} - ) public void test_setSubjectPublicKeyLjava_security_PublicKey() throws CertificateException { PublicKey pkey1 = null; @@ -1861,14 +1550,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#setSubjectPublicKeyAlgID(java.lang.String) + * java.security.cert.X509CertSelector#setSubjectPublicKeyAlgID(java.lang.String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "setSubjectPublicKeyAlgID", - args = {java.lang.String.class} - ) public void test_setSubjectPublicKeyAlgIDLjava_lang_String() throws CertificateException { @@ -1941,14 +1624,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#toString() + * java.security.cert.X509CertSelector#toString() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public void test_toString() { X509CertSelector selector = new X509CertSelector(); assertNotNull(selector.toString()); @@ -2411,14 +2088,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addPathToName(int, byte[]) + * java.security.cert.X509CertSelector#addPathToName(int, byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Verifies Exception", - method = "addPathToName", - args = {int.class, byte[].class} - ) public void test_addPathToNameLintLbyte_array2() throws Exception { TestUtils.initCertPathSSCertChain(); setupEnvironment(); @@ -2454,14 +2125,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addPathToName(int, String) + * java.security.cert.X509CertSelector#addPathToName(int, String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Verifies IOException.", - method = "addPathToName", - args = {int.class, java.lang.String.class} - ) public void test_addPathToNameLintLjava_lang_String2() throws Exception { setupEnvironment(); byte[] bytes, bytesName; @@ -2497,14 +2162,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[]) + * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[]) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "IOException checking missed", - method = "addSubjectAlternativeName", - args = {int.class, byte[].class} - ) public void test_addSubjectAlternativeNameLintLbyte_array2() throws Exception { @@ -2546,14 +2205,8 @@ public class X509CertSelectorTest extends TestCase { } /** - * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String) + * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "addSubjectAlternativeName", - args = {int.class, java.lang.String.class} - ) public void test_addSubjectAlternativeNameLintLjava_lang_String2() throws Exception{ GeneralName san6 = new GeneralName(6, "http://uniform.Resource.Id"); GeneralName san2 = new GeneralName(2, "dNSName"); diff --git a/luni/src/test/java/tests/security/cert/X509Certificate2Test.java b/luni/src/test/java/tests/security/cert/X509Certificate2Test.java index d8e7100..5578234 100644 --- a/luni/src/test/java/tests/security/cert/X509Certificate2Test.java +++ b/luni/src/test/java/tests/security/cert/X509Certificate2Test.java @@ -17,11 +17,6 @@ package tests.security.cert; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargets; - import org.apache.harmony.security.tests.support.cert.TestUtils; import java.io.ByteArrayInputStream; @@ -41,18 +36,11 @@ import java.util.Set; import javax.security.auth.x500.X500Principal; -@TestTargetClass(X509Certificate.class) public class X509Certificate2Test extends junit.framework.TestCase { /** * Test for X.509 Certificate provider */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "toString", - args = {} - ) public void test_toString() throws Exception { // Regression for HARMONY-3384 @@ -70,14 +58,8 @@ public class X509Certificate2Test extends junit.framework.TestCase { } /** - * @tests java.security.cert.X509Certificate#X509Certificate() + * java.security.cert.X509Certificate#X509Certificate() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509Certificate", - args = {} - ) public void test_X509Certificate() { MyX509Certificate s = null; try { @@ -88,110 +70,6 @@ public class X509Certificate2Test extends junit.framework.TestCase { assertEquals("X.509", s.getType()); } - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "checkValidity", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "checkValidity", - args = {java.util.Date.class} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getBasicConstraints", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerDN", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerUniqueID", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getKeyUsage", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getNotAfter", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getNotBefore", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSerialNumber", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSigAlgName", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSigAlgOID", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSigAlgParams", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSignature", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectDN", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectUniqueID", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getTBSCertificate", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getVersion", - args = {} - ) - }) public void testAbstractMethods() { MyX509Certificate s = new MyX509Certificate(); try { @@ -395,27 +273,15 @@ public class X509Certificate2Test extends junit.framework.TestCase { } /** - * @tests java.security.cert.X509Certificate#getType() + * java.security.cert.X509Certificate#getType() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getType", - args = {} - ) public void testGetType() { assertEquals("X.509", new MyX509Certificate().getType()); } /** - * @tests java.security.cert.X509Certificate#getIssuerX500Principal() + * java.security.cert.X509Certificate#getIssuerX500Principal() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getIssuerX500Principal", - args = {} - ) public void testGetIssuerX500Principal() { // return valid encoding MyX509Certificate cert = new MyX509Certificate() { @@ -430,14 +296,8 @@ public class X509Certificate2Test extends junit.framework.TestCase { } /** - * @tests java.security.cert.X509Certificate#getSubjectX500Principal() + * java.security.cert.X509Certificate#getSubjectX500Principal() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getSubjectX500Principal", - args = {} - ) public void testGetSubjectX500Principal() { // return valid encoding MyX509Certificate cert = new MyX509Certificate() { @@ -453,14 +313,8 @@ public class X509Certificate2Test extends junit.framework.TestCase { /** * @throws CertificateException - * @tests java.security.cert.X509Certificate#getExtendedKeyUsage() + * java.security.cert.X509Certificate#getExtendedKeyUsage() */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "Doesn't verify CertificateParsingException.", - method = "getExtendedKeyUsage", - args = {} - ) public void testGetExtendedKeyUsage() throws CertificateException { assertNull(new MyX509Certificate().getExtendedKeyUsage()); @@ -490,14 +344,8 @@ public class X509Certificate2Test extends junit.framework.TestCase { } /** - * @tests java.security.cert.X509Certificate#getSubjectAlternativeNames() + * java.security.cert.X509Certificate#getSubjectAlternativeNames() */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "", - method = "getSubjectAlternativeNames", - args = {} - ) public void testGetSubjectAlternativeNames() throws CertificateParsingException { @@ -526,14 +374,8 @@ public class X509Certificate2Test extends junit.framework.TestCase { } /** - * @tests java.security.cert.X509Certificate#getIssuerAlternativeNames() + * java.security.cert.X509Certificate#getIssuerAlternativeNames() */ - @TestTargetNew( - level = TestLevel.SUFFICIENT, - notes = "Doesn't verify CertificateParsingException.", - method = "getIssuerAlternativeNames", - args = {} - ) public void testGetIssuerAlternativeNames() throws CertificateParsingException { @@ -560,13 +402,6 @@ public class X509Certificate2Test extends junit.framework.TestCase { assertTrue(coll.size() < 10); } - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - clazz = CertificateException.class, - method = "CertificateException", - args = {} - ) public void testCerficateException() { try { CertificateFactory cf = CertificateFactory.getInstance("X.509"); diff --git a/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java b/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java index 0f1df05..0e2fefe 100644 --- a/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java +++ b/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java @@ -16,10 +16,6 @@ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -31,7 +27,6 @@ import java.security.InvalidParameterException; import org.apache.harmony.security.tests.support.interfaces.DSAKeyPairGeneratorImpl; -@TestTargetClass(DSAKeyPairGenerator.class) public class DSAKeyPairGeneratorTest extends TestCase { private final BigInteger p = new BigInteger("4"); @@ -46,15 +41,9 @@ public class DSAKeyPairGeneratorTest extends TestCase { } /** - * @tests java.security.interfaces.DSAKeyPairGenerator + * java.security.interfaces.DSAKeyPairGenerator * #initialize(DSAParams params, SecureRandom random) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "initialize", - args = {java.security.interfaces.DSAParams.class, java.security.SecureRandom.class} - ) public void test_DSAKeyPairGenerator01() { DSAParams dsaParams = new DSAParameterSpec(p, q, g); SecureRandom random = null; @@ -90,15 +79,9 @@ public class DSAKeyPairGeneratorTest extends TestCase { } /** - * @tests java.security.interfaces.DSAKeyPairGenerator + * java.security.interfaces.DSAKeyPairGenerator * #initialize(int modlen, boolean genParams, SecureRandom randomm) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "initialize", - args = {int.class, boolean.class, java.security.SecureRandom.class} - ) public void test_DSAKeyPairGenerator02() { int[] invalidLen = {-1, 0, 511, 513, 650, 1023, 1025}; DSAParams dsaParams = new DSAParameterSpec(p, q, g); diff --git a/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java b/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java index a8aa78a..a53cddb 100644 --- a/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java @@ -15,9 +15,6 @@ */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; @@ -26,22 +23,15 @@ import java.security.interfaces.DSAKey; import java.security.interfaces.DSAParams; import java.security.spec.DSAParameterSpec; -@TestTargetClass(DSAKey.class) public class DSAKeyTest extends TestCase { /** - * @tests java.security.interfaces.DSAKey + * java.security.interfaces.DSAKey * #getParams() * test covers following use cases * Case 1: check private key * Case 2: check public key */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getParams", - args = {} - ) public void test_getParams() throws Exception { DSAParams param = new DSAParameterSpec(Util.P, Util.Q, Util.G); diff --git a/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java b/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java index 686d0f2..d07d5cd 100644 --- a/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java +++ b/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java @@ -14,9 +14,6 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; @@ -24,7 +21,6 @@ import java.math.BigInteger; import java.security.interfaces.DSAParams; import java.security.spec.DSAParameterSpec; -@TestTargetClass(DSAParams.class) public class DSAParamsTest extends TestCase { private final BigInteger p = new BigInteger("4"); @@ -32,45 +28,27 @@ public class DSAParamsTest extends TestCase { private final BigInteger g = BigInteger.ZERO; /** - * @tests java.security.interfaces.DSAParams + * java.security.interfaces.DSAParams * #getG() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getG", - args = {} - ) public void test_getG() { DSAParams params = new DSAParameterSpec(p, q, g); assertEquals("Invalid G", g, params.getG()); } /** - * @tests java.security.interfaces.DSAParams + * java.security.interfaces.DSAParams * #getP() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getP", - args = {} - ) public void test_getP() { DSAParams params = new DSAParameterSpec(p, q, g); assertEquals("Invalid P", p, params.getP()); } /** - * @tests java.security.interfaces.DSAParams + * java.security.interfaces.DSAParams * #getQ() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getQ", - args = {} - ) public void test_getQ() { DSAParams params = new DSAParameterSpec(p, q, g); assertEquals("Invalid Q", q, params.getQ()); diff --git a/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java b/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java index c08d5af..6cebda5 100644 --- a/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java @@ -14,10 +14,6 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.BrokenTest; import junit.framework.TestCase; @@ -28,19 +24,12 @@ import java.security.interfaces.DSAPrivateKey; import java.security.interfaces.DSAPublicKey; import java.security.spec.DSAParameterSpec; -@TestTargetClass(DSAPrivateKey.class) public class DSAPrivateKeyTest extends TestCase { /** - * @tests java.security.interfaces.DSAPrivateKey + * java.security.interfaces.DSAPrivateKey * #getX() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getX", - args = {} - ) public void test_getX() throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA"); keyGen.initialize(new DSAParameterSpec(Util.P, Util.Q, Util.G), diff --git a/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java b/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java index 533ead5..9fe4910 100644 --- a/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java @@ -14,10 +14,6 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.BrokenTest; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; @@ -28,23 +24,16 @@ import java.security.interfaces.DSAPrivateKey; import java.security.interfaces.DSAPublicKey; import java.security.spec.DSAParameterSpec; -@TestTargetClass(DSAPublicKey.class) public class DSAPublicKeyTest extends TestCase { /** - * @tests java.security.interfaces.DSAPublicKey + * java.security.interfaces.DSAPublicKey * #getY() * test covers following use cases * Case 1: check with predefined p, q, g, x * Case 2: check with random p, q, g, x. It takes some time (up to * minute) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getY", - args = {} - ) public void test_getY() throws Exception { KeyPairGenerator keyGen = null; KeyPair keys = null; diff --git a/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java index 63c4df4..9f2830d 100644 --- a/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java @@ -14,9 +14,6 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; @@ -26,22 +23,15 @@ import java.security.interfaces.RSAKey; import java.security.spec.RSAPrivateKeySpec; import java.security.spec.RSAPublicKeySpec; -@TestTargetClass(RSAKey.class) public class RSAKeyTest extends TestCase { /** - * @tests java.security.interfaces.RSAKey + * java.security.interfaces.RSAKey * #getModulus() * test covers following use cases * Case 1: check private key * Case 2: check public key */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getModulus", - args = {} - ) public void test_getModulus() throws Exception { KeyFactory gen = KeyFactory.getInstance("RSA"); final BigInteger n = BigInteger.valueOf(3233); diff --git a/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java index 86d4ae5..dca8de7 100644 --- a/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java @@ -16,11 +16,6 @@ package tests.security.interfaces; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -29,7 +24,6 @@ import java.security.spec.RSAOtherPrimeInfo; import org.apache.harmony.security.tests.support.interfaces.RSAMultiPrimePrivateCrtKeyImpl; -@TestTargetClass(RSAMultiPrimePrivateCrtKey.class) public class RSAMultiPrimePrivateCrtKeyTest extends TestCase { /** @@ -61,51 +55,13 @@ public class RSAMultiPrimePrivateCrtKeyTest extends TestCase { } /** - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getCrtCoefficient() - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentP() - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentQ() - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeP() - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeQ() - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPublicExponent() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getCrtCoefficient() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentP() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentQ() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeP() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeQ() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPublicExponent() */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCrtCoefficient", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentP", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentQ", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeP", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeQ", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) - }) public void test_RSAMultiPrimePrivateCrtKey() { RSAMulti rsam = new RSAMulti(publicExponent, primeExponentP, primeExponentQ, primeP, primeQ, crtCoefficient, opi); @@ -122,14 +78,8 @@ public class RSAMultiPrimePrivateCrtKeyTest extends TestCase { } /** - * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getOtherPrimeInfo() + * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getOtherPrimeInfo() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getOtherPrimeInfo", - args = {} - ) public void test_getOtherPrimeInfo() { RSAMulti rsam = new RSAMulti(publicExponent, primeExponentP, primeExponentQ, primeP, primeQ, crtCoefficient, null); @@ -147,4 +97,4 @@ public class RSAMultiPrimePrivateCrtKeyTest extends TestCase { fail("Unexpected exception: " + e); } } -}
\ No newline at end of file +} diff --git a/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java index 8d0ef80..d0c794c 100644 --- a/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java @@ -14,16 +14,12 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateCrtKey; -@TestTargetClass(RSAPrivateCrtKey.class) public class RSAPrivateCrtKeyTest extends TestCase { RSAPrivateCrtKey key = null; @@ -35,90 +31,54 @@ public class RSAPrivateCrtKeyTest extends TestCase { } /** - * @tests java.security.interfaces.RSAPrivateCrtKey + * java.security.interfaces.RSAPrivateCrtKey * #getCrtCoefficient() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCrtCoefficient", - args = {} - ) public void test_getCrtCoefficient() { assertEquals("invalid CRT coefficient", Util.rsaCrtParam.getCrtCoefficient(), key.getCrtCoefficient()); } /** - * @tests java.security.interfaces.RSAPrivateCrtKey + * java.security.interfaces.RSAPrivateCrtKey * #getPrimeExponentP() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentP", - args = {} - ) public void test_getPrimeExponentP() { assertEquals("invalid prime exponent P", Util.rsaCrtParam.getPrimeExponentP(), key.getPrimeExponentP()); } /** - * @tests java.security.interfaces.RSAPrivateCrtKey + * java.security.interfaces.RSAPrivateCrtKey * #getPrimeExponentQ() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentQ", - args = {} - ) public void test_getPrimeExponentQ() { assertEquals("invalid prime exponent Q", Util.rsaCrtParam.getPrimeExponentQ(), key.getPrimeExponentQ()); } /** - * @tests java.security.interfaces.RSAPrivateCrtKey + * java.security.interfaces.RSAPrivateCrtKey * #getPrimeP() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeP", - args = {} - ) public void test_getPrimeP() { assertEquals("invalid prime P", Util.rsaCrtParam.getPrimeP(), key.getPrimeP()); } /** - * @tests java.security.interfaces.RSAPrivateCrtKey + * java.security.interfaces.RSAPrivateCrtKey * #getPrimeQ() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeQ", - args = {} - ) public void test_getPrimeQ() { assertEquals("invalid prime Q", Util.rsaCrtParam.getPrimeQ(), key.getPrimeQ()); } /** - * @tests java.security.interfaces.RSAPrivateCrtKey + * java.security.interfaces.RSAPrivateCrtKey * #getPublicExponent() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) public void test_getPublicExponent() { assertEquals("invalid public exponent", Util.rsaCrtParam.getPublicExponent(), key.getPublicExponent()); diff --git a/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java index fdd1018..a5035a9 100644 --- a/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java @@ -14,9 +14,6 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; @@ -25,19 +22,12 @@ import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.spec.RSAPrivateKeySpec; -@TestTargetClass(RSAPrivateKey.class) public class RSAPrivateKeyTest extends TestCase { /** - * @tests java.security.interfaces.RSAPrivateKey + * java.security.interfaces.RSAPrivateKey * #getPrivateExponent() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrivateExponent", - args = {} - ) public void test_getPrivateExponent() throws Exception { KeyFactory gen = KeyFactory.getInstance("RSA"); final BigInteger n = BigInteger.valueOf(3233); diff --git a/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java index f3aaaac..09919af 100644 --- a/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java +++ b/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java @@ -14,9 +14,6 @@ * limitations under the License. */ package tests.security.interfaces; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; @@ -25,19 +22,12 @@ import java.security.KeyFactory; import java.security.interfaces.RSAPublicKey; import java.security.spec.RSAPublicKeySpec; -@TestTargetClass(RSAPublicKey.class) public class RSAPublicKeyTest extends TestCase { /** - * @tests java.security.interfaces.RSAPublicKey + * java.security.interfaces.RSAPublicKey * #getPublicExponent() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) public void test_getPublicExponent() throws Exception { KeyFactory gen = KeyFactory.getInstance("RSA"); final BigInteger n = BigInteger.valueOf(3233); diff --git a/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java b/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java index 408e74b..c270a0e 100644 --- a/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java +++ b/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -37,18 +32,11 @@ import java.security.spec.DSAParameterSpec; * Tests for <code>DSAParameterSpec</code> * */ -@TestTargetClass(DSAParameterSpec.class) public class DSAParameterSpecTest extends TestCase { /** * Ctor test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "DSAParameterSpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testDSAParameterSpec() { AlgorithmParameterSpec aps = new DSAParameterSpec( new BigInteger("1"), @@ -61,12 +49,6 @@ public class DSAParameterSpecTest extends TestCase { /** * getG() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getG", - args = {} - ) public final void testGetG() { DSAParameterSpec dps = new DSAParameterSpec( new BigInteger("1"), @@ -79,12 +61,6 @@ public class DSAParameterSpecTest extends TestCase { /** * getP() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getP", - args = {} - ) public final void testGetP() { DSAParameterSpec dps = new DSAParameterSpec( new BigInteger("1"), @@ -97,12 +73,6 @@ public class DSAParameterSpecTest extends TestCase { /** * getQ() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getQ", - args = {} - ) public final void testGetQ() { DSAParameterSpec dps = new DSAParameterSpec( new BigInteger("1"), diff --git a/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java b/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java index b44e29b..98bd8f0 100644 --- a/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -37,18 +32,11 @@ import java.security.spec.KeySpec; * Tests for <code>DSAPrivateKeySpec</code> * */ -@TestTargetClass(DSAPrivateKeySpec.class) public class DSAPrivateKeySpecTest extends TestCase { /** * Test for constructor */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "DSAPrivateKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testDSAPrivateKeySpec() { KeySpec ks = new DSAPrivateKeySpec( new BigInteger("1"), @@ -62,12 +50,6 @@ public class DSAPrivateKeySpecTest extends TestCase { /** * getG() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getG", - args = {} - ) public final void testGetG() { DSAPrivateKeySpec dpks = new DSAPrivateKeySpec( new BigInteger("1"), @@ -81,12 +63,6 @@ public class DSAPrivateKeySpecTest extends TestCase { /** * getP() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getP", - args = {} - ) public final void testGetP() { DSAPrivateKeySpec dpks = new DSAPrivateKeySpec( new BigInteger("1"), @@ -100,12 +76,6 @@ public class DSAPrivateKeySpecTest extends TestCase { /** * getQ() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getQ", - args = {} - ) public final void testGetQ() { DSAPrivateKeySpec dpks = new DSAPrivateKeySpec( new BigInteger("1"), @@ -119,12 +89,6 @@ public class DSAPrivateKeySpecTest extends TestCase { /** * getX() test */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getX", - args = {} - ) public final void testGetX() { DSAPrivateKeySpec dpks = new DSAPrivateKeySpec( new BigInteger("1"), diff --git a/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java b/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java index 6dfecd9..1921566 100644 --- a/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -37,18 +32,11 @@ import java.security.spec.KeySpec; * Tests for <code>DSAPublicKeySpec</code> * */ -@TestTargetClass(DSAPublicKeySpec.class) public class DSAPublicKeySpecTest extends TestCase { /** * Test for <code>DSAPublicKeySpec</code> ctor */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "DSAPublicKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testDSAPublicKeySpec() { KeySpec ks = new DSAPublicKeySpec( new BigInteger("1"), // y @@ -62,12 +50,6 @@ public class DSAPublicKeySpecTest extends TestCase { /** * Test for <code>getG</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getG", - args = {} - ) public final void testGetG() { DSAPublicKeySpec dpks = new DSAPublicKeySpec( new BigInteger("1"), // y @@ -81,12 +63,6 @@ public class DSAPublicKeySpecTest extends TestCase { /** * Test for <code>getP</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getP", - args = {} - ) public final void testGetP() { DSAPublicKeySpec dpks = new DSAPublicKeySpec( new BigInteger("1"), // y @@ -100,12 +76,6 @@ public class DSAPublicKeySpecTest extends TestCase { /** * Test for <code>getQ</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getQ", - args = {} - ) public final void testGetQ() { DSAPublicKeySpec dpks = new DSAPublicKeySpec( new BigInteger("1"), // y @@ -119,12 +89,6 @@ public class DSAPublicKeySpecTest extends TestCase { /** * Test for <code>getY</code> method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getY", - args = {} - ) public final void testGetY() { DSAPublicKeySpec dpks = new DSAPublicKeySpec( new BigInteger("1"), // y diff --git a/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java b/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java index ae26df7..6e541c3 100644 --- a/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java +++ b/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -38,7 +33,6 @@ import java.util.Random; * Tests for <code>ECFieldF2m</code> class fields and methods. * */ -@TestTargetClass(ECFieldF2m.class) public class ECFieldF2mTest extends TestCase { /** @@ -132,12 +126,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: IllegalArgumentException if m is not positive. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ECFieldF2m", - args = {int.class} - ) public final void testECFieldF2mint() { for(int i=0; i<intCtorTestParameters.length; i++) { ECFieldF2mDomainParams tp = intCtorTestParameters[i]; @@ -263,12 +251,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: IllegalArgumentException if ks is invalid. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ECFieldF2m", - args = {int.class, int[].class} - ) public final void testECFieldF2mintintArray() { for(int i=0; i<constructorTestParameters.length; i++) { ECFieldF2mDomainParams tp = constructorTestParameters[i]; @@ -308,11 +290,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: IllegalArgumentException if rp is invalid. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - method = "ECFieldF2m", - args = {int.class, java.math.BigInteger.class} - ) public final void testECFieldF2mintBigInteger() { for(int i=0; i<constructorTestParameters.length; i++) { ECFieldF2mDomainParams tp = constructorTestParameters[i]; @@ -343,12 +320,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: must return the same value if invoked * repeatedly on the same object. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode01() { ECFieldF2m f = new ECFieldF2m(2000); int hc = f.hashCode(); @@ -368,12 +339,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: must return the same value if invoked * repeatedly on the same object. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode02() { ECFieldF2m f = new ECFieldF2m(2000, new int[] {981, 2, 1}); int hc = f.hashCode(); @@ -393,12 +358,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: must return the same value if invoked * on equal (according to the <code>equals(Object)</code> method) objects. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode03() { assertTrue(new ECFieldF2m(111).hashCode() == new ECFieldF2m(111).hashCode()); @@ -410,12 +369,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: must return the same value if invoked * on equal (according to the <code>equals(Object)</code> method) objects. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode04() { assertTrue(new ECFieldF2m(2000, new int[] {981, 2, 1}).hashCode() == new ECFieldF2m(2000, new int[] {981, 2, 1}).hashCode()); @@ -427,12 +380,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: must return the same value if invoked * on equal (according to the <code>equals(Object)</code> method) objects. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode05() { assertTrue(new ECFieldF2m(2000, new int[] {981, 2, 1}).hashCode() == new ECFieldF2m(2000, BigInteger.valueOf(0L). @@ -445,12 +392,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: object equals to itself. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject01() { ECFieldF2m obj = new ECFieldF2m(1999, new int[] {367}); assertTrue(obj.equals(obj)); @@ -461,12 +402,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: normal basis - objects equal if their m are equal. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Simple test. Doesn't verify other cases.", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject02() { assertTrue(new ECFieldF2m(43).equals(new ECFieldF2m(43))); } @@ -477,12 +412,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: trinomial basis - objects equal if their m, and rp * are mutually equal. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject03() { assertTrue(new ECFieldF2m(1999, new int[] {367}).equals( new ECFieldF2m(1999, BigInteger.valueOf(0L). @@ -495,12 +424,6 @@ public class ECFieldF2mTest extends TestCase { * Assertion: pentanomial basis - objects equal if their m, and rp * are mutually equal. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject04() { ECFieldF2m f1 = new ECFieldF2m(2000, new int[] {981, 2, 1}); ECFieldF2m f2 = new ECFieldF2m(2000, BigInteger.valueOf(0L). @@ -514,12 +437,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: objects equal if their m, and rp are mutually equal. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject05() { ECFieldF2m f1 = new ECFieldF2m(2000); ECFieldF2m f2 = new ECFieldF2m(2000, BigInteger.valueOf(0L). @@ -533,12 +450,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns false if obj is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject06() { assertFalse(new ECFieldF2m(2000).equals(null)); } @@ -548,12 +459,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns false if obj is not instance of <code>ECFieldF2m</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject07() { assertFalse(new ECFieldF2m(2000).equals(new Object())); } @@ -563,12 +468,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns m value for <code>ECFieldF2m</code> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getFieldSize", - args = {} - ) public final void testGetFieldSize() { assertEquals(2000, new ECFieldF2m(2000).getFieldSize()); } @@ -578,12 +477,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns m value for <code>ECFieldF2m</code> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getM", - args = {} - ) public final void testGetM() { assertEquals(2000, new ECFieldF2m(2000).getM()); } @@ -593,12 +486,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns mid terms of reduction polynomial */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getMidTermsOfReductionPolynomial method returns mid terms of reduction polynomial.", - method = "getMidTermsOfReductionPolynomial", - args = {} - ) public final void testGetMidTermsOfReductionPolynomial01() { int[] a = new int[] {981,2,1}; int[] b = new ECFieldF2m(2000, @@ -613,12 +500,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns null for normal basis */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getMidTermsOfReductionPolynomial method returns null for normal basis.", - method = "getMidTermsOfReductionPolynomial", - args = {} - ) public final void testGetMidTermsOfReductionPolynomial02() { assertNull(new ECFieldF2m(2000).getMidTermsOfReductionPolynomial()); } @@ -628,12 +509,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns mid terms of reduction polynomial */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getMidTermsOfReductionPolynomial method returns mid terms of reduction polynomial.", - method = "getMidTermsOfReductionPolynomial", - args = {} - ) public final void testGetMidTermsOfReductionPolynomial03() { int[] a = new int[] {367}; int[] b = new ECFieldF2m(1999, a).getMidTermsOfReductionPolynomial(); @@ -645,12 +520,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns reduction polynomial */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getReductionPolynomial method returns reduction polynomial.", - method = "getReductionPolynomial", - args = {} - ) public final void testGetReductionPolynomial01() { BigInteger rp = BigInteger.valueOf(0L).setBit(0).setBit(1).setBit(2). setBit(981).setBit(2000); @@ -662,12 +531,6 @@ public class ECFieldF2mTest extends TestCase { * * Assertion: returns null for normal basis */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getReductionPolynomial method returns null for normal basis.", - method = "getReductionPolynomial", - args = {} - ) public final void testGetReductionPolynomial02() { assertNull(new ECFieldF2m(2000).getReductionPolynomial()); } @@ -676,12 +539,6 @@ public class ECFieldF2mTest extends TestCase { * Tests that object state is preserved against modifications * through array reference passed to the constructor. */ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that object state is preserved against modifications through array reference passed to the constructor.", - method = "ECFieldF2m", - args = {int.class, int[].class} - ) public final void testIsStatePreserved01() { // reference array int[] a = new int[] {367}; @@ -700,20 +557,6 @@ public class ECFieldF2mTest extends TestCase { * modifications through array reference returned by * <code>getMidTermsOfReductionPolynomial()</code> method. */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that object state is preserved against modifications through array reference returned by getMidTermsOfReductionPolynomial() method.", - method = "ECFieldF2m", - args = {int.class, int[].class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL, - notes = "Verifies that object state is preserved against modifications through array reference returned by getMidTermsOfReductionPolynomial() method.", - method = "getMidTermsOfReductionPolynomial", - args = {} - ) - }) public final void testIsStatePreserved02() { // reference array int[] a = new int[] {981,2,1}; diff --git a/luni/src/test/java/tests/security/spec/ECFieldFpTest.java b/luni/src/test/java/tests/security/spec/ECFieldFpTest.java index aacb4b3..838ead0 100644 --- a/luni/src/test/java/tests/security/spec/ECFieldFpTest.java +++ b/luni/src/test/java/tests/security/spec/ECFieldFpTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -36,7 +31,6 @@ import java.security.spec.ECFieldFp; * Tests for <code>ECFieldFp</code> class fields and methods. * */ -@TestTargetClass(ECFieldFp.class) public class ECFieldFpTest extends TestCase { // @@ -49,12 +43,6 @@ public class ECFieldFpTest extends TestCase { * Assertion: creates new object of <code>ECFieldFp</code> class * using valid <code>p</code> (odd prime) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECFieldFp", - args = {java.math.BigInteger.class} - ) public final void testECFieldFp01() { new ECFieldFp(BigInteger.valueOf(23L)); } @@ -65,12 +53,6 @@ public class ECFieldFpTest extends TestCase { * Assertion: creates new object of <code>ECFieldFp</code> class * using valid <code>p</code> (odd but not prime) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECFieldFp", - args = {java.math.BigInteger.class} - ) public final void testECFieldFp02() { new ECFieldFp(BigInteger.valueOf(21L)); } @@ -80,12 +62,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: IllegalArgumentException if <code>p</code> is not positive */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECFieldFp", - args = {java.math.BigInteger.class} - ) public final void testECFieldFp03() { try { new ECFieldFp(BigInteger.valueOf(-1L)); @@ -100,12 +76,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: IllegalArgumentException if <code>p</code> is not positive */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECFieldFp", - args = {java.math.BigInteger.class} - ) public final void testECFieldFp04() { try { new ECFieldFp(BigInteger.valueOf(0L)); @@ -120,12 +90,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: NullPointerException if <code>p</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECFieldFp", - args = {java.math.BigInteger.class} - ) public final void testECFieldFp05() { try { new ECFieldFp(null); @@ -141,12 +105,6 @@ public class ECFieldFpTest extends TestCase { * Assertion: must return the same value if invoked * repeatedly on the same object. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode01() { ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); int hc = f.hashCode(); @@ -166,12 +124,6 @@ public class ECFieldFpTest extends TestCase { * Assertion: must return the same value if invoked * on equal (according to the <code>equals(Object)</code> method) objects. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode02() { assertTrue(new ECFieldFp(BigInteger.valueOf(23L)).hashCode() == new ECFieldFp(BigInteger.valueOf(23L)).hashCode()); @@ -182,12 +134,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: returns field size in bits which is prime size */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getFieldSize", - args = {} - ) public final void testGetFieldSize() { assertEquals(5, new ECFieldFp(BigInteger.valueOf(23L)).getFieldSize()); } @@ -197,12 +143,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: returns prime */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getP", - args = {} - ) public final void testGetP() { BigInteger p = BigInteger.valueOf(23L); assertTrue(p.equals(new ECFieldFp(p).getP())); @@ -213,12 +153,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: object equals to itself. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject01() { ECFieldFp obj = new ECFieldFp(BigInteger.valueOf(23L)); assertTrue(obj.equals(obj)); @@ -229,12 +163,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: returns false if <code>obj</code> is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject02() { assertFalse(new ECFieldFp(BigInteger.valueOf(23L)).equals(null)); } @@ -245,12 +173,6 @@ public class ECFieldFpTest extends TestCase { * Assertion: returns false if <code>obj</code> * is not instance of <code>ECFieldFp</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject03() { assertFalse(new ECFieldFp(BigInteger.valueOf(23L)).equals(new Object())); } @@ -260,12 +182,6 @@ public class ECFieldFpTest extends TestCase { * * Assertion: true if prime values match. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject04() { assertTrue(new ECFieldFp(BigInteger.valueOf(23L)).equals( new ECFieldFp(BigInteger.valueOf(23L)))); diff --git a/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java b/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java index 343d4ce..f3a3913 100644 --- a/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java +++ b/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.ECGenParameterSpec; @@ -35,7 +30,6 @@ import java.security.spec.ECGenParameterSpec; * Tests for <code>ECGenParameterSpec</code> class fields and methods. * */ -@TestTargetClass(ECGenParameterSpec.class) public class ECGenParameterSpecTest extends TestCase { // @@ -48,12 +42,6 @@ public class ECGenParameterSpecTest extends TestCase { * Assertion: creates new object of <code>ECGenParameterSpec</code> class * using valid <code>name</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECGenParameterSpec", - args = {java.lang.String.class} - ) public final void testECGenParameterSpec01() { new ECGenParameterSpec("someName"); } @@ -64,12 +52,6 @@ public class ECGenParameterSpecTest extends TestCase { * Assertion: throws NullPointerException * if <code>name</code> is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "ECGenParameterSpec", - args = {java.lang.String.class} - ) public final void testECGenParameterSpec02() { try { new ECGenParameterSpec(null); @@ -82,12 +64,6 @@ public class ECGenParameterSpecTest extends TestCase { * * Assertion: returns the <code>name</code> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getName", - args = {} - ) public final void testGetName() { String name = "someName"; ECGenParameterSpec ps = new ECGenParameterSpec(name); diff --git a/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java b/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java index 3b4b9a3..cb1c66e 100644 --- a/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java +++ b/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java @@ -16,11 +16,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -29,7 +24,6 @@ import java.security.spec.ECParameterSpec; import java.security.spec.ECPoint; import java.security.spec.EllipticCurve; -@TestTargetClass(ECParameterSpec.class) public class ECParameterSpecTest extends TestCase { EllipticCurve curve; @@ -63,12 +57,6 @@ public class ECParameterSpecTest extends TestCase { * case 5: IllegalArgumentException - if n is not positive * case 6: IllegalArgumentException - if h is not positive */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ECParameterSpec", - args = {java.security.spec.EllipticCurve.class, java.security.spec.ECPoint.class, java.math.BigInteger.class, int.class} - ) public void test_constructorLjava_security_spec_EllipticCurveLjava_security_spec_ECPointLjava_math_BigIntegerI() { // case 1: creating object with valid parameters @@ -123,12 +111,6 @@ public class ECParameterSpecTest extends TestCase { /** * test for getCurve() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCurve", - args = {} - ) public void test_GetCurve() { assertEquals("wrong elliptic curve", curve, ecps.getCurve()); } @@ -136,12 +118,6 @@ public class ECParameterSpecTest extends TestCase { /** * test for getGenerator() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getGenerator", - args = {} - ) public void test_GetGenerator() { assertEquals("wrong generator was returned", ecpoint, ecps .getGenerator()); @@ -150,12 +126,6 @@ public class ECParameterSpecTest extends TestCase { /** * test for getOrder() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getOrder", - args = {} - ) public void test_GetOrder() { assertEquals("wrong order was reteurned", BigInteger.valueOf(1), ecps .getOrder()); @@ -164,12 +134,6 @@ public class ECParameterSpecTest extends TestCase { /** * test for getCofactor() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCofactor", - args = {} - ) public void test_GetCofactor() { assertEquals("wrong cofactor was returned", 1, ecps.getCofactor()); } diff --git a/luni/src/test/java/tests/security/spec/ECPointTest.java b/luni/src/test/java/tests/security/spec/ECPointTest.java index 515e62c..e240f3c 100644 --- a/luni/src/test/java/tests/security/spec/ECPointTest.java +++ b/luni/src/test/java/tests/security/spec/ECPointTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -36,7 +31,6 @@ import java.security.spec.ECPoint; * Tests for <code>ECPoint</code> class fields and methods. * */ -@TestTargetClass(ECPoint.class) public class ECPointTest extends TestCase { // @@ -49,12 +43,6 @@ public class ECPointTest extends TestCase { * Test preconditions: valid parameters passed<br> * Expected: must pass without any exceptions */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive cases.", - method = "ECPoint", - args = {java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testECPoint01() { new ECPoint(BigInteger.ZERO, BigInteger.ZERO); new ECPoint(BigInteger.valueOf(-23456L), BigInteger.valueOf(-23456L)); @@ -70,12 +58,6 @@ public class ECPointTest extends TestCase { * Test preconditions: pass <code>null</code> as mentioned parameters<br> * Expected: must throw <code>NullPointerException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies exceptions.", - method = "ECPoint", - args = {java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testECPoint02() { // test case 1: x is null try { @@ -110,12 +92,6 @@ public class ECPointTest extends TestCase { * which is equal to the one passed to the constructor; * (both must refer the same object) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getAffineX", - args = {} - ) public final void testGetAffineX01() { BigInteger x = BigInteger.valueOf(-23456L); ECPoint p = new ECPoint(x, BigInteger.valueOf(23456L)); @@ -131,12 +107,6 @@ public class ECPointTest extends TestCase { * Expected: must return <code>null</code> for * <code>ECPoint.POINT_INFINITY</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getAffineX returns null for POINT_INFINITY.", - method = "getAffineX", - args = {} - ) public final void testGetAffineX02() { assertNull(ECPoint.POINT_INFINITY.getAffineX()); } @@ -150,12 +120,6 @@ public class ECPointTest extends TestCase { * which is equal to the one passed to the constructor; * (both must refer the same object) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive functionality.", - method = "getAffineY", - args = {} - ) public final void testGetAffineY01() { BigInteger y = BigInteger.valueOf(23456L); ECPoint p = new ECPoint(BigInteger.valueOf(-23456L), y); @@ -171,12 +135,6 @@ public class ECPointTest extends TestCase { * Expected: must return <code>null</code> for * <code>ECPoint.POINT_INFINITY</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getAffineY ruturns null for POINT_INFINITY.", - method = "getAffineY", - args = {} - ) public final void testGetAffineY02() { assertNull(ECPoint.POINT_INFINITY.getAffineY()); } @@ -187,12 +145,6 @@ public class ECPointTest extends TestCase { * Test preconditions: see test comments<br> * Expected: all objects in this test must be equal */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive cases.", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject01() { // test case 1: must be equal to itself ECPoint p2=null, p1 = @@ -216,12 +168,6 @@ public class ECPointTest extends TestCase { * Test preconditions: see test comments<br> * Expected: all objects in this test must be not equal */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies negative cases.", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject02() { // test case 1: must be not equal to null ECPoint p2=null, p1 = @@ -250,12 +196,6 @@ public class ECPointTest extends TestCase { * Assertion: must return the same value if invoked * repeatedly on the same object. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode01() { ECPoint f = new ECPoint(BigInteger.valueOf(-23457L), BigInteger.ONE); int hc = f.hashCode(); @@ -287,12 +227,6 @@ public class ECPointTest extends TestCase { * Assertion: must return the same value if invoked * on equal (according to the <code>equals(Object)</code> method) objects. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode02() { ECPoint p1 = new ECPoint(BigInteger.valueOf(-23456L), BigInteger.ONE); ECPoint p2 = new ECPoint(BigInteger.valueOf(-23456L), BigInteger.valueOf(1L)); diff --git a/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java b/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java index 2dd7c14..a3db5a7 100644 --- a/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java @@ -16,11 +16,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -30,7 +25,6 @@ import java.security.spec.ECPoint; import java.security.spec.ECPrivateKeySpec; import java.security.spec.EllipticCurve; -@TestTargetClass(ECPrivateKeySpec.class) public class ECPrivateKeySpecTest extends TestCase { BigInteger s; @@ -66,12 +60,6 @@ public class ECPrivateKeySpecTest extends TestCase { * case 2: catch NullPointerException - if s is null. * case 3: catch NullPointerException - if params is null. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ECPrivateKeySpec", - args = {java.math.BigInteger.class, java.security.spec.ECParameterSpec.class} - ) public void test_constructorLjava_math_BigIntegerLjava_security_spec_ECParameterSpec() { // case 1: creating object with valid parameters @@ -98,12 +86,6 @@ public class ECPrivateKeySpecTest extends TestCase { /** * test for getS() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getS", - args = {} - ) public void test_GetS() { assertEquals("wrong private value", s, ecpks.getS()); } @@ -111,12 +93,6 @@ public class ECPrivateKeySpecTest extends TestCase { /** * test for getParams() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getParams", - args = {} - ) public void test_GetParams() { assertEquals("wrong parameters", ecparams, ecpks.getParams()); } diff --git a/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java b/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java index 618d6f5..abac7a2 100644 --- a/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java @@ -16,11 +16,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -30,7 +25,6 @@ import java.security.spec.ECPoint; import java.security.spec.ECPublicKeySpec; import java.security.spec.EllipticCurve; -@TestTargetClass(ECPublicKeySpec.class) public class ECPublicKeySpecTest extends TestCase { ECPoint w; @@ -64,12 +58,6 @@ public class ECPublicKeySpecTest extends TestCase { * case 2: catch NullPointerException - if w is null. * case 3: catch NullPointerException - if params is null. */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "ECPublicKeySpec", - args = {java.security.spec.ECPoint.class, java.security.spec.ECParameterSpec.class} - ) public final void test_constructorLjava_security_spec_ECPointLjava_security_spec_ECParameterSpec() { // case 1: creating object with valid parameters @@ -96,12 +84,6 @@ public class ECPublicKeySpecTest extends TestCase { /** * test for getW() method */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getW", - args = {} - ) public final void testGetW() { assertEquals("wrong w value", w, ecpks.getW()); } @@ -109,12 +91,6 @@ public class ECPublicKeySpecTest extends TestCase { /** * test for getParams() meyhod */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getParams", - args = {} - ) public final void testGetParams() { assertEquals("wrong params value", params, ecpks.getParams()); } diff --git a/luni/src/test/java/tests/security/spec/EllipticCurveTest.java b/luni/src/test/java/tests/security/spec/EllipticCurveTest.java index a26532d..cd090c6 100644 --- a/luni/src/test/java/tests/security/spec/EllipticCurveTest.java +++ b/luni/src/test/java/tests/security/spec/EllipticCurveTest.java @@ -17,11 +17,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -35,7 +30,6 @@ import java.util.Arrays; * Tests for <code>EllipticCurve</code> class fields and methods. * */ -@TestTargetClass(EllipticCurve.class) public class EllipticCurveTest extends TestCase { /** @@ -45,12 +39,6 @@ public class EllipticCurveTest extends TestCase { * Test preconditions: valid parameters passed<br> * Expected: must pass without any exceptions */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive cases.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class} - ) public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01() { // test case 1 parameters set ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); @@ -85,12 +73,6 @@ public class EllipticCurveTest extends TestCase { * Test preconditions: pass <code>null</code> as mentioned parameters<br> * Expected: must throw <code>NullPointerException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class} - ) public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray02() { // test case 1 parameters set ECFieldFp f = null; @@ -137,12 +119,6 @@ public class EllipticCurveTest extends TestCase { * not in the <code>field</code> of type <code>ECFieldFp</code><br> * Expected: must throw <code>IllegalArgumentException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class} - ) public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray03() { // test case 1 parameters set, // a is not in field @@ -204,12 +180,6 @@ public class EllipticCurveTest extends TestCase { * not in the <code>field</code> of type <code>ECFieldF2m</code><br> * Expected: must throw <code>IllegalArgumentException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class} - ) public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray04() { // test case 1 parameters set, // a is not in field @@ -256,12 +226,6 @@ public class EllipticCurveTest extends TestCase { * Test preconditions: pass <code>seed</code> to the ctor then modify it<br> * Expected: getSeed() must return unmodified array */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that byte array of EllipticCurve can't be modified", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class} - ) public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray05() { ECFieldF2m f = new ECFieldF2m(5); BigInteger a = BigInteger.valueOf(0L); @@ -283,12 +247,6 @@ public class EllipticCurveTest extends TestCase { * Test preconditions: valid parameters passed, field type is ECFieldFp<br> * Expected: must pass without any exceptions */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Doesn't verify exceptions.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testEllipticCurveECFieldBigIntegerBigInteger01() { // test case 1 parameters set ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); @@ -321,12 +279,6 @@ public class EllipticCurveTest extends TestCase { * Test preconditions: pass <code>null</code> as mentioned parameters<br> * Expected: must throw <code>NullPointerException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testEllipticCurveECFieldBigIntegerBigInteger02() { // test case 1 parameters set ECFieldFp f = null; @@ -370,12 +322,6 @@ public class EllipticCurveTest extends TestCase { * not in the <code>field</code> of type <code>ECFieldFp</code><br> * Expected: must throw <code>IllegalArgumentException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testEllipticCurveECFieldBigIntegerBigInteger03() { // test case 1 parameters set, // a is not in field @@ -433,12 +379,6 @@ public class EllipticCurveTest extends TestCase { * not in the <code>field</code> of type <code>ECFieldF2m</code><br> * Expected: must throw <code>IllegalArgumentException</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testEllipticCurveECFieldBigIntegerBigInteger04() { // test case 1 parameters set, // a is not in field @@ -483,12 +423,6 @@ public class EllipticCurveTest extends TestCase { * to the one passed to the constructor; (both must refer * the same object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getA", - args = {} - ) public final void testGetA() { ECFieldF2m f = new ECFieldF2m(5); BigInteger a = BigInteger.valueOf(5L); @@ -499,14 +433,8 @@ public class EllipticCurveTest extends TestCase { } /** - * @tests java/security/spec/EllipticCurve#EllipticCurve(EcField,BigInteger,BigInteger) + * java/security/spec/EllipticCurve#EllipticCurve(EcField,BigInteger,BigInteger) */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Regression test.", - method = "EllipticCurve", - args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testEllipticCurveECFieldBigIntegerBigInteger05() { // Regression for Harmony-731 EllipticCurve ec = new EllipticCurve(new testECField(), BigInteger @@ -525,12 +453,6 @@ public class EllipticCurveTest extends TestCase { * to the one passed to the constructor; (both must refer * the same object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getB", - args = {} - ) public final void testGetB() { ECFieldF2m f = new ECFieldF2m(5); BigInteger a = BigInteger.valueOf(5L); @@ -549,12 +471,6 @@ public class EllipticCurveTest extends TestCase { * to the one passed to the constructor; (both must refer * the same object) */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getField", - args = {} - ) public final void testGetField() { ECFieldF2m f = new ECFieldF2m(5); BigInteger a = BigInteger.valueOf(5L); @@ -572,12 +488,6 @@ public class EllipticCurveTest extends TestCase { * Expected: must return <code>seed</code> which is equal * to the one passed to the constructor */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getSeed", - args = {} - ) public final void testGetSeed01() { ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); BigInteger a = BigInteger.ONE; @@ -597,12 +507,6 @@ public class EllipticCurveTest extends TestCase { * called and then returned array modified<br> * Expected: internal state must not be affected by the modification */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that modification of byte array doesn't change internal state of test object.", - method = "getSeed", - args = {} - ) public final void testGetSeed02() { ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); BigInteger a = BigInteger.ONE; @@ -624,12 +528,6 @@ public class EllipticCurveTest extends TestCase { * created using valid parameters<br> * Expected: repeated method calls must return different refs */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that repeated calls of getSeed method must return different refs.", - method = "getSeed", - args = {} - ) public final void testGetSeed03() { ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); BigInteger a = BigInteger.ONE; @@ -641,15 +539,9 @@ public class EllipticCurveTest extends TestCase { } /** - * @tests java.security.spec.EllipticCurve#getSeed() + * java.security.spec.EllipticCurve#getSeed() * Assertion: null if not specified */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Regression test.", - method = "getSeed", - args = {} - ) public final void testGetSeed04() { //Regression for HARMONY-732 ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L)); @@ -663,12 +555,6 @@ public class EllipticCurveTest extends TestCase { * Test preconditions: see test comments<br> * Expected: all objects in this test must be equal */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "equals", - args = {java.lang.Object.class} - ) public final void testEqualsObject01() { // test case 1: must be equal to itself EllipticCurve c2 = null, c1 = new EllipticCurve(new ECFieldFp( @@ -712,12 +598,6 @@ public class EllipticCurveTest extends TestCase { * Assertion: must return the same value if invoked * repeatedly on the same object. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that several calls of hashCode method for the same objects return the same values.", - method = "hashCode", - args = {} - ) public final void testHashCode01() { int hc = 0; EllipticCurve f = new EllipticCurve(new ECFieldFp(BigInteger @@ -736,12 +616,6 @@ public class EllipticCurveTest extends TestCase { * Assertion: must return the same value if invoked * on equal (according to the <code>equals(Object)</code> method) objects. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "hashCode", - args = {} - ) public final void testHashCode02() { assertEquals(new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)), BigInteger.ONE, BigInteger.valueOf(19L), new byte[24]) diff --git a/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java b/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java index 8cbab69..edb801e 100644 --- a/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java +++ b/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java @@ -17,11 +17,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.Key; @@ -34,18 +29,11 @@ import java.security.spec.EncodedKeySpec; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; -@TestTargetClass(EncodedKeySpec.class) public class EncodedKeySpec2Test extends TestCase { /** - * @tests java.security.spec.EncodedKeySpec#getEncoded() + * java.security.spec.EncodedKeySpec#getEncoded() */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public void test_getEncoded() throws Exception { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA"); diff --git a/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java b/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java index 32f2282..d97b37d 100644 --- a/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java @@ -22,10 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetClass; -import dalvik.annotation.TestTargetNew; - import junit.framework.TestCase; import org.apache.harmony.security.tests.support.spec.MyEncodedKeySpec; @@ -37,18 +33,11 @@ import java.util.Arrays; * Tests for <code>EncodedKeySpec</code> class fields and methods. * */ -@TestTargetClass(EncodedKeySpec.class) public class EncodedKeySpecTest extends TestCase { /** * Tests for constructor <code>EncodedKeySpec(byte[])</code><br> */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "EncodedKeySpec", - args = {byte[].class} - ) public final void testEncodedKeySpec() { byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 }; EncodedKeySpec eks = new MyEncodedKeySpec(encodedKey); @@ -69,12 +58,6 @@ public class EncodedKeySpecTest extends TestCase { /** * Tests that <code>getEncoded()</code> method returns valid byte array */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testGetEncoded() { byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 }; @@ -99,12 +82,6 @@ public class EncodedKeySpecTest extends TestCase { * Tests that internal state of the object can not be modified by modifying * initial array value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testIsStatePreserved1() { /* Create initial byte array */ byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 }; @@ -125,12 +102,6 @@ public class EncodedKeySpecTest extends TestCase { * Tests that internal state of the object can not be modified using * returned value of <code>getEncoded()</code> method */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testIsStatePreserved2() { byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 }; diff --git a/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java b/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java index 82523e5..f766d7e 100644 --- a/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java +++ b/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.InvalidKeySpecException; @@ -36,7 +31,6 @@ import java.security.spec.InvalidKeySpecException; * methods. * */ -@TestTargetClass(InvalidKeySpecException.class) public class InvalidKeySpecExceptionTest extends TestCase { private static String[] msgs = { @@ -50,12 +44,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * Test for <code>InvalidKeySpecException()</code> constructor Assertion: * constructs InvalidKeySpecException with no detail message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "InvalidKeySpecException", - args = {} - ) public void testInvalidKeySpecException01() { InvalidKeySpecException tE = new InvalidKeySpecException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -67,12 +55,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * Assertion: constructs InvalidKeySpecException with detail message msg. * Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "InvalidKeySpecException", - args = {java.lang.String.class} - ) public void testInvalidKeySpecException02() { InvalidKeySpecException tE; for (int i = 0; i < msgs.length; i++) { @@ -88,12 +70,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * Assertion: constructs InvalidKeySpecException when <code>msg</code> is * null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "InvalidKeySpecException", - args = {java.lang.String.class} - ) public void testInvalidKeySpecException03() { String msg = null; InvalidKeySpecException tE = new InvalidKeySpecException(msg); @@ -106,12 +82,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * Assertion: constructs InvalidKeySpecException when <code>cause</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "InvalidKeySpecException", - args = {java.lang.Throwable.class} - ) public void testInvalidKeySpecException04() { Throwable cause = null; InvalidKeySpecException tE = new InvalidKeySpecException(cause); @@ -124,12 +94,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * Assertion: constructs InvalidKeySpecException when <code>cause</code> * is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive cases.", - method = "InvalidKeySpecException", - args = {java.lang.Throwable.class} - ) public void testInvalidKeySpecException05() { InvalidKeySpecException tE = new InvalidKeySpecException(tCause); if (tE.getMessage() != null) { @@ -148,12 +112,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * constructor Assertion: constructs InvalidKeySpecException when * <code>cause</code> is null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "InvalidKeySpecException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testInvalidKeySpecException06() { InvalidKeySpecException tE = new InvalidKeySpecException(null, null); assertNull("getMessage() must return null", tE.getMessage()); @@ -165,12 +123,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * constructor Assertion: constructs InvalidKeySpecException when * <code>cause</code> is null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a cause parameter.", - method = "InvalidKeySpecException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testInvalidKeySpecException07() { InvalidKeySpecException tE; for (int i = 0; i < msgs.length; i++) { @@ -186,12 +138,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * constructor Assertion: constructs InvalidKeySpecException when * <code>cause</code> is not null <code>msg</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a message parameter.", - method = "InvalidKeySpecException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testInvalidKeySpecException08() { InvalidKeySpecException tE = new InvalidKeySpecException(null, tCause); if (tE.getMessage() != null) { @@ -210,12 +156,6 @@ public class InvalidKeySpecExceptionTest extends TestCase { * constructor Assertion: constructs InvalidKeySpecException when * <code>cause</code> is not null <code>msg</code> is not null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "InvalidKeySpecException", - args = {java.lang.String.class, java.lang.Throwable.class} - ) public void testInvalidKeySpecException09() { InvalidKeySpecException tE; for (int i = 0; i < msgs.length; i++) { diff --git a/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java b/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java index 385696e..daba495 100644 --- a/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java +++ b/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.InvalidParameterSpecException; @@ -36,7 +31,6 @@ import java.security.spec.InvalidParameterSpecException; * methods. * */ -@TestTargetClass(InvalidParameterSpecException.class) public class InvalidParameterSpecExceptionTest extends TestCase { static String[] msgs = { @@ -51,12 +45,6 @@ public class InvalidParameterSpecExceptionTest extends TestCase { * Assertion: constructs InvalidParameterSpecException with no detail * message */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "InvalidParameterSpecException", - args = {} - ) public void testInvalidParameterSpecException01() { InvalidParameterSpecException tE = new InvalidParameterSpecException(); assertNull("getMessage() must return null.", tE.getMessage()); @@ -68,12 +56,6 @@ public class InvalidParameterSpecExceptionTest extends TestCase { * Assertion: constructs InvalidParameterSpecException with detail message * msg. Parameter <code>msg</code> is not null. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "InvalidParameterSpecException", - args = {java.lang.String.class} - ) public void testInvalidParameterSpecException02() { InvalidParameterSpecException tE; for (int i = 0; i < msgs.length; i++) { @@ -89,12 +71,6 @@ public class InvalidParameterSpecExceptionTest extends TestCase { * Assertion: constructs InvalidParameterSpecException when <code>msg</code> * is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "InvalidParameterSpecException", - args = {java.lang.String.class} - ) public void testInvalidParameterSpecException03() { String msg = null; InvalidParameterSpecException tE = new InvalidParameterSpecException( diff --git a/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java b/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java index d92346a..178fcce 100644 --- a/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java +++ b/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.MGF1ParameterSpec; @@ -35,7 +30,6 @@ import java.security.spec.MGF1ParameterSpec; * Test for MGF1ParameterSpec class * */ -@TestTargetClass(MGF1ParameterSpec.class) public class MGF1ParameterSpecTest extends TestCase { /** @@ -52,12 +46,6 @@ public class MGF1ParameterSpecTest extends TestCase { * Assertion: constructs new <code>MGF1ParameterSpec</code> * object using valid parameter */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "MGF1ParameterSpec", - args = {java.lang.String.class} - ) public final void testMGF1ParameterSpec01() { try { MGF1ParameterSpec pgf = new MGF1ParameterSpec(testAlgName); @@ -72,12 +60,6 @@ public class MGF1ParameterSpecTest extends TestCase { * Test #2 for <code>MGF1ParameterSpec</code> constructor<br> * Assertion: <code>NullPointerException</code> if parameter is <code>null</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "MGF1ParameterSpec", - args = {java.lang.String.class} - ) public final void testMGF1ParameterSpec02() { try { new MGF1ParameterSpec(null); @@ -92,12 +74,6 @@ public class MGF1ParameterSpecTest extends TestCase { * Assertion: returns the algorithm name of the message * digest used by the mask generation function */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getDigestAlgorithm", - args = {} - ) public final void testGetDigestAlgorithm() { MGF1ParameterSpec aps = new MGF1ParameterSpec(testAlgName); assertTrue(testAlgName.equals(aps.getDigestAlgorithm())); @@ -108,32 +84,6 @@ public class MGF1ParameterSpecTest extends TestCase { * Assertion: returns the algorithm name of the message * digest used by the mask generation function */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Field testing", - method = "!field SHA1", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Field testing", - method = "!field SHA256", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Field testing", - method = "!field SHA384", - args = {} - ), - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "Field testing", - method = "!field SHA512", - args = {} - ) - }) public final void testFieldsGetDigestAlgorithm() { assertEquals("SHA-1", MGF1ParameterSpec.SHA1.getDigestAlgorithm()); diff --git a/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java b/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java index 5e86384..41a5d33 100644 --- a/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.EncodedKeySpec; @@ -37,7 +32,6 @@ import java.util.Arrays; * Tests for <code>PKCS8EncodedKeySpec</code> class fields and methods. * */ -@TestTargetClass(PKCS8EncodedKeySpec.class) public class PKCS8EncodedKeySpecTest extends TestCase { // @@ -49,12 +43,6 @@ public class PKCS8EncodedKeySpecTest extends TestCase { * Assertion: constructs new <code>PKCS8EncodedKeySpec</code> * object using valid parameter */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "PKCS8EncodedKeySpec", - args = {byte[].class} - ) public final void testPKCS8EncodedKeySpec() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -73,12 +61,6 @@ public class PKCS8EncodedKeySpecTest extends TestCase { * Test for <code>getEncoded()</code> method<br> * Assertion: returns encoded key */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testGetEncoded() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -93,12 +75,6 @@ public class PKCS8EncodedKeySpecTest extends TestCase { * Test for <code>getFormat()</code> method * Assertion: returns format name (always "PKCS#8") */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getFormat", - args = {} - ) public final void testGetFormat() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -112,12 +88,6 @@ public class PKCS8EncodedKeySpecTest extends TestCase { * can not be changed by modifying initial * array value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testIsStatePreserved1() { // Reference array byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -142,12 +112,6 @@ public class PKCS8EncodedKeySpecTest extends TestCase { * can not be modified using returned value * of <code>getEncoded()</code> method */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testIsStatePreserved2() { // Reference array byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; diff --git a/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java b/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java index 1dad00a..6e720d3 100644 --- a/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java +++ b/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.AlgorithmParameterSpec; @@ -37,7 +32,6 @@ import java.security.spec.PSSParameterSpec; * Tests for <code>PSSParameterSpec</code> class (1.5) * */ -@TestTargetClass(PSSParameterSpec.class) public class PSSParameterSpecTest extends TestCase { /** @@ -45,12 +39,6 @@ public class PSSParameterSpecTest extends TestCase { * Assertion: constructs using valid parameter * <code>PSSParameterSpec<code> object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameter.", - method = "PSSParameterSpec", - args = {int.class} - ) public final void testPSSParameterSpec0101() { AlgorithmParameterSpec aps = new PSSParameterSpec(20); assertTrue(aps instanceof PSSParameterSpec); @@ -62,12 +50,6 @@ public class PSSParameterSpecTest extends TestCase { * throws <code>IllegalArgumentException</code> * if <code>saltLen</code> less than 0 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "PSSParameterSpec", - args = {int.class} - ) public final void testPSSParameterSpec0102() { try { new PSSParameterSpec(-1); @@ -84,12 +66,6 @@ public class PSSParameterSpecTest extends TestCase { * Assertion: constructs using valid parameters * <code>PSSParameterSpec<code> object */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameters.", - method = "PSSParameterSpec", - args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class} - ) public final void testPSSParameterSpec0201() { AlgorithmParameterSpec aps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1); @@ -105,12 +81,6 @@ public class PSSParameterSpecTest extends TestCase { * throws <code>NullPointerException</code> * if <code>mdName</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "PSSParameterSpec", - args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class} - ) public final void testPSSParameterSpec0202() { try { new PSSParameterSpec(null, "MGF1", MGF1ParameterSpec.SHA1, 20, 1); @@ -128,12 +98,6 @@ public class PSSParameterSpecTest extends TestCase { * throws <code>NullPointerException</code> * if <code>mgfName</code> is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "PSSParameterSpec", - args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class} - ) public final void testPSSParameterSpec0203() { try { new PSSParameterSpec("SHA-1", null, MGF1ParameterSpec.SHA1, 20, 1); @@ -151,12 +115,6 @@ public class PSSParameterSpecTest extends TestCase { * throws <code>IllegalArgumentException<code> * if <code>saltLen<code> less than 0 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "PSSParameterSpec", - args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class} - ) public final void testPSSParameterSpec0204() { try { new PSSParameterSpec("SHA-1", "MGF1", @@ -175,12 +133,6 @@ public class PSSParameterSpecTest extends TestCase { * throws <code>IllegalArgumentException</code> * if <code>trailerField</code> less than 0 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "PSSParameterSpec", - args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class} - ) public final void testPSSParameterSpec0205() { try { new PSSParameterSpec("SHA-1", "MGF1", @@ -198,12 +150,6 @@ public class PSSParameterSpecTest extends TestCase { * Assertion: <code>AlgorithmParameterSpec</code> can be null * */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as AlgorithmParameterSpec parameter.", - method = "PSSParameterSpec", - args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class} - ) public final void testPSSParameterSpec0206() { new PSSParameterSpec("SHA-1", "MGF1", null, 20, 1); } @@ -212,12 +158,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>getDigestAlgorithm()</code> method * Assertion: returns message digest algorithm name */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getDigestAlgorithm", - args = {} - ) public final void testGetDigestAlgorithm() { PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1); @@ -228,12 +168,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>getMGFAlgorithm()</code> method * Assertion: returns mask generation function algorithm name */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getMGFAlgorithm", - args = {} - ) public final void testGetMGFAlgorithm() { PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1); @@ -244,12 +178,6 @@ public class PSSParameterSpecTest extends TestCase { * Test #1 for <code>getMGFParameters()</code> method * Assertion: returns mask generation function parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getMGFParameters", - args = {} - ) public final void testGetMGFParameters01() { PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1); @@ -262,12 +190,6 @@ public class PSSParameterSpecTest extends TestCase { * if <code>null</code> had been passed as * AlgorithmParameterSpec parameter to the ctor */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as a parameter.", - method = "getMGFParameters", - args = {} - ) public final void testGetMGFParameters02() { PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", null, 20, 1); @@ -279,12 +201,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>getSaltLength()</code> method<br> * Assertion: returns salt length value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getSaltLength", - args = {} - ) public final void testGetSaltLength() { PSSParameterSpec pssps = new PSSParameterSpec(20); assertEquals(20, pssps.getSaltLength()); @@ -294,12 +210,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>getTrailerField()</code> method<br> * Assertion: returns trailer field value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getTrailerField", - args = {} - ) public final void testGetTrailerField() { PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1); @@ -310,12 +220,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>DEFAULT</code> field<br> * Assertion: default message digest algorithm name is "SHA-1" */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies the name of default message digest algorithm.", - method = "getDigestAlgorithm", - args = {} - ) public final void testDEFAULTmdName() { assertEquals("SHA-1", PSSParameterSpec.DEFAULT.getDigestAlgorithm()); } @@ -324,12 +228,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>DEFAULT</code> field<br> * Assertion: default mask generation function algorithm name is "MGF1" */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies the name of default mask generation function algorithm.", - method = "getMGFAlgorithm", - args = {} - ) public final void testDEFAULTmgfName() { assertEquals("MGF1", PSSParameterSpec.DEFAULT.getMGFAlgorithm()); } @@ -339,12 +237,6 @@ public class PSSParameterSpecTest extends TestCase { * Assertion: default algorithm parameters for mask * generation function are <code>MGF1ParameterSpec.SHA1</code> */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies default algorithm parameters for mask generation function.", - method = "getMGFParameters", - args = {} - ) public final void testDEFAULTmgfSpec() { assertTrue(MGF1ParameterSpec.SHA1.equals(PSSParameterSpec.DEFAULT.getMGFParameters())); } @@ -353,12 +245,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>DEFAULT</code> field<br> * Assertion: default salt length value is 20 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getSaltLength", - args = {} - ) public final void testDEFAULTsaltLen() { assertEquals(20, PSSParameterSpec.DEFAULT.getSaltLength()); } @@ -367,12 +253,6 @@ public class PSSParameterSpecTest extends TestCase { * Test for <code>DEFAULT</code> field<br> * Assertion: default trailer field value is 1 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies default trailer field value.", - method = "getTrailerField", - args = {} - ) public final void testDEFAULTtrailerField() { assertEquals(1, PSSParameterSpec.DEFAULT.getTrailerField()); } diff --git a/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java b/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java index ae8317c..929034a 100644 --- a/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java +++ b/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -37,7 +32,6 @@ import java.security.spec.RSAKeyGenParameterSpec; * Tests for <code>RSAKeyGenParameterSpec</code> class fields and methods. * */ -@TestTargetClass(RSAKeyGenParameterSpec.class) public class RSAKeyGenParameterSpecTest extends TestCase { /** @@ -45,12 +39,6 @@ public class RSAKeyGenParameterSpecTest extends TestCase { * Assertion: constructs <code>RSAKeyGenParameterSpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "RSAKeyGenParameterSpec", - args = {int.class, java.math.BigInteger.class} - ) public final void testRSAKeyGenParameterSpec() { AlgorithmParameterSpec aps = new RSAKeyGenParameterSpec(512, BigInteger.valueOf(0L)); @@ -61,12 +49,6 @@ public class RSAKeyGenParameterSpecTest extends TestCase { * Test for <code>getKeySize()</code> method<br> * Assertion: returns key size value */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getKeysize", - args = {} - ) public final void testGetKeysize() { RSAKeyGenParameterSpec rkgps = new RSAKeyGenParameterSpec(512, BigInteger.valueOf(0L)); @@ -77,12 +59,6 @@ public class RSAKeyGenParameterSpecTest extends TestCase { * Test for <code>getPublicExponent()</code> method<br> * Assertion: returns public exponent value */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) public final void testGetPublicExponent() { RSAKeyGenParameterSpec rkgps = new RSAKeyGenParameterSpec(512, BigInteger.valueOf(0L)); @@ -93,12 +69,6 @@ public class RSAKeyGenParameterSpecTest extends TestCase { * Test for <code>F0</code> field<br> * Assertion: the public exponent value F0 = 3 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Test for F0 field.", - method = "!Constants", - args = {} - ) public final void testF0Value() { assertEquals(3, RSAKeyGenParameterSpec.F0.intValue()); } @@ -107,12 +77,6 @@ public class RSAKeyGenParameterSpecTest extends TestCase { * Test for <code>F4</code> field<br> * Assertion: the public exponent value F0 = 65537 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Test for F4 field.", - method = "!Constants", - args = {} - ) public final void testF4Value() { assertEquals(65537, RSAKeyGenParameterSpec.F4.intValue()); } diff --git a/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java index 8a50f25..bb6bc87 100644 --- a/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -39,7 +34,6 @@ import java.security.spec.RSAPrivateKeySpec; * Tests for <code>RSAMultiPrimePrivateCrtKeySpec</code> class fields and methods. * */ -@TestTargetClass(RSAMultiPrimePrivateCrtKeySpec.class) public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { /** * Reference array of RSAOtherPrimeInfo. DO NOT MODIFY @@ -67,12 +61,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Assertion: constructs <code>RSAMultiPrimePrivateCrtKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameters.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec01() { KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, @@ -101,12 +89,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if modulus is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec02() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -138,12 +120,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if publicExponent is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec03() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -175,12 +151,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if privateExponent is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec04() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -212,12 +182,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if primeP is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec05() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -249,12 +213,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if primeQ is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec06() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -286,12 +244,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if primeExponentP is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec07() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -323,12 +275,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if primeExponentQ is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec08() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -360,12 +306,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: NullPointerException if crtCoefficient is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec09() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -397,12 +337,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: otherPrimeInfo can be null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null otherPrimeInfo.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec10() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -434,12 +368,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * </code> ctor<br> * Assertion: IllegalArgumentException if otherPrimeInfo length is 0 */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies IllegalArgumentException.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec11() { try { new RSAMultiPrimePrivateCrtKeySpec( @@ -473,12 +401,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * object using valid parameters. Constructed object must be * instance of RSAPrivateKeySpec. */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor using valid parameters. Constructed object must be instance of RSAPrivateKeySpec.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ) public final void testRSAMultiPrimePrivateCrtKeySpec12() { KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( BigInteger.ONE, @@ -497,12 +419,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getCrtCoefficient()</code> method<br> * Assertion: returns crt coefficient */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCrtCoefficient", - args = {} - ) public final void testGetCrtCoefficient() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -522,12 +438,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeExponentP()</code> method<br> * Assertion: returns prime exponent P */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentP", - args = {} - ) public final void testGetPrimeExponentP() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -547,12 +457,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeExponentQ()</code> method<br> * Assertion: returns prime exponent Q */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentQ", - args = {} - ) public final void testGetPrimeExponentQ() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -572,12 +476,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeP()</code> method<br> * Assertion: returns prime P */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeP", - args = {} - ) public final void testGetPrimeP() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -597,12 +495,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeQ()</code> method<br> * Assertion: returns prime Q */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeQ", - args = {} - ) public final void testGetPrimeQ() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -622,12 +514,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getPublicExponent()</code> method<br> * Assertion: returns public exponent */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) public final void testGetPublicExponent() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -647,12 +533,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test #1 for <code>getOtherPrimeInfo()</code> method<br> * Assertion: returns array of RSAOtherPrimeInfo */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies positive case.", - method = "getOtherPrimeInfo", - args = {} - ) public final void testGetOtherPrimeInfo01() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -673,12 +553,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Assertion: returns null if null has been passed to the * constructor as otherPrimeInfo parameter */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that getOtherPrimeInfo returns null if there are only two prime factors.", - method = "getOtherPrimeInfo", - args = {} - ) public final void testGetOtherPrimeInfo02() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -702,20 +576,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Tests that internal state of the object * can not be modified by modifying initial array */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that internal state of the object can not be modified by modifying initial array.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that internal state of the object can not be modified by modifying initial array.", - method = "getOtherPrimeInfo", - args = {} - ) - }) public final void testIsStatePreserved1() { // Create initial array RSAOtherPrimeInfo[] opi1 = opi.clone(); @@ -747,20 +607,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * returned by <code>getOtherPrimeInfo()</code> * method */ - @TestTargets({ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that internal state of the object can not be modified using array reference returned by getOtherPrimeInfo() method.", - method = "RSAMultiPrimePrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class} - ), - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies that internal state of the object can not be modified using array reference returned by getOtherPrimeInfo() method.", - method = "getOtherPrimeInfo", - args = {} - ) - }) public final void testIsStatePreserved2() { // Create initial array RSAOtherPrimeInfo[] opi1 = opi.clone(); @@ -796,12 +642,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getModulus()</code> method<br> * Assertion: returns modulus */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getModulus", - args = {} - ) public final void testGetModulus() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( @@ -821,12 +661,6 @@ public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrivateExponent()</code> method<br> * Assertion: returns private exponent */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrivateExponent", - args = {} - ) public final void testGetPrivateExponent() { RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( diff --git a/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java b/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java index b3343ee..ad128e0 100644 --- a/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java +++ b/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -36,7 +31,6 @@ import java.security.spec.RSAOtherPrimeInfo; * Tests for <code>RSAOtherPrimeInfo</code> class fields and methods. * */ -@TestTargetClass(RSAOtherPrimeInfo.class) public class RSAOtherPrimeInfoTest extends TestCase { /** @@ -44,12 +38,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Assertion: constructs <code>RSAOtherPrimeInfo</code> * object using valid parameter */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameters.", - method = "RSAOtherPrimeInfo", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAOtherPrimeInfo01() { Object o = new RSAOtherPrimeInfo(BigInteger.valueOf(1L), @@ -62,12 +50,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test #2 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor * Assertion: NullPointerException if prime is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAOtherPrimeInfo", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAOtherPrimeInfo02() { try { new RSAOtherPrimeInfo(null, @@ -82,12 +64,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test #3 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor * Assertion: NullPointerException if primeExponent is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAOtherPrimeInfo", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAOtherPrimeInfo03() { try { new RSAOtherPrimeInfo(BigInteger.valueOf(1L), @@ -102,12 +78,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test #4 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor * Assertion: NullPointerException if crtCoefficient is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAOtherPrimeInfo", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAOtherPrimeInfo04() { try { new RSAOtherPrimeInfo(BigInteger.valueOf(1L), @@ -122,12 +92,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test #5 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor * Assertion: NullPointerException if prime and crtCoefficient is null */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies NullPointerException.", - method = "RSAOtherPrimeInfo", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAOtherPrimeInfo05() { try { new RSAOtherPrimeInfo(null, @@ -142,12 +106,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test for <code>getCrtCoefficient()</code> method<br> * Assertion: returns CRT coefficient value */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCrtCoefficient", - args = {} - ) public final void testGetCrtCoefficient() { RSAOtherPrimeInfo ropi = new RSAOtherPrimeInfo(BigInteger.valueOf(1L), @@ -160,12 +118,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test for <code>getPrime()</code> method<br> * Assertion: returns prime value */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrime", - args = {} - ) public final void testGetPrime() { RSAOtherPrimeInfo ropi = new RSAOtherPrimeInfo(BigInteger.valueOf(1L), @@ -178,12 +130,6 @@ public class RSAOtherPrimeInfoTest extends TestCase { * Test for <code>getExponent()</code> method<br> * Assertion: returns prime exponent value */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getExponent", - args = {} - ) public final void testGetExponent() { RSAOtherPrimeInfo ropi = new RSAOtherPrimeInfo(BigInteger.valueOf(1L), diff --git a/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java index 392e998..f19ecc7 100644 --- a/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -38,7 +33,6 @@ import java.security.spec.RSAPrivateKeySpec; * Tests for <code>RSAPrivateCrtKeySpec</code> class fields and methods * */ -@TestTargetClass(RSAPrivateCrtKeySpec.class) public class RSAPrivateCrtKeySpecTest extends TestCase { /** @@ -46,12 +40,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Assertion: Constructs <code>RSAPrivateCrtKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameters.", - method = "RSAPrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAPrivateCrtKeySpec01() { KeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -70,12 +58,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Assertion: Constructs <code>RSAPrivateCrtKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameters.", - method = "RSAPrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAPrivateCrtKeySpec02() { KeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -94,12 +76,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Assertion: Constructs <code>RSAPrivateCrtKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "RSAPrivateCrtKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAPrivateCrtKeySpec03() { new RSAPrivateCrtKeySpec( null, @@ -116,12 +92,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getCrtCoefficient()</code> method<br> * Assertion: returns crt coefficient */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getCrtCoefficient", - args = {} - ) public final void testGetCrtCoefficient() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -139,12 +109,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeExponentP()</code> method<br> * Assertion: returns prime exponent P */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentP", - args = {} - ) public final void testGetPrimeExponentP() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -162,12 +126,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeExponentQ()</code> method<br> * Assertion: returns prime exponent Q */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeExponentQ", - args = {} - ) public final void testGetPrimeExponentQ() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -185,12 +143,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeP()</code> method<br> * Assertion: returns prime P */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeP", - args = {} - ) public final void testGetPrimeP() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -208,12 +160,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrimeQ()</code> method<br> * Assertion: returns prime Q */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrimeQ", - args = {} - ) public final void testGetPrimeQ() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -231,12 +177,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getPublicExponent()</code> method<br> * Assertion: returns public exponent */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) public final void testGetPublicExponent() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, @@ -258,12 +198,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getModulus()</code> method<br> * Assertion: returns modulus */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getModulus", - args = {} - ) public final void testGetModulus() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.valueOf(5L), @@ -281,12 +215,6 @@ public class RSAPrivateCrtKeySpecTest extends TestCase { * Test for <code>getPrivateExponent()</code> method<br> * Assertion: returns private exponent */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrivateExponent", - args = {} - ) public final void testGetPrivateExponent() { RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec( BigInteger.ONE, diff --git a/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java index f231fd7..411d4d2 100644 --- a/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -37,7 +32,6 @@ import java.security.spec.RSAPrivateKeySpec; * Tests for <code>RSAPrivateKeySpec</code> class fields and methods * */ -@TestTargetClass(RSAPrivateKeySpec.class) public class RSAPrivateKeySpecTest extends TestCase { /** @@ -45,12 +39,6 @@ public class RSAPrivateKeySpecTest extends TestCase { * Assertion: constructs <code>RSAPrivateKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "RSAPrivateKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAPrivateKeySpec() { KeySpec ks = new RSAPrivateKeySpec(BigInteger.valueOf(1234567890L), BigInteger.valueOf(3L)); @@ -61,12 +49,6 @@ public class RSAPrivateKeySpecTest extends TestCase { * Test for <code>getModulus()</code> method<br> * Assertion: returns modulus */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getModulus", - args = {} - ) public final void testGetModulus() { RSAPrivateKeySpec rpks = new RSAPrivateKeySpec(BigInteger.valueOf(1234567890L), @@ -78,12 +60,6 @@ public class RSAPrivateKeySpecTest extends TestCase { * Test for <code>getPrivateExponent()</code> method<br> * Assertion: returns private exponent */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPrivateExponent", - args = {} - ) public final void testGetPrivateExponent() { RSAPrivateKeySpec rpks = new RSAPrivateKeySpec(BigInteger.valueOf(1234567890L), diff --git a/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java index 7a46160..96a1034 100644 --- a/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.math.BigInteger; @@ -37,7 +32,6 @@ import java.security.spec.RSAPublicKeySpec; * Tests for <code>RSAPublicKeySpec</code> class fields and methods * */ -@TestTargetClass(RSAPublicKeySpec.class) public class RSAPublicKeySpecTest extends TestCase { /** @@ -45,12 +39,6 @@ public class RSAPublicKeySpecTest extends TestCase { * Assertion: Constructs <code>RSAPublicKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies constructor with valid parameters.", - method = "RSAPublicKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAPublicKeySpec01() { KeySpec ks = new RSAPublicKeySpec(BigInteger.valueOf(1234567890L), @@ -64,12 +52,6 @@ public class RSAPublicKeySpecTest extends TestCase { * Assertion: Constructs <code>RSAPublicKeySpec</code> * object using valid parameters */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "Verifies null as parameters.", - method = "RSAPublicKeySpec", - args = {java.math.BigInteger.class, java.math.BigInteger.class} - ) public final void testRSAPublicKeySpec02() { KeySpec ks = new RSAPublicKeySpec(null, null); @@ -81,12 +63,6 @@ public class RSAPublicKeySpecTest extends TestCase { * Test for <code>getModulus()</code> method<br> * Assertion: returns modulus */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getModulus", - args = {} - ) public final void testGetModulus() { RSAPublicKeySpec rpks = new RSAPublicKeySpec(BigInteger.valueOf(1234567890L), @@ -98,12 +74,6 @@ public class RSAPublicKeySpecTest extends TestCase { * Test for <code>getPublicExponent()</code> method<br> * Assertion: returns public exponent */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getPublicExponent", - args = {} - ) public final void testGetPublicExponent() { RSAPublicKeySpec rpks = new RSAPublicKeySpec(BigInteger.valueOf(3L), diff --git a/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java b/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java index 0ccbf52..1292983 100644 --- a/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java +++ b/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java @@ -22,11 +22,6 @@ package tests.security.spec; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; - import junit.framework.TestCase; import java.security.spec.EncodedKeySpec; @@ -38,7 +33,6 @@ import java.util.Arrays; * Tests for <code>X509EncodedKeySpec</code> class fields and methods * */ -@TestTargetClass(X509EncodedKeySpec.class) public class X509EncodedKeySpecTest extends TestCase { // @@ -50,12 +44,6 @@ public class X509EncodedKeySpecTest extends TestCase { * Assertion: constructs new <code>X509EncodedKeySpec</code> * object using valid parameter */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "X509EncodedKeySpec", - args = {byte[].class} - ) public final void testX509EncodedKeySpec() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -74,12 +62,6 @@ public class X509EncodedKeySpecTest extends TestCase { * Test for <code>getEncoded()</code> method<br> * Assertion: returns encoded key */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testGetEncoded() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -94,12 +76,6 @@ public class X509EncodedKeySpecTest extends TestCase { * Test for <code>getFormat()</code> method * Assertion: returns format name (always "X.509") */ - @TestTargetNew( - level = TestLevel.COMPLETE, - notes = "", - method = "getFormat", - args = {} - ) public final void testGetFormat() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -113,12 +89,6 @@ public class X509EncodedKeySpecTest extends TestCase { * can not be changed by modifying initial * array value */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testIsStatePreserved1() { // Reference array byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; @@ -143,12 +113,6 @@ public class X509EncodedKeySpecTest extends TestCase { * can not be modified using returned value * of <code>getEncoded()</code> method */ - @TestTargetNew( - level = TestLevel.PARTIAL_COMPLETE, - notes = "", - method = "getEncoded", - args = {} - ) public final void testIsStatePreserved2() { // Reference array byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; |