directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r653605 - in /directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl: NotCursorTest.java OrCursorTest.java
Date Mon, 05 May 2008 21:16:19 GMT
Author: kayyagari
Date: Mon May  5 14:16:18 2008
New Revision: 653605

URL: http://svn.apache.org/viewvc?rev=653605&view=rev
Log:
removed two test methods in each class which are using a static variable
removed unused variable in NotCursorTest

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java?rev=653605&r1=653604&r2=653605&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
Mon May  5 14:16:18 2008
@@ -77,8 +77,6 @@
     EvaluatorBuilder evaluatorBuilder;
     CursorBuilder cursorBuilder;
 
-    static Cursor<IndexEntry<?,Attributes>> storedCursor;
-    
     public NotCursorTest() throws Exception
     {
         // setup the standard registries
@@ -149,8 +147,6 @@
     @Test
     public void testNotCursor() throws Exception
     {
-        LdapDN baseDn = new LdapDN( "ou=Sales,o=Good Times Co." );
-        
         String filter = "(!(cn=J*))";
 
         ExprNode exprNode = FilterParser.parse( filter );
@@ -197,8 +193,6 @@
     @Test
     public void testNotCursorWithManualFilter() throws Exception
     {
-        LdapDN baseDn = new LdapDN( "ou=Sales,o=Good Times Co." );
-        
         NotNode notNode = new NotNode();
         
         ExprNode exprNode = new SubstringNode( "cn", "J", null );
@@ -206,7 +200,6 @@
         notNode.addNode( exprNode );
         
         Cursor<IndexEntry<?,Attributes>> cursor = ( Cursor<IndexEntry<?,Attributes>>
) new NotCursor( store, eval ); //cursorBuilder.build( andNode );
-        storedCursor = cursor;
         
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
@@ -277,20 +270,20 @@
             fail( "should fail with InvalidCursorPositionException" );
         }
         catch( InvalidCursorPositionException ice ) { }
-    }
-    
-    
-    @Test( expected = UnsupportedOperationException.class )
-    public void testAfter() throws Exception
-    {
-        storedCursor.after( new ForwardIndexEntry() );
-    }
-    
-    
-    @Test( expected = UnsupportedOperationException.class )
-    public void testBefore() throws Exception
-    {
-        storedCursor.before( new ForwardIndexEntry() );
+        
+        try
+        {
+            cursor.after( new ForwardIndexEntry() );
+            fail( "should fail with UnsupportedOperationException " );
+        }
+        catch( UnsupportedOperationException uoe ) {}
+        
+        try
+        {
+            cursor.before( new ForwardIndexEntry() );
+            fail( "should fail with UnsupportedOperationException " );
+        }
+        catch( UnsupportedOperationException uoe ) {}
     }
 
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java?rev=653605&r1=653604&r2=653605&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
Mon May  5 14:16:18 2008
@@ -82,8 +82,6 @@
     EvaluatorBuilder evaluatorBuilder;
     CursorBuilder cursorBuilder;
 
-    static Cursor<IndexEntry<?,Attributes>> storedCursor;
-    
     public OrCursorTest() throws Exception
     {
         // setup the standard registries
@@ -270,7 +268,6 @@
         orNode.addNode( exprNode );
         
         cursor = ( Cursor<IndexEntry<?,Attributes>> ) new OrCursor( cursors,
evaluators );
-        storedCursor = cursor;
         
         cursor.beforeFirst();
         assertFalse( cursor.available() );
@@ -348,21 +345,21 @@
         
         assertTrue( cursor.isElementReused() );
         
+        try
+        {
+            cursor.after( new ForwardIndexEntry() );
+            fail( "should fail with UnsupportedOperationException " );
+        }
+        catch( UnsupportedOperationException uoe ) {}
+        
+        try
+        {
+            cursor.before( new ForwardIndexEntry() );
+            fail( "should fail with UnsupportedOperationException " );
+        }
+        catch( UnsupportedOperationException uoe ) {}
+        
         cursor.get();
     }
-    
-    
-    @Test( expected = UnsupportedOperationException.class )
-    public void testAfter() throws Exception
-    {
-        storedCursor.after( new ForwardIndexEntry() );
-    }
-    
-    
-    @Test( expected = UnsupportedOperationException.class )
-    public void testBefore() throws Exception
-    {
-        storedCursor.before( new ForwardIndexEntry() );
-    }
 
 }



Mime
View raw message