directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r729144 - /directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
Date Tue, 23 Dec 2008 22:24:29 GMT
Author: elecharny
Date: Tue Dec 23 14:24:29 2008
New Revision: 729144

URL: http://svn.apache.org/viewvc?rev=729144&view=rev
Log:
Used junit 4.4 annotations

Modified:
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java?rev=729144&r1=729143&r2=729144&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
Tue Dec 23 14:24:29 2008
@@ -27,23 +27,28 @@
 import org.apache.directory.server.schema.bootstrap.ApacheSchema;
 import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
 import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.schema.bootstrap.NisSchema;
 import org.apache.directory.server.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.DefaultOidRegistry;
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
 
 
 /**
  * Tests methods in SchemaInterceptor.
  */
-public class SchemaServiceTest extends TestCase
+public class SchemaServiceTest
 {
-    DefaultRegistries registries;
-
-
+    private static DefaultRegistries registries;
+    
+    
+    @Before
     public void setUp() throws Exception
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
@@ -51,20 +56,25 @@
         loader.load( new SystemSchema(), registries, false );
         loader.load( new ApacheSchema(), registries, false );
         loader.load( new CoreSchema(), registries, false );
+        loader.load( new CosineSchema(), registries, false );
+        loader.load( new NisSchema(), registries, false );
     }
 
     
+    @Test
     public void testDescendants() throws Exception
     {
         AttributeTypeRegistry attrRegistry = registries.getAttributeTypeRegistry();
-        Iterator list = attrRegistry.descendants( "name" );
+        Iterator<AttributeType> list = attrRegistry.descendants( "name" );
         Set<String> nameAttrs = new HashSet<String>();
+        
         while ( list.hasNext() )
         {
-            AttributeType type = ( AttributeType ) list.next();
+            AttributeType type = list.next();
             nameAttrs.add( type.getName() );
         }
-        assertEquals( "size of attributes extending name", 13, nameAttrs.size() );
+        
+        assertEquals( "size of attributes extending name", 15, nameAttrs.size() );
         assertTrue( nameAttrs.contains( "dmdName" ) );
         assertTrue( nameAttrs.contains( "o" ) );
         assertTrue( nameAttrs.contains( "c" ) );
@@ -78,7 +88,6 @@
         assertTrue( nameAttrs.contains( "st" ) );
         assertTrue( nameAttrs.contains( "givenName" ) );
     }
-    
 /*
     public void testAlterObjectClassesBogusAttr() throws NamingException
     {



Mime
View raw message