Package javax.net.ssl

Examples of javax.net.ssl.KeyStoreBuilderParameters


    /*
     * Class under test for void KeyStoreBuilderParameters(List)
     */
    public final void testKeyStoreBuilderParametersList() {
        try {
            new KeyStoreBuilderParameters((List) null);
            fail("No expected NullPointerException");
        } catch (NullPointerException e) {
        }

        try {
            new KeyStoreBuilderParameters(new ArrayList());
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }

    }
View Full Code Here


    public final void testGetParameters() {
        List ksbuilders;
        KeyStore.Builder builder = new myBuilder();
        List result;
        KeyStoreBuilderParameters param = new KeyStoreBuilderParameters(builder);
        result = param.getParameters();
        try {
            result.add(new myBuilder());
            fail("The list is modifiable");
        } catch (UnsupportedOperationException e) {
        }
        assertEquals("incorrect size", 1, result.size());
        assertTrue("incorrect list", result.contains(builder));
       
        ksbuilders = new ArrayList();
        ksbuilders.add(builder);
        ksbuilders.add(new myBuilder())
        param = new KeyStoreBuilderParameters(ksbuilders);
        result = param.getParameters();
        try {
            result.add(new Object());
            fail("The list is modifiable");
        } catch (UnsupportedOperationException e) {
        }
View Full Code Here

    /*
     * Class under test for void KeyStoreBuilderParameters(KeyStore.Builder)
     */
    public final void testKeyStoreBuilderParametersBuilder() {
        // should not throw NullPointerException
        new KeyStoreBuilderParameters((KeyStore.Builder) null);
    }
View Full Code Here

    /*
     * Class under test for void KeyStoreBuilderParameters(List)
     */
    public final void testKeyStoreBuilderParametersList() {
        try {
            new KeyStoreBuilderParameters((List) null);
            fail("No expected NullPointerException");
        } catch (NullPointerException e) {
        }

        try {
            new KeyStoreBuilderParameters(new ArrayList());
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }

    }
View Full Code Here

    public final void testGetParameters() {
        List ksbuilders;
        KeyStore.Builder builder = new myBuilder();
        List result;
        KeyStoreBuilderParameters param = new KeyStoreBuilderParameters(builder);
        result = param.getParameters();
        try {
            result.add(new myBuilder());
            fail("The list is modifiable");
        } catch (UnsupportedOperationException e) {
        }
        if (result.size() != 1) {
            fail("incorrect size");
        }
        if (!result.contains(builder)) {
            fail("incorrect list");
        }
       
        ksbuilders = new ArrayList();
        ksbuilders.add(builder);
        ksbuilders.add(new myBuilder())
        param = new KeyStoreBuilderParameters(ksbuilders);
        result = param.getParameters();
        try {
            result.add(new Object());
            fail("The list is modifiable");
        } catch (UnsupportedOperationException e) {
        }
View Full Code Here

    /*
     * Class under test for void KeyStoreBuilderParameters(KeyStore.Builder)
     */
    public final void testKeyStoreBuilderParametersBuilder() {
        try {
            new KeyStoreBuilderParameters((KeyStore.Builder) null);
        } catch (NullPointerException e) {
            // javadoc says this should throw NPE, but it doesn't
            fail("no NPE expected");
        }
    }
View Full Code Here

    /*
     * Class under test for void KeyStoreBuilderParameters(List)
     */
    public final void testKeyStoreBuilderParametersList() {
        try {
            new KeyStoreBuilderParameters((List<?>) null);
            fail("expected a NPE");
        } catch (NullPointerException e) {
        }

        try {
            new KeyStoreBuilderParameters(new ArrayList<Builder>());
            fail("expected a IAE");
        } catch (IllegalArgumentException e) {
        }

    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public final void testGetParameters() {
        List<Builder> ksbuilders;
        KeyStore.Builder builder = new EmptyBuilder();
        List<Object> result;
        KeyStoreBuilderParameters param = new KeyStoreBuilderParameters(builder);
        result = param.getParameters();
        try {
            result.add(new EmptyBuilder());
            fail("The list is modifiable");
        } catch (UnsupportedOperationException e) {
        }
        assertEquals("incorrect size", 1, result.size());
        assertTrue("incorrect list", result.contains(builder));
       
        ksbuilders = new ArrayList<Builder>();
        ksbuilders.add(builder);
        ksbuilders.add(new EmptyBuilder())
        param = new KeyStoreBuilderParameters(ksbuilders);
        result = param.getParameters();
        try {
            result.add(new Object());
            fail("The list is modifiable");
        } catch (UnsupportedOperationException e) {
        }
View Full Code Here

TOP

Related Classes of javax.net.ssl.KeyStoreBuilderParameters

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.