Code example for CodeSource

Methods: getCodeSigners

0
    /** 
     * getCodeSigners() must not take into account non-X509 certificates. 
     */ 
    public void testGetCodeSigners_01() { 
        Certificate[] certs = { new TestCertUtils.TestCertificate("00") };
        CodeSource cs = new CodeSource(null, certs);
        assertNull(cs.getCodeSigners());
    } 
 
    /** 
     * getCodeSigners() must return null if no X509 factory available 
     */ 
    public void testGetCodeSigners_02() { 
        ArrayList al = new ArrayList();
        boolean noMoreFactories = false;
        try { 
            // remove all providers for x509 
            // 'for' loop here for the sake of avoiding endless loop - well, just  
            // in case if something is wrong with add/remove machinery. 
            // '100' seems reasonable big to remove all necessary providers 
            // ...