directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oer...@apache.org
Subject svn commit: r550803 [8/10] - in /directory/sandbox/oersoy/das.ldap.parent: ./ das.ldap.constants/ das.ldap.constants/.settings/ das.ldap.constants/src/ das.ldap.constants/src/main/ das.ldap.constants/src/main/java/ das.ldap.constants/src/main/java/org/...
Date Tue, 26 Jun 2007 13:29:26 GMT
Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EObjectClassDestroyerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EObjectClassDestroyerTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EObjectClassDestroyerTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EObjectClassDestroyerTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,492 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.tuscany.das.ldap.schema.emf.destroy.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.prototype.setup.Prototype;
+import org.apache.tuscany.das.ldap.prototype.setup.PrototypeUtilities;
+import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator;
+import org.apache.tuscany.das.ldap.schema.create.MetaTopSDOObjectClassCreator;
+import org.apache.tuscany.das.ldap.schema.destroy.MetaTopSDOObjectClassDestroyer;
+import org.apache.tuscany.das.ldap.schema.emf.create.EObjectClassCreator;
+import org.apache.tuscany.das.ldap.schema.emf.create.EcoreTypeSystemCreator;
+import org.apache.tuscany.das.ldap.schema.emf.destroy.EObjectClassDestroyer;
+import org.apache.tuscany.das.ldap.schema.emf.destroy.EcoreTypeSystemDestroyer;
+import org.apache.tuscany.das.ldap.schema.embedded.setup.test.EcoreSchemaAndDASContextsSetup;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/*
+ * TODO Make sure that we test EAttribute deletion as well.
+ */
+public class EObjectClassDestroyerTest
+extends EcoreSchemaAndDASContextsSetup
+implements Prototype
+{
+    public void tearDown() 
+    throws NamingException, Exception
+    {
+        MetaTopSDOObjectClassDestroyer.
+        destroy(
+            ecoreAttributeTypesContext,
+            ecoreObjectClassesContext, 
+            TUSCANY_SYNTAX_OID_VALUE );        
+        
+        EcoreTypeSystemDestroyer.
+        destroy(
+            ecoreSyntaxesContext, 
+            ecoreSyntaxCheckersContext,
+            TUSCANY_SYNTAX_OID_VALUE);
+
+        super.tearDown();
+    }
+
+    public void setUp() 
+    throws NamingException, Exception
+    {
+        super.setUp();
+
+        ecoreFactory                   =
+            EcoreFactory.eINSTANCE;
+        ecorePackage                 =
+            EcorePackage.eINSTANCE;
+
+
+        EcoreTypeSystemCreator.
+        create(
+            ecoreSyntaxesContext,
+            ecoreSyntaxCheckersContext,
+            TUSCANY_SYNTAX_OID_VALUE);
+        
+        
+        MetaTopSDOObjectClassCreator 
+        metaTopSDOObjectClassCreator = 
+            new MetaTopSDOObjectClassCreator();
+        
+        metaTopSDOObjectClassCreator.
+        create(
+            ecoreAttributeTypesContext, 
+            ecoreObjectClassesContext, 
+            TUSCANY_SYNTAX_OID_VALUE );
+        
+
+        processedEClassifiers            = 
+            new ArrayList<EClass>();
+        
+        eClassL0                                 =
+            ecoreFactory.
+            createEClass();
+        
+        eClassL1                                 =
+            ecoreFactory.
+            createEClass();
+        
+        eClassL0.setName( "L0" );
+        eClassL1.setName( "L1" );
+    }
+    
+    /*
+     * Test the deletion of two
+     * single level hierarchy ObjectClasses
+     */
+    public void testDestroy0() 
+    throws NamingException, Exception
+    {
+        EPackage ePackage               = 
+            ecoreFactory.
+            createEPackage();
+        
+        ePackage.
+        setNsURI(xsdNamespace);
+
+        ePackage.
+        getEClassifiers().
+        add( eClassL0 );
+        
+        ePackage.
+        getEClassifiers().
+        add( eClassL1 );
+        
+
+        EObjectClassCreator
+        eObjectClassCreator             =
+            new EObjectClassCreator();
+        
+        eObjectClassCreator.
+        create(
+            metaContext,
+            ecoreAttributeTypesContext,
+            ecoreObjectClassesContext,
+            eClassL0, 
+            processedEClassifiers,
+            TUSCANY_SYNTAX_OID_VALUE );
+        
+        eObjectClassCreator.
+        create(
+            metaContext,
+            ecoreAttributeTypesContext,
+            ecoreObjectClassesContext,
+            eClassL1, 
+            processedEClassifiers,
+            TUSCANY_SYNTAX_OID_VALUE );
+        
+        String rdnL0                           = 
+            ComplexTypeRDNCreator.
+            create(
+                TUSCANY_SYNTAX_OID_VALUE,
+                xsdNamespace, 
+                eClassL0.getName());
+
+        String rdnL1                           = 
+            ComplexTypeRDNCreator.
+            create(
+                TUSCANY_SYNTAX_OID_VALUE,
+                xsdNamespace, 
+                eClassL1.getName());
+
+        eObjectClassL0EntryContext = 
+            ( DirContext ) 
+            ecoreObjectClassesContext.
+            lookup( rdnL0 );
+
+        eObjectClassL1EntryContext = 
+        ( DirContext ) 
+        ecoreObjectClassesContext.
+        lookup( rdnL1 );
+        
+        assertNotNull(
+            eObjectClassL0EntryContext);
+        
+        assertNotNull(
+            eObjectClassL1EntryContext);
+        
+        EObjectClassDestroyer.
+        destroy( 
+            metaContext,
+            ecoreAttributeTypesContext, 
+            ecoreObjectClassesContext, 
+            eClassL0, 
+            TUSCANY_SYNTAX_OID_VALUE );
+
+        EObjectClassDestroyer.
+        destroy(
+            metaContext,
+            ecoreAttributeTypesContext, 
+            ecoreObjectClassesContext, 
+            eClassL1, 
+            TUSCANY_SYNTAX_OID_VALUE );
+        
+        try
+        {
+            eObjectClassL0EntryContext = 
+                ( DirContext ) 
+                ecoreObjectClassesContext.
+                lookup( rdnL0 );
+        }
+        catch (Exception e)
+        {
+            eObjectClassL0EntryContext = 
+                null;
+        }
+
+        try
+        {
+            eObjectClassL1EntryContext = 
+                ( DirContext ) 
+                ecoreObjectClassesContext.
+                lookup( rdnL1 );
+        }
+        catch (Exception e)
+        {
+            eObjectClassL1EntryContext = 
+                null;
+        }
+        
+        assertNull(
+            eObjectClassL0EntryContext);
+        
+        assertNull(
+            eObjectClassL1EntryContext);
+    }
+
+    /*
+     * Testt the deletion of two
+     * ObjectClasses where L1 inherits from
+     * L0
+     */
+
+    public void testDestroy1() 
+    throws NamingException, Exception
+    {
+        eClassL1.
+        getESuperTypes().
+        add(eClassL0);
+
+        EPackage ePackage        = 
+            ecoreFactory.
+            createEPackage();
+        
+        ePackage.
+        setNsURI(xsdNamespace);
+
+        ePackage.
+        getEClassifiers().
+        add( eClassL0 );
+        
+        ePackage.
+        getEClassifiers().
+        add( eClassL1 );
+        
+
+        EObjectClassCreator
+        eObjectClassCreator           =
+            new EObjectClassCreator();
+        
+        eObjectClassCreator.
+        create(
+            metaContext,
+            ecoreAttributeTypesContext,
+            ecoreObjectClassesContext,
+            eClassL1, 
+            processedEClassifiers,
+            TUSCANY_SYNTAX_OID_VALUE );
+        
+        String rdnL0                          = 
+            ComplexTypeRDNCreator.
+            create(
+                TUSCANY_SYNTAX_OID_VALUE,
+                xsdNamespace, 
+                eClassL0.getName());
+
+        String rdnL1                          = 
+            ComplexTypeRDNCreator.
+            create(
+                TUSCANY_SYNTAX_OID_VALUE,
+                xsdNamespace, 
+                eClassL1.getName());
+
+        eObjectClassL0EntryContext = 
+            ( DirContext ) 
+            ecoreObjectClassesContext.
+            lookup( rdnL0 );
+
+        eObjectClassL1EntryContext = 
+        ( DirContext ) 
+        ecoreObjectClassesContext.
+        lookup( rdnL1 );
+        
+        assertNotNull(
+            eObjectClassL0EntryContext);
+        
+        assertNotNull(
+            eObjectClassL1EntryContext);
+
+        eClassL0MetaContext            =
+            ( DirContext ) 
+            metaContext.
+            lookup( 
+                "cn=" + eClassL0.getName() );
+
+        assertNotNull(
+            eClassL0MetaContext );
+        
+        eClassL1MetaContext            =
+            ( DirContext ) 
+            eClassL0MetaContext.
+            lookup( 
+                "cn=" + eClassL1.getName() );
+
+        assertNotNull(
+            eClassL0MetaContext );
+        
+        assertNotNull(
+            eClassL1MetaContext );
+
+        EObjectClassDestroyer.
+        destroy(
+            metaContext,
+            ecoreAttributeTypesContext, 
+            ecoreObjectClassesContext, 
+            eClassL1, 
+            TUSCANY_SYNTAX_OID_VALUE );
+
+        EObjectClassDestroyer.
+        destroy( 
+            metaContext,
+            ecoreAttributeTypesContext, 
+            ecoreObjectClassesContext, 
+            eClassL0, 
+            TUSCANY_SYNTAX_OID_VALUE );
+
+        try
+        {
+            eObjectClassL0EntryContext = 
+                ( DirContext ) 
+                ecoreObjectClassesContext.
+                lookup( rdnL0 );
+        }
+        catch (Exception e)
+        {
+            eObjectClassL0EntryContext = 
+                null;
+        }
+
+        try
+        {
+            eObjectClassL1EntryContext = 
+                ( DirContext ) 
+                ecoreObjectClassesContext.
+                lookup( rdnL1 );
+        }
+        catch (Exception e)
+        {
+            eObjectClassL1EntryContext = 
+                null;
+        }
+        
+        assertNull(
+            eObjectClassL0EntryContext);
+        
+        assertNull(
+            eObjectClassL1EntryContext);
+
+        
+        eClassL0MetaContext            =
+            ( DirContext ) 
+            metaContext.
+            lookup( 
+                "cn=" + eClassL0.getName() );
+
+        assertNotNull(
+            eClassL0MetaContext );
+
+        try
+        {
+            eClassL1MetaContext            =
+                ( DirContext ) 
+                eClassL0MetaContext.
+                lookup( 
+                    "cn=" + eClassL1.getName() );
+
+        }
+        catch (Exception e)
+        {
+            eClassL1MetaContext = 
+                null;
+        }
+        
+        assertNull(
+            eClassL1MetaContext);
+
+        metaContext.
+        destroySubcontext( 
+            "cn=" + eClassL0.getName() );
+    }
+    
+    /*
+     * Test the deletion of an ObjectClass that has 
+     * has attributes.
+     */
+    public void testDestroy2() throws NamingException, Exception
+    {
+    	userEClass.getEStructuralFeatures().add(userIDEAttribute);
+    	userEClass.getEStructuralFeatures().add(userNameEAttribute);
+    	userEClass.getEStructuralFeatures().add(userPasswordEAttribute);
+    	userEClass.getEStructuralFeatures().add(authorizationEReference);
+    	
+        EPackage ePackage        = 
+            ecoreFactory.
+            createEPackage();
+        
+        ePackage.
+        setNsURI(xsdNamespace);
+
+        ePackage.
+        getEClassifiers().
+        add( userEClass );
+
+        EObjectClassCreator
+        eObjectClassCreator           =
+            new EObjectClassCreator();
+        
+        eObjectClassCreator.
+        create(
+            metaContext,
+            ecoreAttributeTypesContext,
+            ecoreObjectClassesContext,
+            userEClass, 
+            processedEClassifiers,
+            TUSCANY_SYNTAX_OID_VALUE );
+    	
+        String rdnL0                          = 
+            ComplexTypeRDNCreator.
+            create(
+                TUSCANY_SYNTAX_OID_VALUE,
+                xsdNamespace, 
+                userEClass.getName());
+        
+        EObjectClassDestroyer.
+        destroy(
+            metaContext,
+            ecoreAttributeTypesContext, 
+            ecoreObjectClassesContext, 
+            userEClass, 
+            TUSCANY_SYNTAX_OID_VALUE );
+    }
+
+    private static EcoreFactory ecoreFactory =
+        null;
+
+    private static EcorePackage ecorePackage =
+        null;
+    
+    private static EClass eClassL0           =
+        null;
+    
+    private static EClass eClassL1           =
+        null;
+
+    private static List<EClass> 
+    processedEClassifiers                            =
+        null;
+    
+    private static DirContext 
+    eObjectClassL0EntryContext                  = 
+        null;
+
+    private static DirContext 
+    eObjectClassL1EntryContext                  = 
+        null;
+    
+    private static DirContext 
+    eClassL0MetaContext                             = 
+        null;
+
+    private static DirContext 
+    eClassL1MetaContext                             = 
+        null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EcoreTypeSystemDestroyerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EcoreTypeSystemDestroyerTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EcoreTypeSystemDestroyerTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/destroy/test/EcoreTypeSystemDestroyerTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,55 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.tuscany.das.ldap.schema.emf.destroy.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.schema.emf.create.EcoreTypeSystemCreator;
+import org.apache.tuscany.das.ldap.schema.emf.destroy.EcoreTypeSystemDestroyer;
+import org.apache.tuscany.das.ldap.schema.embedded.setup.test.EcoreSchemaContextsSetup;
+import org.eclipse.emf.ecore.EcorePackage;
+
+public class EcoreTypeSystemDestroyerTest 
+extends EcoreSchemaContextsSetup
+{
+    public EcorePackage ecorePackage = EcorePackage.eINSTANCE;
+
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+     }
+    
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void testDestroy() throws Exception
+    {
+        EcoreTypeSystemCreator.create(
+        		ecoreSyntaxesContext,
+        		ecoreSyntaxCheckersContext,
+        		TUSCANY_SYNTAX_OID_VALUE);
+        EcoreTypeSystemDestroyer.destroy(
+        		ecoreSyntaxesContext,
+        		ecoreSyntaxCheckersContext,
+        		TUSCANY_SYNTAX_OID_VALUE);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/provide/test/TypeConverterTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/provide/test/TypeConverterTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/provide/test/TypeConverterTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/emf/provide/test/TypeConverterTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,18 @@
+package org.apache.tuscany.das.ldap.schema.emf.provide.test;
+
+import junit.framework.TestCase;
+
+public class TypeConverterTest extends TestCase {
+	
+	public void testConvert()
+	{
+		String decimalString = "6.11";
+		
+		Float floatVariable    = new Float(decimalString);
+		Float floatVFloat       = new Float(6.11);
+		
+		System.out.println(floatVariable);
+		assertEquals(floatVFloat,floatVariable);
+	}
+
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/AbstractTestSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/AbstractTestSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/AbstractTestSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/AbstractTestSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,50 @@
+
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.directory.DirContext;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.directory.apacheds.testing.setup.JNDIConnectionTemplate;
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.EnumeratedSchemaAttributeTypeValues;
+import org.apache.tuscany.das.ldap.schema.constants.ObjectClassConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaObjectClassConstants;
+
+public abstract class AbstractTestSetup 
+extends JNDIConnectionTemplate
+implements 
+EnumeratedSchemaAttributeTypeValues,
+SchemaAttributeTypeConstants,
+AttributeTypeConstants,
+SchemaObjectClassConstants,
+ObjectClassConstants,
+DASConstants
+{
+    protected LdapContext schemaContext                         = 
+        null;
+
+    protected static String PROVIDER_URL_VALUE                 =
+        "ldap://localhost:10389/ou=schema";
+    
+    protected static final String SYNTAXES_CONTEXT_RDN         = 
+        OU + "=" + SYNTAXES_CONTEXT_NAME;
+
+    protected static final String ATTRIBUTE_TYPES_CONTEXT_RDN  = 
+        OU + "=" + ATTRIBUTE_TYPES_CONTEXT_NAME;
+    
+    protected static final String OBJECT_CLASSES_CONTEXT_RDN   = 
+        OU + "=" + OBJECT_CLASSES_CONTEXT_NAME;
+    
+    protected static final String XSD_CONTEXT_RDN              = 
+        CN + "=" + XSD_CONTEXT_NAME;
+    protected static final String DAS_CONTEXT_RDN              = 
+        CN + "=" + DAS_CONTEXT_NAME;
+    protected static final String ECORE_CONTEXT_RDN            = 
+        CN + "=" + ECORE_CONTEXT_NAME;
+    
+    protected String xsdNamespace                   = 
+        "http://example.com/users/accounts";
+
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,56 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.directory.apacheds.testing.setup.JNDIHotPartitionConnectionTemplate;
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.create.InitialContextCreator;
+import org.apache.tuscany.das.ldap.create.MetaContextCreator;
+import org.apache.tuscany.das.ldap.destroy.InitialContextDestroyer;
+import org.apache.tuscany.das.ldap.destroy.MetaContextDestroyer;
+
+public class DASContextSetup 
+extends JNDIHotPartitionConnectionTemplate
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        MetaContextDestroyer.
+        destroy( modelContext );
+        
+        InitialContextDestroyer.
+        destroy(
+            modelContext, 
+            dasPartitionContext );
+                super.tearDown();
+                
+        dasPartitionContext.close();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        dasPartitionContext                     =
+        	connect("das");
+
+        modelContext                               = 
+            (LdapContext) 
+            InitialContextCreator.
+            create(
+                xsdNamespace,
+                dasPartitionContext);
+
+        //Meta Context
+        //----------------------------------------------
+        metaContext                               =
+            (LdapContext) MetaContextCreator.
+            create( 
+            modelContext);
+    }
+    protected LdapContext dasPartitionContext      = null;
+    protected LdapContext modelContext                = null;
+    protected LdapContext metaContext                 = null;
+    protected LdapContext schemaContext             = null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASContextSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,34 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class DASContextSetupTest 
+extends DASContextSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+    
+    public void testCreateDASPartitionContext()
+    {
+        assertNotNull(dasPartitionContext);
+    }
+    
+    public void testModelContext()
+    {
+        assertNotNull(modelContext);
+    }
+    public void testMetaContext()
+    {
+        assertNotNull(metaContext);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,191 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.  
+ *  
+ */
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator;
+import org.apache.tuscany.das.ldap.schema.create.SimpleTypeRDNCreator;
+
+public class DASSchemaContextsSetup 
+extends AbstractTestSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        dasSyntaxesContext.close();
+        
+        dasContext.destroySubcontext(    
+            SYNTAXES_CONTEXT_RDN );
+        
+        dasAttributeTypesContext.close();
+        
+        dasContext.destroySubcontext(
+            ATTRIBUTE_TYPES_CONTEXT_RDN );
+        
+        dasContext.destroySubcontext(
+            OBJECT_CLASSES_CONTEXT_RDN );
+        
+        dasContext.close();
+        
+        schemaContext.destroySubcontext( 
+            DAS_CONTEXT_RDN );
+        
+        schemaContext.close();
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        schemaContext                   = connect();
+        dasContext                          = (LdapContext) createDasContext();
+        dasSyntaxesContext          = (LdapContext) createDasSyntaxesContext();
+        dasAttributeTypesContext = (LdapContext) createDasAttributeTypesContext();
+        dasObjectClassesContext  = (LdapContext) createDasObjectClassesContext();
+        
+        mComplexMayRDN           = 
+            SimpleTypeRDNCreator.create( 
+                TUSCANY_SYNTAX_OID_VALUE, 
+                DAS_XSD_NAMESPACE, 
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MAY);
+        
+        mComplexMustRDN          = 
+            SimpleTypeRDNCreator.create( 
+                TUSCANY_SYNTAX_OID_VALUE, 
+                DAS_XSD_NAMESPACE, 
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MUST);
+        
+        idRDN                    = 
+            SimpleTypeRDNCreator.create( 
+                TUSCANY_SYNTAX_OID_VALUE, 
+                DAS_XSD_NAMESPACE, 
+                M_META_TOP_SDO_OBJECT_CLASS,
+                ID);
+
+        
+        metaTopSDORDN            =
+            ComplexTypeRDNCreator.create( 
+                TUSCANY_SYNTAX_OID_VALUE,
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS);
+    }
+    
+    private DirContext createDasContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            CN, 
+            DAS_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            DAS_CONTEXT_RDN, contextAttributes );
+    }
+
+    private DirContext createDasAttributeTypesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            ATTRIBUTE_TYPES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return dasContext.createSubcontext( 
+            ATTRIBUTE_TYPES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    private DirContext createDasSyntaxesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return dasContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    private DirContext createDasObjectClassesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute attributeTypes = new BasicAttribute(
+            OU, 
+            OBJECT_CLASSES_CONTEXT_NAME);
+
+        contextAttributes.put( attributeTypes );
+        contextAttributes.put( objectClassAttribute );
+        
+        return dasContext.createSubcontext( 
+            OBJECT_CLASSES_CONTEXT_RDN, 
+            contextAttributes );
+    }
+
+    protected LdapContext dasContext                          = null;
+    protected LdapContext dasAttributeTypesContext = null;
+    protected LdapContext dasSyntaxesContext           = null;
+    protected LdapContext dasObjectClassesContext   = null;
+    
+    protected String mComplexMayRDN                         = null;
+    protected String mComplexMustRDN                        = null;
+    protected String idRDN                                               = null;
+    protected String metaTopSDORDN                             = null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/DASSchemaContextsSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,48 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class DASSchemaContextsSetupTest 
+extends DASSchemaContextsSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+
+    
+    public void testConnect()
+    {
+        assertNotNull(schemaContext);
+    }
+    
+    public void testCreateEcoreContext()
+    {
+        assertNotNull(dasContext);
+    }
+
+    
+    public void testCreateDasAttributeTypesContext()
+    {
+        assertNotNull(dasAttributeTypesContext);
+    }
+    
+    public void testCreateDasSyntaxesContext()
+    {
+        assertNotNull(dasSyntaxesContext);
+    }
+    
+    public void testCreateDasObjectClassesContext()
+    {
+        assertNotNull(dasObjectClassesContext);
+    }
+
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,131 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class EcoreSchemaAndDASContextsSetup 
+extends DASContextSetup
+implements DASConstants
+{
+    public void tearDown() 
+    throws NamingException, Exception
+    {
+        ecoreSyntaxesContext.close();
+        ecoreContext.destroySubcontext( SYNTAXES_CONTEXT_RDN );
+        
+        ecoreAttributeTypesContext.close();
+        ecoreContext.destroySubcontext( ATTRIBUTE_TYPES_CONTEXT_RDN );
+        
+        ecoreObjectClassesContext.close();
+        ecoreContext.destroySubcontext( OBJECT_CLASSES_CONTEXT_RDN );
+        
+        ecoreContext.close();
+        schemaContext.destroySubcontext( ECORE_CONTEXT_RDN );
+        
+        schemaContext.close();
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        schemaContext                      = connect("schema");
+        ecoreContext                         = createEcoreContext();
+        ecoreSyntaxesContext          = createEcoreSyntaxesContext();
+        ecoreObjectClassesContext  = createEcoreObjectClassesContext();
+        ecoreAttributeTypesContext = createEcoreAttributeTypesContext();
+    }
+    
+    private DirContext createEcoreContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            CN, 
+            ECORE_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            ECORE_CONTEXT_RDN, contextAttributes );
+    }
+
+    private DirContext createEcoreObjectClassesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            OBJECT_CLASSES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            OBJECT_CLASSES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    
+
+    private DirContext createEcoreAttributeTypesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            ATTRIBUTE_TYPES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            ATTRIBUTE_TYPES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    
+    private DirContext createEcoreSyntaxesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    protected DirContext ecoreContext               = null;
+    protected DirContext ecoreObjectClassesContext  = null;
+    protected DirContext ecoreAttributeTypesContext = null;
+    protected DirContext ecoreSyntaxesContext       = null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaAndDASContextsSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,56 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class EcoreSchemaAndDASContextsSetupTest 
+extends EcoreSchemaAndDASContextsSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+
+    public void testConnect()
+    {
+        assertNotNull(schemaContext);
+    }
+    
+    public void testCreateEcoreContext()
+    {
+        assertNotNull(ecoreContext);
+    }
+    
+    public void testCreateEcoreObjectClassesContext()
+    {
+        assertNotNull(ecoreObjectClassesContext);
+    }
+    
+    public void testCreateEcoreAttributeTypesContext()
+    {
+        assertNotNull(ecoreAttributeTypesContext);
+    }
+    
+    public void testCreateEcoreSyntaxesContext()
+    {
+        assertNotNull(ecoreSyntaxesContext);
+    }
+    
+    public void testCreateDasModelContext()
+    {
+        assertNotNull(modelContext);
+    }
+
+    public void testCreateDasMetaContext()
+    {
+        assertNotNull(metaContext);
+    }
+
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,132 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class EcoreSchemaContextsSetup 
+extends AbstractTestSetup
+implements DASConstants
+{
+    public void tearDown() 
+    throws NamingException, Exception
+    {
+        ecoreSyntaxesContext.close();
+        ecoreContext.destroySubcontext( SYNTAXES_CONTEXT_RDN );
+        
+        ecoreAttributeTypesContext.close();
+        ecoreContext.destroySubcontext( ATTRIBUTE_TYPES_CONTEXT_RDN );
+        
+        ecoreObjectClassesContext.close();
+        ecoreContext.destroySubcontext( OBJECT_CLASSES_CONTEXT_RDN );
+        
+        ecoreContext.close();
+        schemaContext.destroySubcontext( ECORE_CONTEXT_RDN );
+        
+        schemaContext.close();
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        schemaContext                      = connect();
+        ecoreContext                          = createEcoreContext();
+        ecoreSyntaxesContext          = createEcoreSyntaxesContext();
+        ecoreObjectClassesContext  = createEcoreObjectClassesContext();
+        ecoreAttributeTypesContext = createEcoreAttributeTypesContext();
+    }
+    
+    private DirContext createEcoreContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            CN, 
+            ECORE_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            ECORE_CONTEXT_RDN, contextAttributes );
+    }
+    
+
+    private DirContext createEcoreObjectClassesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            OBJECT_CLASSES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            OBJECT_CLASSES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    
+
+    private DirContext createEcoreAttributeTypesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            ATTRIBUTE_TYPES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            ATTRIBUTE_TYPES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    
+    private DirContext createEcoreSyntaxesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    protected DirContext ecoreContext               = null;
+    protected DirContext ecoreObjectClassesContext  = null;
+    protected DirContext ecoreAttributeTypesContext = null;
+    protected DirContext ecoreSyntaxesContext       = null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/EcoreSchemaContextsSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,45 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class EcoreSchemaContextsSetupTest 
+extends EcoreSchemaContextsSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+
+    public void testConnect()
+    {
+        assertNotNull(schemaContext);
+    }
+    
+    public void testCreateEcoreContext()
+    {
+        assertNotNull(ecoreContext);
+    }
+    
+    public void testCreateEcoreObjectClassesContext()
+    {
+        assertNotNull(ecoreObjectClassesContext);
+    }
+    
+    public void testCreateEcoreAttributeTypesContext()
+    {
+        assertNotNull(ecoreAttributeTypesContext);
+    }
+    
+    public void testCreateEcoreSyntaxesContext()
+    {
+        assertNotNull(ecoreSyntaxesContext);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,21 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class SchemaContextSetup 
+extends AbstractTestSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        schemaContext.close();
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        schemaContext            = connect();
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,25 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class SchemaContextSetupTest 
+extends SchemaContextSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+    
+    public void testConnect()
+    {
+        assertNotNull(schemaContext);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,231 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+public class SchemaContextsSetup 
+extends AbstractTestSetup
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        dasSyntaxesContext.close();
+        dasContext.destroySubcontext( SYNTAXES_CONTEXT_RDN );
+
+        dasAttributeTypesContext.close();
+        dasContext.destroySubcontext( ATTRIBUTE_TYPES_CONTEXT_RDN );
+        
+        dasObjectClassesContext.close();
+        dasContext.destroySubcontext( OBJECT_CLASSES_CONTEXT_RDN );
+        dasContext.close();
+        
+        xsdSyntaxesContext.close();
+        xsdContext.destroySubcontext( SYNTAXES_CONTEXT_RDN );
+        
+        xsdContext.close();
+        schemaContext.destroySubcontext( XSD_CONTEXT_RDN );
+
+        ecoreSyntaxesContext.close();
+        ecoreContext.destroySubcontext( SYNTAXES_CONTEXT_RDN );
+        
+        ecoreContext.close();
+        schemaContext.destroySubcontext( ECORE_CONTEXT_RDN );
+        
+        schemaContext.destroySubcontext( DAS_CONTEXT_RDN );
+        schemaContext.close();
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        schemaContext            = connect();
+        dasContext               = createDASContext();
+        dasSyntaxesContext       = createSyntaxesContext();
+        dasAttributeTypesContext = createAttributeTypesContext();
+        dasObjectClassesContext  = createObjectClassesContext();
+        xsdContext               = createXSDContext();
+        xsdSyntaxesContext       = createXSDSyntaxesContext();
+        ecoreContext             = createEcoreContext();
+        ecoreSyntaxesContext     = createEcoreSyntaxesContext();
+    }
+    
+    private DirContext createDASContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute dasAttribute = new BasicAttribute(
+            CN, 
+            DAS_CONTEXT_NAME);
+
+        contextAttributes.put( dasAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            DAS_CONTEXT_RDN, contextAttributes );
+    }
+
+    
+    private DirContext createXSDContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute xsdAttribute = new BasicAttribute(
+            CN, 
+            XSD_CONTEXT_NAME);
+
+        contextAttributes.put( xsdAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            XSD_CONTEXT_RDN, contextAttributes );
+    }
+
+    private DirContext createXSDSyntaxesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute xsdAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( xsdAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return xsdContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+    
+
+    private DirContext createEcoreContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            CN, 
+            ECORE_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            ECORE_CONTEXT_RDN, contextAttributes );
+    }
+
+    
+    private DirContext createEcoreSyntaxesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return ecoreContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    private DirContext createSyntaxesContext() throws NamingException
+    {   
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute syntaxesRDNAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( objectClassAttribute );
+        contextAttributes.put( syntaxesRDNAttribute );
+        
+        return dasContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+    
+    
+    private DirContext createAttributeTypesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute attributeTypes = new BasicAttribute(
+            OU, 
+            ATTRIBUTE_TYPES_CONTEXT_NAME);
+
+        contextAttributes.put( attributeTypes );
+        contextAttributes.put( objectClassAttribute );
+        
+        return dasContext.createSubcontext( 
+            ATTRIBUTE_TYPES_CONTEXT_RDN, contextAttributes );
+    }
+
+    private DirContext createObjectClassesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute attributeTypes = new BasicAttribute(
+            OU, 
+            OBJECT_CLASSES_CONTEXT_NAME);
+
+        contextAttributes.put( attributeTypes );
+        contextAttributes.put( objectClassAttribute );
+        
+        return dasContext.createSubcontext( 
+            OBJECT_CLASSES_CONTEXT_RDN, 
+            contextAttributes );
+    }
+    
+    protected DirContext dasContext               = null;
+    protected DirContext xsdContext               = null;
+    protected DirContext xsdSyntaxesContext       = null;
+    protected DirContext ecoreContext             = null;
+    protected DirContext ecoreSyntaxesContext     = null;
+    protected DirContext dasSyntaxesContext       = null;
+    protected DirContext dasAttributeTypesContext = null;
+    protected DirContext dasObjectClassesContext  = null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/SchemaContextsSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,71 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+public class SchemaContextsSetupTest 
+extends SchemaContextsSetup
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+    
+    public void testConnect()
+    {
+        assertNotNull(schemaContext);
+    }
+    
+
+    public void testCreateDASContext()
+    {
+        assertNotNull(dasContext);
+    }
+
+    
+    public void testCreateXSDContext()
+    {
+        assertNotNull(xsdContext);
+    }
+
+
+    
+    public void testCreateXSDSyntaxesContext()
+    {
+        assertNotNull(xsdSyntaxesContext);
+    }
+
+
+    public void testCreateEcoreContext()
+    {
+        assertNotNull(ecoreContext);
+    }
+
+    
+    
+    public void testCreateEcoreSyntaxesContext()
+    {
+        assertNotNull(ecoreSyntaxesContext);
+    }
+    
+    public void testCreateSyntaxesContext()
+    {
+        assertNotNull(dasSyntaxesContext);
+    }
+    
+    public void testCreateAttributeTypesContext()
+    {
+        assertNotNull(dasAttributeTypesContext);
+    }
+    
+    
+    public void testCreateObjectClassesContext()
+    {
+        assertNotNull(dasObjectClassesContext);
+    }
+    
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetup.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetup.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetup.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetup.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,76 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class XSDSchemaContextsSetup 
+extends AbstractTestSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        xsdSyntaxesContext.close();
+        xsdContext.destroySubcontext( SYNTAXES_CONTEXT_RDN );
+        xsdContext.close();
+        schemaContext.destroySubcontext( XSD_CONTEXT_RDN );
+        schemaContext.close();
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+        schemaContext         = connect();
+        xsdContext                = createXsdContext();
+        xsdSyntaxesContext = createXsdSyntaxesContext();
+    }
+    
+    private DirContext createXsdContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(META_SCHEMA);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            CN, 
+            XSD_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return schemaContext.createSubcontext( 
+            XSD_CONTEXT_RDN, contextAttributes );
+    }
+    
+    private DirContext createXsdSyntaxesContext() throws NamingException
+    {
+        Attributes contextAttributes   = new BasicAttributes();
+        
+        Attribute objectClassAttribute = new BasicAttribute(
+        OBJECT_CLASS, 
+        TOP);
+        objectClassAttribute.add(ORGANIZATIONAL_UNIT);
+
+        Attribute ecoreAttribute = new BasicAttribute(
+            OU, 
+            SYNTAXES_CONTEXT_NAME);
+
+        contextAttributes.put( ecoreAttribute );
+        contextAttributes.put( objectClassAttribute );
+        
+        return xsdContext.createSubcontext( 
+            SYNTAXES_CONTEXT_RDN, contextAttributes );
+    }
+
+    protected DirContext xsdContext                = null;
+    protected DirContext xsdSyntaxesContext = null;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetupTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetupTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetupTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/schema/setup/test/XSDSchemaContextsSetupTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,35 @@
+package org.apache.tuscany.das.ldap.schema.setup.test;
+
+import javax.naming.NamingException;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+
+public class XSDSchemaContextsSetupTest 
+extends XSDSchemaContextsSetup
+implements DASConstants
+{
+    public void tearDown() throws NamingException, Exception
+    {
+        super.tearDown();
+    }
+    
+    public void setUp() throws NamingException, Exception
+    {
+        super.setUp();
+    }
+    
+    public void testConnect()
+    {
+        assertNotNull(schemaContext);
+    }
+    
+    public void testCreateEcoreContext()
+    {
+        assertNotNull(xsdContext);
+    }
+    
+    public void testCreateEcoreSyntaxesContext()
+    {
+        assertNotNull(xsdSyntaxesContext);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/testing/constants/DASTestingConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/testing/constants/DASTestingConstants.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/testing/constants/DASTestingConstants.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/testing/constants/DASTestingConstants.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,9 @@
+package org.apache.tuscany.das.ldap.testing.constants;
+
+public interface DASTestingConstants {
+
+	String xsdNamespace               = 
+        "http://example.com/users/accounts";
+
+
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/JNDIUtilTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/JNDIUtilTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/JNDIUtilTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/JNDIUtilTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,109 @@
+package org.apache.tuscany.das.ldap.util.test;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.embedded.setup.test.AbstractTestSetup;
+import org.apache.tuscany.das.ldap.util.JNDIUtil;
+
+/*
+ * Note that these tests rely on the ADS Partition
+ * ou=system, which is also the directoryContext
+ * that the tests start with.
+ */
+public class JNDIUtilTest 
+extends AbstractTestSetup
+{
+    DirContext test1Context = null;
+    DirContext test2Context = null;
+    DirContext test3Context = null;
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        test1Context = 
+            ( DirContext ) 
+            dasPartitionContext.
+            createSubcontext( "cn=test1" );
+        
+        test2Context = 
+            ( DirContext ) 
+            test1Context.
+            createSubcontext( "cn=test2" );
+        
+        test3Context = 
+            ( DirContext ) 
+            test2Context.
+            createSubcontext( "cn=test3" );
+    }
+    
+    public void tearDown() throws Exception
+    {   
+        test2Context.destroySubcontext( "cn=test3" );
+        test1Context.destroySubcontext("cn=test2");
+        dasPartitionContext.destroySubcontext("cn=test1");
+        super.tearDown();
+    }
+
+    public void testCalculateParentRelativeDN() throws NamingException
+    {
+        String partitionDN = "ou=das";
+        
+        String testA = 
+            JNDIUtil.calculateParentRelativeDN( 
+                test2Context, partitionDN );
+        
+        String testB = 
+            JNDIUtil.calculateParentRelativeDN( 
+                test3Context, partitionDN );
+        
+        String testC = 
+            JNDIUtil.calculateParentRelativeDN( test1Context, partitionDN );
+        
+        assertTrue(testA.equals( "cn=test1" ));
+        assertTrue(testB.equals( "cn=test2,cn=test1" ));
+        assertTrue(testC.equals( "ou=das" ));
+
+    }
+    
+    public void testCalculateDNComponents() throws NamingException
+    {
+        String[] contextComponents = JNDIUtil.calculateDNComponents(  test3Context );
+        assertTrue(contextComponents.length==4);
+        
+        contextComponents = null;
+        
+        contextComponents = JNDIUtil.calculateDNComponents(  test3Context.getNameInNamespace() );
+        assertTrue(contextComponents.length==4);
+    }
+    
+    public void testGetParentContext() throws NamingException
+    {
+        DirContext parentContext = 
+            JNDIUtil.
+            getParentContext( 
+                test3Context, 
+                dasPartitionContext );
+        
+        assertTrue(
+            parentContext.getNameInNamespace().
+            equals("cn=test2,cn=test1,ou=das"));
+        
+        parentContext = 
+            JNDIUtil.getParentContext( 
+                test1Context, 
+                dasPartitionContext );
+        
+        assertTrue(
+            parentContext.getNameInNamespace().
+            equals("ou=das"));
+
+        parentContext = 
+            JNDIUtil.
+            getParentContext( 
+                dasPartitionContext, 
+                dasPartitionContext );
+        
+        assertTrue(null == parentContext);
+    }
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/QualifiedNameNormalizerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/QualifiedNameNormalizerTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/QualifiedNameNormalizerTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/QualifiedNameNormalizerTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.tuscany.das.ldap.util.test;
+
+import org.apache.tuscany.das.ldap.util.QualifiedNameNormalizer;
+
+import junit.framework.TestCase;
+
+public class QualifiedNameNormalizerTest 
+extends TestCase 
+{
+	public void testNormalize()
+	{
+		String qualifiedName     = 
+			"http://example.com/users/accounts/L0";
+		
+		String normalizedName =
+			QualifiedNameNormalizer.
+			normalize(qualifiedName);
+		
+		assertEquals(
+				"example-com-users-accounts-L0", 
+				normalizedName);
+	}
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/XSDNamespaceURITokenizerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/XSDNamespaceURITokenizerTest.java?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/XSDNamespaceURITokenizerTest.java (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/java/org/apache/tuscany/das/ldap/util/test/XSDNamespaceURITokenizerTest.java Tue Jun 26 06:29:06 2007
@@ -0,0 +1,36 @@
+
+package org.apache.tuscany.das.ldap.util.test;
+
+import org.apache.tuscany.das.ldap.schema.embedded.setup.test.AbstractTestSetup;
+
+import org.apache.tuscany.das.ldap.util.XSDNamespaceURITokenizer;
+import org.eclipse.emf.common.util.URI;
+
+public class XSDNamespaceURITokenizerTest 
+extends AbstractTestSetup
+{
+    public void testCreateAuthorityTokens()
+    {
+        String[] authorityTokens =
+            XSDNamespaceURITokenizer.
+            createAuthorityTokens(
+            		URI.createURI(xsdNamespace));
+        
+        assertTrue(authorityTokens[0].equals( "example"));
+        assertTrue(authorityTokens[1].equals( "com"));
+        assertTrue(authorityTokens.length == 2);
+    }
+
+    public void testCreatePathTokens()
+    {
+        String[] pathTokens =  
+        	XSDNamespaceURITokenizer.
+        	createPathTokens(
+        			URI.createURI(xsdNamespace));
+        
+        assertTrue(pathTokens[1].equals("users"));
+        assertTrue(pathTokens[2].equals("accounts"));
+        assertTrue(pathTokens.length == 3);
+    }
+
+}

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/resources/log4j.properties?view=auto&rev=550803
==============================================================================
--- directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/resources/log4j.properties (added)
+++ directory/sandbox/oersoy/das.ldap.parent/das.ldap/src/test/resources/log4j.properties Tue Jun 26 06:29:06 2007
@@ -0,0 +1,6 @@
+log4j.rootCategory=ERROR, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
+

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/DAS.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/DAS.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/DAS.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/constants/DASConstants.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/constants/DASConstants.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/constants/DASConstants.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/constants/SyntaxOIDValues.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/constants/SyntaxOIDValues.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/constants/SyntaxOIDValues.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreator.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/InitialContextCreatorHelper.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/MetaContextCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/MetaContextCreator.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/create/MetaContextCreator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/destroy/InitialContextDestroyer.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/destroy/MetaContextDestroyer.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataGraphCreatorHelper.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/create/EDataObjectCreator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataGraphReader.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataGraphReaderHelper.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/emf/read/EDataObjectReader.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/encryption/constants/EncryptionConstants.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/encryption/util/ChecksumUtils.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/impl/DASImpl.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/impl/DASImpl.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/impl/DASImpl.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/impl/DASImplHelper.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/impl/DASImplHelper.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/impl/DASImplHelper.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/oid/create/ComplexTypeOIDCreator.class
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.ldap.parent/das.ldap/target/classes/org/apache/tuscany/das/ldap/oid/create/ComplexTypeOIDCreator.class?view=auto&rev=550803
==============================================================================
Binary file - no diff available.



Mime
View raw message