| | |
| | | * Test setExcludeAttribute method of LDIFEntryWriter Throws a |
| | | * NullPointerException if the attributeDescription is null. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = NullPointerException.class) |
| | | public void testSetExcludeAttributeDoesntAllowNull() throws Exception { |
| | |
| | | /** |
| | | * Test to write an entry with attribute exclusions. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeAttributeWithMatch() throws Exception { |
| | |
| | | * Test to write an entry with attribute exclusions. In this test, the |
| | | * attribute description 'vip' doesn't exist then the entry must be written |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeAttributeWithNoMatch() throws Exception { |
| | |
| | | * Test SetExcludeBranch method of LDIFEntryWriter Throws a |
| | | * NullPointerException if the excludeBranch is null. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = NullPointerException.class) |
| | | public void testSetExcludeBranchDoesntAllowNull() throws Exception { |
| | |
| | | /** |
| | | * Test SetExcludeBranch method of LDIFEntryWriter. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeBranchWrongDN() throws Exception { |
| | |
| | | /** |
| | | * Test SetExcludeBranch method of LDIFEntryWriter. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeBranchWithNoMatch() throws Exception { |
| | |
| | | /** |
| | | * Test SetExcludeBranch method of LDIFEntryWriter. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeBranchWithMatch() throws Exception { |
| | |
| | | * Test SetExcludeFilter method of LDIFEntryWriter Throws a |
| | | * NullPointerException if the excludeFilter is null. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = NullPointerException.class) |
| | | public void testsetExcludeFilterDoesntAllowNull() throws Exception { |
| | |
| | | * Test testSetExcludeFilter method of LDIFEntryWriter. StandardEntry has an |
| | | * objectclass : person |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeFilterWithMatch() throws Exception { |
| | |
| | | * Test testSetExcludeFilter method of LDIFEntryWriter StandardEntry has an |
| | | * objectclass : person |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeFilterWithNoMatch() throws Exception { |
| | |
| | | * Test SetIncludeAttribute method of LDIFEntryWriter Throws a |
| | | * NullPointerException if the attributeDescription is null. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = NullPointerException.class) |
| | | public void testSetIncludeAttributeDoesntAllowNull() throws Exception { |
| | |
| | | * Test SetIncludeAttribute method of LDIFEntryWriter. Inserting attribute |
| | | * cn (common name) & sn (surname) |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeAttributeWithMatch() throws Exception { |
| | |
| | | * field "manager" is not present in the StandardEntry. Then the entry must |
| | | * only write the first line : dn: cn=John Doe,ou=people,dc=example,dc=com |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeAttributeWithNoMatch() throws Exception { |
| | |
| | | * Test SetIncludeAttribute method of LDIFEntryWriter. Attempted insertions |
| | | * repeating attributes. An attribute mustn't be written twice or +. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeAttributeWithRepeatedAttributes() throws Exception { |
| | |
| | | * Test to write an entry excluding all operational attributes |
| | | * setExcludeAllOperationalAttributes to false (default case) |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeAllOperationalAttributesFalse() throws Exception { |
| | |
| | | * setExcludeAllOperationalAttributes is forced to true Result should be dn: |
| | | * cn=John Doe,ou=people,dc=example,dc=com plus an empty line. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeAllOperationalAttributesTrue() throws Exception { |
| | |
| | | * Test to write an entry excluding user attributes Default case - full |
| | | * entry must be written |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeAllUserAttributesFalse() throws Exception { |
| | |
| | | * Test to write an entry excluding user attributes result should be dn: |
| | | * cn=John Doe,ou=people,dc=example,dc=com plus an empty line. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetExcludeAllUserAttributesTrue() throws Exception { |
| | |
| | | * Test SetIncludeBranch method of LDIFEntryWriter Throws a |
| | | * NullPointerException if the includeBranch is null. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = NullPointerException.class) |
| | | public void testSetIncludeBranchDoesntAllowNull() throws Exception { |
| | |
| | | * Test SetIncludeBranch method of LDIFEntryWriter verifying right data are |
| | | * present. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeBranchWithMatch() throws Exception { |
| | |
| | | * "dc=opendj,dc=org", which is not the one from the standard entry Entry |
| | | * must not be written |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeBranchWithNoMatch() throws Exception { |
| | |
| | | * Filter.equality("objectclass", "vip"); which is not the one from the |
| | | * standard entry. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeFilterWithNoMatch() throws Exception { |
| | |
| | | * Filter.equality("objectclass", "person"); which is the one from the |
| | | * standard entry. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetIncludeFilterWithMatch() throws Exception { |
| | |
| | | * Test SetIncludeFilter method of LDIFEntryWriter Throws a |
| | | * NullPointerException if the schema is null. |
| | | * |
| | | * @throws NullPointerException |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = NullPointerException.class) |
| | | public void testSetIncludeFilterDoesntAllowNull() throws Exception { |
| | |
| | | /** |
| | | * Test to write an entry adding the user friendly Comment TODO |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testSetAddUserFriendlyComments() throws IOException { |
| | | public void testSetAddUserFriendlyComments() throws Exception { |
| | | final List<String> actual = new ArrayList<String>(); |
| | | final LDIFEntryWriter writer = new LDIFEntryWriter(actual); |
| | | |
| | |
| | | * Testing the WriteEntry function using the mock for testing more |
| | | * IOExceptions and verify if they are correctly handled. |
| | | * |
| | | * @throws FileNotFoundException |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test(expectedExceptions = IOException.class) |
| | | public void testWriteEntryUsingMockOutputThrowsIOException() throws Exception { |
| | |
| | | /** |
| | | * Verify flush/close are also forwarded to the stream. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testWriteEntryUsingMockOutputForFlushAndClose() throws Exception { |
| | |
| | | * Test the WriteEntry using an output file verifying write is correctly |
| | | * invoked. |
| | | * |
| | | * @throws Exception |
| | | * @throws Exception If the test failed unexpectedly. |
| | | */ |
| | | @Test |
| | | public void testWriteEntryOutputStreamUsingMock() throws Exception { |