use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.
the class DeepTrimToLowerNormalizerTest method testNormalizeIgnore.
@Test
public void testNormalizeIgnore() throws Exception {
Normalizer normalizer = new DeepTrimToLowerNormalizer("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)));
}
use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.
the class DeepTrimToLowerNormalizerTest method testInsignifiantSpacesStringOneCombining.
@Test
public void testInsignifiantSpacesStringOneCombining() throws LdapException {
Normalizer normalizer = new DeepTrimToLowerNormalizer("1.1.1");
char[] chars = new char[] { 'e', 0x0301 };
char[] expected = new char[] { ' ', '\u00E9', ' ' };
String expectedStr = new String(expected);
String charsStr = new String(chars);
assertEquals(expectedStr, normalizer.normalize(charsStr));
}
use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.
the class DeepTrimToLowerNormalizerTest method testInsignifiantSpacesStringOneChar.
@Test
public void testInsignifiantSpacesStringOneChar() throws LdapException {
Normalizer normalizer = new DeepTrimToLowerNormalizer("1.1.1");
assertEquals(" a ", normalizer.normalize("a"));
}
use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.
the class DeepTrimToLowerNormalizerTest method testNormalizeString.
@Test
public void testNormalizeString() throws Exception {
Normalizer normalizer = new DeepTrimToLowerNormalizer("1.1.1");
assertEquals(" abcd ", normalizer.normalize("abcd"));
}
use of org.apache.directory.api.ldap.model.schema.Normalizer in project directory-ldap-api by apache.
the class NumericNormalizerTest method testInsignifiantSpacesStringOneChar.
@Test
public void testInsignifiantSpacesStringOneChar() throws LdapException {
Normalizer normalizer = new NumericNormalizer();
assertEquals("1", normalizer.normalize("1"));
}
Aggregations