Code example for PKIXParameters

Methods: getCertStoressetCertStores

0
        Set taSet = TestUtils.getTrustAnchorSet();
        if (taSet == null) {
            fail(getName() + ": not performed (could not create test TrustAnchor set)");
        } 
 
        PKIXParameters p = new PKIXParameters(taSet);
        // add null 
        p.setCertStores(null);
        // check that we have non null empty list now 
        assertNotNull("notNull1", p.getCertStores());
        assertTrue("isEmpty1", p.getCertStores().isEmpty());
        // add empty 
        p.setCertStores(new ArrayList());
        assertNotNull("notNull2", p.getCertStores());
        assertTrue("isEmpty2", p.getCertStores().isEmpty());
    } 
 
    /** 
     * Test #3 for <code>setCertStores(List)</code> method<br> 
     * Assertion: list is copied to protect against subsequent modifications 
Stop searching for code, let great code find you!  Add Codota to your java IDE