CreateContextTest createTest = new CreateContextTest(); createTest.setUp(); createTest.testCreateContexts();
Attributes attributes = new BasicAttributes(); Attribute attribute = new BasicAttribute( "objectClass" ); attribute.add( "top" ); attribute.add( "organizationalUnit" ); attributes.put( attribute ); attributes.put( "ou", "testing00" ); DirContext ctx = sysRoot.createSubcontext( "ou=testing00", attributes ); assertNotNull( ctx );  ctx = ( DirContext ) sysRoot.lookup( "ou=testing00" ); assertNotNull( ctx );  attributes = ctx.getAttributes( "" ); assertNotNull( attributes ); assertEquals( "testing00", attributes.get( "ou" ).get() ); attribute = attributes.get( "objectClass" ); assertNotNull( attribute ); assertTrue( attribute.contains( "top" ) ); assertTrue( attribute.contains( "organizationalUnit" ) );   attributes = new BasicAttributes(); attribute = new BasicAttribute( "objectClass" ); attribute.add( "top" ); attribute.add( "organizationalUnit" ); attributes.put( attribute ); attributes.put( "ou", "testing01" ); ctx = sysRoot.createSubcontext( "ou=testing01", attributes ); assertNotNull( ctx );  ctx = ( DirContext ) sysRoot.lookup( "ou=testing01" ); assertNotNull( ctx );  attributes = ctx.getAttributes( "" ); assertNotNull( attributes ); assertEquals( "testing01", attributes.get( "ou" ).get() ); attribute = attributes.get( "objectClass" ); assertNotNull( attribute ); assertTrue( attribute.contains( "top" ) ); assertTrue( attribute.contains( "organizationalUnit" ) );   attributes = new BasicAttributes(); attribute = new BasicAttribute( "objectClass" ); attribute.add( "top" ); attribute.add( "organizationalUnit" ); attributes.put( attribute ); attributes.put( "ou", "testing02" ); ctx = sysRoot.createSubcontext( "ou=testing02", attributes ); assertNotNull( ctx );  ctx = ( DirContext ) sysRoot.lookup( "ou=testing02" ); assertNotNull( ctx );  attributes = ctx.getAttributes( "" ); assertNotNull( attributes ); assertEquals( "testing02", attributes.get( "ou" ).get() ); attribute = attributes.get( "objectClass" ); assertNotNull( attribute ); assertTrue( attribute.contains( "top" ) ); assertTrue( attribute.contains( "organizationalUnit" ) );   ctx = ( DirContext ) sysRoot.lookup( "ou=testing01" );  attributes = new BasicAttributes(); attribute = new BasicAttribute( "objectClass" ); attribute.add( "top" ); attribute.add( "organizationalUnit" ); attributes.put( attribute ); attributes.put( "ou", "subtest" ); ctx = ctx.createSubcontext( "ou=subtest", attributes ); assertNotNull( ctx );  ctx = ( DirContext ) sysRoot.lookup( "ou=subtest,ou=testing01" ); assertNotNull( ctx );  attributes = ctx.getAttributes( "" ); assertNotNull( attributes ); assertEquals( "subtest", attributes.get( "ou" ).get() ); attribute = attributes.get( "objectClass" ); assertNotNull( attribute ); assertTrue( attribute.contains( "top" ) ); assertTrue( attribute.contains( "organizationalUnit" ) );
    protected void setUp() throws Exception    {        super.setUp();        CreateContextTest createTest = new CreateContextTest();        createTest.setUp();        createTest.testCreateContexts();    }