Package tests.support

Examples of tests.support.Support_ProviderTrust


   */
  public void test_removeProviderLjava_lang_String() {
    // Test for method void
    // java.security.Security.removeProvider(java.lang.String)
    Provider test = new Support_TestProvider();
    Provider entrust = new Support_ProviderTrust();
    try {
      // Make sure provider not already loaded. Should do nothing
      // if not already loaded.
      Security.removeProvider(test.getName());

      // Now add it
      int addResult = Security.addProvider(test);
      assertTrue("Failed to add provider", addResult != -1);

      Security.removeProvider(test.getName());
      assertNull(
          "the provider TestProvider is found after it was removed",
          Security.getProvider(test.getName()));

      // Make sure entrust provider not already loaded. Should do nothing
      // if not already loaded.
      Security.removeProvider(entrust.getName());

      // Now add entrust
      addResult = Security.addProvider(entrust);
      assertTrue("Failed to add provider", addResult != -1);

      Security.removeProvider(entrust.getName());
      Provider provTest[] = Security.getProviders();
      for (int i = 0; i < provTest.length; i++) {
        assertTrue(
            "the provider entrust is found after it was removed",
            provTest[i].getName() != entrust.getName());
      }
    } finally {
      // Tidy up - the following calls do nothing if the providers were
      // already removed above.
      Security.removeProvider(test.getName());
      Security.removeProvider(entrust.getName());
    }
  }
View Full Code Here


   */
  public void test_removeProviderLjava_lang_String() {
    // Test for method void
    // java.security.Security.removeProvider(java.lang.String)
    Provider test = new Support_TestProvider();
    Provider entrust = new Support_ProviderTrust();
    try {
      // Make sure provider not already loaded. Should do nothing
      // if not already loaded.
      Security.removeProvider(test.getName());

      // Now add it
      int addResult = Security.addProvider(test);
      assertTrue("Failed to add provider", addResult != -1);

      Security.removeProvider(test.getName());
      assertNull(
          "the provider TestProvider is found after it was removed",
          Security.getProvider(test.getName()));

      // Make sure entrust provider not already loaded. Should do nothing
      // if not already loaded.
      Security.removeProvider(entrust.getName());

      // Now add entrust
      addResult = Security.addProvider(entrust);
      assertTrue("Failed to add provider", addResult != -1);

      Security.removeProvider(entrust.getName());
      Provider provTest[] = Security.getProviders();
      for (int i = 0; i < provTest.length; i++) {
        assertTrue(
            "the provider entrust is found after it was removed",
            provTest[i].getName() != entrust.getName());
      }
    } finally {
      // Tidy up - the following calls do nothing if the providers were
      // already removed above.
      Security.removeProvider(test.getName());
      Security.removeProvider(entrust.getName());
    }
  }
View Full Code Here

TOP

Related Classes of tests.support.Support_ProviderTrust

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.