Package org.apache.harmony.security.tests.java.security.IdentityScope2Test

Examples of org.apache.harmony.security.tests.java.security.IdentityScope2Test.IdentityScopeSubclass


  /**
   * @tests java.security.Identity#Identity(java.lang.String,
   *        java.security.IdentityScope)
   */
  public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() throws Exception {
           new IdentitySubclass("test", new IdentityScopeSubclass());
  }
View Full Code Here


  /**
   * @tests java.security.Identity#getScope()
   */
  public void test_getScope() throws Exception {
           IdentityScope scope = new IdentityScopeSubclass();
           IdentitySubclass sub = new IdentitySubclass("test", scope);
           IdentityScope returnedScope = sub.getScope();
           assertEquals("Wrong Scope returned", scope, returnedScope);
  }
View Full Code Here

  /**
   * @tests java.security.Identity#getPublicKey()
   */
  public void test_getPublicKey() throws Exception {
           IdentitySubclass sub = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           sub.setPublicKey(pubKey);
           PublicKey returnedPubKey = sub.getPublicKey();
           assertEquals("Wrong PublicKey returned", pubKey, returnedPubKey);
  }
View Full Code Here

   * @tests java.security.Identity#getName()
   */
  public void test_getName() throws Exception {
           String name = "test";
           IdentitySubclass sub = new IdentitySubclass(name,
               new IdentityScopeSubclass());
           assertEquals("Wrong Name returned", name, sub.getName());
  }
View Full Code Here

   * @tests java.security.Identity#getInfo()
   */
  public void test_getInfo() throws Exception {
           String info = "This is the general information.";
           IdentitySubclass sub = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           sub.setInfo(info);
           assertEquals("Wrong Info returned", info, sub.getInfo());
  }
View Full Code Here

  /**
   * @tests java.security.Identity#certificates()
   */
  public void test_certificates() throws Exception {
           IdentitySubclass sub = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           CertificateFactory cf = CertificateFactory.getInstance("X.509");
           X509Certificate cert[] = new X509Certificate[1];
           cert[0] = (X509Certificate) cf.generateCertificate(certArray);
           sub.setPublicKey(cert[0].getPublicKey());
           CertificateImpl certImpl = new CertificateImpl(cert[0]);
View Full Code Here

  /**
   * @tests java.security.Identity#addCertificate(java.security.Certificate)
   */
  public void test_addCertificateLjava_security_Certificate() throws Exception {
           IdentitySubclass sub = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           CertificateFactory cf = CertificateFactory.getInstance("X.509");
           X509Certificate cert[] = new X509Certificate[1];
           cert[0] = (X509Certificate) cf.generateCertificate(certArray);
           sub.setPublicKey(cert[0].getPublicKey());
           CertificateImpl certImpl = new CertificateImpl(cert[0]);
View Full Code Here

  /**
   * @tests java.security.Identity#removeCertificate(java.security.Certificate)
   */
  public void test_removeCertificateLjava_security_Certificate() throws Exception {
           IdentitySubclass sub = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           CertificateFactory cf = CertificateFactory.getInstance("X.509");
           X509Certificate cert[] = new X509Certificate[1];
           cert[0] = (X509Certificate) cf.generateCertificate(certArray);
           sub.setPublicKey(cert[0].getPublicKey());
           CertificateImpl certImpl = new CertificateImpl(cert[0]);
View Full Code Here

  /**
   * @tests java.security.Identity#equals(java.lang.Object)
   */
  public void test_equalsLjava_lang_Object() throws Exception {
           IdentitySubclass sub = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           CertificateFactory cf = CertificateFactory.getInstance("X.509");
           X509Certificate cert[] = new X509Certificate[1];
           cert[0] = (X509Certificate) cf.generateCertificate(certArray);
           sub.setPublicKey(cert[0].getPublicKey());
           CertificateImpl certImpl = new CertificateImpl(cert[0]);
           sub.addCertificate(certImpl);
           IdentitySubclass sub2 = new IdentitySubclass("test",
               new IdentityScopeSubclass());
           assertEquals("the two Identity objects are not equal", sub2, sub);
  }
View Full Code Here

  /**
   * @tests java.security.Identity#Identity(java.lang.String,
   *        java.security.IdentityScope)
   */
  public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() throws Exception {
           new IdentitySubclass("test", new IdentityScopeSubclass());
  }
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.tests.java.security.IdentityScope2Test.IdentityScopeSubclass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.