directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063609 [2/2] - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/codec/controls/ main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/ main/java/org/apache/directory/shared/ldap/codec/...
Date Wed, 26 Jan 2011 06:24:05 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
Wed Jan 26 06:24:04 2011
@@ -30,9 +30,10 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControlContainer;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControlDecoder;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearch;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchContainer;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchDecoder;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchDecorator;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -71,7 +72,7 @@ public class PSearchControlTest
         String expected = Strings.dumpBytes(bb.array());
         bb.flip();
 
-        PersistentSearchControl ctrl = new PersistentSearchControl();
+        PersistentSearchDecorator ctrl = new PersistentSearchDecorator();
         ctrl.setChangesOnly( false );
         ctrl.setReturnECs( false );
         ctrl.setChangeTypes( 1 );
@@ -86,7 +87,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessChangeTypesAddModDN()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x0b );
         bb.put( new byte[]
             { 
@@ -97,8 +98,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
 
         try
         {
@@ -109,12 +110,12 @@ public class PSearchControlTest
             fail( de.getMessage() );
         }
 
-        PersistentSearchControl control = container.getPSearchControl();
-        int changeTypes = control.getChangeTypes();
-        assertEquals( PersistentSearchControl.CHANGE_TYPE_ADD, changeTypes & PersistentSearchControl.CHANGE_TYPE_ADD
);
-        assertEquals( PersistentSearchControl.CHANGE_TYPE_MODDN, changeTypes & PersistentSearchControl.CHANGE_TYPE_MODDN
);
-        assertEquals( false, control.isChangesOnly() );
-        assertEquals( false, control.isReturnECs() );
+        PersistentSearchDecorator decorator = container.getPSearchControl();
+        int changeTypes = decorator.getChangeTypes();
+        assertEquals( PersistentSearch.CHANGE_TYPE_ADD, changeTypes & PersistentSearch.CHANGE_TYPE_ADD
);
+        assertEquals( PersistentSearch.CHANGE_TYPE_MODDN, changeTypes & PersistentSearch.CHANGE_TYPE_MODDN
);
+        assertEquals( false, decorator.isChangesOnly() );
+        assertEquals( false, decorator.isReturnECs() );
     }
 
     /**
@@ -124,7 +125,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessChangeTypes0()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x0b );
         bb.put( new byte[]
             { 
@@ -135,8 +136,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
         
         try
         {
@@ -156,7 +157,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessChangeTypes22()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x0b );
         bb.put( new byte[]
             { 
@@ -167,8 +168,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
 
         try
         {
@@ -187,7 +188,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessNullSequence()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x02 );
         bb.put( new byte[]
             { 
@@ -195,8 +196,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
 
         try
         {
@@ -215,7 +216,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessWithoutChangeTypes()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x08 );
         bb.put( new byte[]
             { 
@@ -225,8 +226,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
 
         try
         {
@@ -245,7 +246,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessWithoutChangesOnly()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x08 );
         bb.put( new byte[]
             { 
@@ -255,8 +256,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
 
         try
         {
@@ -275,7 +276,7 @@ public class PSearchControlTest
     @Test
     public void testDecodeModifyDNRequestSuccessWithoutReturnECs()
     {
-        Asn1Decoder decoder = new PersistentSearchControlDecoder();
+        Asn1Decoder decoder = new PersistentSearchDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x08 );
         bb.put( new byte[]
             { 
@@ -285,8 +286,8 @@ public class PSearchControlTest
             } );
         bb.flip();
 
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( new PersistentSearchControl() );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( new PersistentSearchDecorator() );
 
         try
         {

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
Wed Jan 26 06:24:04 2011
@@ -32,9 +32,9 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControlContainer;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControlDecoder;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsContainer;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsDecoder;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsDecorator;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -56,7 +56,7 @@ public class PagedSearchControlTest
     @Test
     public void testEncodePagedSearchControl() throws Exception
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x2A );
         bb.put( new byte[]
             { 
@@ -66,8 +66,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
         
         try
         {
@@ -79,7 +79,7 @@ public class PagedSearchControlTest
             fail( de.getMessage() );
         }
 
-        PagedResultsControl pagedSearch = container.getPagedSearchControl();
+        PagedResultsDecorator pagedSearch = container.getPagedSearchControl();
         assertEquals( 32, pagedSearch.getSize() );
         assertTrue( Arrays.equals( Strings.getBytesUtf8("test"),
             pagedSearch.getCookie() ) );
@@ -101,7 +101,7 @@ public class PagedSearchControlTest
             } );
         buffer.flip();
 
-        PagedResultsControl ctrl = new PagedResultsControl();
+        PagedResultsDecorator ctrl = new PagedResultsDecorator();
         ctrl.setSize( 32 );
         ctrl.setCookie( Strings.getBytesUtf8("test") );
 
@@ -118,7 +118,7 @@ public class PagedSearchControlTest
     @Test
     public void testDecodePagedSearchRequestNoCookie()
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x05 );
         bb.put( new byte[]
             { 
@@ -127,8 +127,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
         
         try
         {
@@ -148,7 +148,7 @@ public class PagedSearchControlTest
     @Test
     public void testDecodePagedSearchRequestNoSize()
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x08 );
         bb.put( new byte[]
             { 
@@ -157,8 +157,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
         
         try
         {
@@ -178,7 +178,7 @@ public class PagedSearchControlTest
     @Test
     public void testDecodePagedSearchRequestNoSizeNoCookie()
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x02 );
         bb.put( new byte[]
             { 
@@ -186,8 +186,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
         
         try
         {
@@ -207,7 +207,7 @@ public class PagedSearchControlTest
     @Test
     public void testEncodePagedSearchControlNegativeSize() throws Exception
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x0b );
         bb.put( new byte[]
             { 
@@ -217,8 +217,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
         
         try
         {
@@ -230,7 +230,7 @@ public class PagedSearchControlTest
             fail( de.getMessage() );
         }
 
-        PagedResultsControl pagedSearch = container.getPagedSearchControl();
+        PagedResultsDecorator pagedSearch = container.getPagedSearchControl();
         assertEquals( Integer.MAX_VALUE, pagedSearch.getSize() );
         assertTrue( Arrays.equals( Strings.getBytesUtf8("test"),
             pagedSearch.getCookie() ) );
@@ -253,7 +253,7 @@ public class PagedSearchControlTest
             } );
         buffer.flip();
 
-        PagedResultsControl ctrl = new PagedResultsControl();
+        PagedResultsDecorator ctrl = new PagedResultsDecorator();
         ctrl.setSize( -1 );
         ctrl.setCookie( Strings.getBytesUtf8("test") );
 
@@ -270,7 +270,7 @@ public class PagedSearchControlTest
     @Test
     public void testEncodePagedSearchControlEmptySize() throws Exception
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x0a );
         bb.put( new byte[]
             { 
@@ -280,8 +280,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
 
         try
         {
@@ -301,7 +301,7 @@ public class PagedSearchControlTest
     @Test
     public void testEncodePagedSearchControlEmptyCookie() throws Exception
     {
-        Asn1Decoder decoder = new PagedResultsControlDecoder();
+        Asn1Decoder decoder = new PagedResultsDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0x07 );
         bb.put( new byte[]
             { 
@@ -311,8 +311,8 @@ public class PagedSearchControlTest
             } );
         bb.flip();
 
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( new PagedResultsControl() );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( new PagedResultsDecorator() );
 
         try
         {
@@ -324,7 +324,7 @@ public class PagedSearchControlTest
             fail( de.getMessage() );
         }
 
-        PagedResultsControl pagedSearch = container.getPagedSearchControl();
+        PagedResultsDecorator pagedSearch = container.getPagedSearchControl();
         assertEquals( 32, pagedSearch.getSize() );
         assertNotNull( pagedSearch.getCookie() );
         assertEquals( StringConstants.EMPTY_BYTES, pagedSearch.getCookie() );
@@ -344,7 +344,7 @@ public class PagedSearchControlTest
             } );
         buffer.flip();
 
-        PagedResultsControl ctrl = new PagedResultsControl();
+        PagedResultsDecorator ctrl = new PagedResultsDecorator();
         ctrl.setSize( 32 );
         ctrl.setCookie( null );
 



Mime
View raw message