| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock, AS. |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | public class LDAPCompareTestCase |
| | | extends ToolsTestCase |
| | | { |
| | | // The path to a file containing an invalid bind password. |
| | | private String invalidPasswordFile; |
| | | |
| | | // The path to a file containing a valid bind password. |
| | | private String validPasswordFile; |
| | | |
| | |
| | | fileWriter = new FileWriter(pwFile); |
| | | fileWriter.write("wrongPassword" + System.getProperty("line.separator")); |
| | | fileWriter.close(); |
| | | invalidPasswordFile = pwFile.getAbsolutePath(); |
| | | } |
| | | |
| | | @AfterClass |
| | |
| | | /** |
| | | * Tests a simple LDAPv2 compare. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testSimpleLDAPv2Compare() |
| | |
| | | /** |
| | | * Tests a simple LDAPv3 compare in which the assertion is true. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testSimpleLDAPv3CompareTrue() |
| | |
| | | /** |
| | | * Tests a simple LDAPv3 compare in which the assertion is false. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testSimpleLDAPv3CompareFalse() |
| | |
| | | /** |
| | | * Tests a simple compare using SSL with blind trust. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testSSLBlindTrust() |
| | |
| | | /** |
| | | * Tests a simple compare using SSL with a trust store. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testSSLTrustStore() |
| | |
| | | /** |
| | | * Tests a simple compare using StartTLS with blind trust. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testStartTLSBlindTrust() |
| | |
| | | /** |
| | | * Tests a simple compare using StartTLS with a trust store. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testStartTLSTrustStore() |
| | |
| | | * Tests a a comparison in which the assertion value is base64-encoded with a |
| | | * valid encoding. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareValidBase64Assertion() |
| | |
| | | * Tests a a comparison in which the assertion value should be base64-encoded |
| | | * but uses an incorrect encoding. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareInvalidBase64Assertion() |
| | |
| | | /** |
| | | * Tests a a comparison in which the assertion value is contained in a file. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareAssertionValueFromFile() |
| | |
| | | * Tests a a comparison in which the assertion value is contained in a file |
| | | * that does not exist. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareAssertionValueFromNonExistentFile() |
| | |
| | | * Tests a a comparison using the LDAP assertion control in which the |
| | | * assertion is true. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareLDAPAssertionControlTrue() |
| | |
| | | * Tests a a comparison using the LDAP assertion control in which the |
| | | * assertion is not true. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareLDAPAssertionControlNotTrue() |
| | |
| | | * Tests a a compare operation reading the DNs to compare from a file. Some |
| | | * of the compares will succeed and others will not. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareDNsFromFile() |
| | |
| | | * Tests a a compare operation reading the DNs to compare from a file that |
| | | * doesn't exist. |
| | | * |
| | | * @throws Exception If an unexpectd problem occurs. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testCompareDNsFromNonExistentFile() |