Search in sources :

Example 6 with LDAPCertStoreParameters

use of java.security.cert.LDAPCertStoreParameters in project robovm by robovm.

the class LDAPCertStoreParametersTest method testLDAPCertStoreParametersString01.

/**
     * Test #1 for <code>LDAPCertStoreParameters(String)</code> constructor<br>
     * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
     * with the specified server name and a default port of 389
     */
public final void testLDAPCertStoreParametersString01() {
    CertStoreParameters cp = new LDAPCertStoreParameters("myhost");
    assertTrue("isLDAPCertStoreParameters", cp instanceof LDAPCertStoreParameters);
}
Also used : CertStoreParameters(java.security.cert.CertStoreParameters) LDAPCertStoreParameters(java.security.cert.LDAPCertStoreParameters) LDAPCertStoreParameters(java.security.cert.LDAPCertStoreParameters)

Example 7 with LDAPCertStoreParameters

use of java.security.cert.LDAPCertStoreParameters in project robovm by robovm.

the class LDAPCertStoreParametersTest method testClone.

/**
     * 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());
}
Also used : LDAPCertStoreParameters(java.security.cert.LDAPCertStoreParameters)

Example 8 with LDAPCertStoreParameters

use of java.security.cert.LDAPCertStoreParameters in project robovm by robovm.

the class LDAPCertStoreParametersTest method testGetServerName.

/**
     * 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());
}
Also used : LDAPCertStoreParameters(java.security.cert.LDAPCertStoreParameters)

Example 9 with LDAPCertStoreParameters

use of java.security.cert.LDAPCertStoreParameters in project robovm by robovm.

the class LDAPCertStoreParametersTest method testLDAPCertStoreParametersString02.

/**
     * Test #2 for <code>LDAPCertStoreParameters(String)</code> constructor<br>
     * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
     * with the specified server name and a default port of 389
     */
public final void testLDAPCertStoreParametersString02() {
    String serverName = "myhost";
    LDAPCertStoreParameters cp = new LDAPCertStoreParameters(serverName);
    assertTrue("host", serverName.equals(cp.getServerName()));
    assertEquals("port", 389, cp.getPort());
}
Also used : LDAPCertStoreParameters(java.security.cert.LDAPCertStoreParameters)

Example 10 with LDAPCertStoreParameters

use of java.security.cert.LDAPCertStoreParameters in project robovm by robovm.

the class LDAPCertStoreParametersTest method testGetPort.

/**
     * 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);
}
Also used : LDAPCertStoreParameters(java.security.cert.LDAPCertStoreParameters)

Aggregations

LDAPCertStoreParameters (java.security.cert.LDAPCertStoreParameters)11 CertStoreParameters (java.security.cert.CertStoreParameters)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1