harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r413841 [1/9] - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/java/security/ test/api/java.injected/java/security/ test/api/java/org/apache/harmony/security/tests/java/security/ test/impl/java.injected...
Date Tue, 13 Jun 2006 08:58:17 GMT
Author: mloenko
Date: Tue Jun 13 01:58:11 2006
New Revision: 413841

URL: http://svn.apache.org/viewvc?rev=413841&view=rev
Log:
split api vs. impl tests in security - applied patches from HARMONY-587

Added:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AllPermissionTest.java
      - copied unchanged from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/AllPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/BasicPermissionTest.java
      - copied unchanged from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/BasicPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandomTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/UnresolvedPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AccessControlExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AccessControlExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator1Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AlgorithmParameterGenerator1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator2Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AlgorithmParameterGenerator2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AlgorithmParametersTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/CodeSignerTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/CodeSignerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/CodeSourceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/DigestExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/DigestExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/DigestInputStreamTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/DigestInputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/DigestOutputStreamTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/DigestOutputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/GeneralSecurityExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/GeneralSecurityExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/GuardedObjectTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/GuardedObjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/IdentityScopeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/InvalidAlgorithmParameterExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/InvalidKeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/InvalidParameterExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSCallbackHandlerProtectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSPasswordProtectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSPrivateKeyEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSSecretKeyEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSTrustedCertificateEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyManagementExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyManagementExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator1Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGenerator1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator2Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGenerator2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator3Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGenerator3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyPairGeneratorSpiTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGeneratorSpiTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyPairTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyRepTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyRepTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStoreExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStoreExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStoreSpiTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStoreSpiTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/MessageDigest1Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigest1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/NoSuchAlgorithmExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/NoSuchAlgorithmExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/NoSuchProviderExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/NoSuchProviderExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PermissionCollectionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PermissionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PermissionsTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PermissionsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PolicyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PrivateKeyTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PrivateKeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PrivilegedActionExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PrivilegedActionExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProtectionDomainTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProtectionDomainTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderServiceTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderServiceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/ProviderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/PublicKeyTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PublicKeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecurityPermissionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecurityPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecurityTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/SecurityTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SignatureExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SignedObjectTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignedObjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SignerTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/TimestampTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/TimestampTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/UnrecoverableEntryExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/UnrecoverableEntryExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/UnrecoverableKeyExceptionTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/UnrecoverableKeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/AllPermissionCollection_ImplTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/AllPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/BasicPermissionCollection_ImplTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/BasicPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/MessageDigestSpi_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Provider_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Security_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/Signature_Impl2Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/UnresolvedPermissionCollection_ImplTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/UnresolvedPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/UnresolvedPermission_ImplTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/UnresolvedPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/CodeSigner_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/CodeSource_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KSBuilder_ImplTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSBuilderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl1Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStore1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl2Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStore2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/KeyStore_Impl3Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStore3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/MessageDigest_Impl1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/MessageDigest_Impl2Test.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigest2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/PermissionCollection_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/Permissions_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/Policy_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/ProviderService_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/SecureRandom_ImplTest.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/Timestamp_ImplTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/KeyStoreTestSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/MyKeyStore.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MyKeyStore.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/RandomImpl.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/RandomImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/tmpCallbackHandler.java
      - copied, changed from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/tmpCallbackHandler.java
Removed:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AccessControlExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AlgorithmParameterGenerator1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AlgorithmParameterGenerator2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/AlgorithmParametersTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/CodeSignerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/CodeSourceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/DigestExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/DigestInputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/DigestOutputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/GeneralSecurityExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/GuardedObjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/IdentityScopeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/InvalidAlgorithmParameterExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/InvalidKeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/InvalidParameterExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSBuilderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSCallbackHandlerProtectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSPasswordProtectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSPrivateKeyEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSSecretKeyEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KSTrustedCertificateEntryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyManagementExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGenerator1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGenerator2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGenerator3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairGeneratorSpiTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyPairTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyRepTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStore1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStore2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStore3Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStoreExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyStoreSpiTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/KeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigest1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigest2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MyKeyStore.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/NoSuchAlgorithmExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/NoSuchProviderExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PermissionsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PolicyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PrivateKeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PrivilegedActionExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProtectionDomainTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderServiceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/PublicKeyTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/RandomImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecurityPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature1Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature2Test.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignedObjectTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/TimestampTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/UnrecoverableEntryExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/UnrecoverableKeyExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/tmpCallbackHandler.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/AllPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/AllPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/BasicPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/BasicPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/ProviderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/SecurityTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/UnresolvedPermissionCollectionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/UnresolvedPermissionTest.java
Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigestSpiTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/cert/X509CRLSelectorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/cert/X509CertSelectorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java.injected/java/security/cert/X509CertificateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/SerializationTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/TestCertUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/TestUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/cert/TestUtils.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/support/common/java/org/apache/harmony/security/tests/support/provider/cert/CertFactoryTestData.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java?rev=413841&r1=413840&r2=413841&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/Permissions.java Tue Jun 13 01:58:11 2006
@@ -178,11 +178,12 @@
 	 *            java.security.Permission the permission to check
 	 */
     public boolean implies(Permission permission) {
+        if (permission == null) {
+            // RI compartible
+            throw new NullPointerException("Null permission");
+        }
         if (allEnabled) {
             return true;
-        }
-        if (permission == null) {
-            return false;
         }
         Class klass = permission.getClass();
         PermissionCollection klassMates = null;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigestSpiTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigestSpiTest.java?rev=413841&r1=413840&r2=413841&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigestSpiTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/MessageDigestSpiTest.java Tue Jun 13 01:58:11 2006
@@ -1,122 +1,95 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package java.security;
-
-import java.nio.ByteBuffer;
-
-import junit.framework.TestCase;
-
-
-/**
- * Tests for <code>MessageDigestSpi</code> constructor and methods
- * 
- */
-public class MessageDigestSpiTest extends TestCase {
-
-	public void testEngineGetDigestLength() {
-		MyMessageDigest md = new MyMessageDigest();
-		if (md.engineGetDigestLength() != 0) {
-			fail("engineGetDigestLength failed");
-		}
-	}
-
-	/*
-	 * Class under test for void engineUpdate(ByteBuffer)
-	 */
-	public void testEngineUpdateByteBuffer() {
-		MyMessageDigest md = new MyMessageDigest();
-		byte[] b = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
-
-		ByteBuffer buf = ByteBuffer.wrap(b,0,b.length);
-		buf.get(b);
-		int l = buf.limit();
-		md.engineUpdate(buf);
-		if (buf.limit() !=l || buf.position() != l) {
-			fail("Case 1. Incorrect position");
-		}
-		
-		buf = ByteBuffer.wrap(b,0,b.length);
-		buf.get();
-		buf.get();
-		buf.get();
-		md.engineUpdate(buf);
-		if (buf.limit() !=l || buf.position() != l) {
-			fail("Case 2. Incorrect position");
-		}
-	}
-
-	/*
-	 * Class under test for int engineDigest(byte[], int, int)
-	 */
-	public void testEngineDigestbyteArrayintint() {
-		MyMessageDigest md = new MyMessageDigest();
-		byte[] b = new byte[5];
-		try {
-			md.engineDigest(null, 1, 1);
-			fail("No expected NullPointerException");	
-		} catch (NullPointerException e) {		
-		} catch (DigestException e) {
-			fail(e.toString());
-		}
-		try {
-			md.engineDigest(b, 3, 10);
-			fail("No expected DigestException");	
-		} catch (DigestException e) {
-		}
-		try {
-			if (md.engineDigest(b, 1, 3) != 0) {
-				fail("incorrect result");
-			}
-		} catch (DigestException e) {
-			fail(e.toString());
-		}
-	}
-
-	/*
-	 * Class under test for Object clone()
-	 */
-	public void testClone() {
-		MyMessageDigest md = new MyMessageDigest();
-		try {
-			md.clone();
-			fail("No expected CloneNotSupportedException");
-		} catch (CloneNotSupportedException e) {			
-		}
-	}
-
-	private class MyMessageDigest extends MessageDigestSpi {
-		
-		public void engineReset() {}
-
-		public byte[] engineDigest() {
-			return null;
-		}
-
-		public void engineUpdate(byte arg0) {}
-
-		public void engineUpdate(byte[] arg0, int arg1, int arg2) {}
-
-		public Object clone() throws CloneNotSupportedException {
-			throw new CloneNotSupportedException();
-		}
-	}
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Boris V. Kuznetsov
+* @version $Revision$
+*/
+
+package java.security;
+
+import java.nio.ByteBuffer;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Tests for <code>MessageDigestSpi</code> constructor and methods
+ * 
+ */
+public class MessageDigestSpiTest extends TestCase {
+
+	public void testEngineGetDigestLength() {
+		MyMessageDigest md = new MyMessageDigest();
+		if (md.engineGetDigestLength() != 0) {
+			fail("engineGetDigestLength failed");
+		}
+	}
+
+	/*
+	 * Class under test for void engineUpdate(ByteBuffer)
+	 */
+	public void testEngineUpdateByteBuffer() {
+		MyMessageDigest md = new MyMessageDigest();
+		byte[] b = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+		ByteBuffer buf = ByteBuffer.wrap(b,0,b.length);
+		buf.get(b);
+		int l = buf.limit();
+		md.engineUpdate(buf);
+		if (buf.limit() !=l || buf.position() != l) {
+			fail("Case 1. Incorrect position");
+		}
+		
+		buf = ByteBuffer.wrap(b,0,b.length);
+		buf.get();
+		buf.get();
+		buf.get();
+		md.engineUpdate(buf);
+		if (buf.limit() !=l || buf.position() != l) {
+			fail("Case 2. Incorrect position");
+		}
+	}
+
+	/*
+	 * Class under test for Object clone()
+	 */
+	public void testClone() {
+		MyMessageDigest md = new MyMessageDigest();
+		try {
+			md.clone();
+			fail("No expected CloneNotSupportedException");
+		} catch (CloneNotSupportedException e) {			
+		}
+	}
+
+	private class MyMessageDigest extends MessageDigestSpi {
+		
+		public void engineReset() {}
+
+		public byte[] engineDigest() {
+			return null;
+		}
+
+		public void engineUpdate(byte arg0) {}
+
+		public void engineUpdate(byte[] arg0, int arg1, int arg2) {}
+
+		public Object clone() throws CloneNotSupportedException {
+			throw new CloneNotSupportedException();
+		}
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java?rev=413841&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/ProviderTest.java Tue Jun 13 01:58:11 2006
@@ -0,0 +1,217 @@
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Boris V. Kuznetsov
+* @version $Revision$
+*/
+
+package java.security;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.security.tests.support.TestUtils;
+
+
+/**
+ * Tests for <code>Provider</code> constructor and methods
+ * 
+ */
+public class ProviderTest extends TestCase {
+
+    Provider p;
+    
+    /*
+     * @see TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+        p = new MyProvider();
+    }
+    
+    /*
+     * Class under test for void load(InputStream)
+     */
+    public final void testLoadInputStream() {
+        FileInputStream fis = null;
+        String fileName = SpiEngUtils.getFileName(TestUtils.TEST_ROOT,
+                "java/security/Provider.prop.dat");
+        try {
+            fis = new FileInputStream(fileName);
+        } catch (FileNotFoundException e) {
+            fail(e.toString());
+        }
+        try {
+            p.load(fis);    
+        } catch (IOException e) {
+            fail(e.toString());
+        }
+
+        if (!"value 1".equals(p.getProperty("Property 1").trim()) ||
+                !"className".equals(p.getProperty("serviceName.algName").trim()) ||    
+                !"attrValue".equals(p.getProperty("serviceName.algName attrName").trim()) ||
+                !"stanbdardName".equals(p.getProperty("Alg.Alias.engineClassName.aliasName").trim()) ||
+                !String.valueOf(p.getName()).equals(p.getProperty("Provider.id name").trim()) ||
+                !String.valueOf(p.getVersion()).equals(p.getProperty("Provider.id version").trim()) ||
+                !String.valueOf(p.getInfo()).equals(p.getProperty("Provider.id info").trim()) ||
+                !p.getClass().getName().equals(p.getProperty("Provider.id className").trim()) ||
+                !"SomeClassName".equals(p.getProperty("MessageDigest.SHA-1").trim()) ) {
+            fail("Incorrect property value");
+        }
+    }
+
+    public final void testGetService() {
+        try { 
+            p.getService(null, "algorithm");
+            fail("No expected NullPointerException");
+        } catch (NullPointerException e) {
+        }
+        try { 
+            p.getService("type", null);
+            fail("No expected NullPointerException");
+        } catch (NullPointerException e) {
+        }
+        
+        Provider.Service s = new Provider.Service(p, "Type", "Algorithm",
+                "className", null, null);
+        p.putService(s);
+        
+        if (p.getService("Type", "AlgoRithM") != s) {
+            fail("Case 1. getService() failed");
+        }
+        
+        Provider.Service s1 = p.getService("MessageDigest", "AbC");
+        if (s1 == null) {
+            fail("Case 2. getService() failed");            
+        }
+        
+        s = new Provider.Service(p, "MessageDigest", "SHA-1",
+                "className", null, null);
+        p.putService(s);
+        if (s1 == p.getService("MessageDigest", "SHA-1")) {
+            fail("Case 3. getService() failed");
+        }
+        
+        if (p.getService("MessageDigest", "SHA1") == null) {
+            fail("Case 4. getService() failed");
+        }
+    }
+
+    public final void testGetServices() {
+        Provider.Service s = new Provider.Service(p, "Type", "Algorithm",
+                "className", null, null);
+
+        // incomplete services should be removed
+        p.put("serv.alg", "aaaaaaaaaaaaa");
+        p.put("serv.alg KeySize", "11111");
+        p.put("serv1.alg1 KeySize", "222222");
+        p.remove("serv.alg");
+        
+        p.putService(s);
+        Set services = p.getServices();
+        if (services.size() != 3) {
+            fail("incorrect size");
+        }
+        for (Iterator it = services.iterator(); it.hasNext();) {
+            s = (Provider.Service)it.next();
+            if ("Type".equals(s.getType()) &&
+                    "Algorithm".equals(s.getAlgorithm()) &&
+                    "className".equals(s.getClassName())) {
+                continue;
+            }
+            if ("MessageDigest".equals(s.getType()) &&
+                    "SHA-1".equals(s.getAlgorithm()) &&
+                    "SomeClassName".equals(s.getClassName())) {
+                continue;
+            }
+            if ("MessageDigest".equals(s.getType()) &&
+                    "abc".equals(s.getAlgorithm()) &&
+                    "SomeClassName".equals(s.getClassName())) {
+                continue;
+            }    
+            fail("Incorrect service");
+        }
+    }
+
+    public final void testPutService() {
+        HashMap hm = new HashMap();
+        hm.put("KeySize", "1024");
+        hm.put("AAA", "BBB");
+        Provider.Service s = new Provider.Service(p, "Type", "Algorithm",
+                "className", null, hm);
+        p.putService(s);
+        if (s != p.getService("Type", "Algorithm")){
+            fail("putService failed");
+        }
+        if (!"className".equals(p.getProperty("Type.Algorithm"))) {
+            fail("incorrect className");
+        }
+        if (!"1024".equals(p.getProperty("Type.Algorithm KeySize"))) {
+            fail("incorrect attribute");
+        }    
+    }
+
+    public final void testRemoveService() {
+        Provider.Service s = new Provider.Service(p, "Type", "Algorithm",
+                "className", null, null);
+        p.putService(s);
+        p.removeService(s);
+        Set services = p.getServices();
+        if (services.size() != 2) {
+            fail("incorrect size");
+        }
+        
+        for (Iterator it = services.iterator(); it.hasNext();) {
+            s = (Provider.Service)it.next();
+            if ("MessageDigest".equals(s.getType()) &&
+                    "SHA-1".equals(s.getAlgorithm()) &&
+                    "SomeClassName".equals(s.getClassName())) {
+                continue;
+            }
+            if ("MessageDigest".equals(s.getType()) &&
+                    "abc".equals(s.getAlgorithm()) &&
+                    "SomeClassName".equals(s.getClassName())) {
+                continue;
+            }
+            fail("Incorrect service");
+        }
+        
+        if (p.getProperty("Type.Algorithm") != null) {
+            fail("incorrect property");
+        }    
+    }
+
+    class MyProvider extends Provider {
+        MyProvider() {
+            super("MyProvider", 1.0, "Provider for testing");
+            put("MessageDigest.SHA-1", "SomeClassName");
+            put("MessageDigest.abc", "SomeClassName");
+            put("Alg.Alias.MessageDigest.SHA1", "SHA-1");
+        }
+        
+        MyProvider(String name, double version, String info) {
+            super(name, version, info);
+        }
+    }
+}

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandomTest.java (from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom1Test.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandomTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandomTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom1Test.java&r1=412639&r2=413841&rev=413841&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandom1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SecureRandomTest.java Tue Jun 13 01:58:11 2006
@@ -1,188 +1,179 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package java.security;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>SecureRandom</code> constructor and methods
- * 
- */
-public class SecureRandom1Test extends TestCase {
-
-	/**
-	 * SRProvider
-	 */
-	Provider p;
-	
-	/*
-	 * @see TestCase#setUp()
-	 */
-	protected void setUp() throws Exception {
-		super.setUp();
-		p = new SRProvider();
-		Security.insertProviderAt(p, 1);
-	}
-
-	/*
-	 * @see TestCase#tearDown()
-	 */
-	protected void tearDown() throws Exception {
-		super.tearDown();
-		Security.removeProvider(p.getName());
-	}
-
-	public final void testNext() {
-		SecureRandom sr = new SecureRandom();
-		if (sr.next(1) != 1 || sr.next(2) != 3 || sr.next(3) != 7) {
-			fail("next failed");			
-		}
-	}
-
-	/*
-	 * Class under test for void setSeed(long)
-	 */
-	public final void testSetSeedlong() {
-		SecureRandom sr = new SecureRandom();
-		sr.setSeed(12345);
-		if (!RandomImpl.runEngineSetSeed) {
-			fail("setSeed failed");
-		}	
-	}
-
-	public final void testNextBytes() {
-		byte[] b = new byte[5];
-		SecureRandom sr = new SecureRandom();
-		sr.nextBytes(b);
-		for (int i = 0; i < b.length; i++) {
-			if (b[i] != (byte)(i + 0xF1)) {
-				fail("nextBytes failed");
-			}
-		}
-	}
-
-	/*
-	 * Class under test for void SecureRandom()
-	 */
-	public final void testSecureRandom() {
-		SecureRandom sr = new SecureRandom();
-		if (!sr.getAlgorithm().equals("someRandom")  ||
-				sr.getProvider()!= p) {
-			fail("incorrect SecureRandom implementation" + p.getName());
-		}	
-	}
-
-	/*
-	 * Class under test for void SecureRandom(byte[])
-	 */
-	public final void testSecureRandombyteArray() {
-		byte[] b = {1,2,3};
-		new SecureRandom(b);
-		if (!RandomImpl.runEngineSetSeed) {
-			fail("No setSeed");
-		}
-	}
-
-	/*
-	 * Class under test for SecureRandom getInstance(String)
-	 */
-	public final void testGetInstanceString() {
-		SecureRandom sr = null;
-		try {
-			sr = SecureRandom.getInstance("someRandom");	
-		} catch (NoSuchAlgorithmException e) {
-			fail(e.toString());
-		}
-		if (sr.getProvider() != p || !"someRandom".equals(sr.getAlgorithm())) {
-			fail("getInstance failed");
-		}	
-	}
-
-	/*
-	 * Class under test for SecureRandom getInstance(String, String)
-	 */
-	public final void testGetInstanceStringString() {
-		SecureRandom sr = null;
-		try {
-			sr = SecureRandom.getInstance("someRandom", "SRProvider");	
-		} catch (NoSuchAlgorithmException e) {
-			fail(e.toString());
-		} catch (NoSuchProviderException e) {
-			fail(e.toString());
-		}
-		if (sr.getProvider() != p || !"someRandom".equals(sr.getAlgorithm())) {
-			fail("getInstance failed");
-		}	
-	}
-
-	/*
-	 * Class under test for SecureRandom getInstance(String, Provider)
-	 */
-	public final void testGetInstanceStringProvider() {
-		SecureRandom sr = null;
-		Provider p = new SRProvider();
-		try {
-			sr = SecureRandom.getInstance("someRandom", p);	
-		} catch (NoSuchAlgorithmException e) {
-			fail(e.toString());
-		}
-		if (sr.getProvider() != p || !"someRandom".equals(sr.getAlgorithm())) {
-			fail("getInstance failed");
-		}	
-	}
-
-	/*
-	 * Class under test for void setSeed(byte[])
-	 */
-	public final void testSetSeedbyteArray() {
-		byte[] b = {1,2,3};
-		SecureRandom sr = new SecureRandom();
-		sr.setSeed(b);
-		if (!RandomImpl.runEngineSetSeed) {
-			fail("setSeed failed");
-		}
-	}
-
-	public final void testGetSeed() {
-		byte[] b = SecureRandom.getSeed(4);
-		if( b.length != 4) {
-			fail("getSeed failed");
-		}
-	}
-
-	public final void testGenerateSeed() {
-		SecureRandom sr = new SecureRandom();
-		byte[] b = sr.generateSeed(4);
-		for (int i = 0; i < b.length; i++) {
-			if (b[i] != (byte)i) {
-				fail("generateSeed failed");
-			}
-		}
-	}
-	
-	class SRProvider extends Provider {
-		public SRProvider() {
-			super("SRProvider", 1.0, "SRProvider for testing");
-			put("SecureRandom.someRandom", "java.security.RandomImpl");
-		}
-	}
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Boris V. Kuznetsov
+* @version $Revision$
+*/
+
+package java.security;
+
+import org.apache.harmony.security.tests.support.RandomImpl;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>SecureRandom</code> constructor and methods
+ * 
+ */
+public class SecureRandomTest extends TestCase {
+
+	/**
+	 * SRProvider
+	 */
+	Provider p;
+	
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+		p = new SRProvider();
+		Security.insertProviderAt(p, 1);
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		Security.removeProvider(p.getName());
+	}
+
+	public final void testNext() {
+		SecureRandom sr = new SecureRandom();
+		if (sr.next(1) != 1 || sr.next(2) != 3 || sr.next(3) != 7) {
+			fail("next failed");			
+		}
+	}
+
+	/*
+	 * Class under test for void setSeed(long)
+	 */
+	public final void testSetSeedlong() {
+		SecureRandom sr = new SecureRandom();
+		sr.setSeed(12345);
+		if (!RandomImpl.runEngineSetSeed) {
+			fail("setSeed failed");
+		}	
+	}
+
+	public final void testNextBytes() {
+		byte[] b = new byte[5];
+		SecureRandom sr = new SecureRandom();
+		sr.nextBytes(b);
+		for (int i = 0; i < b.length; i++) {
+			if (b[i] != (byte)(i + 0xF1)) {
+				fail("nextBytes failed");
+			}
+		}
+	}
+
+	/*
+	 * Class under test for void SecureRandom()
+	 */
+	public final void testSecureRandom() {
+		SecureRandom sr = new SecureRandom();
+		if (!sr.getAlgorithm().equals("someRandom")  ||
+				sr.getProvider()!= p) {
+			fail("incorrect SecureRandom implementation" + p.getName());
+		}	
+	}
+
+	/*
+	 * Class under test for void SecureRandom(byte[])
+	 */
+	public final void testSecureRandombyteArray() {
+		byte[] b = {1,2,3};
+		new SecureRandom(b);
+		if (!RandomImpl.runEngineSetSeed) {
+			fail("No setSeed");
+		}
+	}
+
+	/*
+	 * Class under test for SecureRandom getInstance(String)
+	 */
+	public final void testGetInstanceString() {
+		SecureRandom sr = null;
+		try {
+			sr = SecureRandom.getInstance("someRandom");	
+		} catch (NoSuchAlgorithmException e) {
+			fail(e.toString());
+		}
+		if (sr.getProvider() != p || !"someRandom".equals(sr.getAlgorithm())) {
+			fail("getInstance failed");
+		}	
+	}
+
+	/*
+	 * Class under test for SecureRandom getInstance(String, String)
+	 */
+	public final void testGetInstanceStringString() throws Exception {
+		SecureRandom sr = SecureRandom.getInstance("someRandom", "SRProvider");	
+		if (sr.getProvider() != p || !"someRandom".equals(sr.getAlgorithm())) {
+			fail("getInstance failed");
+		}	
+	}
+
+	/*
+	 * Class under test for SecureRandom getInstance(String, Provider)
+	 */
+	public final void testGetInstanceStringProvider() throws Exception {
+		Provider p = new SRProvider();
+        SecureRandom sr = SecureRandom.getInstance("someRandom", p);
+        if (sr.getProvider() != p || !"someRandom".equals(sr.getAlgorithm())) {
+            fail("getInstance failed");
+        }	
+	}
+
+	/*
+	 * Class under test for void setSeed(byte[])
+	 */
+	public final void testSetSeedbyteArray() {
+		byte[] b = {1,2,3};
+		SecureRandom sr = new SecureRandom();
+		sr.setSeed(b);
+		if (!RandomImpl.runEngineSetSeed) {
+			fail("setSeed failed");
+		}
+	}
+
+	public final void testGetSeed() {
+		byte[] b = SecureRandom.getSeed(4);
+		if( b.length != 4) {
+			fail("getSeed failed");
+		}
+	}
+
+	public final void testGenerateSeed() {
+		SecureRandom sr = new SecureRandom();
+		byte[] b = sr.generateSeed(4);
+		for (int i = 0; i < b.length; i++) {
+			if (b[i] != (byte)i) {
+				fail("generateSeed failed");
+			}
+		}
+	}
+	
+	class SRProvider extends Provider {
+        public SRProvider() {
+            super("SRProvider", 1.0, "SRProvider for testing");
+            put("SecureRandom.someRandom",
+                    "org.apache.harmony.security.tests.support.RandomImpl");
+        }
+	}
+}

Copied: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureTest.java (from r412639, incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature1Test.java)
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureTest.java?p2=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureTest.java&p1=incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature1Test.java&r1=412639&r2=413841&rev=413841&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/Signature1Test.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/SignatureTest.java Tue Jun 13 01:58:11 2006
@@ -1,518 +1,465 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Boris V. Kuznetsov
-* @version $Revision$
-*/
-
-package java.security;
-
-import org.apache.harmony.security.tests.support.MySignature1;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for <code>Signature</code> constructor and methods
- * 
- */
-public class Signature1Test extends TestCase {
-
-	/*
-	 * Class under test for Object clone()
-	 */
-	public void testClone() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.clone();
-			fail("No expected CloneNotSupportedException");
-		} catch (CloneNotSupportedException e) {	
-		}	
-	}
-
-	public void testGetProvider() {
-		MySignature1 s = new MySignature1("ABC");
-		if (s.getState() != Signature.UNINITIALIZED) {
-			fail("Incorrect state");
-		}
-		if (s.getProvider() != null) {
-			fail("getProvider() failed");
-		}
-	}
-
-	public void testGetAlgorithm() {
-		MySignature1 s = new MySignature1("ABC");
-		if (s.getState() != Signature.UNINITIALIZED) {
-			fail("Incorrect state");
-		}
-		if (!"ABC".equals(s.getAlgorithm())) {
-			fail("getAlgorithm() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void initVerify(PublicKey)
-	 */
-	public void testInitVerifyPublicKey() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.VERIFY) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineInitVerify) {
-			fail("initVerify() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void initVerify(Certificate)
-	 */
-	public void testInitVerifyCertificate() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.initVerify(new MyCertificate());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.VERIFY) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineInitVerify) {
-			fail("initVerify() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void initSign(PrivateKey)
-	 */
-	public void testInitSignPrivateKey() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineInitSign) {
-			fail("initSign() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void initSign(PrivateKey, SecureRandom)
-	 */
-	public void testInitSignPrivateKeySecureRandom() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.initSign(new MyPrivateKey(), new SecureRandom());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineInitSign) {
-			fail("initSign() failed");
-		}
-	}
-
-	/*
-	 * Class under test for byte[] sign()
-	 */
-	public void testSign() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.sign();
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.sign();
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-		
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		try {
-			s.sign();
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineSign) {
-			fail("sign() failed");
-		}
-	}
-
-	/*
-	 * Class under test for int sign(byte[], int, int)
-	 */
-	public void testSignbyteArrayintint() {
-		MySignature1 s = new MySignature1("ABC");
-		byte[] b = new byte[8];
-		try {
-			s.sign(b, 0, 5);
-			fail("No expected SignatureException 1");
-		} catch (SignatureException e) {		
-		}
-		
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.sign(b, 0, 5);
-			fail("No expected SignatureException 1");
-		} catch (SignatureException e) {		
-		}
-		
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.sign(b, 0, 5);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineSign) {
-			fail("sign() failed");
-		}
-	}
-
-	/*
-	 * Class under test for boolean verify(byte[])
-	 */
-	public void testVerifybyteArray() {
-		MySignature1 s = new MySignature1("ABC");
-		byte[] b = {1, 2, 3, 4};
-		try {
-			s.verify(b);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		try {
-			s.verify(b);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-		
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.verify(b);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		
-		if (s.getState() != Signature.VERIFY) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineVerify) {
-			fail("verify() failed");
-		}
-	}
-
-	/*
-	 * Class under test for boolean verify(byte[], int, int)
-	 */
-	public void testVerifybyteArrayintint() {
-		MySignature1 s = new MySignature1("ABC");
-		byte[] b = {1, 2, 3, 4};
-		try {
-			s.verify(b, 0, 3);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		try {
-			s.verify(b, 0, 3);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-		
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.verify(b, 0, 5);
-			fail("No expected IllegalArgumentException");
-		} catch (IllegalArgumentException e) {		
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.verify(b, 0, 3);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		
-		if (s.getState() != Signature.VERIFY) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineVerify) {
-			fail("verify() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void update(byte)
-	 */
-	public void testUpdatebyte() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.update((byte)1);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.update((byte)1);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		try {
-			s.update((byte)1);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineUpdate1) {
-			fail("update() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void update(byte[])
-	 */
-	public void testUpdatebyteArray() {
-		MySignature1 s = new MySignature1("ABC");
-		byte[] b = {1, 2, 3, 4};
-		try {
-			s.update(b);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.update(b);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		try {
-			s.update(b);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineUpdate2) {
-			fail("update() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void update(byte[], int, int)
-	 */
-	public void testUpdatebyteArrayintint() {
-		MySignature1 s = new MySignature1("ABC");
-		byte[] b = {1, 2, 3, 4};
-		try {
-			s.update(b, 0, 3);
-			fail("No expected SignatureException");
-		} catch (SignatureException e) {		
-		}
-
-		try {
-			s.initVerify(new MyPublicKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		
-		try {
-			s.update(b, 0, 3);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-			
-		try {
-			s.initSign(new MyPrivateKey());
-		} catch (InvalidKeyException e) {
-			fail(e.toString());
-		}
-		try {
-			s.update(b, 0, 3);
-		} catch (SignatureException e) {
-			fail(e.toString());
-		}
-		if (s.getState() != Signature.SIGN) {
-			fail("Incorrect state");
-		}
-		if (!s.runEngineUpdate2) {
-			fail("update() failed");
-		}
-	}
-
-	/*
-	 * Class under test for String toString()
-	 */
-	public void testToString() {
-		MySignature1 s = new MySignature1("ABC");
-		if (!"SIGNATURE ABC state: UNINITIALIZED".equals(s.toString())) {
-			fail("toString() failed");
-		}
-	}
-
-	/*
-	 * Class under test for void setParameter(String, Object)
-	 */
-	public void testSetParameterStringObject() {
-		MySignature1 s = new MySignature1("ABC");
-		s.setParameter("aaa", new Object());
-	}
-
-	/*
-	 * Class under test for void setParameter(AlgorithmParameterSpec)
-	 */
-	public void testSetParameterAlgorithmParameterSpec() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.setParameter((java.security.spec.AlgorithmParameterSpec)null);
-			fail("No expected UnsupportedOperationException");
-		} catch (UnsupportedOperationException e){	
-		} catch (Exception e){
-			fail(e.toString());
-		}
-	}
-
-	public void testGetParameter() {
-		MySignature1 s = new MySignature1("ABC");
-		try {
-			s.getParameter("aaa");
-		} catch (InvalidParameterException e){
-			fail(e.toString());
-		}
-	}
-	
-	private class MyKey implements Key {
-		public String getFormat() {
-			return "123";
-		}
-		public byte[] getEncoded() {
-			return null;
-		}
-		public String getAlgorithm() {
-			return "aaa";
-		}		
-	}
-	
-	private class MyPublicKey extends MyKey implements PublicKey {}
-
-	private class MyPrivateKey extends MyKey implements PrivateKey {}
-	
-	private class MyCertificate extends java.security.cert.Certificate {	
-		public  MyCertificate() {
-			super("MyCertificateType");
-		}
-		
-		public PublicKey getPublicKey() {
-			return new MyPublicKey();
-		}
-		
-		public byte[] getEncoded() {
-			return null;
-		}
-		public void verify(PublicKey key) {}
-		
-		public void verify(PublicKey key, String sigProvider) {}
-		
-		public String toString() {
-			return "MyCertificate";
-		}
-	}
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Boris V. Kuznetsov
+* @version $Revision$
+*/
+
+package java.security;
+
+import org.apache.harmony.security.tests.support.MySignature1;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for <code>Signature</code> constructor and methods
+ * 
+ */
+public class SignatureTest extends TestCase {
+
+	/*
+	 * Class under test for Object clone()
+	 */
+	public void testClone() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.clone();
+			fail("No expected CloneNotSupportedException");
+		} catch (CloneNotSupportedException e) {	
+		}	
+	}
+
+	public void testGetProvider() {
+		MySignature1 s = new MySignature1("ABC");
+		if (s.getState() != Signature.UNINITIALIZED) {
+			fail("Incorrect state");
+		}
+		if (s.getProvider() != null) {
+			fail("getProvider() failed");
+		}
+	}
+
+	public void testGetAlgorithm() {
+		MySignature1 s = new MySignature1("ABC");
+		if (s.getState() != Signature.UNINITIALIZED) {
+			fail("Incorrect state");
+		}
+		if (!"ABC".equals(s.getAlgorithm())) {
+			fail("getAlgorithm() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void initVerify(PublicKey)
+	 */
+	public void testInitVerifyPublicKey() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.VERIFY) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineInitVerify) {
+			fail("initVerify() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void initVerify(Certificate)
+	 */
+	public void testInitVerifyCertificate() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.initVerify(new MyCertificate());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.VERIFY) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineInitVerify) {
+			fail("initVerify() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void initSign(PrivateKey)
+	 */
+	public void testInitSignPrivateKey() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.SIGN) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineInitSign) {
+			fail("initSign() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void initSign(PrivateKey, SecureRandom)
+	 */
+	public void testInitSignPrivateKeySecureRandom() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.initSign(new MyPrivateKey(), new SecureRandom());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.SIGN) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineInitSign) {
+			fail("initSign() failed");
+		}
+	}
+
+	/*
+	 * Class under test for byte[] sign()
+	 */
+	public void testSign() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.sign();
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.sign();
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+		
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		try {
+			s.sign();
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.SIGN) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineSign) {
+			fail("sign() failed");
+		}
+	}
+
+	/*
+	 * Class under test for boolean verify(byte[])
+	 */
+	public void testVerifybyteArray() {
+		MySignature1 s = new MySignature1("ABC");
+		byte[] b = {1, 2, 3, 4};
+		try {
+			s.verify(b);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		try {
+			s.verify(b);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+		
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.verify(b);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		
+		if (s.getState() != Signature.VERIFY) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineVerify) {
+			fail("verify() failed");
+		}
+	}
+
+	/*
+	 * Class under test for boolean verify(byte[], int, int)
+	 */
+	public void testVerifybyteArrayintint() {
+		MySignature1 s = new MySignature1("ABC");
+		byte[] b = {1, 2, 3, 4};
+		try {
+			s.verify(b, 0, 3);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		try {
+			s.verify(b, 0, 3);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+		
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.verify(b, 0, 5);
+			fail("No expected IllegalArgumentException");
+		} catch (IllegalArgumentException e) {		
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.verify(b, 0, 3);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		
+		if (s.getState() != Signature.VERIFY) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineVerify) {
+			fail("verify() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void update(byte)
+	 */
+	public void testUpdatebyte() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.update((byte)1);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.update((byte)1);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		try {
+			s.update((byte)1);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.SIGN) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineUpdate1) {
+			fail("update() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void update(byte[])
+	 */
+	public void testUpdatebyteArray() {
+		MySignature1 s = new MySignature1("ABC");
+		byte[] b = {1, 2, 3, 4};
+		try {
+			s.update(b);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.update(b);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		try {
+			s.update(b);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.SIGN) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineUpdate2) {
+			fail("update() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void update(byte[], int, int)
+	 */
+	public void testUpdatebyteArrayintint() {
+		MySignature1 s = new MySignature1("ABC");
+		byte[] b = {1, 2, 3, 4};
+		try {
+			s.update(b, 0, 3);
+			fail("No expected SignatureException");
+		} catch (SignatureException e) {		
+		}
+
+		try {
+			s.initVerify(new MyPublicKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		
+		try {
+			s.update(b, 0, 3);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+			
+		try {
+			s.initSign(new MyPrivateKey());
+		} catch (InvalidKeyException e) {
+			fail(e.toString());
+		}
+		try {
+			s.update(b, 0, 3);
+		} catch (SignatureException e) {
+			fail(e.toString());
+		}
+		if (s.getState() != Signature.SIGN) {
+			fail("Incorrect state");
+		}
+		if (!s.runEngineUpdate2) {
+			fail("update() failed");
+		}
+	}
+
+	/*
+	 * Class under test for void setParameter(String, Object)
+	 */
+	public void testSetParameterStringObject() {
+		MySignature1 s = new MySignature1("ABC");
+		s.setParameter("aaa", new Object());
+	}
+
+	/*
+	 * Class under test for void setParameter(AlgorithmParameterSpec)
+	 */
+	public void testSetParameterAlgorithmParameterSpec() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.setParameter((java.security.spec.AlgorithmParameterSpec)null);
+			fail("No expected UnsupportedOperationException");
+		} catch (UnsupportedOperationException e){	
+		} catch (Exception e){
+			fail(e.toString());
+		}
+	}
+
+	public void testGetParameter() {
+		MySignature1 s = new MySignature1("ABC");
+		try {
+			s.getParameter("aaa");
+		} catch (InvalidParameterException e){
+			fail(e.toString());
+		}
+	}
+	
+	private class MyKey implements Key {
+		public String getFormat() {
+			return "123";
+		}
+		public byte[] getEncoded() {
+			return null;
+		}
+		public String getAlgorithm() {
+			return "aaa";
+		}		
+	}
+	
+	private class MyPublicKey extends MyKey implements PublicKey {}
+
+	private class MyPrivateKey extends MyKey implements PrivateKey {}
+	
+	private class MyCertificate extends java.security.cert.Certificate {	
+		public  MyCertificate() {
+			super("MyCertificateType");
+		}
+		
+		public PublicKey getPublicKey() {
+			return new MyPublicKey();
+		}
+		
+		public byte[] getEncoded() {
+			return null;
+		}
+		public void verify(PublicKey key) {}
+		
+		public void verify(PublicKey key, String sigProvider) {}
+		
+		public String toString() {
+			return "MyCertificate";
+		}
+	}
+}



Mime
View raw message