directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r760762 - in /directory/apacheds/branches/ldif-partition: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/ avl-partition/src/test/java/o...
Date Wed, 01 Apr 2009 01:25:12 GMT
Author: akarasulu
Date: Wed Apr  1 01:25:11 2009
New Revision: 760762

URL: http://svn.apache.org/viewvc?rev=760762&view=rev
Log:
moved avl stuff into avl partion and removed if from ldif partition.

Added:
    directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/
      - copied from r760755, directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/
    directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/
      - copied from r760755, directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/ldif/
    directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java
Removed:
    directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/ldif/
    directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlUsageTest.java
    directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/ldif/
    directory/apacheds/branches/ldif-partition/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/
    directory/apacheds/branches/ldif-partition/ldif-partition/src/test/java/org/apache/directory/server/core/partition/ldif/
Modified:
    directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java
    directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java

Modified: directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java?rev=760762&r1=760755&r2=760762&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java
(original)
+++ directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTable.java
Wed Apr  1 01:25:11 2009
@@ -17,7 +17,7 @@
  *   under the License.
  *
  */
-package org.apache.directory.server.core.partition.ldif;
+package org.apache.directory.server.core.partition.avl;
 
 
 import java.util.Comparator;

Modified: directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java?rev=760762&r1=760755&r2=760762&view=diff
==============================================================================
--- directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java
(original)
+++ directory/apacheds/branches/ldif-partition/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlTableDupsCursor.java
Wed Apr  1 01:25:11 2009
@@ -17,7 +17,7 @@
  *   under the License.
  *
  */
-package org.apache.directory.server.core.partition.ldif;
+package org.apache.directory.server.core.partition.avl;
 
 
 import org.apache.directory.server.core.avltree.AvlTree;

Added: directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java?rev=760762&view=auto
==============================================================================
--- directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java
(added)
+++ directory/apacheds/branches/ldif-partition/avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/AvlTableTest.java
Wed Apr  1 01:25:11 2009
@@ -0,0 +1,77 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you 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.directory.server.core.partition.avl;
+
+
+import java.util.Comparator;
+
+import junit.framework.TestCase;
+
+
+/**
+ * A set of test cases for the AvlTable class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class AvlTableTest extends TestCase
+{
+    /**
+     * Tests the put() and get() methods on an AvlTable with duplicate keys 
+     * disabled.
+     */
+    public void testPutNoDups() throws Exception
+    {
+        AvlTable<Integer,Integer> table = new AvlTable<Integer,Integer>( 
+            "test", new IntComparator(), new IntComparator(), false );
+
+        // ---------------------------------------------------------
+        // normal operation 
+        // ---------------------------------------------------------
+        
+        table.put( 0, 3 );
+        table.put( 1, 2 );
+        table.put( 2, 1 );
+        table.put( 3, 0 );
+        table.put( 23, 8934 );
+        
+        assertEquals( 3, table.get( 0 ).intValue() );
+        assertEquals( 2, table.get( 1 ).intValue() );
+        assertEquals( 1, table.get( 2 ).intValue() );
+        assertEquals( 0, table.get( 3 ).intValue() );
+        assertEquals( 8934, table.get( 23 ).intValue() );
+
+        // ---------------------------------------------------------
+        // try adding duplicates when not supported
+        // ---------------------------------------------------------
+        
+        table.put( 23, 34 );
+        assertEquals( 34, table.get( 23 ).intValue() );
+    }
+    
+    
+    class IntComparator implements Comparator<Integer>
+    {
+        public int compare( Integer i1, Integer i2 )
+        {
+            return i1.compareTo( i2 );
+        }
+    }
+}



Mime
View raw message