directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1065065 - /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java
Date Sat, 29 Jan 2011 16:41:56 GMT
Author: akarasulu
Date: Sat Jan 29 16:41:55 2011
New Revision: 1065065

URL: http://svn.apache.org/viewvc?rev=1065065&view=rev
Log:
more test fixes

Modified:
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java?rev=1065065&r1=1065064&r2=1065065&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java
Sat Jan 29 16:41:55 2011
@@ -30,12 +30,10 @@ import java.nio.ByteBuffer;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.ISyncDoneValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueDecorator;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueContainer;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlDecoder;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,7 +53,6 @@ public class SyncDoneValueControlTest
     @Test
     public void testSyncDoneValueControl()
     {
-        Asn1Decoder decoder = new SyncDoneValueControlDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 11 );
 
         bb.put( new byte[]
@@ -68,11 +65,11 @@ public class SyncDoneValueControlTest
         bb.flip();
 
         SyncDoneValueContainer container = new SyncDoneValueContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         try
         {
-            decoder.decode( bb, container );
+            decorator.decode( bb.array() );
         }
         catch ( Exception e )
         {
@@ -117,7 +114,6 @@ public class SyncDoneValueControlTest
     @Test
     public void testSyncDoneValueControlWithoutCookie()
     {
-        Asn1Decoder decoder = new SyncDoneValueControlDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 5 );
 
         bb.put( new byte[]
@@ -130,11 +126,11 @@ public class SyncDoneValueControlTest
         bb.flip();
 
         SyncDoneValueContainer container = new SyncDoneValueContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         try
         {
-            decoder.decode( bb, container );
+            decorator.decode( bb.array() );
         }
         catch ( Exception e )
         {
@@ -178,7 +174,6 @@ public class SyncDoneValueControlTest
     @Test
     public void testSyncDoneValueWithSequenceOnly()
     {
-        Asn1Decoder decoder = new SyncDoneValueControlDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 2 );
 
         bb.put( new byte[]
@@ -189,11 +184,11 @@ public class SyncDoneValueControlTest
         bb.flip();
 
         SyncDoneValueContainer container = new SyncDoneValueContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         try
         {
-            decoder.decode( bb, container );
+            decorator.decode( bb.array() );
         }
         catch ( Exception e )
         {
@@ -209,7 +204,6 @@ public class SyncDoneValueControlTest
     @Test
     public void testSyncDoneValueControlWithEmptyCookie()
     {
-        Asn1Decoder decoder = new SyncDoneValueControlDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 7 );
 
         bb.put( new byte[]
@@ -222,11 +216,11 @@ public class SyncDoneValueControlTest
         bb.flip();
 
         SyncDoneValueContainer container = new SyncDoneValueContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         try
         {
-            decoder.decode( bb, container );
+            decorator.decode( bb.array() );
         }
         catch ( Exception e )
         {



Mime
View raw message