You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/12/31 19:23:30 UTC

svn commit: r491463 - in /directory/branches/trunks/schema/apacheds: core/src/main/java/org/apache/directory/server/core/schema/ mitosis/ mitosis/src/test/java/org/apache/directory/mitosis/service/ server-unit/src/test/java/org/apache/directory/server/

Author: akarasulu
Date: Sun Dec 31 10:23:28 2006
New Revision: 491463

URL: http://svn.apache.org/viewvc?view=rev&rev=491463
Log:
fixed some nasty bugs with ObjectClass must lists

Added:
    directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java
      - copied, changed from r491163, directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java
Removed:
    directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java
Modified:
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/branches/trunks/schema/apacheds/mitosis/pom.xml
    directory/branches/trunks/schema/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java?view=diff&rev=491463&r1=491462&r2=491463
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassImpl.java Sun Dec 31 10:23:28 2006
@@ -126,7 +126,7 @@
     }
     
     
-    public void setMustListOids( String[] mayListOids )
+    public void setMustListOids( String[] mustListOids )
     {
         if ( mustListOids == null )
         {
@@ -135,8 +135,8 @@
         }
         else
         {
-            this.mustListOids = mayListOids;
-            this.mustList = new AttributeType[mayListOids.length];
+            this.mustListOids = mustListOids;
+            this.mustList = new AttributeType[mustListOids.length];
         }
     }
 

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=491463&r1=491462&r2=491463
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Sun Dec 31 10:23:28 2006
@@ -106,7 +106,7 @@
 
     private TopFilter topFilter;
 
-    private List filters = new ArrayList();
+    private List<SearchResultFilter> filters = new ArrayList<SearchResultFilter>();
 
     /**
      * the global schema object registries
@@ -276,7 +276,7 @@
             ids = EMPTY_STRING_ARRAY;
         }
 
-        Set set = new HashSet();
+        Set<String> set = new HashSet<String>();
         LockableAttributesImpl attrs = new LockableAttributesImpl();
         LockableAttributeImpl attr;
 
@@ -606,7 +606,7 @@
                 ResultCodeEnum.OPERATIONS_ERROR );
         }
 
-        Set objectClasses = new HashSet();
+        Set<String> objectClasses = new HashSet<String>();
         for ( int ii = 0; ii < objectClassAttr.size(); ii++ )
         {
             String val = ( String ) objectClassAttr.get( ii );
@@ -807,9 +807,9 @@
         
         // We will use this temporary entry to check that the modifications
         // can be applied as atomic operations
-        Attributes tmpEntry = (Attributes)entry.clone();
+        Attributes tmpEntry = ( Attributes ) entry.clone();
         
-        Set modset = new HashSet();
+        Set<String> modset = new HashSet<String>();
         ModificationItem objectClassMod = null;
         
         // Check that we don't have two times the same modification.
@@ -880,7 +880,7 @@
             return;
         }
         
-        // Now, apply the modifications on the cloned entry before applyong it to the
+        // Now, apply the modifications on the cloned entry before applying it on the
         // real object.
         for ( int ii = 0; ii < mods.length; ii++ )
         {
@@ -924,7 +924,7 @@
                 case DirContext.REMOVE_ATTRIBUTE :
                     if ( tmpEntry.get( change.getID() ) == null )
                     {
-                        log.error( "Trying to remove an inexistant attribute: " + change.getID() );
+                        log.error( "Trying to remove an non-existant attribute: " + change.getID() );
                         throw new LdapNoSuchAttributeException();
                     }
 
@@ -1237,7 +1237,7 @@
         ObjectClassRegistry registry ) throws NamingException
     {
         AttributeType[] attributeTypes;
-        Set set = new HashSet();
+        Set<AttributeType> set = new HashSet<AttributeType>();
         
         for ( int ii = 0; ii < objectClass.size(); ii++ )
         {
@@ -1246,7 +1246,7 @@
             infuseMustList( set, oc );
         }
         
-        attributeTypes = ( AttributeType[] ) set.toArray( EMPTY_ATTRIBUTE_TYPE_ARRAY );
+        attributeTypes = set.toArray( EMPTY_ATTRIBUTE_TYPE_ARRAY );
         return attributeTypes;
     }
 
@@ -1258,7 +1258,7 @@
      * @param set set to infuse attributeTypes into
      * @param oc the objectClass to ascent the polymorphic inheritance tree of 
      */
-    private static final void infuseMustList( Set set, ObjectClass oc ) throws NamingException
+    private static final void infuseMustList( Set<AttributeType> set, ObjectClass oc ) throws NamingException
     {
         // ignore top
         if ( oc.getName().equalsIgnoreCase( "top" ) )

Modified: directory/branches/trunks/schema/apacheds/mitosis/pom.xml
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/mitosis/pom.xml?view=diff&rev=491463&r1=491462&r2=491463
==============================================================================
--- directory/branches/trunks/schema/apacheds/mitosis/pom.xml (original)
+++ directory/branches/trunks/schema/apacheds/mitosis/pom.xml Sun Dec 31 10:23:28 2006
@@ -87,5 +87,142 @@
       <artifactId>derby</artifactId>
     </dependency>
   </dependencies>
+
+  <profiles>
+    <profile>
+    <id>no-integration-or-perf-tests</id>
+    <activation>
+      <activeByDefault>true</activeByDefault>
+    </activation>
+    <build>
+      <plugins>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <configuration>
+            <excludes>
+              <exclude>**/*ITest.java</exclude>
+              <exclude>**/*PTest.java</exclude>
+            </excludes>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>validate</phase>
+                <configuration>
+                  <tasks>
+                    <echo>
+=================================================================
+                          W A R N I N G
+                          -------------
+
+Integration and performance tests have been disabled.  To enable
+integration tests run maven with the -Dintegration switch.  To
+enable performance tests run maven with the -Dperformance switch.
+=================================================================
+                    </echo>
+                  </tasks>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+            </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>integration</id>
+      <activation>
+        <property><name>integration</name></property>
+      </activation>
+    <build>
+      <plugins>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <configuration>
+            <excludes>
+              <exclude>**/*PTest.java</exclude>
+            </excludes>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>validate</phase>
+                <configuration>
+                  <tasks>
+                    <echo>
+=================================================================
+                   I N T E G R A T I O N
+                   ---------------------
+
+Performance tests have been disabled.  To enable
+performance tests run maven with the -Dperformance switch.
+=================================================================
+                    </echo>
+                  </tasks>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+            </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>performance</id>
+      <activation>
+        <property><name>performance</name></property>
+      </activation>
+    <build>
+      <plugins>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <configuration>
+            <systemProperties>
+              <property>
+                <name>outputDirectory</name>
+                <value>${basedir}/target</value>
+              </property>
+            </systemProperties>
+            <excludes>
+              <exclude>**/*ITest.java</exclude>
+            </excludes>
+          </configuration>
+        </plugin>
+        <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>validate</phase>
+                <configuration>
+                  <tasks>
+                    <echo>
+=================================================================
+                   P E R F O R M A N C E
+                   ---------------------
+
+Integration tests have been disabled.  To enable integration
+tests run maven with the -Dintegration switch.
+=================================================================
+                    </echo>
+                  </tasks>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+            </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
 

Copied: directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java (from r491163, directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java)
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java?view=diff&rev=491463&p1=directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java&r1=491163&p2=directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java&r2=491463
==============================================================================
--- directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceIntegrationTest.java (original)
+++ directory/branches/trunks/schema/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/ReplicationServiceITest.java Sun Dec 31 10:23:28 2006
@@ -52,12 +52,12 @@
 import org.apache.mina.util.AvailablePortFinder;
 
 /**
- * A test case for {@link ReplicationServiceIntegrationTest}
+ * A test case for {@link ReplicationServiceITest}
  * 
  * @author The Apache Directory Project Team (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public class ReplicationServiceIntegrationTest extends TestCase
+public class ReplicationServiceITest extends TestCase
 {
     private Map contexts = new HashMap();
     private Map replicationServices = new HashMap();

Modified: directory/branches/trunks/schema/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java?view=diff&rev=491463&r1=491462&r2=491463
==============================================================================
--- directory/branches/trunks/schema/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java (original)
+++ directory/branches/trunks/schema/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java Sun Dec 31 10:23:28 2006
@@ -100,7 +100,7 @@
     {
         super.setUp();
 
-        Hashtable env = new Hashtable();
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
         env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
         env.put( "java.naming.security.principal", "uid=admin,ou=system" );
@@ -114,7 +114,6 @@
         Attributes attributes = this.getPersonAttributes( "Amos", "Tori Amos" );
         attributes.put( "description", "an American singer-songwriter" );
         ctx.createSubcontext( RDN, attributes );
-
     }