You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/09/30 09:54:32 UTC

svn commit: r292666 - in /directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support: DummyOidRegistry.java RelatedUserClassFilterTest.java

Author: trustin
Date: Fri Sep 30 00:54:28 2005
New Revision: 292666

URL: http://svn.apache.org/viewcvs?rev=292666&view=rev
Log:
Extracted DummyOidRegistry to a separate file.

Added:
    directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/DummyOidRegistry.java   (with props)
Modified:
    directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/RelatedUserClassFilterTest.java

Added: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/DummyOidRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/DummyOidRegistry.java?rev=292666&view=auto
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/DummyOidRegistry.java (added)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/DummyOidRegistry.java Fri Sep 30 00:54:28 2005
@@ -0,0 +1,71 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.server.authz.support;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.server.schema.OidRegistry;
+
+/**
+ * A mock {@link OidRegistry} to test {@link ACITupleFilter} implementations.
+ *
+ * @author The Apache Directory Project
+ * @version $Rev$, $Date$
+ *
+ */
+class DummyOidRegistry implements OidRegistry
+{
+    public String getOid( String name ) throws NamingException
+    {
+        return String.valueOf( name.hashCode() );
+    }
+
+    public boolean hasOid( String id )
+    {
+        return true;
+    }
+
+    public String getPrimaryName( String oid ) throws NamingException
+    {
+        return oid;
+    }
+
+    public List getNameSet( String oid ) throws NamingException
+    {
+        List list = new ArrayList();
+        list.add( oid );
+        return list;
+    }
+
+    public Iterator list()
+    {
+        // Not used
+        return new ArrayList().iterator();
+    }
+
+    public void register( String name, String oid )
+    {
+        // Not used
+    }
+    
+}
\ No newline at end of file

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/DummyOidRegistry.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/RelatedUserClassFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/RelatedUserClassFilterTest.java?rev=292666&r1=292665&r2=292666&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/RelatedUserClassFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/support/RelatedUserClassFilterTest.java Fri Sep 30 00:54:28 2005
@@ -22,8 +22,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Set;
 
 import javax.naming.Name;
@@ -36,7 +34,6 @@
 import org.apache.ldap.common.aci.AuthenticationLevel;
 import org.apache.ldap.common.aci.UserClass;
 import org.apache.ldap.common.name.LdapName;
-import org.apache.ldap.server.schema.OidRegistry;
 import org.apache.ldap.server.subtree.SubtreeEvaluator;
 
 /**
@@ -187,43 +184,6 @@
                         null, AuthenticationLevel.SIMPLE, null, null, null, null, null ).size() );
     }
 
-    private static class DummyOidRegistry implements OidRegistry
-    {
-        public String getOid( String name ) throws NamingException
-        {
-            return String.valueOf( name.hashCode() );
-        }
-
-        public boolean hasOid( String id )
-        {
-            return true;
-        }
-
-        public String getPrimaryName( String oid ) throws NamingException
-        {
-            return oid;
-        }
-
-        public List getNameSet( String oid ) throws NamingException
-        {
-            List list = new ArrayList();
-            list.add( oid );
-            return list;
-        }
-
-        public Iterator list()
-        {
-            // Not used
-            return new ArrayList().iterator();
-        }
-
-        public void register( String name, String oid )
-        {
-            // Not used
-        }
-        
-    }
-    
     private static Collection getTuples( UserClass userClass )
     {
         Collection classes = new ArrayList();