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"));
}
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"));
}
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);
}
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);
}
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);
}
Aggregations