Search in sources :

Example 66 with Normalizer

use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.

the class DeepTrimNormalizerTest method testInsignifiantSpacesStringOneCombining.

@Test
public void testInsignifiantSpacesStringOneCombining() throws LdapException {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    char[] chars = new char[] { ' ', 0x0310 };
    char[] expected = new char[] { ' ', 0x0310, ' ' };
    // assertEquals( new String( expected ), normalizer.normalize( new String( chars ) ) );
    String expectedStr = new String(expected);
    String charsStr = new String(chars);
    assertEquals(expectedStr, normalizer.normalize(charsStr));
}
Also used : DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Normalizer(org.apache.directory.api.ldap.model.schema.Normalizer) DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Test(org.junit.Test)

Example 67 with Normalizer

use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.

the class DeepTrimNormalizerTest method testDeepTrimNormalizerEmpty.

@Test
public void testDeepTrimNormalizerEmpty() throws LdapException {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    assertEquals("  ", normalizer.normalize(""));
}
Also used : DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Normalizer(org.apache.directory.api.ldap.model.schema.Normalizer) DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Test(org.junit.Test)

Example 68 with Normalizer

use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.

the class DeepTrimNormalizerTest method testDeepTrimNormalizerNSpaces.

@Test
public void testDeepTrimNormalizerNSpaces() throws LdapException {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    assertEquals("  ", normalizer.normalize("      "));
}
Also used : DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Normalizer(org.apache.directory.api.ldap.model.schema.Normalizer) DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Test(org.junit.Test)

Example 69 with Normalizer

use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.

the class DeepTrimNormalizerTest method testInsignifiantSpacesStringNCombining.

@Test
public void testInsignifiantSpacesStringNCombining() throws LdapException {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    char[] chars = new char[] { ' ', 0x0310, ' ', 0x0311, ' ', 0x0312 };
    char[] expected = new char[] { ' ', 0x0310, ' ', ' ', 0x0311, ' ', ' ', 0x0312, ' ' };
    assertEquals(new String(expected), normalizer.normalize(new String(chars)));
}
Also used : DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Normalizer(org.apache.directory.api.ldap.model.schema.Normalizer) DeepTrimNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer) Test(org.junit.Test)

Example 70 with Normalizer

use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.

the class DeepTrimToLowerNormalizerTest method testDeepTrimToLowerNormalizerNSpaces.

@Test
public void testDeepTrimToLowerNormalizerNSpaces() throws LdapException {
    Normalizer normalizer = new DeepTrimToLowerNormalizer("1.1.1");
    assertEquals("  ", normalizer.normalize("      "));
}
Also used : DeepTrimToLowerNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer) DeepTrimToLowerNormalizer(org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer) Normalizer(org.apache.directory.api.ldap.model.schema.Normalizer) Test(org.junit.Test)

Aggregations

Normalizer (org.apache.directory.api.ldap.model.schema.Normalizer)78 Test (org.junit.Test)59 DeepTrimToLowerNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer)20 DeepTrimNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer)15 TelephoneNumberNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.TelephoneNumberNormalizer)12 LdapException (org.apache.directory.api.ldap.model.exception.LdapException)10 NumericNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.NumericNormalizer)9 SchemaManager (org.apache.directory.api.ldap.model.schema.SchemaManager)7 NoOpNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.NoOpNormalizer)7 DefaultSchemaManager (org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager)7 MutableAttributeType (org.apache.directory.api.ldap.model.schema.MutableAttributeType)6 PrepareString (org.apache.directory.api.ldap.model.schema.PrepareString)6 LdapSchemaException (org.apache.directory.api.ldap.model.exception.LdapSchemaException)5 LdapSyntax (org.apache.directory.api.ldap.model.schema.LdapSyntax)5 MatchingRule (org.apache.directory.api.ldap.model.schema.MatchingRule)5 MutableMatchingRule (org.apache.directory.api.ldap.model.schema.MutableMatchingRule)4 SyntaxChecker (org.apache.directory.api.ldap.model.schema.SyntaxChecker)4 ByteArrayComparator (org.apache.directory.api.ldap.model.schema.comparators.ByteArrayComparator)4 BooleanNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.BooleanNormalizer)4 LdapProtocolErrorException (org.apache.directory.api.ldap.model.exception.LdapProtocolErrorException)3