As a side effect on the changes I'm applying, I detect tests that should
have failed :
@Test
public void testSimpleRdnNoValueSerialization() throws
LdapException, IOException, ClassNotFoundException
{
Rdn rdn = new Rdn( schemaManager, " CN =" );
...
should simply fail immediately, as a cn should never accept an empty
value. Niow, I get this exception (plain normal) :
org.apache.directory.api.ldap.model.exception.LdapInvalidDnException:
ERR_04447_CANNOT_NORMALIZE_VALUE Cannot normalize the wrapped value
ERR_04473_NOT_VALID_VALUE Not a valid value '' for the AttributeType
'attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
DESC 'RFC2256: common name(s) for which the entity is known by'
SUP name
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
USAGE userApplications )'
at
org.apache.directory.api.ldap.model.name.Dn.atavOidToName(Dn.java:1117)
at
org.apache.directory.api.ldap.model.name.Dn.rdnOidToName(Dn.java:1154)
at org.apache.directory.api.ldap.model.name.Rdn.apply(Rdn.java:481)
at org.apache.directory.api.ldap.model.name.Rdn.<init>(Rdn.java:243)
at
org.apache.directory.api.ldap.model.name.SchemaAwareRdnTest.testSimpleRdnNoValueSerialization(SchemaAwareRdnTest.java:1066)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by:
org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException:
ERR_04447_CANNOT_NORMALIZE_VALUE Cannot normalize the wrapped value
ERR_04473_NOT_VALID_VALUE Not a valid value '' for the AttributeType
'attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
DESC 'RFC2256: common name(s) for which the entity is known by'
SUP name
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
USAGE userApplications )'
at
org.apache.directory.api.ldap.model.entry.AbstractValue.apply(AbstractValue.java:219)
at
org.apache.directory.api.ldap.model.entry.StringValue.<init>(StringValue.java:122)
at
org.apache.directory.api.ldap.model.name.Dn.atavOidToName(Dn.java:1099)
... 23 more
Caused by:
org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException:
ERR_04473_NOT_VALID_VALUE Not a valid value '' for the AttributeType
'attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
DESC 'RFC2256: common name(s) for which the entity is known by'
SUP name
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
USAGE userApplications )'
at
org.apache.directory.api.ldap.model.entry.AbstractValue.apply(AbstractValue.java:212)
... 25 more