Package java.security.cert

Examples of java.security.cert.LDAPCertStoreParameters


    /**
     * Test for <code>clone()</code> method<br>
     * Assertion: Returns a copy of this object
     */
    public final void testClone() {
        LDAPCertStoreParameters cp1 =
            new LDAPCertStoreParameters("myhost", 1100);
        LDAPCertStoreParameters cp2 = (LDAPCertStoreParameters)cp1.clone();
        // check that that we have new object
        assertTrue("newObject", cp1 != cp2);
        assertTrue("hostsTheSame",
                cp1.getServerName().equals(cp2.getServerName()));
        assertTrue("portsTheSame", cp1.getPort() == cp2.getPort());
    }
View Full Code Here


    /**
     * Test for <code>toString()</code> method<br>
     * Assertion: returns the formatted string describing parameters
     */
    public final void testToString() {
        LDAPCertStoreParameters cp1 =
            new LDAPCertStoreParameters("myhost", 1101);

        assertNotNull(cp1.toString());
    }
View Full Code Here

     * Test for <code>toString()</code> method<br>
     * Assertion: returns the port number
     */
    public final void testGetPort() {
        int portNumber = -1099;
        LDAPCertStoreParameters cp =
            new LDAPCertStoreParameters("serverName", portNumber);
        assertTrue(cp.getPort() == portNumber);
    }
View Full Code Here

    /**
     * Test for <code>toString()</code> method<br>
     * Assertion: returns the server name (never <code>null</code>)
     */
    public final void testGetServerName() {
        LDAPCertStoreParameters cp =
            new LDAPCertStoreParameters("serverName");
        assertNotNull(cp.getServerName());
    }
View Full Code Here

      while (tok.hasMoreTokens()) {
    String s = tok.nextToken().trim();
    Matcher m = hostPortPattern.matcher(s);
    try {
        CertStoreParameters params = m.matches() ?
      new LDAPCertStoreParameters(
          m.group(1), Integer.parseInt(m.group(2))) :
      new LDAPCertStoreParameters(s);
        l.add(CertStore.getInstance("LDAP", params));
    } catch (Exception e) {
        logger.log(Level.WARNING,
             "exception initializing cert store", e);
    }
View Full Code Here

TOP

Related Classes of java.security.cert.LDAPCertStoreParameters

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.