Package org.apache.harmony.xnet.provider.jsse

Examples of org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl


    /*
     * Class under test for void engineInit(KeyStore, char[])
     */
    public void testEngineInitKeyStorecharArray() throws Exception {
        KeyManagerFactoryImpl kmf = new KeyManagerFactoryImpl();
        kmf.engineInit(null, null);

        String def_keystore = System.getProperty("javax.net.ssl.keyStore");
        try {
            System.setProperty("javax.net.ssl.keyStore", "abc");
            kmf.engineInit(null, null);
            fail("No expected KeyStoreException");
        } catch (KeyStoreException e) {
        } finally {
            if (def_keystore == null) {
                 System.clearProperty("javax.net.ssl.keyStore");
View Full Code Here


    /*
     * Class under test for void engineInit(ManagerFactoryParameters)
     */
    public void testEngineInitManagerFactoryParameters() {
        KeyManagerFactoryImpl kmf = new KeyManagerFactoryImpl();
        try {
            kmf.engineInit(null);
            fail("No expected InvalidAlgorithmParameterException");
        } catch (InvalidAlgorithmParameterException e) {
            // expected
        }
    }
View Full Code Here

            // expected
        }
    }

    public void testEngineGetKeyManagers() throws Exception {
        KeyManagerFactoryImpl kmf = new KeyManagerFactoryImpl();
        try {
            kmf.engineGetKeyManagers();
            fail("No expected IllegalStateException");
        } catch (IllegalStateException e) {
            // expected
        }
        KeyStore ks;
        ks = KeyStore.getInstance("BKS");
        ks.load(null, null);
        kmf.engineInit(ks, null);

        KeyManager[] kma = kmf.engineGetKeyManagers();
        assertEquals("Incorrect array length", 1, kma.length);
        assertTrue("Incorrect KeyManager type",
                kma[0] instanceof KeyManagerImpl);
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl

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.