directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1065417 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/ test/java/org/apache/directory/shared/ldap/codec/controls/replication/
Date Sun, 30 Jan 2011 23:03:21 GMT
Author: elecharny
Date: Sun Jan 30 23:03:21 2011
New Revision: 1065417

URL: http://svn.apache.org/viewvc?rev=1065417&view=rev
Log:
Fixed the SyncInfoValue tests

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java?rev=1065417&r1=1065416&r2=1065417&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java
Sun Jan 30 23:03:21 2011
@@ -30,7 +30,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -99,9 +98,8 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
-                    SyncInfoValueDecorator control = 
-                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.NEW_COOKIE);
-                    
+                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
+
                     Value value = container.getCurrentTLV().getValue();
 
                     byte[] newCookie = value.getData();
@@ -138,8 +136,7 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
-                    SyncInfoValueDecorator control = 
-                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.REFRESH_DELETE);
+                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                     
                     container.setSyncInfoValueControl( control );
 
@@ -304,8 +301,7 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
-                    SyncInfoValueDecorator control = 
-                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.REFRESH_PRESENT);
+                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                     
                     container.setSyncInfoValueControl( control );
 
@@ -471,8 +467,7 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
-                    SyncInfoValueDecorator control = 
-                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.SYNC_ID_SET);
+                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                     
                     container.setSyncInfoValueControl( control );
                 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java?rev=1065417&r1=1065416&r2=1065417&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java
Sun Jan 30 23:03:21 2011
@@ -33,7 +33,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.util.Strings;
@@ -50,8 +49,7 @@ import org.junit.runner.RunWith;
 public class SyncInfoValueControlTest
 {
     private ILdapCodecService codec = new DefaultLdapCodecService();
-    
-    
+
     //--------------------------------------------------------------------------------
     // NewCookie choice tests
     //--------------------------------------------------------------------------------
@@ -69,8 +67,7 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
         decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -119,8 +116,7 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
         decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -174,8 +170,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -229,8 +225,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -284,8 +280,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -338,8 +334,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -390,8 +386,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -446,8 +442,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -501,8 +497,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -556,8 +552,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -610,8 +606,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -662,8 +658,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -715,8 +711,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -747,8 +743,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -779,8 +775,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -812,8 +808,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -844,8 +840,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -908,8 +904,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -983,8 +979,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1049,8 +1045,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1125,8 +1121,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1191,9 +1187,9 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
-        decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
+        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
 
@@ -1268,8 +1264,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1336,8 +1332,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1417,8 +1413,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
+        
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -1455,8 +1451,7 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
-        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try



Mime
View raw message