directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r600731 - /directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogITest.java
Date Mon, 03 Dec 2007 23:39:54 GMT
Author: akarasulu
Date: Mon Dec  3 15:39:45 2007
New Revision: 600731

URL: http://svn.apache.org/viewvc?rev=600731&view=rev
Log:
added test to check change log persistence across restarts

Modified:
    directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogITest.java

Modified: directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogITest.java?rev=600731&r1=600730&r2=600731&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogITest.java
Mon Dec  3 15:39:45 2007
@@ -158,6 +158,35 @@
     }
 
 
+    public void testTagPersistenceAcrossRestarts() throws NamingException, InterruptedException
+    {
+        assertEquals( 0, service.getChangeLog().getCurrentRevision() );
+        assertNull( service.getChangeLog().getLatest() );
+
+        Tag t0 = service.getChangeLog().tag();
+        assertEquals( t0, service.getChangeLog().getLatest() );
+        assertEquals( 0, service.getChangeLog().getCurrentRevision() );
+
+        // add new test entry
+        AttributesImpl attrs = new AttributesImpl( "objectClass", "organizationalUnit", true
);
+        attrs.put( "ou", "test" );
+        sysRoot.createSubcontext( "ou=test", attrs );
+        assertEquals( 1, service.getChangeLog().getCurrentRevision() );
+
+        service.sync();
+        service.shutdown();
+
+        service.startup();
+        assertEquals( 1, service.getChangeLog().getCurrentRevision() );
+        assertEquals( t0, service.getChangeLog().getLatest() );
+
+        service.revert();
+        assertNotPresent( sysRoot, "ou=test" );
+        assertEquals( 2, service.getChangeLog().getCurrentRevision() );
+        assertEquals( t0, service.getChangeLog().getLatest() );
+    }
+
+
     public void testRevertAddOperations() throws NamingException
     {
         Tag t0 = service.getChangeLog().tag();



Mime
View raw message