Package javax.naming.ldap

Examples of javax.naming.ldap.LdapContext.createSubcontext()


            "objectClass: top",
            "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
            "cn: dummy",
            "m-dependencies: nis" );
       
        schemaRoot.createSubcontext( "cn=dummy", dummySchema );
       
        // check that the nis schema is loaded and the dummy schema is loaded
        assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
       
View Full Code Here


        String description = "New Value";

        Attributes attributes = LdifUtils.createAttributes( "objectClass: top", "objectClass: organizationalUnit",
            "ou: Test", "description: Old Value" );

        DirContext ctx = ctxRoot.createSubcontext( dn, attributes );
        assertNotNull( ctx );

        ModificationItem[] mods = new ModificationItem[1];
        mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute( "description", description ) );
View Full Code Here

        String dn = "ou=Test";

        Attributes attributes = LdifUtils.createAttributes( "objectClass: top", "objectClass: organizationalUnit",
            "ou: Test" );

        DirContext ctx = ctxRoot.createSubcontext( dn, attributes );
        assertNotNull( ctx );

        ctxRoot.destroySubcontext( dn );

        SearchControls sc = new SearchControls();
View Full Code Here

        String base = "uid=kevin";

        //create subcontext
        try
        {
            sysRoot.createSubcontext( base, attrs );
            fail( "Should not reach this state" );
        }
        catch ( LdapSchemaViolationException e )
        {
            assertTrue( true );
View Full Code Here

        String base = "sn=kevin";

        // create subcontext
        try
        {
            sysRoot.createSubcontext( base, attrs );
            fail( "Should not reach this state" );
        }
        catch ( LdapInvalidAttributeValueException e )
        {
            assertTrue( true );
View Full Code Here

            "ObjectClass: inetorgperson",
            "cn: John\\+Doe",
            "sn: \\+Name\\+" );
       
        LdapContext sysRoot = getSystemContext( service );
        DirContext dc = sysRoot.createSubcontext( "cn=John\\+Doe", entry );
       
        ServerLdapContext sc = ( ServerLdapContext ) dc;
       
        assertTrue( sc.getDn().toString().contains( "+" ) );
View Full Code Here

        String base = "cn=kevin Spacey";

        //create subcontext
        try
        {
            sysRoot.createSubcontext( base, attrs );
        }
        catch ( NamingException ne )
        {
            fail();
        }
View Full Code Here

            "objectClass: top",
            "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
            "cn: broken",
            MetaSchemaConstants.M_DISABLED_AT, "TRUE" );
       
        schemaRoot.createSubcontext( "cn=broken", dummySchema );
    }

   
    private void createEnabledValidSchema( String schemaName ) throws Exception
    {
View Full Code Here

        Attributes dummySchema = LdifUtils.createAttributes(
            "objectClass: top",
            "objectClass", MetaSchemaConstants.META_SCHEMA_OC,
            "cn", schemaName );
       
        schemaRoot.createSubcontext( "cn=" + schemaName, dummySchema );
    }

    // -----------------------------------------------------------------------
    // Enabling Schema tests
    // -----------------------------------------------------------------------
View Full Code Here

            "cn: dummy",
            "m-dependencies: core",
            "m-dependencies: system",
            MetaSchemaConstants.M_DISABLED_AT, "FALSE" );
       
        schemaRoot.createSubcontext( "cn=dummy", dummySchema );
       
        assertTrue( IntegrationUtils.isEnabled( service, "dummy" ) );
        assertNotNull( schemaRoot.lookup( "cn=dummy" ) );
       
        assertTrue( isOnDisk( dn ) );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.