directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r471344 - in /directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis: common/ service/protocol/codec/ store/derby/
Date Sun, 05 Nov 2006 02:46:53 GMT
Author: akarasulu
Date: Sat Nov  4 18:46:51 2006
New Revision: 471344

URL: http://svn.apache.org/viewvc?view=rev&rev=471344
Log:
source formatting

Modified:
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest2.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
Sat Nov  4 18:46:51 2006
@@ -19,8 +19,10 @@
  */
 package org.apache.directory.mitosis.common;
 
+
 import junit.framework.TestCase;
 
+
 /**
  * 
  * Test for the SimpleCSN class
@@ -33,14 +35,15 @@
     public void testCSN()
     {
         long ts = System.currentTimeMillis();
-        
+
         CSN csn = new SimpleCSN( Long.toString( ts, 16 ) + ":abcdefghi0123:" + 1 );
-        
+
         assertEquals( ts, csn.getTimestamp() );
         assertEquals( 1, csn.getOperationSequence() );
         assertEquals( "abcdefghi0123", csn.getReplicaId().toString() );
     }
 
+
     public void testCSNEmpty()
     {
         try
@@ -58,6 +61,7 @@
         }
     }
 
+
     public void testCSNTSOnly()
     {
         try
@@ -75,6 +79,7 @@
         }
     }
 
+
     public void testCSNInvalidTS()
     {
         try
@@ -92,6 +97,7 @@
         }
     }
 
+
     public void testCSNNoTS()
     {
         try
@@ -109,6 +115,7 @@
         }
     }
 
+
     public void testCSNInavlidReplica()
     {
         try
@@ -126,6 +133,7 @@
         }
     }
 
+
     public void testCSNNoReplica()
     {
         try
@@ -143,6 +151,7 @@
         }
     }
 
+
     public void testCSNInavlidOpSeq()
     {
         try
@@ -160,6 +169,7 @@
         }
     }
 
+
     public void testCSNEmptyOpSeq()
     {
         try
@@ -177,6 +187,7 @@
         }
     }
 
+
     public void testCSNNoOpSeq()
     {
         try
@@ -193,28 +204,29 @@
             assertTrue( true );
         }
     }
-    
+
+
     public void testCSNToBytes()
     {
         CSN csn = new SimpleCSN( "0123456789abcdef:test:5678cdef" );
-        
+
         byte[] bytes = csn.toBytes();
-        
+
         assertEquals( 0x01, bytes[0] );
         assertEquals( 0x23, bytes[1] );
         assertEquals( 0x45, bytes[2] );
         assertEquals( 0x67, bytes[3] );
-        assertEquals( (byte)0x89, bytes[4] );
-        assertEquals( (byte)0xAB, bytes[5] );
-        assertEquals( (byte)0xCD, bytes[6] );
-        assertEquals( (byte)0xEF, bytes[7] );
+        assertEquals( ( byte ) 0x89, bytes[4] );
+        assertEquals( ( byte ) 0xAB, bytes[5] );
+        assertEquals( ( byte ) 0xCD, bytes[6] );
+        assertEquals( ( byte ) 0xEF, bytes[7] );
         assertEquals( 0x56, bytes[8] );
         assertEquals( 0x78, bytes[9] );
-        assertEquals( (byte)0xCD, bytes[10] );
-        assertEquals( (byte)0xEF, bytes[11] );
-        
+        assertEquals( ( byte ) 0xCD, bytes[10] );
+        assertEquals( ( byte ) 0xEF, bytes[11] );
+
         assertEquals( "test", new String( bytes, 12, bytes.length - 12 ) );
-        
+
         CSN deserializedCSN = new SimpleCSN( bytes );
         assertEquals( csn, deserializedCSN );
     }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
@@ -31,25 +32,25 @@
 import org.apache.mina.filter.codec.support.SimpleProtocolEncoderOutput;
 import org.apache.mina.util.Queue;
 
+
 public abstract class AbstractMessageCodecTest extends TestCase
 {
     private final BaseMessage message;
     private final MessageEncoder encoder;
     private final MessageDecoder decoder;
-    
-    protected AbstractMessageCodecTest( BaseMessage message,
-                                        MessageEncoder encoder,
-                                        MessageDecoder decoder )
+
+
+    protected AbstractMessageCodecTest( BaseMessage message, MessageEncoder encoder, MessageDecoder
decoder )
     {
-        if( message == null )
+        if ( message == null )
         {
             throw new NullPointerException( "message" );
         }
-        if( encoder == null )
+        if ( encoder == null )
         {
             throw new NullPointerException( "encoder" );
         }
-        if( decoder == null )
+        if ( decoder == null )
         {
             throw new NullPointerException( "decoder" );
         }
@@ -58,7 +59,8 @@
         this.encoder = encoder;
         this.decoder = decoder;
     }
-    
+
+
     public void testMessageCodec() throws Exception
     {
         SimpleProtocolEncoderOutput encoderOut = new SimpleProtocolEncoderOutput()
@@ -67,7 +69,7 @@
             {
                 return null;
             }
-            
+
         };
         encoder.encode( null, message, encoderOut );
         ByteBuffer buf = ( ByteBuffer ) encoderOut.getBufferQueue().pop();
@@ -75,30 +77,32 @@
         buf.mark();
         Assert.assertTrue( decoder.decodable( null, buf ) == MessageDecoder.OK );
         buf.reset();
-        
+
         ProtocolDecoderOutputImpl decoderOut = new ProtocolDecoderOutputImpl();
         decoder.decode( null, buf, decoderOut );
-        
-        Assert.assertTrue( compare( message,
-                                    ( BaseMessage ) decoderOut.messages.pop() ) );
+
+        Assert.assertTrue( compare( message, ( BaseMessage ) decoderOut.messages.pop() )
);
     }
-    
+
+
     protected boolean compare( BaseMessage expected, BaseMessage actual )
     {
         return expected.equals( actual );
     }
-    
+
     private class ProtocolDecoderOutputImpl implements ProtocolDecoderOutput
     {
         private final Queue messages = new Queue();
 
+
         public void flush()
         {
         }
 
-        public void write(Object message)
+
+        public void write( Object message )
         {
-            messages.push(message);
+            messages.push( message );
         }
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.SimpleCSN;
@@ -27,11 +28,13 @@
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesAckMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
 
-public class BeginLogEntriesAckMessageCodecTest extends AbstractMessageCodecTest {
+
+public class BeginLogEntriesAckMessageCodecTest extends AbstractMessageCodecTest
+{
 
     private static final CSNVector PURGE_VECTOR = new CSNVector();
     private static final CSNVector UPDATE_VECTOR = new CSNVector();
-    
+
     static
     {
         PURGE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() - 400, new ReplicaId(
"replica0" ), 3456 ) );
@@ -44,10 +47,11 @@
         UPDATE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() + 200, new ReplicaId(
"replica2" ), 9012 ) );
         UPDATE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() + 300, new ReplicaId(
"replica3" ), 3456 ) );
     }
-    
-    public BeginLogEntriesAckMessageCodecTest() {
+
+
+    public BeginLogEntriesAckMessageCodecTest()
+    {
         super( new BeginLogEntriesAckMessage( 1234, Constants.OK, PURGE_VECTOR, UPDATE_VECTOR
),
-               new BeginLogEntriesAckMessageEncoder(),
-               new BeginLogEntriesAckMessageDecoder() );
+            new BeginLogEntriesAckMessageEncoder(), new BeginLogEntriesAckMessageDecoder()
);
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest2.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest2.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest2.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest2.java
Sat Nov  4 18:46:51 2006
@@ -19,16 +19,19 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesAckMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesAckMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
 
-public class BeginLogEntriesAckMessageCodecTest2 extends AbstractMessageCodecTest {
-    
-    public BeginLogEntriesAckMessageCodecTest2() {
+
+public class BeginLogEntriesAckMessageCodecTest2 extends AbstractMessageCodecTest
+{
+
+    public BeginLogEntriesAckMessageCodecTest2()
+    {
         super( new BeginLogEntriesAckMessage( 1234, Constants.NOT_OK, null, null ),
-               new BeginLogEntriesAckMessageEncoder(),
-               new BeginLogEntriesAckMessageDecoder() );
+            new BeginLogEntriesAckMessageEncoder(), new BeginLogEntriesAckMessageDecoder()
);
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,15 +19,18 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesMessage;
 
-public class BeginLogEntriesMessageCodecTest extends AbstractMessageCodecTest {
 
-    public BeginLogEntriesMessageCodecTest() {
-        super( new BeginLogEntriesMessage( 1234 ),
-               new BeginLogEntriesMessageEncoder(),
-               new BeginLogEntriesMessageDecoder() );
+public class BeginLogEntriesMessageCodecTest extends AbstractMessageCodecTest
+{
+
+    public BeginLogEntriesMessageCodecTest()
+    {
+        super( new BeginLogEntriesMessage( 1234 ), new BeginLogEntriesMessageEncoder(),
+            new BeginLogEntriesMessageDecoder() );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesAckMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,15 +19,18 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.service.protocol.codec.EndLogEntriesAckMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.EndLogEntriesAckMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesAckMessage;
 
-public class EndLogEntriesAckMessageCodecTest extends AbstractMessageCodecTest {
 
-    public EndLogEntriesAckMessageCodecTest() {
-        super( new EndLogEntriesAckMessage( 1234, 5678 ),
-               new EndLogEntriesAckMessageEncoder(),
-               new EndLogEntriesAckMessageDecoder() );
+public class EndLogEntriesAckMessageCodecTest extends AbstractMessageCodecTest
+{
+
+    public EndLogEntriesAckMessageCodecTest()
+    {
+        super( new EndLogEntriesAckMessage( 1234, 5678 ), new EndLogEntriesAckMessageEncoder(),
+            new EndLogEntriesAckMessageDecoder() );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/EndLogEntriesMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,15 +19,17 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.service.protocol.codec.EndLogEntriesMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.EndLogEntriesMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.EndLogEntriesMessage;
 
-public class EndLogEntriesMessageCodecTest extends AbstractMessageCodecTest {
 
-    public EndLogEntriesMessageCodecTest() {
-        super( new EndLogEntriesMessage( 1234 ),
-               new EndLogEntriesMessageEncoder(),
-               new EndLogEntriesMessageDecoder() );
+public class EndLogEntriesMessageCodecTest extends AbstractMessageCodecTest
+{
+
+    public EndLogEntriesMessageCodecTest()
+    {
+        super( new EndLogEntriesMessage( 1234 ), new EndLogEntriesMessageEncoder(), new EndLogEntriesMessageDecoder()
);
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryAckMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,15 +19,17 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.service.protocol.codec.LogEntryAckMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.LogEntryAckMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.LogEntryAckMessage;
 
-public class LogEntryAckMessageCodecTest extends AbstractMessageCodecTest {
 
-    public LogEntryAckMessageCodecTest() {
-        super( new LogEntryAckMessage( 1234, 5678 ),
-               new LogEntryAckMessageEncoder(),
-               new LogEntryAckMessageDecoder() );
+public class LogEntryAckMessageCodecTest extends AbstractMessageCodecTest
+{
+
+    public LogEntryAckMessageCodecTest()
+    {
+        super( new LogEntryAckMessage( 1234, 5678 ), new LogEntryAckMessageEncoder(), new
LogEntryAckMessageDecoder() );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -38,11 +38,10 @@
 
     public LogEntryMessageCodecTest() throws InvalidNameException
     {
-        super( new LogEntryMessage( 1234,
-            new AddAttributeOperation(
-                new SimpleCSN( System.currentTimeMillis(), new ReplicaId( "testReplica0"
), 1234 ), new LdapDN(
-                    "ou=system" ), new BasicAttribute( "Hello", "Test" ) ) ), new LogEntryMessageEncoder(),
-            new LogEntryMessageDecoder() );
+        super(
+            new LogEntryMessage( 1234, new AddAttributeOperation( new SimpleCSN( System.currentTimeMillis(),
+                new ReplicaId( "testReplica0" ), 1234 ), new LdapDN( "ou=system" ),
+                new BasicAttribute( "Hello", "Test" ) ) ), new LogEntryMessageEncoder(),
new LogEntryMessageDecoder() );
     }
 
 

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,16 +19,19 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.codec.LoginAckMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.LoginAckMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.LoginAckMessage;
 
-public class LoginAckMessageCodecTest extends AbstractMessageCodecTest {
 
-    public LoginAckMessageCodecTest() {
-        super( new LoginAckMessage( 1234, 5678, new ReplicaId( "ReplicaABCD" ) ),
-               new LoginAckMessageEncoder(),
-               new LoginAckMessageDecoder() );
+public class LoginAckMessageCodecTest extends AbstractMessageCodecTest
+{
+
+    public LoginAckMessageCodecTest()
+    {
+        super( new LoginAckMessage( 1234, 5678, new ReplicaId( "ReplicaABCD" ) ), new LoginAckMessageEncoder(),
+            new LoginAckMessageDecoder() );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java
Sat Nov  4 18:46:51 2006
@@ -19,16 +19,19 @@
  */
 package org.apache.directory.mitosis.service.protocol.codec;
 
+
 import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.codec.LoginMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.LoginMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
 
-public class LoginMessageCodecTest extends AbstractMessageCodecTest {
 
-    public LoginMessageCodecTest() {
-        super( new LoginMessage( 1234, new ReplicaId( "myReplica0" ) ),
-               new LoginMessageEncoder(),
-               new LoginMessageDecoder() );
+public class LoginMessageCodecTest extends AbstractMessageCodecTest
+{
+
+    public LoginMessageCodecTest()
+    {
+        super( new LoginMessage( 1234, new ReplicaId( "myReplica0" ) ), new LoginMessageEncoder(),
+            new LoginMessageDecoder() );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java?view=diff&rev=471344&r1=471343&r2=471344
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
Sat Nov  4 18:46:51 2006
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.mitosis.store.derby;
 
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -66,6 +67,7 @@
 import org.apache.directory.mitosis.store.ReplicationStoreException;
 import org.apache.directory.mitosis.store.derby.DerbyReplicationStore;
 
+
 public class DerbyReplicationStoreTest extends TestCase
 {
     private static final ReplicaId REPLICA_ID = new ReplicaId( "TEST_REPLICA" );
@@ -79,6 +81,7 @@
     private int testCount;
     private long startTime;
 
+
     public void setUp() throws Exception
     {
         dropDatabase();
@@ -86,33 +89,38 @@
         initStopWatch();
     }
 
+
     private void startupDatabase( ReplicaId replicaId ) throws Exception
     {
         // Prepare configuration
         ReplicationConfiguration cfg = new ReplicationConfiguration();
         cfg.setReplicaId( replicaId );
-        
+
         // Open store
         store = new DerbyReplicationStore();
         store.setTablePrefix( "TEST_" );
         store.open( new DirectoryServiceConfigurationImpl(), cfg );
     }
-    
+
+
     public void tearDown() throws Exception
     {
         store.close();
         dropDatabase();
     }
 
-    private void dropDatabase() throws IOException {
+
+    private void dropDatabase() throws IOException
+    {
         FileUtils.deleteDirectory( DB_PATH );
         File logFile = new File( "derby.log" );
-        if( !logFile.delete() )
+        if ( !logFile.delete() )
         {
             logFile.deleteOnExit();
         }
     }
 
+
     public void testOperations() throws Exception
     {
         subTestReopen();
@@ -128,7 +136,8 @@
         subTestVectors();
         printElapsedTime( "Vectors" );
     }
-    
+
+
     private void subTestReopen() throws Exception
     {
         store.close();
@@ -137,12 +146,13 @@
             startupDatabase( OTHER_REPLICA_ID );
             Assert.fail( "Store cannot start up with wrong replica ID." );
         }
-        catch( ReplicationStoreException e )
+        catch ( ReplicationStoreException e )
         {
         }
         startupDatabase( REPLICA_ID );
     }
-    
+
+
     private void subTestUUID() throws Exception
     {
         UUID uuid = uuidFactory.newInstance();
@@ -153,11 +163,12 @@
         Assert.assertFalse( store.removeUUID( uuid ) );
         Assert.assertNull( store.getDN( uuid ) );
     }
-    
+
+
     private void subTestEmptyLog() throws Exception
     {
         ReplicationLogIterator it;
-        
+
         it = store.getLogs( csnFactory.newInstance( REPLICA_ID ), true );
         Assert.assertFalse( it.next() );
         it.close();
@@ -170,10 +181,11 @@
         it = store.getLogs( csnFactory.newInstance( OTHER_REPLICA_ID ), false );
         Assert.assertFalse( it.next() );
         it.close();
-        
+
         Assert.assertEquals( 0, store.getLogSize() );
     }
 
+
     private void subTestWriteLog() throws Exception
     {
         CSN csn = csnFactory.newInstance( REPLICA_ID );
@@ -182,7 +194,7 @@
         op1.add( new AddAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute(
"id", "valie" ) ) );
         op1.add( new ReplaceAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute(
"id", "valie" ) ) );
         op1.add( new DeleteAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute(
"id", "valie" ) ) );
-        
+
         store.putLog( op1 );
         testGetLogs( csn, op1 );
 
@@ -192,14 +204,14 @@
         op2.add( new AddAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute(
"id", "valie" ) ) );
         op2.add( new ReplaceAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute(
"id", "valie" ) ) );
         op2.add( new DeleteAttributeOperation( csn, new LdapDN( "ou=a" ), new BasicAttribute(
"id", "valie" ) ) );
-        
+
         store.putLog( op2 );
         testGetLogs( csn, op2 );
-        
+
         Assert.assertEquals( 2, store.getLogSize() );
         Assert.assertEquals( 1, store.getLogSize( REPLICA_ID ) );
         Assert.assertEquals( 1, store.getLogSize( OTHER_REPLICA_ID ) );
-        
+
         // Test getLogs(CSNVector, true)
         List<Operation> expected = new ArrayList<Operation>();
         expected.add( op1 );
@@ -239,17 +251,18 @@
         updateVector.setCSN( op2.getCSN() );
         testGetLogs( updateVector, false, expected );
     }
-    
+
+
     private void subTestRemoveLogs()
     {
         CSN csn;
         ReplicationLogIterator it;
-        
+
         it = store.getLogs( new SimpleCSN( 0, REPLICA_ID, 0 ), false );
         it.next();
         csn = it.getOperation().getCSN();
         it.close();
-        
+
         Assert.assertEquals( 0, store.removeLogs( csn, false ) );
         Assert.assertEquals( 1, store.removeLogs( csn, true ) );
         Assert.assertEquals( 0, store.getLogSize( REPLICA_ID ) );
@@ -258,14 +271,15 @@
         Assert.assertTrue( it.next() );
         csn = it.getOperation().getCSN();
         it.close();
-        
+
         Assert.assertEquals( 0, store.removeLogs( csn, false ) );
         Assert.assertEquals( 1, store.removeLogs( csn, true ) );
         Assert.assertEquals( 0, store.getLogSize( OTHER_REPLICA_ID ) );
-        
+
         Assert.assertEquals( 0, store.getLogSize() );
     }
-    
+
+
     private void subTestVectors() throws Exception
     {
         CSN csnA = new SimpleCSN( 0, REPLICA_ID, 0 );
@@ -276,27 +290,28 @@
         store.putLog( new Operation( csnB ) );
         store.putLog( new Operation( csnC ) );
         store.putLog( new Operation( csnD ) );
-        
+
         Set<ReplicaId> expectedKnownReplicaIds = new HashSet<ReplicaId>();
         expectedKnownReplicaIds.add( REPLICA_ID );
         expectedKnownReplicaIds.add( OTHER_REPLICA_ID );
         expectedKnownReplicaIds.add( OTHER_REPLICA_ID_2 );
-        
+
         Assert.assertEquals( expectedKnownReplicaIds, store.getKnownReplicaIds() );
-        
+
         CSNVector expectedUpdateVector = new CSNVector();
         expectedUpdateVector.setCSN( csnB );
         expectedUpdateVector.setCSN( csnD );
-        
+
         Assert.assertEquals( expectedUpdateVector, store.getUpdateVector() );
 
         CSNVector expectedPurgeVector = new CSNVector();
         expectedPurgeVector.setCSN( csnA );
         expectedPurgeVector.setCSN( csnC );
-        
+
         Assert.assertEquals( expectedPurgeVector, store.getPurgeVector() );
     }
-    
+
+
     private void testGetLogs( CSN csn, Operation operation )
     {
         List<Operation> operations = new ArrayList<Operation>();
@@ -304,31 +319,34 @@
         testGetLogs( csn, operations );
     }
 
+
     private void testGetLogs( CSN csn, List operations )
     {
         Iterator it = operations.iterator();
         ReplicationLogIterator rit;
-        
+
         rit = store.getLogs( csn, true );
         testGetLogs( it, rit );
-        
+
         rit = store.getLogs( csn, false );
         Assert.assertFalse( rit.next() );
         rit.close();
     }
 
+
     private void testGetLogs( CSNVector updateVector, boolean inclusive, List operations
)
     {
         Iterator it = operations.iterator();
         ReplicationLogIterator rit;
-        
+
         rit = store.getLogs( updateVector, inclusive );
         testGetLogs( it, rit );
     }
 
+
     private void testGetLogs( Iterator expectedIt, ReplicationLogIterator actualIt )
     {
-        while( expectedIt.hasNext() )
+        while ( expectedIt.hasNext() )
         {
             Operation expected = ( Operation ) expectedIt.next();
             Assert.assertTrue( actualIt.next() );
@@ -341,23 +359,26 @@
         actualIt.close();
     }
 
+
     private void initStopWatch()
     {
         startTime = System.currentTimeMillis();
     }
-    
+
+
     private void printElapsedTime( String testName )
     {
         long endTime = System.currentTimeMillis();
         System.out.println( "Subtest #" + ( ++testCount ) + " [" + testName + "]: " + ( endTime
- startTime ) + " ms" );
         startTime = System.currentTimeMillis();
     }
-    
+
+
     private static void assertEquals( Operation expected, Operation actual )
     {
         Assert.assertEquals( expected.toString(), actual.toString() );
     }
-    
+
     private static class DirectoryServiceConfigurationImpl implements DirectoryServiceConfiguration
     {
         public DirectoryService getService()
@@ -365,16 +386,19 @@
             return null;
         }
 
+
         public String getInstanceId()
         {
             return null;
         }
 
+
         public Hashtable getEnvironment()
         {
             return null;
         }
 
+
         public StartupConfiguration getStartupConfiguration()
         {
             MutableStartupConfiguration cfg = new MutableStartupConfiguration();
@@ -382,25 +406,30 @@
             return cfg;
         }
 
+
         public GlobalRegistries getGlobalRegistries()
         {
             return null;
         }
 
+
         public PartitionNexus getPartitionNexus()
         {
             return null;
         }
 
+
         public InterceptorChain getInterceptorChain()
         {
             return null;
         }
 
+
         public boolean isFirstStart()
         {
             return false;
         }
+
 
         public DirectoryServiceListener getServiceListener()
         {



Mime
View raw message