Search in sources :

Example 11 with DeepTrimNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer 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 12 with DeepTrimNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer 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 13 with DeepTrimNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer 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 14 with DeepTrimNormalizer

use of org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer 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)

Aggregations

Normalizer (org.apache.directory.api.ldap.model.schema.Normalizer)14 DeepTrimNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimNormalizer)14 Test (org.junit.Test)14