use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.
the class DebugTestCase method testDebugLDIFWrite2EnabledWithoutLDIF.
/**
* Tests the second {@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 testDebugLDIFWrite2EnabledWithoutLDIF() throws Exception {
Debug.setEnabled(true, EnumSet.of(DebugType.OTHER));
testLogHandler.resetMessageCount();
assertFalse(Debug.debugEnabled(DebugType.LDIF));
Debug.debugLDIFWrite(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 testDebugLDIFWrite2DisabledAll.
/**
* Tests the second {@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 testDebugLDIFWrite2DisabledAll() throws Exception {
Debug.setEnabled(false);
testLogHandler.resetMessageCount();
assertFalse(Debug.debugEnabled(DebugType.LDIF));
Debug.debugLDIFWrite(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 testDebugLDIFRead2EnabledWithoutLDIF.
/**
* Tests the second {@code debugLDIFRead} 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 testDebugLDIFRead2EnabledWithoutLDIF() throws Exception {
Debug.setEnabled(true, EnumSet.of(DebugType.OTHER));
testLogHandler.resetMessageCount();
assertFalse(Debug.debugEnabled(DebugType.LDIF));
Debug.debugLDIFRead(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 testDebugLDIFRead2DisabledAll.
/**
* Tests the second {@code debugLDIFRead} method with the debugger disabled
* and a debug type set of all types.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDebugLDIFRead2DisabledAll() throws Exception {
Debug.setEnabled(false);
testLogHandler.resetMessageCount();
assertFalse(Debug.debugEnabled(DebugType.LDIF));
Debug.debugLDIFRead(new LDIFDeleteChangeRecord("dc=example,dc=com"));
assertTrue(testLogHandler.getMessageCount() >= 0);
}
use of com.unboundid.ldif.LDIFDeleteChangeRecord in project ldapsdk by pingidentity.
the class TransformLDIFTestCase method testExcludeRecordsWithoutChangeType.
/**
* Tests the ability to exclude LDIF records without change types.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testExcludeRecordsWithoutChangeType() throws Exception {
// Create the LDIF file to process.
final File sourceLDIFFile = createTempFile("dn: dc=example,dc=com", "objectClass: top", "objectClass: domain", "dc: example", "", "dn: ou=People,dc=example,dc=com", "changetype: add", "objectClass: top", "objectClass: organizationalUnit", "ou: People", "", "dn: ou=People,dc=example,dc=com", "changetype: modify", "add: description", "description: foo", "", "dn: ou=People,dc=example,dc=com", "changetype: moddn", "newrdn: ou=Users", "deleteoldrdn: 1", "", "dn: ou=Users,dc=example,dc=com", "changetype: delete");
final File outputFile = runTool("--sourceLDIF", sourceLDIFFile.getAbsolutePath(), "--excludeRecordsWithoutChangeType");
final LDIFReader reader = new LDIFReader(outputFile);
LDIFRecord r = reader.readLDIFRecord();
assertNotNull(r);
assertTrue(r instanceof LDIFAddChangeRecord);
r = reader.readLDIFRecord();
assertNotNull(r);
assertTrue(r instanceof LDIFModifyChangeRecord);
r = reader.readLDIFRecord();
assertNotNull(r);
assertTrue(r instanceof LDIFModifyDNChangeRecord);
r = reader.readLDIFRecord();
assertNotNull(r);
assertTrue(r instanceof LDIFDeleteChangeRecord);
assertNull(reader.readEntry());
reader.close();
}
Aggregations