Search in sources :

Example 16 with LDIFDeleteChangeRecord

use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.

the class RedactAttributeTransformationTestCase method testTransformDeleteChangeRecordProcessDNsFalsePreserveCountFalse.

/**
 * Provides test coverage for the transformChangeRecord method for an add
 * record with both processDNs and preserveValueCount arguments set to false.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testTransformDeleteChangeRecordProcessDNsFalsePreserveCountFalse() throws Exception {
    final Schema schema = Schema.getDefaultStandardSchema();
    final RedactAttributeTransformation t = new RedactAttributeTransformation(schema, false, false, "description", "displayName", "cn", "ou");
    final LDIFChangeRecord r = t.transformChangeRecord(new LDIFDeleteChangeRecord("cn=Test,ou=People,dc=example,dc=com"));
    assertNotNull(r);
    assertEquals(r, new LDIFDeleteChangeRecord("cn=Test,ou=People,dc=example,dc=com"));
}
Also used : LDIFChangeRecord(com.unboundid.ldif.LDIFChangeRecord) Schema(com.unboundid.ldap.sdk.schema.Schema) LDIFDeleteChangeRecord(com.unboundid.ldif.LDIFDeleteChangeRecord) Test(org.testng.annotations.Test)

Example 17 with LDIFDeleteChangeRecord

use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.

the class MoveSubtreeTransformationTestCase method testTransformDeleteChangeRecord.

/**
 * Provides general test coverage for the transformChangeRecord method for
 * delete change records.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testTransformDeleteChangeRecord() throws Exception {
    final MoveSubtreeTransformation t = new MoveSubtreeTransformation(new DN("o=example.com"), new DN("dc=example,dc=com"));
    LDIFChangeRecord r = t.transformChangeRecord(new LDIFDeleteChangeRecord("o=example.com"));
    assertNotNull(r);
    assertEquals(r, new LDIFDeleteChangeRecord("dc=example,dc=com"));
    r = t.transformChangeRecord(new LDIFDeleteChangeRecord("ou=People,o=example.com"));
    assertNotNull(r);
    assertEquals(r, new LDIFDeleteChangeRecord("ou=People,dc=example,dc=com"));
    r = t.transformChangeRecord(new LDIFDeleteChangeRecord("dc=example,dc=com"));
    assertNotNull(r);
    assertEquals(r, new LDIFDeleteChangeRecord("dc=example,dc=com"));
    r = t.transformChangeRecord(new LDIFDeleteChangeRecord("o=example.org"));
    assertNotNull(r);
    assertEquals(r, new LDIFDeleteChangeRecord("o=example.org"));
}
Also used : LDIFChangeRecord(com.unboundid.ldif.LDIFChangeRecord) DN(com.unboundid.ldap.sdk.DN) LDIFDeleteChangeRecord(com.unboundid.ldif.LDIFDeleteChangeRecord) Test(org.testng.annotations.Test)

Example 18 with LDIFDeleteChangeRecord

use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugLDIFWrite4EnabledWithoutLDIF.

/**
 * Tests the fourth {@code debugLDIFWrite} method with the debugger enabled
 * and a debug type set that does not include the LDIF type.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testDebugLDIFWrite4EnabledWithoutLDIF() throws Exception {
    Debug.setEnabled(true, EnumSet.of(DebugType.OTHER));
    testLogHandler.resetMessageCount();
    assertFalse(Debug.debugEnabled(DebugType.LDIF));
    Debug.debugLDIFWrite(Level.FINEST, new LDIFDeleteChangeRecord("dc=example,dc=com"));
    assertTrue(testLogHandler.getMessageCount() >= 0);
}
Also used : LDIFDeleteChangeRecord(com.unboundid.ldif.LDIFDeleteChangeRecord) Test(org.testng.annotations.Test)

Example 19 with LDIFDeleteChangeRecord

use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugLDIFWrite4EnabledAll.

/**
 * Tests the fourth {@code debugLDIFWrite} method with the debugger enabled
 * and a debug type set of all types.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testDebugLDIFWrite4EnabledAll() throws Exception {
    Debug.setEnabled(true);
    testLogHandler.resetMessageCount();
    assertTrue(Debug.debugEnabled(DebugType.LDIF));
    Debug.debugLDIFWrite(Level.FINEST, new LDIFDeleteChangeRecord("dc=example,dc=com"));
    assertTrue(testLogHandler.getMessageCount() >= 1);
}
Also used : LDIFDeleteChangeRecord(com.unboundid.ldif.LDIFDeleteChangeRecord) Test(org.testng.annotations.Test)

Example 20 with LDIFDeleteChangeRecord

use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugLDIFWrite4DisabledAll.

/**
 * Tests the fourth {@code debugLDIFWrite} method with the debugger disabled
 * and a debug type set of all types.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testDebugLDIFWrite4DisabledAll() throws Exception {
    Debug.setEnabled(false);
    testLogHandler.resetMessageCount();
    assertFalse(Debug.debugEnabled(DebugType.LDIF));
    Debug.debugLDIFWrite(Level.FINEST, new LDIFDeleteChangeRecord("dc=example,dc=com"));
    assertTrue(testLogHandler.getMessageCount() >= 0);
}
Also used : LDIFDeleteChangeRecord(com.unboundid.ldif.LDIFDeleteChangeRecord) Test(org.testng.annotations.Test)

Aggregations

LDIFDeleteChangeRecord (com.unboundid.ldif.LDIFDeleteChangeRecord)67 Test (org.testng.annotations.Test)58 LDIFAddChangeRecord (com.unboundid.ldif.LDIFAddChangeRecord)29 LDIFChangeRecord (com.unboundid.ldif.LDIFChangeRecord)20 LDIFModifyChangeRecord (com.unboundid.ldif.LDIFModifyChangeRecord)18 LDIFModifyDNChangeRecord (com.unboundid.ldif.LDIFModifyDNChangeRecord)17 Calendar (java.util.Calendar)17 GregorianCalendar (java.util.GregorianCalendar)17 Entry (com.unboundid.ldap.sdk.Entry)10 Attribute (com.unboundid.ldap.sdk.Attribute)9 ModifyRequest (com.unboundid.ldap.sdk.ModifyRequest)9 ReadOnlyEntry (com.unboundid.ldap.sdk.ReadOnlyEntry)9 DN (com.unboundid.ldap.sdk.DN)7 LDAPException (com.unboundid.ldap.sdk.LDAPException)6 File (java.io.File)5 Schema (com.unboundid.ldap.sdk.schema.Schema)4 Nullable (com.unboundid.util.Nullable)4 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)3 ChangeLogEntry (com.unboundid.ldap.sdk.ChangeLogEntry)3 Modification (com.unboundid.ldap.sdk.Modification)3