Search in sources :

Example 6 with DeepTrimNormalizer

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

the class DeepTrimNormalizerTest method testNormalizeIgnore.

@Test
public void testNormalizeIgnore() throws Exception {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    char[] chars = new char[58];
    int pos = 0;
    for (char c = 0x0000; c < 0x0008; c++) {
        chars[pos++] = c;
    }
    for (char c = 0x000E; c < 0x001F; c++) {
        chars[pos++] = c;
    }
    for (char c = 0x007F; c < 0x0084; c++) {
        chars[pos++] = c;
    }
    for (char c = 0x0086; c < 0x009F; c++) {
        chars[pos++] = c;
    }
    chars[pos++] = 0x00AD;
    assertEquals("  ", 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 7 with DeepTrimNormalizer

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

the class DeepTrimNormalizerTest method testInsignifiantSpacesStringOneChar.

@Test
public void testInsignifiantSpacesStringOneChar() throws LdapException {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    assertEquals(" a ", normalizer.normalize("a"));
}
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 8 with DeepTrimNormalizer

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

the class DeepTrimNormalizerTest method testDeepTrimNormalizerOneSpace.

@Test
public void testDeepTrimNormalizerOneSpace() 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 9 with DeepTrimNormalizer

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

the class DeepTrimNormalizerTest method testDeepTrimNormalizerTwoSpaces.

@Test
public void testDeepTrimNormalizerTwoSpaces() 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 10 with DeepTrimNormalizer

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

the class DeepTrimNormalizerTest method testInsignifiantSpacesStringNChars.

@Test
public void testInsignifiantSpacesStringNChars() throws LdapException {
    Normalizer normalizer = new DeepTrimNormalizer("1.1.1");
    assertEquals(" aaaaa ", normalizer.normalize("aaaaa"));
}
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