directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r893758 - in /directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ: AbstractTestUnit.java ApplyLdifs.java DirectoryServiceFactory.java FrameworkDirectoryServiceFactory.java FrameworkRunner.java
Date Thu, 24 Dec 2009 13:31:13 GMT
Author: elecharny
Date: Thu Dec 24 13:31:13 2009
New Revision: 893758

URL: http://svn.apache.org/viewvc?rev=893758&view=rev
Log:
o Removed commented code
o Added missing headers
o Minor other cleanups

Modified:
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractTestUnit.java
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/ApplyLdifs.java
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
    directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractTestUnit.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractTestUnit.java?rev=893758&r1=893757&r2=893758&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractTestUnit.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractTestUnit.java
Thu Dec 24 13:31:13 2009
@@ -1,4 +1,22 @@
-
+/*
+ *  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.directory.server.core.integ;
 
 import org.apache.directory.server.core.DirectoryService;

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/ApplyLdifs.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/ApplyLdifs.java?rev=893758&r1=893757&r2=893758&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/ApplyLdifs.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/ApplyLdifs.java
Thu Dec 24 13:31:13 2009
@@ -27,8 +27,6 @@
 import java.lang.annotation.Target;
 
 
-
-
 /**
  * A annotation used to specify an sequence of LDIF's to be applied to
  * the instance for integration testing.

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java?rev=893758&r1=893757&r2=893758&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
Thu Dec 24 13:31:13 2009
@@ -21,8 +21,6 @@
 import org.apache.directory.server.core.DirectoryService;
 
 
-
-
 /**
  * A factory used to generate differently configured DirectoryService objects.
  * Since the DirectoryService itself is what is configured then a factory for

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java?rev=893758&r1=893757&r2=893758&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
Thu Dec 24 13:31:13 2009
@@ -33,28 +33,6 @@
      */
     public static final DirectoryServiceFactory DEFAULT = new FrameworkDirectoryServiceFactory();
 
-    /*
-    public DirectoryService newInstance() throws Exception
-    {
-        String workingDirectory = System.getProperty( "workingDirectory" );
-
-        if ( workingDirectory == null )
-        {
-            String path = DirectoryServiceFactory.class.getResource( "" ).getPath();
-            int targetPos = path.indexOf( "target" );
-            workingDirectory = path.substring( 0, targetPos + 6 ) + "/server-work-" + UUID.randomUUID().toString();
-        }
-        
-        System.out.println( "Starting DS " + workingDirectory );
-
-        service = new DefaultDirectoryService();
-        service.setWorkingDirectory( new File( workingDirectory ) );
-
-        return service;
-    }
-    */
-
-    
     public void init( String name ) throws Exception
     {
         if ( ( service != null ) && (service.isStarted() ) )
@@ -66,64 +44,6 @@
         builder.build( name );
         
         service = builder.getDirectoryService();
-        
-        /*
-        SchemaPartition schemaPartition = service.getSchemaService().getSchemaPartition();
-
-        // Init the LdifPartition
-        LdifPartition ldifPartition = new LdifPartition();
-        String workingDirectory = service.getWorkingDirectory().getPath();
-        ldifPartition.setWorkingDirectory( workingDirectory + "/schema" );
-
-        // Extract the schema on disk (a brand new one) and load the registries
-        File schemaRepository = new File( workingDirectory, "schema" );
-        SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
-        
-        extractor.extractOrCopy();
-
-        schemaPartition.setWrappedPartition( ldifPartition );
-
-        SchemaLoader loader = new LdifSchemaLoader( schemaRepository );
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-        service.setSchemaManager( schemaManager );
-
-        // We have to load the schema now, otherwise we won't be able
-        // to initialize the Partitions, as we won't be able to parse 
-        // and normalize their suffix DN
-        boolean loaded = schemaManager.loadAllEnabled();
-        
-        schemaPartition.setSchemaManager( schemaManager );
-
-        List<Throwable> errors = schemaManager.getErrors();
-
-        if ( errors.size() != 0 )
-        {
-            throw new Exception( "Schema load failed : " + ExceptionUtils.printErrors( errors
) );
-        }
-
-        service.getChangeLog().setEnabled( true );
-
-        // change the working directory to something that is unique
-        // on the system and somewhere either under target directory
-        // or somewhere in a temp area of the machine.
-
-        // Inject the System Partition
-        Partition systemPartition = new JdbmPartition();
-        systemPartition.setId( "system" );
-        ( ( JdbmPartition ) systemPartition ).setCacheSize( 500 );
-        systemPartition.setSuffix( ServerDNConstants.SYSTEM_DN );
-        systemPartition.setSchemaManager( schemaManager );
-        ( ( JdbmPartition ) systemPartition ).setPartitionDir( new File( workingDirectory,
"system" ) );
-
-        // Add objectClass attribute for the system partition
-        Set<Index<?, ServerEntry>> indexedAttrs = new HashSet<Index<?,
ServerEntry>>();
-        indexedAttrs.add( new JdbmIndex<Object, ServerEntry>( SchemaConstants.OBJECT_CLASS_AT
) );
-        ( ( JdbmPartition ) systemPartition ).setIndexedAttributes( indexedAttrs );
-
-        service.setSystemPartition( systemPartition );
-
-        service.startup();
-        */
     }
 
     

Modified: directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=893758&r1=893757&r2=893758&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Thu Dec 24 13:31:13 2009
@@ -97,58 +97,6 @@
 
         try
         {
-            /*
-            if ( fac != null )
-            {
-                DirectoryServiceFactory dsf = ( DirectoryServiceFactory ) fac.factory().newInstance();
-                dsf.init();
-                dirService = dsf.getDirectoryService();
-                
-                if ( getSuite() != null )
-                {
-                    applyLdifs( getSuite().getDescription(), dirService );
-                }
-                
-            }
-            else if( getSuite() == null ) // for a class without a @Factory and running standalone
without a suite
-            {
-                DirectoryServiceFactory dsf = FrameworkDirectoryServiceFactory.DEFAULT;
-                dsf.init();
-                dirService = dsf.getDirectoryService();
-            }
-            else if( suiteDirectoryService == null ) // set the parent suit's factory value
-            {
-                DSBuilder suitFactory = getSuite().getDescription().getAnnotation( DSBuilder.class
);
-                
-                DirectoryServiceFactory dsf;
-                if ( suitFactory == null )
-                {
-                    // instantiate a default factory
-                    dsf = FrameworkDirectoryServiceFactory.DEFAULT;
-                }
-                else
-                {
-                    dsf = ( DirectoryServiceFactory ) suitFactory.factory().newInstance();
-                }
-
-                dsf.init();
-                suiteDirectoryService = dsf.getDirectoryService();
-                dirService = suiteDirectoryService;
-                
-                applyLdifs( getSuite().getDescription(), suiteDirectoryService );
-            }
-            else
-            {
-                dirService = suiteDirectoryService;
-            }
-
-            long revision = dirService.getChangeLog().getCurrentRevision();
-            
-            applyLdifs( getDescription(), dirService );
-            
-            field.set( getTestClass().getJavaClass(), dirService );
-            */
-
             super.run( notifier );
             
             // cleanup classService if it is not the same as suite service or
@@ -178,35 +126,6 @@
             {
                 testCount.set( 0 );
             }
-            
-            /*
-            // clean the DS ONLY if it is class level DS
-            if( dirService != suiteDirectoryService )
-            {
-                dirService.shutdown();
-                FileUtils.deleteDirectory( dirService.getWorkingDirectory() );
-            }
-            else if( suiteDirectoryService != null )
-            {
-                suiteDirectoryService.revert( revision );
-            }
-            
-            if( suiteDirectoryService != null ) // not null means there is a suite associated
-            {
-                // all tests were ran, delete the suite level DS 
-                if( testCount.get() == getSuite().testCount() )
-                {
-                    suiteDirectoryService.shutdown();
-                    FileUtils.deleteDirectory( suiteDirectoryService.getWorkingDirectory()
);
-                    
-                    // while running test suite *and* classes with maven the other test classes
-                    // still use this runner and cause this field is not null
-                    // the if block with condition 'suiteDirectoryService != null' is executing
-                    // to prevent that setting suiteDirectoryService to null
-                    suiteDirectoryService = null;
-                }
-            }
-            */
         }
         catch ( Exception e )
         {



Mime
View raw message