Search in sources :

Example 11 with DeepTrimToLowerNormalizer

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

the class DeepTrimToLowerNormalizerTest method testDeepTrimToLowerNormalizerNull.

@Test
public void testDeepTrimToLowerNormalizerNull() throws LdapException {
    Normalizer normalizer = new DeepTrimToLowerNormalizer("1.1.1");
    assertNull(normalizer.normalize((String) null));
}
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)

Example 12 with DeepTrimToLowerNormalizer

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

the class DeepTrimToLowerNormalizerTest method testDeepTrimToLowerNormalizerEmpty.

@Test
public void testDeepTrimToLowerNormalizerEmpty() 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)

Example 13 with DeepTrimToLowerNormalizer

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

the class DeepTrimToLowerNormalizerTest method testDeepTrimToLowerNormalizerTwoSpaces.

@Test
public void testDeepTrimToLowerNormalizerTwoSpaces() 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)

Example 14 with DeepTrimToLowerNormalizer

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

the class DeepTrimToLowerNormalizerTest method testInsignifiantSpacesStringNChars.

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

Example 15 with DeepTrimToLowerNormalizer

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

the class DeepTrimToLowerNormalizerTest method testInsignifiantSpacesStringCharsSpaces.

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

DeepTrimToLowerNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer)24 Normalizer (org.apache.directory.api.ldap.model.schema.Normalizer)17 Test (org.junit.Test)16 PrepareString (org.apache.directory.api.ldap.model.schema.PrepareString)3 StringComparator (org.apache.directory.api.ldap.model.schema.comparators.StringComparator)3 OidNormalizer (org.apache.directory.api.ldap.model.schema.normalizers.OidNormalizer)3 Before (org.junit.Before)3 BeforeClass (org.junit.BeforeClass)3 LdapSyntax (org.apache.directory.api.ldap.model.schema.LdapSyntax)2 MutableAttributeType (org.apache.directory.api.ldap.model.schema.MutableAttributeType)2 MutableMatchingRule (org.apache.directory.api.ldap.model.schema.MutableMatchingRule)2 SyntaxChecker (org.apache.directory.api.ldap.model.schema.SyntaxChecker)2 LdapException (org.apache.directory.api.ldap.model.exception.LdapException)1 ByteArrayComparator (org.apache.directory.api.ldap.model.schema.comparators.ByteArrayComparator)1 Ignore (org.junit.Ignore)1