Supposedly we added a feature that allows us to do ctx.createSubcontext("cn=test")... without attributes (There's an RFC for this I think). The server just adds the necessary ObjectClass for us. It runs fine in my tests. Yes, the server does have to be run besides the test. I have to look at the other setup stuff to figure out how to get around that.

Emmanuel Lecharny (JIRA) wrote:
[ https://issues.apache.org/jira/browse/DIRSERVER-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503189 ]
Emmanuel Lecharny commented on DIRSERVER-964:
---------------------------------------------

I have changed the test to use :
configuration.setPartitionConfigurations( partitions );
now, I have another pb : it's not a selfcontained test. I have to launch ADS 
beside the test in order to make it happy. It would be better and easier to 
fgollow thes tests in server-unit for such self-contained tests.

ok, when I launch ADS beside, here is what  I get :
org.apache.directory.shared.ldap.exception.LdapSchemaViolationException: 
Attribute cn not declared in objectClasses of entry cn=L0,ou=test
        at 
org.apache.directory.server.core.schema.SchemaService.assertAllAttributesAllowed(SchemaService.java:1767)
        at 
org.apache.directory.server.core.schema.SchemaService.check(SchemaService.java:1704)
        at 
org.apache.directory.server.core.schema.SchemaService.add(SchemaService.java:1722)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.operational.OperationalAttributeService.add(OperationalAttributeService.java:171)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.exception.ExceptionService.add(ExceptionService.java:205)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.interceptor.BaseInterceptor.add(BaseInterceptor.java:100)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.authz.AuthorizationService.add(AuthorizationService.java:411)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.referral.ReferralService.add(ReferralService.java:292)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.authn.AuthenticationService.add(AuthenticationService.java:213)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain$Entry$1.add(InterceptorChain.java:1142)
        at 
org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:117)
        at 
org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:698)
        at 
org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:352)
        at 
org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:340)
        at 
org.apache.directory.server.core.jndi.ServerContext.createSubcontext(ServerContext.java:328)
        at 
org.apache.directory.server.core.jndi.ServerContext.createSubcontext(ServerContext.java:305)
        at javax.naming.InitialContext.createSubcontext(InitialContext.java:464)
        at 
SelfContainedBindingTest.testNullBinding(SelfContainedBindingTest.java:99)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

You have to use createSubContext( Name, Attributes )

Binding does not return DirContext Object's when creating by doing 
ctx.createSubcontext("cn=test");
---------------------------------------------------------------------------------------------------

                Key: DIRSERVER-964
                URL: https://issues.apache.org/jira/browse/DIRSERVER-964
            Project: Directory ApacheDS
         Issue Type: Bug
           Reporter: Ole Ersoy
            Fix For: pre-2.0

        Attachments: SelfContainedBindingTest.java


See test.  I expect assertNull(binding.getObject()); to fail, but it passes.  
If I manually attempt to lookup the DirContext that the same DirContext 
instance, I get a real directory context.


Reply via email to