directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r894082 - in /directory/apacheds/branches/apacheds-schema: core-annotations/src/main/java/org/apache/directory/server/core/ core-annotations/src/main/java/org/apache/directory/server/core/annotations/ server-annotations/src/main/java/org/ap...
Date Sun, 27 Dec 2009 17:29:04 GMT
Author: elecharny
Date: Sun Dec 27 17:29:04 2009
New Revision: 894082

URL: http://svn.apache.org/viewvc?rev=894082&view=rev
Log:
o Moved the DefaultDirectoryServiceFactry to core-annotations
o Added a LdapServerFactory
o Renamed LdapServer to LdapServerBuilder to avoid name collision
o Updated the dependencies in server-unit
o Removed the factory definition as we are now using the default one
o Renamed the FrameworkDirectoryServiceFactory to DefaultDirectoryServoceFactory

Added:
    directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceFactory.java
      - copied, changed from r894074, directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/DefaultLdapServerFactory.java
    directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerBuilder.java
      - copied, changed from r894075, directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServer.java
    directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerFactory.java
Removed:
    directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServer.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/DirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
Modified:
    directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
    directory/apacheds/branches/apacheds-schema/server-unit/pom.xml
    directory/apacheds/branches/apacheds-schema/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuite.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteServer.java

Copied: directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceFactory.java
(from r894074, directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceFactory.java?p2=directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceFactory.java&p1=directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java&r1=894074&r2=894082&rev=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkDirectoryServiceFactory.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceFactory.java
Sun Dec 27 17:29:04 2009
@@ -16,14 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.directory.server.core.integ;
+package org.apache.directory.server.core;
 
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.builder.DirectoryServiceBuilder;
 
 
-public class FrameworkDirectoryServiceFactory implements DirectoryServiceFactory
+/**
+ * A Default factory for DirectoryService
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class DefaultDirectoryServiceFactory implements DirectoryServiceFactory
 {
     private DirectoryService service;
 
@@ -31,7 +36,7 @@
      * The default factory returns stock instances of a directory
      * service with smart defaults
      */
-    public static final DirectoryServiceFactory DEFAULT = new FrameworkDirectoryServiceFactory();
+    public static final DirectoryServiceFactory DEFAULT = new DefaultDirectoryServiceFactory();
 
     public void init( String name ) throws Exception
     {

Modified: directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
Sun Dec 27 17:29:04 2009
@@ -23,13 +23,21 @@
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import org.apache.directory.server.core.DefaultDirectoryServiceFactory;
+
+/**
+ * An anntation for the DirectoryService builder
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 @Retention(RetentionPolicy.RUNTIME)
 @Target( {ElementType.METHOD, ElementType.TYPE } )
 public @interface DSBuilder
 {
     /** The Factory to use to create a DirectoryService */
-    Class<?> factory();
+    Class<?> factory() default DefaultDirectoryServiceFactory.class;
     
     /** The DS name */
-    String name();
+    String name() default "defaultDS";
 }

Added: directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/DefaultLdapServerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/DefaultLdapServerFactory.java?rev=894082&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/DefaultLdapServerFactory.java
(added)
+++ directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/DefaultLdapServerFactory.java
Sun Dec 27 17:29:04 2009
@@ -0,0 +1,37 @@
+/*
+ *  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.annotations;
+
+import org.apache.directory.server.ldap.LdapServer;
+
+public class DefaultLdapServerFactory
+{
+    private LdapServer ldapServer;
+    
+    void init()
+    {
+        
+    }
+    
+    LdapServer getLdapServer()
+    {
+        return ldapServer;
+    }
+}

Copied: directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerBuilder.java
(from r894075, directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServer.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerBuilder.java?p2=directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerBuilder.java&p1=directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServer.java&r1=894075&r2=894082&rev=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerBuilder.java
Sun Dec 27 17:29:04 2009
@@ -44,11 +44,14 @@
 @Inherited
 @Retention ( RetentionPolicy.RUNTIME )
 @Target ( { ElementType.METHOD, ElementType.TYPE } )
-public @interface LdapServer
+public @interface LdapServerBuilder
 {
     /** The instance name */
     String name();
     
+    /** The LdapServer factory */
+    Class<?> factory() default DefaultLdapServerFactory.class;
+    
     /** The maximum size limit.*/
     int maxSizeLimit() default 1000;
     

Added: directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerFactory.java?rev=894082&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerFactory.java
(added)
+++ directory/apacheds/branches/apacheds-schema/server-annotations/src/main/java/org/apache/directory/server/annotations/LdapServerFactory.java
Sun Dec 27 17:29:04 2009
@@ -0,0 +1,29 @@
+/*
+ *  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.annotations;
+
+import org.apache.directory.server.ldap.LdapServer;
+
+public interface LdapServerFactory
+{
+    void init();
+    
+    LdapServer getLdapServer();
+}

Modified: directory/apacheds/branches/apacheds-schema/server-unit/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-unit/pom.xml?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-unit/pom.xml (original)
+++ directory/apacheds/branches/apacheds-schema/server-unit/pom.xml Sun Dec 27 17:29:04 2009
@@ -70,6 +70,18 @@
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-annotations</artifactId>
+      <version>${pom.version}</version>
+    </dependency>  
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-annotations</artifactId>
+      <version>${pom.version}</version>
+    </dependency>  
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-interceptor-kerberos</artifactId>
       <version>${pom.version}</version>
     </dependency>  

Modified: directory/apacheds/branches/apacheds-schema/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
Sun Dec 27 17:29:04 2009
@@ -38,10 +38,14 @@
 import junit.framework.AssertionFailedError;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.server.annotations.LdapServerBuilder;
+import org.apache.directory.server.annotations.Transport;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.annotations.DSBuilder;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
 import org.apache.directory.server.ldap.LdapServer;
@@ -76,6 +80,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
+@LdapServerBuilder( name="test" )
+@Transport( protocol="LDAP")
+@DSBuilder( factory = DefaultDirectoryServiceFactory.class, name="DSTest" )
 public abstract class AbstractServerTest
 {
     private static final Logger LOG = LoggerFactory.getLogger( AbstractServerTest.class );

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Sun Dec 27 17:29:04 2009
@@ -28,6 +28,8 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.DirectoryServiceFactory;
+import org.apache.directory.server.core.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.core.annotations.ApplyLdifFiles;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.DSBuilder;
@@ -268,7 +270,7 @@
             else if ( ( suite != null ) && ( suite.getSuiteService() == null ) )
             {
                 // Use the default DS
-                DirectoryServiceFactory dsf = FrameworkDirectoryServiceFactory.DEFAULT;
+                DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.DEFAULT;
                 dsf.init( "default" + UUID.randomUUID().toString() );
                 service = dsf.getDirectoryService();
                 
@@ -290,7 +292,7 @@
             else if ( classService == null ) // finally just create a default DS for class
alone
             {
                 // Use the default DS
-                DirectoryServiceFactory dsf = FrameworkDirectoryServiceFactory.DEFAULT;
+                DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.DEFAULT;
                 dsf.init( "class-" + UUID.randomUUID().toString() );
                 classService = dsf.getDirectoryService();
                 service = classService;

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java
Sun Dec 27 17:29:04 2009
@@ -30,7 +30,7 @@
 
 
 @RunWith(FrameworkRunner.class)
-@DSBuilder( factory=FrameworkDirectoryServiceFactory.class, name="Class" )
+@DSBuilder( name="ClassDS" )
 @ApplyLdifs(
     {
         "dn: cn=testClassA,ou=system\n" + 
@@ -41,7 +41,7 @@
 public class TestClassA extends AbstractTestUnit
 {
     @Test
-    @DSBuilder( factory=FrameworkDirectoryServiceFactory.class, name="test" )
+    @DSBuilder( name="testDS" )
     @ApplyLdifs(
         {
             "dn: cn=testMethodA,ou=system\n" + 

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
Sun Dec 27 17:29:04 2009
@@ -39,7 +39,7 @@
 {
 
     @Test
-    @DSBuilder( factory=FrameworkDirectoryServiceFactory.class, name="test" )
+    @DSBuilder( name="testDS" )
     public void testWithFactoryAnnotation() throws Exception
     {
         if ( isRunInSuite )

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuite.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuite.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuite.java
Sun Dec 27 17:29:04 2009
@@ -24,8 +24,8 @@
 import org.junit.runners.Suite;
 
 @RunWith( FrameworkSuite.class )
-@Suite.SuiteClasses({ TestClassA.class, TestClassB.class, TestClassC.class })
-@DSBuilder(factory = FrameworkDirectoryServiceFactory.class, name = "SuiteDS")
+@Suite.SuiteClasses( { TestClassA.class, TestClassB.class, TestClassC.class } )
+@DSBuilder( name = "SuiteDS" )
 @ApplyLdifs(
     {
         "dn: cn=testSuite,ou=system\n" + 

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteServer.java?rev=894082&r1=894081&r2=894082&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteServer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteServer.java
Sun Dec 27 17:29:04 2009
@@ -18,7 +18,7 @@
  */
 package org.apache.directory.server.core.integ;
 
-import org.apache.directory.server.annotations.LdapServer;
+import org.apache.directory.server.annotations.LdapServerBuilder;
 import org.apache.directory.server.annotations.Transport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.DSBuilder;
@@ -27,9 +27,9 @@
 
 @RunWith( FrameworkSuite.class )
 @Suite.SuiteClasses( { TestClassA.class, TestClassB.class, TestClassC.class } )
-@DSBuilder( factory = FrameworkDirectoryServiceFactory.class, name = "SuiteDS" )
+@DSBuilder( name = "SuiteDS" )
 @Transport( protocol="LDAP" )
-@LdapServer( name="test" )
+@LdapServerBuilder( name="test" )
 @ApplyLdifs(
     {
         "dn: cn=testSuite,ou=system\n" + 



Mime
View raw message