| | |
| | | import org.forgerock.opendj.ldap.schema.SchemaValidationPolicy.Action; |
| | | import org.testng.Assert; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.fest.assertions.Assertions.assertThat; |
| | | import static org.mockito.Matchers.any; |
| | | import static org.mockito.Matchers.anyListOf; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Tries to read an entry composed by multi-valued attributes. The |
| | | * multi-valued attributes contains an interesting case where two of them |
| | | * represents the same value, one in uppercase and the other in lower case. |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | @Test(enabled = false) |
| | | public void testLDIFEntryReaderMultiplesAttributeValuesDifferentLetterCase() throws Exception { |
| | | |
| | | // @formatter:off |
| | | final String[] strEntry = { |
| | | "dn: cn=Character Set,cn=Password Validators,cn=config", |
| | | "objectClass: ds-cfg-character-set-password-validator", |
| | | "objectClass: ds-cfg-password-validator", |
| | | "objectClass: top", |
| | | "ds-cfg-enabled: true", |
| | | "ds-cfg-java-class: org.opends.server.extensions.CharacterSetPasswordValidator", |
| | | "ds-cfg-allow-unclassified-characters: true", |
| | | "ds-cfg-character-set: 1:abcdefghijklmnopqrstuvwxyz", |
| | | "ds-cfg-character-set: 1:ABCDEFGHIJKLMNOPQRSTUVWXYZ", |
| | | "ds-cfg-character-set: 1:0123456789", |
| | | "ds-cfg-character-set: 1:~!@#$%^&*()-_=+[]{}|;:,.<>/?", |
| | | "cn: Character Set" |
| | | }; |
| | | // @formatter:on |
| | | final String path = TestCaseUtils.createTempFile(strEntry); |
| | | final FileInputStream in = new FileInputStream(path); |
| | | final LDIFEntryReader reader = new LDIFEntryReader(in); |
| | | |
| | | try { |
| | | assertThat(reader.hasNext()); |
| | | final Entry entry = reader.readEntry(); |
| | | assertThat(entry.getName().toString()).isEqualTo( |
| | | "cn=Character Set,cn=Password Validators,cn=config"); |
| | | // List the attributes : objectClass ds-cfg-enabled ds-cfg-java-class |
| | | // ds-cfg-allow-unclassified-characters ds-cfg-character-set cn |
| | | assertThat(entry.getAttributeCount()).isEqualTo(6); |
| | | assertThat(entry.getAttribute("ds-cfg-character-set")).isNotEmpty(); |
| | | assertThat(entry.getAttribute("ds-cfg-character-set").toArray().length).isEqualTo(4); |
| | | assertThat(reader.hasNext()).isFalse(); |
| | | } finally { |
| | | reader.close(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Testing to read an entry which containing empty required attributes. |
| | | * |