directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1038516 [2/2] - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/test/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/ core/src/main/java/org/apa...
Date Wed, 24 Nov 2010 08:04:08 GMT
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
Wed Nov 24 08:04:06 2010
@@ -30,7 +30,6 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.subtree.SubtreeEvaluator;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -76,8 +75,8 @@ public class RelatedUserClassFilterTest
         
         try
         {
-            GROUP_NAME = DNFactory.create( "ou=test,ou=groups,ou=system" );
-            USER_NAME = DNFactory.create( "ou=test, ou=users, ou=system" );
+            GROUP_NAME = new DN( "ou=test,ou=groups,ou=system" );
+            USER_NAME = new DN( "ou=test, ou=users, ou=system" );
         }
         catch ( LdapInvalidDnException e )
         {
@@ -128,7 +127,7 @@ public class RelatedUserClassFilterTest
         aciContext.setAciTuples( tuples );
         aciContext.setUserDn( USER_NAME );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
-        aciContext.setEntryDn( DNFactory.create( "ou=unrelated" ) );
+        aciContext.setEntryDn( new DN( "ou=unrelated" ) );
 
         assertEquals( 0, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
     }
@@ -143,7 +142,7 @@ public class RelatedUserClassFilterTest
         aciContext.setAciTuples( tuples );
         aciContext.setUserDn( USER_NAME );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
-        aciContext.setEntryDn( DNFactory.create( "ou=phoneBook, ou=test, ou=users, ou=system"
) );
+        aciContext.setEntryDn( new DN( "ou=phoneBook, ou=test, ou=users, ou=system" ) );
 
         assertEquals( 1, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
 
@@ -151,7 +150,7 @@ public class RelatedUserClassFilterTest
         aciContext.setAciTuples( tuples );
         aciContext.setUserDn( USER_NAME );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
-        aciContext.setEntryDn( DNFactory.create( "ou=unrelated" ) );
+        aciContext.setEntryDn( new DN( "ou=unrelated" ) );
 
         assertEquals( 0, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
     }
@@ -171,7 +170,7 @@ public class RelatedUserClassFilterTest
 
         aciContext = new AciContext( null, null );
         aciContext.setAciTuples( tuples );
-        aciContext.setUserDn( DNFactory.create( "ou=unrelateduser, ou=users" ) );
+        aciContext.setUserDn( new DN( "ou=unrelateduser, ou=users" ) );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
         aciContext.setEntryDn( USER_NAME );
 
@@ -193,7 +192,7 @@ public class RelatedUserClassFilterTest
         assertEquals( 1, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
 
         Set<DN> wrongGroupNames = new HashSet<DN>();
-        wrongGroupNames.add( DNFactory.create( "ou=unrelatedgroup" ) );
+        wrongGroupNames.add( new DN( "ou=unrelatedgroup" ) );
 
         aciContext = new AciContext( null, null );
         aciContext.setAciTuples( tuples );
@@ -287,7 +286,7 @@ public class RelatedUserClassFilterTest
             
             try
             {
-                names.add( DNFactory.create( "dummy=dummy" ) );
+                names.add( new DN( "dummy=dummy" ) );
             }
             catch ( LdapInvalidDnException e )
             {

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
Wed Nov 24 08:04:06 2010
@@ -31,7 +31,6 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -95,7 +94,7 @@ public class RestrictedByFilterTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors()
) );
         }
 
-        DN entryName = DNFactory.create( "ou=test, ou=system" );
+        DN entryName = new DN( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new MaxImmSubItem( 2 ) );
         ENTRY = new DefaultEntry( schemaManager, entryName );
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
Wed Nov 24 08:04:06 2010
@@ -34,7 +34,6 @@ import java.util.Map;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -108,7 +107,7 @@ public class MemoryChangeLogStoreTest
         forward.putAttribute( "objectClass", "organizationalUnit" );
         forward.putAttribute( "ou", "system" );
 
-        LdifEntry reverse = LdifRevertor.reverseAdd( DNFactory.create( forward.getDn() )
);
+        LdifEntry reverse = LdifRevertor.reverseAdd( new DN( forward.getDn() ) );
         assertEquals( 1, store.log( new LdapPrincipal(), forward, reverse ).getRevision()
);
         assertEquals( 1, store.getCurrentRevision() );
     }
@@ -117,10 +116,10 @@ public class MemoryChangeLogStoreTest
     @Test
     public void testChangeLogSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        DN systemDn = DNFactory.create( "ou=system" );
+        DN systemDn = new DN( "ou=system" );
         systemDn.normalize( oidsMap );
         
-        DN adminDn = DNFactory.create( "uid=admin, ou=system" );
+        DN adminDn = new DN( "uid=admin, ou=system" );
         adminDn.normalize( oidsMap );
 
         LdifEntry forward = new LdifEntry();
@@ -129,7 +128,7 @@ public class MemoryChangeLogStoreTest
         forward.putAttribute( "objectClass", "organizationalUnit" );
         forward.putAttribute( "ou", "system" );
         
-        DN reverseDn = DNFactory.create( forward.getDn() );
+        DN reverseDn = new DN( forward.getDn() );
         reverseDn.normalize( oidsMap );
 
         LdifEntry reverse = LdifRevertor.reverseAdd( reverseDn );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
Wed Nov 24 08:04:06 2010
@@ -28,7 +28,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -87,7 +86,7 @@ public class InterceptorChainTest
     @Test
     public void testNoBypass() throws Exception
     {
-        DN dn = DNFactory.create( "ou=system" );
+        DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(),
AuthenticationLevel.STRONG ),
             ds );
@@ -113,7 +112,7 @@ public class InterceptorChainTest
     @Test
     public void testSingleBypass() throws Exception
     {
-        DN dn = DNFactory.create( "ou=system" );
+        DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(),
AuthenticationLevel.STRONG ),
             ds );
@@ -140,7 +139,7 @@ public class InterceptorChainTest
     @Test
     public void testAdjacentDoubleBypass() throws Exception
     {
-        DN dn = DNFactory.create( "ou=system" );
+        DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(),
AuthenticationLevel.STRONG ),
             ds );
@@ -170,7 +169,7 @@ public class InterceptorChainTest
     @Test
     public void testFrontAndBackDoubleBypass() throws Exception
     {
-        DN dn = DNFactory.create( "ou=system" );
+        DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(),
AuthenticationLevel.STRONG ),
             ds );
@@ -199,7 +198,7 @@ public class InterceptorChainTest
     @Test
     public void testDoubleBypass() throws Exception
     {
-        DN dn = DNFactory.create( "ou=system" );
+        DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(),
AuthenticationLevel.STRONG ),
             ds );
@@ -228,7 +227,7 @@ public class InterceptorChainTest
     @Test
     public void testCompleteBypass() throws Exception
     {
-        DN dn = DNFactory.create( "ou=system" );
+        DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService( 0 );
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(),
AuthenticationLevel.STRONG ),
             ds );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
Wed Nov 24 08:04:06 2010
@@ -28,9 +28,13 @@ import java.io.File;
 import java.util.HashSet;
 import java.util.Set;
 
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.server.core.DNFactory;
+import org.apache.directory.server.core.DefaultDNFactory;
 import org.apache.directory.server.core.normalization.FilterNormalizingVisitor;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -61,12 +65,12 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class SubtreeEvaluatorTest
 {
+    private static DNFactory dnFactory;
     private static SchemaManager schemaManager;
     private static SubtreeEvaluator evaluator;
     private static FilterNormalizingVisitor visitor;
     private static ConcreteNameComponentNormalizer ncn;
 
-
     @BeforeClass
     public static void init() throws Exception
     {
@@ -92,7 +96,9 @@ public class SubtreeEvaluatorTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors()
) );
         }
 
-        DNFactory.setSchemaManager( schemaManager );
+        CacheManager.getInstance().addCacheIfAbsent( "dnCache" );
+        Cache dnCache = CacheManager.getInstance().getCache( "dnCache" );
+        dnFactory = new DefaultDNFactory( schemaManager, dnCache );
         
         ncn = new ConcreteNameComponentNormalizer( schemaManager );
 
@@ -106,6 +112,7 @@ public class SubtreeEvaluatorTest
     {
         visitor = null;
         evaluator = null;
+        CacheManager.getInstance().getCache( "dnCache" ).removeAll();
     }
 
 
@@ -121,16 +128,16 @@ public class SubtreeEvaluatorTest
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
         Entry entry = new DefaultEntry( schemaManager, entryDn, "objectClass" );
 
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=abc" );
+        entryDn = dnFactory.create( "ou=abc" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
     }
 
@@ -139,18 +146,18 @@ public class SubtreeEvaluatorTest
     public void testWithBase() throws Exception
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
-        modifier.setBase( DNFactory.create( "ou=users" ) );
+        modifier.setBase( dnFactory.create( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
         Entry entry = new DefaultEntry( schemaManager, entryDn, "objectClass" );
 
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
     }
 
@@ -161,27 +168,27 @@ public class SubtreeEvaluatorTest
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( DNFactory.create( "ou=users" ) );
+        modifier.setBase( dnFactory.create( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
         Entry entry = new DefaultEntry( schemaManager, entryDn, "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
     }
 
@@ -191,32 +198,32 @@ public class SubtreeEvaluatorTest
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         Set<DN> chopAfter = new HashSet<DN>();
-        chopAfter.add( DNFactory.create( "uid=Tori Amos" ) );
-        chopAfter.add( DNFactory.create( "ou=twolevels,uid=akarasulu" ) );
+        chopAfter.add( dnFactory.create( "uid=Tori Amos" ) );
+        chopAfter.add( dnFactory.create( "ou=twolevels,uid=akarasulu" ) );
         modifier.setChopAfterExclusions( chopAfter );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( DNFactory.create( "ou=users" ) );
+        modifier.setBase( dnFactory.create( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
         Entry entry = new DefaultEntry( schemaManager, entryDn, "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
     }
 
@@ -226,32 +233,32 @@ public class SubtreeEvaluatorTest
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         Set<DN> chopBefore = new HashSet<DN>();
-        chopBefore.add( DNFactory.create( "uid=Tori Amos" ) );
-        chopBefore.add( DNFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu" ) );
+        chopBefore.add( dnFactory.create( "uid=Tori Amos" ) );
+        chopBefore.add( dnFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu" ) );
         modifier.setChopBeforeExclusions( chopBefore );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( DNFactory.create( "ou=users" ) );
+        modifier.setBase( dnFactory.create( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
         Entry entry = new DefaultEntry( schemaManager, entryDn, "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
     }
 
@@ -266,28 +273,28 @@ public class SubtreeEvaluatorTest
         modifier.setRefinement( refinement );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( DNFactory.create( "ou=users" ) );
+        modifier.setBase( dnFactory.create( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
         Entry entry = new DefaultEntry( schemaManager, entryDn );
         entry.put( "objectClass", "person" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
         // now change the refinement so the entry is rejected
@@ -296,19 +303,19 @@ public class SubtreeEvaluatorTest
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "uid=akarasulu,ou=users,ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=system" );
+        entryDn = dnFactory.create( "ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
+        entryDn = dnFactory.create( "ou=twolevels,uid=akarasulu,ou=users,ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
+        entryDn = dnFactory.create( "ou=fourlevels,ou=threelevels,ou=twolevels,uid=akarasulu,ou=users,ou=system"
);
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
     }
@@ -324,10 +331,10 @@ public class SubtreeEvaluatorTest
         modifier.setRefinement( filter );
         modifier.setMinBaseDistance( 1 );
         modifier.setMaxBaseDistance( 3 );
-        modifier.setBase( DNFactory.create( "ou=users" ) );
+        modifier.setBase( dnFactory.create( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        DN apDn = DNFactory.create( "ou=system" );
-        DN entryDn = DNFactory.create( "ou=users,ou=system" );
+        DN apDn = dnFactory.create( "ou=system" );
+        DN entryDn = dnFactory.create( "ou=users,ou=system" );
 
         Entry entry = new DefaultEntry( schemaManager, entryDn );;
         entry.put( "objectClass", "person" );
@@ -335,7 +342,7 @@ public class SubtreeEvaluatorTest
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "cn=Ersin,ou=users,ou=system" );
+        entryDn = dnFactory.create( "cn=Ersin,ou=users,ou=system" );
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
         // now change the filter so the entry is rejected
@@ -345,7 +352,7 @@ public class SubtreeEvaluatorTest
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
-        entryDn = DNFactory.create( "cn=Alex,ou=users,ou=system" );
+        entryDn = dnFactory.create( "cn=Alex,ou=users,ou=system" );
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
     }
 }

Modified: directory/apacheds/trunk/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java?rev=1038516&r1=1038515&r2=1038516&view=diff
==============================================================================
--- directory/apacheds/trunk/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java
(original)
+++ directory/apacheds/trunk/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java
Wed Nov 24 08:04:06 2010
@@ -38,14 +38,12 @@ import java.util.UUID;
 
 import org.apache.directory.server.HttpDirectoryService;
 import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.security.TlsKeyGenerator;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
 import org.apache.directory.shared.ldap.entry.Entry;
-import org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo;
-import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
+import org.apache.directory.shared.ldap.name.DN;
 import org.bouncycastle.jce.provider.X509CertParser;
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
@@ -178,7 +176,8 @@ public class HttpServer
             if ( httpsTransport != null )
             {
                 // load the admin entry to get the private key and certificate
-                Entry adminEntry = dirService.getAdminSession().lookup( DNFactory.create(
ServerDNConstants.ADMIN_SYSTEM_DN ), new String[]{ "+" } );
+                DN adminDn = dirService.getDNFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN
);
+                Entry adminEntry = dirService.getAdminSession().lookup( adminDn, new String[]{
"+" } );
                 
                 File confDir = dirService.getInstanceLayout().getConfDirectory();
                 File ksFile = new File( confDir, "httpserver.generated.ks" );



Mime
View raw message