directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r613608 [3/15] - in /directory/sandbox/akarasulu/bigbang/apacheds: ./ bootstrap-plugin/ bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ core-entry/ core-entry/src/main/java/org/apache/directory/server/core/...
Date Sun, 20 Jan 2008 16:59:36 GMT
Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java Sun Jan 20 08:59:10 2008
@@ -21,7 +21,13 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
-import static org.apache.directory.server.core.authz.AutzIntegUtils.*;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.createUser;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.getContextAs;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.createAccessControlSubentry;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.addUserToGroup;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.deleteAccessControlSubentry;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.addEntryACI;
+import static org.apache.directory.server.core.authz.AutzIntegUtils.addSubentryACI;
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.server.core.integ.annotations.Factory;
@@ -30,14 +36,23 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
 import java.util.Map;
@@ -151,10 +166,11 @@
     private void recursivelyDelete( Name rdn ) throws NamingException
     {
         LdapContext sysRoot = getSystemContext( service );
-        NamingEnumeration results = sysRoot.search( rdn, "(objectClass=*)", new SearchControls() );
+        NamingEnumeration<SearchResult> results = sysRoot.search( rdn, "(objectClass=*)", new SearchControls() );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             Name childRdn = new LdapDN( result.getName() );
             childRdn.remove( 0 );
             recursivelyDelete( childRdn );
@@ -240,11 +256,12 @@
         {
             results.clear();
             DirContext userCtx = getContextAs( userDn, password );
-            NamingEnumeration list = userCtx.search( base, filter, cons );
+            NamingEnumeration<SearchResult> list = userCtx.search( base, filter, cons );
             int counter = 0;
+            
             while ( list.hasMore() )
             {
-                SearchResult result = ( SearchResult ) list.next();
+                SearchResult result = list.next();
                 results.put( result.getName(), result );
                 counter++;
             }
@@ -289,11 +306,12 @@
         {
             results.clear();
             DirContext userCtx = getContextAs( userDn, password );
-            NamingEnumeration list = userCtx.search( base, "(objectClass=*)", cons );
+            NamingEnumeration<SearchResult> list = userCtx.search( base, "(objectClass=*)", cons );
             int counter = 0;
+            
             while ( list.hasMore() )
             {
-                SearchResult result = ( SearchResult ) list.next();
+                SearchResult result = list.next();
                 results.put( result.getName(), result );
                 counter++;
             }
@@ -324,8 +342,9 @@
         Name base = addSearchData( new LdapDN(), 3, 10 );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        NamingEnumeration results = sysRoot.search( base, "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = sysRoot.search( base, "(objectClass=*)", controls );
         int counter = 0;
+        
         while ( results.hasMore() )
         {
             results.next();
@@ -760,7 +779,7 @@
         SearchControls cons = new SearchControls();
         cons.setSearchScope( SearchControls.OBJECT_SCOPE );
         SearchResult result = null;
-        NamingEnumeration list = null;
+        NamingEnumeration<SearchResult> list = null;
 
         //noinspection EmptyCatchBlock
         try
@@ -768,7 +787,7 @@
             list = userCtx.search( rdn, "(objectClass=*)", cons );
             if ( list.hasMore() )
             {
-                result = ( SearchResult ) list.next();
+                result = list.next();
                 list.close();
                 return result;
             }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java Sun Jan 20 08:59:10 2008
@@ -23,13 +23,16 @@
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.state.TestServiceContext.shutdown;
 import static org.apache.directory.server.core.integ.state.TestServiceContext.startup;
-import static org.apache.directory.server.core.integ.state.TestServiceContext.revert;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java Sun Jan 20 08:59:10 2008
@@ -28,13 +28,22 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -126,10 +135,11 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
             { "+", "*" } );
-        NamingEnumeration results = getSystemContext( service ).search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = getSystemContext( service ).search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
         return resultMap;
@@ -161,10 +171,10 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
             { "cn" } );
-        NamingEnumeration results = getSystemContext( service ).search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = getSystemContext( service ).search( "", "(objectClass=*)", controls );
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
         return resultMap;
@@ -178,10 +188,11 @@
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[]
                                                     { "c-ou", "c-st" } );
-        NamingEnumeration results = getSystemContext( service ).search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = getSystemContext( service ).search( "", "(objectClass=*)", controls );
+        
         while ( results.hasMore() )
         {
-            SearchResult result = ( SearchResult ) results.next();
+            SearchResult result = results.next();
             resultMap.put( result.getName(), result.getAttributes() );
         }
         return resultMap;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java Sun Jan 20 08:59:10 2008
@@ -22,18 +22,19 @@
 
 import junit.framework.Assert;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NameNotFoundException;
-import javax.naming.directory.Attributes;
 import java.util.Hashtable;
 
 
@@ -55,7 +56,8 @@
         Partition partition = new JdbmPartition();
         partition.setId( "removable" );
         partition.setSuffix( "ou=removable" );
-        Attributes ctxEntry = new AttributesImpl( true );
+        
+        ServerEntry ctxEntry = new DefaultServerEntry( service.getRegistries(), new LdapDN( "ou=removable" ) );
         ctxEntry.put( "objectClass", "top" );
         ctxEntry.get( "objectClass" ).add( "organizationalUnit" );
         ctxEntry.put( "ou", "removable" );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java Sun Jan 20 08:59:10 2008
@@ -33,7 +33,12 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
-import javax.naming.event.*;
+import javax.naming.event.EventDirContext;
+import javax.naming.event.NamespaceChangeListener;
+import javax.naming.event.NamingEvent;
+import javax.naming.event.NamingExceptionEvent;
+import javax.naming.event.ObjectChangeListener;
+
 import java.util.ArrayList;
 import java.util.EventObject;
 import java.util.List;
@@ -135,7 +140,7 @@
         List<EventRecord> events = new ArrayList<EventRecord>();
 
 
-        public List getEventRecords()
+        public List<EventRecord> getEventRecords()
         {
             return events;
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java Sun Jan 20 08:59:10 2008
@@ -32,13 +32,21 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 
 
@@ -113,11 +121,11 @@
     public void testSearchControl() throws NamingException
     {
         SearchControls ctls = new SearchControls();
-        NamingEnumeration list = getSystemContext( service ).search( "ou=users", "(objectClass=*)", ctls );
+        NamingEnumeration<SearchResult> list = getSystemContext( service ).search( "ou=users", "(objectClass=*)", ctls );
 
         if ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             assertNotNull( result.getAttributes() );
             assertEquals( "uid=akarasulu,ou=users,ou=system", result.getName() );
         }
@@ -485,11 +493,11 @@
     {
         LdapContext sysRoot = getSystemContext( service );
 
-        NamingEnumeration list = sysRoot.list( "ou=users" );
+        NamingEnumeration<?> list = sysRoot.list( "ou=users" );
 
         if ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = (SearchResult)list.next();
             assertNotNull( result.getAttributes() );
             assertEquals( "uid=akarasulu,ou=users,ou=system", result.getName() );
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/CreateContextIT.java Sun Jan 20 08:59:10 2008
@@ -38,7 +38,13 @@
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+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.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java Sun Jan 20 08:59:10 2008
@@ -33,7 +33,12 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.Hashtable;
 
@@ -100,9 +105,9 @@
         SearchControls ctls = new SearchControls();
         String searchBase = "ou=people";
 
-        NamingEnumeration results = ctx.search( searchBase, "(uid=bob)", ctls );
+        NamingEnumeration<SearchResult> results = ctx.search( searchBase, "(uid=bob)", ctls );
         assertTrue( results.hasMore() );
-        SearchResult searchResult = ( SearchResult ) results.next();
+        SearchResult searchResult = results.next();
 
         StringBuffer userDn = new StringBuffer();
         userDn.append( searchResult.getName() );
@@ -147,8 +152,8 @@
         ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
         String filter = "(userPassword={0})";
-        NamingEnumeration results = ctx.search( "uid=bob,ou=people", filter, new Object[]
-            { "bobspassword" }, ctls );
+        NamingEnumeration<SearchResult> results = ctx.search( "uid=bob,ou=people", filter, new Object[]
+                                                                                            { "bobspassword" }, ctls );
 
         // We should have a match
         assertTrue( results.hasMore() );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER759IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER759IT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER759IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER759IT.java Sun Jan 20 08:59:10 2008
@@ -27,7 +27,9 @@
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER783IT.java Sun Jan 20 08:59:10 2008
@@ -34,7 +34,13 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
 import java.util.Hashtable;
 
 /**
@@ -105,12 +111,12 @@
         String base = "";
 
         // Check entry
-        NamingEnumeration enm = ctx.search(base, filter, sctls);
+        NamingEnumeration<SearchResult> enm = ctx.search(base, filter, sctls);
         assertTrue(enm.hasMore());
 
         while (enm.hasMore()) 
         {
-            SearchResult sr = (SearchResult) enm.next();
+            SearchResult sr = enm.next();
             Attribute desc = sr.getAttributes().get("description");
             assertNotNull(desc);
             assertTrue(desc.contains(description1));

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java Sun Jan 20 08:59:10 2008
@@ -35,7 +35,14 @@
 
 import javax.naming.Context;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.InvalidAttributeIdentifierException;
+import javax.naming.directory.InvalidAttributeValueException;
+import javax.naming.directory.SchemaViolationException;
+
 import java.util.Hashtable;
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DestroyContextIT.java Sun Jan 20 08:59:10 2008
@@ -26,7 +26,10 @@
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java Sun Jan 20 08:59:10 2008
@@ -22,7 +22,10 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import static org.apache.directory.server.core.integ.IntegrationUtils.*;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getContext;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.ldif.Entry;
 
 import static org.junit.Assert.assertTrue;
@@ -59,11 +62,11 @@
 
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
         HashSet<String> set = new HashSet<String>();
-        NamingEnumeration list = sysRoot.list( "" );
+        NamingEnumeration<NameClassPair> list = sysRoot.list( "" );
 
         while ( list.hasMore() )
         {
-            NameClassPair ncp = ( NameClassPair ) list.next();
+            NameClassPair ncp = list.next();
             set.add( ncp.getName() );
         }
 
@@ -81,11 +84,11 @@
 
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
         HashSet<String> set = new HashSet<String>();
-        NamingEnumeration list = sysRoot.list( "ou=users" );
+        NamingEnumeration<NameClassPair> list = sysRoot.list( "ou=users" );
 
         while ( list.hasMore() )
         {
-            NameClassPair ncp = ( NameClassPair ) list.next();
+            NameClassPair ncp = list.next();
             set.add( ncp.getName() );
         }
 
@@ -99,11 +102,11 @@
     {
         LdapContext sysRoot = getSystemContext( service );
         HashSet<String> set = new HashSet<String>();
-        NamingEnumeration list = sysRoot.list( "" );
+        NamingEnumeration<NameClassPair> list = sysRoot.list( "" );
 
         while ( list.hasMore() )
         {
-            NameClassPair ncp = ( NameClassPair ) list.next();
+            NameClassPair ncp = list.next();
             set.add( ncp.getName() );
         }
 
@@ -121,10 +124,11 @@
         Entry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
-        NamingEnumeration list = sysRoot.list( "ou=users" );
+        NamingEnumeration<NameClassPair> list = sysRoot.list( "ou=users" );
+        
         while ( list.hasMore() )
         {
-            NameClassPair ncp = ( NameClassPair ) list.next();
+            NameClassPair ncp = list.next();
             set.add( ncp.getName() );
         }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java Sun Jan 20 08:59:10 2008
@@ -22,6 +22,8 @@
 
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.server.core.integ.DirectoryServiceFactory;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getContext;
@@ -36,13 +38,23 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashSet;
 import java.util.Set;
@@ -61,19 +73,19 @@
 {
     public static DirectoryService service;
 
-    private static final String SUFFIX = "dc=Apache,dc=Org";
+    private static final String SUFFIX_DN = "dc=Apache,dc=Org";
 
 
     public static class MyFactory implements DirectoryServiceFactory
     {
-        public DirectoryService newInstance()
+        public DirectoryService newInstance() throws NamingException
         {
             DirectoryService service = new DefaultDirectoryService();
             service.getChangeLog().setEnabled( true );
 
             JdbmPartition partition = new JdbmPartition();
             partition.setId( "apache" );
-            partition.setSuffix( SUFFIX );
+            partition.setSuffix( SUFFIX_DN );
 
             HashSet<Index> indexedAttributes = new HashSet<Index>();
             indexedAttributes.add( new JdbmIndex( "objectClass" ) );
@@ -81,15 +93,11 @@
             indexedAttributes.add( new JdbmIndex( "uid" ) );
             partition.setIndexedAttributes( indexedAttributes );
 
-            Attributes attrs = new AttributesImpl( true );
-            Attribute objectClass = new AttributeImpl( "objectClass" );
-            objectClass.add( "top" );
-            objectClass.add( "domain" );
-            objectClass.add( "extensibleObject" );
-            attrs.put( objectClass );
-            attrs.put( "dc", "Apache" );
+            ServerEntry serverEntry = new DefaultServerEntry( service.getRegistries(), new LdapDN( SUFFIX_DN ) );
+            serverEntry.put( "objectClass", "top", "domain", "extensibleObject" );
+            serverEntry.put( "dc", "Apache" );
 
-            partition.setContextEntry( attrs );
+            partition.setContextEntry( serverEntry );
 
             Set<Partition> partitions = new HashSet<Partition>();
             partitions.add( partition );
@@ -103,16 +111,16 @@
     @Test
     public void testSearch() throws NamingException
     {
-        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX );
+        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX_DN );
 
         SearchControls sc = new SearchControls();
         sc.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        NamingEnumeration ne = ctxRoot.search( "", "(objectClass=*)", sc );
+        NamingEnumeration<SearchResult> ne = ctxRoot.search( "", "(objectClass=*)", sc );
         assertTrue( "Search should return at least one entry.", ne.hasMore() );
 
-        SearchResult sr = ( SearchResult ) ne.next();
-        assertEquals( "The entry returned should be the root entry.", SUFFIX, sr.getName() );
+        SearchResult sr = ne.next();
+        assertEquals( "The entry returned should be the root entry.", SUFFIX_DN, sr.getName() );
         assertFalse( "Search should return no more entries.", ne.hasMore() );
     }
 
@@ -120,7 +128,7 @@
     @Test
     public void testAdd() throws NamingException
     {
-        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX );
+        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX_DN );
 
         String dn = "ou=Test";
 
@@ -137,11 +145,11 @@
         SearchControls sc = new SearchControls();
         sc.setSearchScope( SearchControls.OBJECT_SCOPE );
 
-        NamingEnumeration ne = ctxRoot.search( dn, "(objectClass=*)", sc );
+        NamingEnumeration<SearchResult> ne = ctxRoot.search( dn, "(objectClass=*)", sc );
         assertTrue( "Search should return at least one entry.", ne.hasMore() );
 
-        SearchResult sr = ( SearchResult ) ne.next();
-        assertEquals( "The entry returned should be the entry added earlier.", dn + "," + SUFFIX, sr.getName() );
+        SearchResult sr = ne.next();
+        assertEquals( "The entry returned should be the entry added earlier.", dn + "," + SUFFIX_DN, sr.getName() );
         assertFalse( "Search should return no more entries.", ne.hasMore() );
     }
 
@@ -149,7 +157,7 @@
     @Test
     public void testModify() throws NamingException
     {
-        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX );
+        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX_DN );
 
         String dn = "ou=Test";
         String description = "New Value";
@@ -173,11 +181,11 @@
         SearchControls sc = new SearchControls();
         sc.setSearchScope( SearchControls.OBJECT_SCOPE );
 
-        NamingEnumeration ne = ctxRoot.search( dn, "(objectClass=*)", sc );
+        NamingEnumeration<SearchResult> ne = ctxRoot.search( dn, "(objectClass=*)", sc );
         assertTrue( "Search should return at least one entry.", ne.hasMore() );
 
         SearchResult sr = ( SearchResult ) ne.next();
-        assertEquals( "The entry returned should be the entry added earlier.", dn + "," + SUFFIX, sr.getName() );
+        assertEquals( "The entry returned should be the entry added earlier.", dn + "," + SUFFIX_DN, sr.getName() );
 
         attributes = sr.getAttributes();
         attribute = attributes.get( "description" );
@@ -190,7 +198,7 @@
     @Test
     public void testDelete() throws NamingException
     {
-        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX );
+        LdapContext ctxRoot = getContext( "uid=admin,ou=system", service, SUFFIX_DN );
 
         String dn = "ou=Test";
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java Sun Jan 20 08:59:10 2008
@@ -29,7 +29,11 @@
 import org.apache.directory.shared.ldap.ldif.Entry;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java Sun Jan 20 08:59:10 2008
@@ -29,7 +29,9 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
 import org.apache.directory.shared.ldap.ldif.Entry;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java Sun Jan 20 08:59:10 2008
@@ -22,8 +22,10 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
-import static org.junit.Assert.*;
+import static org.apache.directory.server.core.integ.IntegrationUtils.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java Sun Jan 20 08:59:10 2008
@@ -33,15 +33,29 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.naming.*;
-import javax.naming.directory.*;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.ReferralException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 
@@ -75,7 +89,6 @@
         LdapContext rootCtx;
         Name ctxDn;
         LdapContext refCtx;
-        List refs;
     }
 
 
@@ -157,7 +170,7 @@
 
 
     /**
-     * Checks for correct core behavoir when Context.REFERRAL is set to <b>throw</b>
+     * Checks for correct core behavior when Context.REFERRAL is set to <b>throw</b>
      * for an add operation with the parent context being a referral.
      * 
      * @throws Exception if something goes wrong.
@@ -967,11 +980,12 @@
 
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        NamingEnumeration list = td.rootCtx.search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> list = td.rootCtx.search( "", "(objectClass=*)", controls );
         Map<String, SearchResult> results = new HashMap<String, SearchResult>();
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             results.put( result.getName(), result );
         }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java Sun Jan 20 08:59:10 2008
@@ -20,12 +20,14 @@
 package org.apache.directory.server.core.jndi;
 
 
-import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -34,7 +36,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
-import java.io.File;
 import java.util.Hashtable;
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java Sun Jan 20 08:59:10 2008
@@ -34,13 +34,22 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashMap;
 import java.util.Set;
@@ -238,10 +247,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String,Attributes> map = new HashMap<String,Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=*)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -265,10 +275,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(ou=*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=*)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -296,11 +307,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing02)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing02)", controls );
         
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -325,10 +336,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(objectClass=organ*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(objectClass=organ*)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -355,11 +367,12 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(|(ou={0})(ou={1}))", new Object[]
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(|(ou={0})(ou={1}))", new Object[]
             { "testing00", "testing01" }, controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -383,15 +396,16 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(ou=*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=*)", controls );
 
         try
         {
             while ( list.hasMore() )
             {
-                SearchResult result = ( SearchResult ) list.next();
+                SearchResult result = list.next();
                 map.put( result.getName(), result.getAttributes() );
             }
+            
             fail( "Should not get here due to a SizeLimitExceededException" );
         }
         catch ( LdapSizeLimitExceededException e )
@@ -415,7 +429,7 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(ou=*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=*)", controls );
         SearchResultFilteringEnumeration srfe = ( SearchResultFilteringEnumeration ) list;
         srfe.addResultFilter( new SearchResultFilter()
         {
@@ -463,12 +477,14 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(name=testing00)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(name=testing00)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
+        
         assertEquals( "size of results", 1, map.size() );
         assertTrue( "contains ou=testing00,ou=system", map.containsKey( "ou=testing00,ou=system" ) ); 
     }
@@ -487,12 +503,14 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(name=*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(name=*)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
+        
         assertEquals( "size of results", 19, map.size() );
         assertTrue( "contains ou=testing00,ou=system", map.containsKey( "ou=testing00,ou=system" ) ); 
         assertTrue( "contains ou=testing01,ou=system", map.containsKey( "ou=testing01,ou=system" ) ); 
@@ -523,12 +541,14 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(|(name=testing00)(name=testing01))", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(|(name=testing00)(name=testing01))", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
+        
         assertEquals( "size of results", 2, map.size() );
         assertTrue( "contains ou=testing00,ou=system", map.containsKey( "ou=testing00,ou=system" ) ); 
         assertTrue( "contains ou=testing01,ou=system", map.containsKey( "ou=testing01,ou=system" ) ); 
@@ -548,12 +568,14 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
-        NamingEnumeration list = sysRoot.search( "", "(name=testing*)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(name=testing*)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
+        
         assertEquals( "size of results", 3, map.size() );
         assertTrue( "contains ou=testing00,ou=system", map.containsKey( "ou=testing00,ou=system" ) ); 
         assertTrue( "contains ou=testing01,ou=system", map.containsKey( "ou=testing01,ou=system" ) ); 
@@ -579,12 +601,14 @@
             "(2.5.4.44=testing*)(2.5.4.11=testing*)(2.5.4.4=testing*)(2.5.4.8.1=testing*)" +
             "(2.5.4.12=testing*)(1.3.6.1.4.1.18060.0.4.1.2.3=testing*)" +
             "(2.5.4.7=testing*)(2.5.4.3=testing*)(2.5.4.8=testing*)(2.5.4.42=testing*))";
-        NamingEnumeration list = sysRoot.search( "", filter, controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", filter, controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
+        
         assertEquals( "size of results", 3, map.size() );
         assertTrue( "contains ou=testing00,ou=system", map.containsKey( "ou=testing00,ou=system" ) ); 
         assertTrue( "contains ou=testing01,ou=system", map.containsKey( "ou=testing01,ou=system" ) ); 
@@ -606,10 +630,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing00)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing00)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -636,10 +661,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing00)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing00)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -692,9 +718,9 @@
         // Search for kate by cn first
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        NamingEnumeration enm = sysRoot.search( "", "(cn=Kate Bush)", controls );
+        NamingEnumeration<SearchResult> enm = sysRoot.search( "", "(cn=Kate Bush)", controls );
         assertTrue( enm.hasMore() );
-        SearchResult sr = ( SearchResult ) enm.next();
+        SearchResult sr = enm.next();
         assertNotNull( sr );
         assertFalse( enm.hasMore() );
         assertEquals( "cn=Kate Bush,ou=system", sr.getName() );
@@ -722,10 +748,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing01)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing01)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -754,10 +781,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing01)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing01)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -786,10 +814,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing01)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing01)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -818,10 +847,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing01)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing01)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -850,10 +880,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing01)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing01)", controls );
+        
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -882,11 +913,12 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(ou=testing01)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=testing01)", controls );
+        
 
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName(), result.getAttributes() );
         }
 
@@ -916,11 +948,11 @@
         ctls.setReturningAttributes( new String[]
             { "cn", "sn;unknownOption" } );
 
-        NamingEnumeration result = sysRoot.search( RDN, FILTER, ctls );
+        NamingEnumeration<SearchResult> result = sysRoot.search( RDN, FILTER, ctls );
 
         if ( result.hasMore() )
         {
-            SearchResult entry = ( SearchResult ) result.next();
+            SearchResult entry = result.next();
             Attributes attrs = entry.getAttributes();
             Attribute cn = attrs.get( "cn" );
 
@@ -954,11 +986,11 @@
         ctls.setReturningAttributes( new String[]
             { "cn", "cn" } );
 
-        NamingEnumeration result = sysRoot.search( RDN, FILTER, ctls );
+        NamingEnumeration<SearchResult> result = sysRoot.search( RDN, FILTER, ctls );
 
         if ( result.hasMore() )
         {
-            SearchResult entry = ( SearchResult ) result.next();
+            SearchResult entry = result.next();
             Attributes attrs = entry.getAttributes();
             Attribute cn = attrs.get( "cn" );
 
@@ -1025,11 +1057,11 @@
         }
 
         Set<String> results = new HashSet<String>();
-        NamingEnumeration list = getSystemContext( service ).search( "ou=groups", filter, controls );
+        NamingEnumeration<SearchResult> list = getSystemContext( service ).search( "ou=groups", filter, controls );
 
         while( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             results.add( result.getName() );
         }
 
@@ -1057,7 +1089,7 @@
         LdapContext sysRoot = getSystemContext( service );
         createData( sysRoot );
 
-        Set results = searchGroups( "(objectClass=posixGroup)" );
+        Set<String> results = searchGroups( "(objectClass=posixGroup)" );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
@@ -1073,7 +1105,7 @@
         LdapContext sysRoot = getSystemContext( service );
         createData( sysRoot );
 
-        Set results = searchGroups( "(gidNumber<=5)" );
+        Set<String> results = searchGroups( "(gidNumber<=5)" );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
@@ -1121,7 +1153,7 @@
         LdapContext sysRoot = getSystemContext( service );
         createData( sysRoot );
 
-        Set results = searchGroups( "(gidNumber>=0)" );
+        Set<String> results = searchGroups( "(gidNumber>=0)" );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
@@ -1161,7 +1193,7 @@
         LdapContext sysRoot = getSystemContext( service );
         createData( sysRoot );
 
-        Set results = searchGroups( "(!(gidNumber=4))" );
+        Set<String> results = searchGroups( "(!(gidNumber=4))" );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
@@ -1180,7 +1212,7 @@
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        Set results = searchGroups( "(!(gidNumber=4))", controls );
+        Set<String> results = searchGroups( "(!(gidNumber=4))", controls );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java Sun Jan 20 08:59:10 2008
@@ -22,6 +22,8 @@
 
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.server.core.integ.DirectoryServiceFactory;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
@@ -35,6 +37,8 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import org.junit.Test;
@@ -42,7 +46,11 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.HashSet;
 import java.util.Set;
@@ -111,7 +119,7 @@
     
     public static class MyFactory implements DirectoryServiceFactory
     {
-        public DirectoryService newInstance()
+        public DirectoryService newInstance() 
         {
             DirectoryService service = new DefaultDirectoryService();
             service.getChangeLog().setEnabled( true );
@@ -122,11 +130,20 @@
 
             JdbmPartition partition = new JdbmPartition();
             partition.setId( "system" );
-            Attributes attrs = new AttributesImpl( "objectClass", "top", true );
-            attrs.get( "objectClass" ).add( "organizationalUnit" );
-            attrs.put( "ou", "system" );
-            partition.setContextEntry( attrs );
-            partition.setSuffix( "ou=system" );
+            
+            try
+            {
+                ServerEntry serverEntry = new DefaultServerEntry( service.getRegistries(), new LdapDN( "ou=system" ) );
+                serverEntry.put( "objectClass", "top", "organizationalUnit" );
+                serverEntry.put( "ou", "system" );
+                partition.setContextEntry( serverEntry );
+                partition.setSuffix( "ou=system" );
+
+            }
+            catch ( NamingException ne )
+            {
+                // Do nothing
+            }
 
             Set<Index> indices = new HashSet<Index>();
             indices.addAll( partition.getIndexedAttributes() );
@@ -156,11 +173,11 @@
         }
 
         Set<String> results = new HashSet<String>();
-        NamingEnumeration list = getSystemContext( service ).search( "ou=groups", filter, controls );
+        NamingEnumeration<SearchResult> list = getSystemContext( service ).search( "ou=groups", filter, controls );
 
         while( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             results.add( result.getName() );
         }
 
@@ -186,7 +203,7 @@
     public void testLessThanSearchWithIndices() throws Exception
     {
         createData();
-        Set results = searchGroups( "(gidNumber<=5)" );
+        Set<String> results = searchGroups( "(gidNumber<=5)" );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );
@@ -232,7 +249,7 @@
     public void testGreaterThanSearchWithIndices() throws Exception
     {
         createData();
-        Set results = searchGroups( "(gidNumber>=0)" );
+        Set<String> results = searchGroups( "(gidNumber>=0)" );
         assertTrue( results.contains( "cn=testGroup0,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup1,ou=groups,ou=system" ) );
         assertTrue( results.contains( "cn=testGroup2,ou=groups,ou=system" ) );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java Sun Jan 20 08:59:10 2008
@@ -27,7 +27,11 @@
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -89,11 +93,11 @@
         
         Attributes returned = sysRoot.getAttributes( "cn=kevin Spacey" );
       
-        NamingEnumeration attrList = returned.getAll();
+        NamingEnumeration<? extends Attribute> attrList = returned.getAll();
         
         while ( attrList.hasMore() )
         {
-            Attribute attr = ( Attribute ) attrList.next();
+            Attribute attr = attrList.next();
           
             if ( attr.getID().equalsIgnoreCase( "cn" ) )
             {
@@ -103,7 +107,7 @@
           
             if ( attr.getID().equalsIgnoreCase( "objectClass" ) )
             {
-                NamingEnumeration values = attr.getAll();
+                NamingEnumeration<?> values = attr.getAll();
                 Set<String> expectedValues = new HashSet<String>();
                 
                 expectedValues.add( "top" );
@@ -161,11 +165,11 @@
         
         Attributes returned = sysRoot.getAttributes( "cn=kevin Spacey 2" );
       
-        NamingEnumeration attrList = returned.getAll();
+        NamingEnumeration<? extends Attribute> attrList = returned.getAll();
         
         while ( attrList.hasMore() )
         {
-            Attribute attr = ( Attribute ) attrList.next();
+            Attribute attr = attrList.next();
           
             if ( attr.getID().equalsIgnoreCase( "cn" ) )
             {
@@ -175,7 +179,7 @@
           
             if ( attr.getID().equalsIgnoreCase( "objectClass" ) )
             {
-                NamingEnumeration values = attr.getAll();
+                NamingEnumeration<?> values = attr.getAll();
                 Set<String> expectedValues = new HashSet<String>();
                 
                 expectedValues.add( "top" );
@@ -302,11 +306,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(uniqueMember=cn = kevin spacey, dc=example, dc=org)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn = kevin spacey, dc=example, dc=org)", controls );
         
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName().toLowerCase(), result.getAttributes() );
         }
 
@@ -354,11 +358,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(uniqueMember=cn = Kevin  Spacey , dc = example , dc = ORG)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn = Kevin  Spacey , dc = example , dc = ORG)", controls );
         
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName().toLowerCase(), result.getAttributes() );
         }
 
@@ -405,7 +409,7 @@
         sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
 
-        NamingEnumeration list = sysRoot.search( "", "(uniqueMember=cn=cevin spacey,dc=example,dc=org)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn=cevin spacey,dc=example,dc=org)", controls );
         
         assertFalse( list.hasMore() );
     }
@@ -445,11 +449,11 @@
                 AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
 
-        NamingEnumeration list = sysRoot.search( "", "(uniqueMember=cn= Kevin Spacey, dc=example, dc=org #'010101'B)", controls );
+        NamingEnumeration<SearchResult> list = sysRoot.search( "", "(uniqueMember=cn= Kevin Spacey, dc=example, dc=org #'010101'B)", controls );
         
         while ( list.hasMore() )
         {
-            SearchResult result = ( SearchResult ) list.next();
+            SearchResult result = list.next();
             map.put( result.getName().toLowerCase(), result.getAttributes() );
         }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java Sun Jan 20 08:59:10 2008
@@ -24,7 +24,9 @@
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java Sun Jan 20 08:59:10 2008
@@ -32,14 +32,27 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.util.StringTools;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.NoPermissionException;
-import javax.naming.directory.*;
+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.directory.InvalidAttributeValueException;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/prefs/PreferencesIT.java Sun Jan 20 08:59:10 2008
@@ -22,7 +22,9 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -23,8 +23,6 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import org.apache.directory.server.core.integ.SetupMode;
-import org.apache.directory.server.core.integ.annotations.Mode;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -36,7 +34,10 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaComparatorHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -40,7 +40,10 @@
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.Syntax;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -124,7 +127,7 @@
         
         assertTrue( getComparatorRegistry().hasComparator( OID ) );
         assertEquals( getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
-        Class clazz = getComparatorRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz, StringComparator.class );
     }
     
@@ -155,7 +158,7 @@
         
         assertTrue( getComparatorRegistry().hasComparator( OID ) );
         assertEquals( getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
-        Class clazz = getComparatorRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz.getName(), "DummyComparator" );
     }
     
@@ -207,7 +210,7 @@
         }
 
         assertTrue( getComparatorRegistry().hasComparator( NEW_OID ) );
-        Class clazz = getComparatorRegistry().lookup( NEW_OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, StringComparator.class );
     }
 
@@ -231,7 +234,7 @@
         assertEquals( "comparator schema should be set to apache not apachemeta", 
             getComparatorRegistry().getSchemaName( OID ), "apache" );
 
-        Class clazz = getComparatorRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz, StringComparator.class );
     }
 
@@ -258,7 +261,7 @@
         assertEquals( "comparator with new oid should have schema set to apache NOT apachemeta", 
             getComparatorRegistry().getSchemaName( NEW_OID ), "apache" );
 
-        Class clazz = getComparatorRegistry().lookup( NEW_OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, StringComparator.class );
     }
 
@@ -282,7 +285,7 @@
         assertEquals( "comparator schema should be set to apachemeta", 
             getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
 
-        Class clazz = getComparatorRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz, IntegerComparator.class );
     }
 
@@ -305,7 +308,7 @@
         assertEquals( "comparator schema should be set to apachemeta", 
             getComparatorRegistry().getSchemaName( OID ), "apachemeta" );
 
-        Class clazz = getComparatorRegistry().lookup( OID ).getClass();
+        Class<?> clazz = getComparatorRegistry().lookup( OID ).getClass();
         assertEquals( clazz, IntegerComparator.class );
     }
     

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java?rev=613608&r1=613607&r2=613608&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandlerIT.java Sun Jan 20 08:59:10 2008
@@ -23,8 +23,6 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import org.apache.directory.server.core.integ.SetupMode;
-import org.apache.directory.server.core.integ.annotations.Mode;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -35,7 +33,10 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 



Mime
View raw message