Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 43061 invoked from network); 29 Jan 2011 17:09:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jan 2011 17:09:08 -0000 Received: (qmail 22633 invoked by uid 500); 29 Jan 2011 17:09:08 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 22579 invoked by uid 500); 29 Jan 2011 17:09:07 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 22571 invoked by uid 99); 29 Jan 2011 17:09:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jan 2011 17:09:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jan 2011 17:09:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BC28523889E7; Sat, 29 Jan 2011 17:08:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1065073 - /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java Date: Sat, 29 Jan 2011 17:08:45 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110129170845.BC28523889E7@eris.apache.org> Author: akarasulu Date: Sat Jan 29 17:08:45 2011 New Revision: 1065073 URL: http://svn.apache.org/viewvc?rev=1065073&view=rev Log: more test fixes Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java 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=1065073&r1=1065072&r2=1065073&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 Sat Jan 29 17:08:45 2011 @@ -31,9 +31,7 @@ import java.util.Arrays; import org.apache.directory.junit.tools.Concurrent; 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.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; @@ -56,7 +54,6 @@ public class PagedSearchControlTest @Test public void testEncodePagedSearchControl() throws Exception { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x2A ); bb.put( new byte[] { @@ -67,11 +64,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); + PagedResultsDecorator decorator = container.getDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); } catch ( DecoderException de ) { @@ -118,7 +115,6 @@ public class PagedSearchControlTest @Test public void testDecodePagedSearchRequestNoCookie() { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x05 ); bb.put( new byte[] { @@ -128,11 +124,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); + PagedResultsDecorator decorator = container.getDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail(); } catch ( DecoderException de ) @@ -148,7 +144,6 @@ public class PagedSearchControlTest @Test public void testDecodePagedSearchRequestNoSize() { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x08 ); bb.put( new byte[] { @@ -158,11 +153,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); + PagedResultsDecorator decorator = container.getDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail(); } catch ( DecoderException de ) @@ -178,7 +173,6 @@ public class PagedSearchControlTest @Test public void testDecodePagedSearchRequestNoSizeNoCookie() { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x02 ); bb.put( new byte[] { @@ -187,11 +181,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); + PagedResultsDecorator decorator = container.getDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail(); } catch ( DecoderException de ) @@ -207,7 +201,6 @@ public class PagedSearchControlTest @Test public void testEncodePagedSearchControlNegativeSize() throws Exception { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x0b ); bb.put( new byte[] { @@ -218,11 +211,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); + PagedResultsDecorator decorator = container.getDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); } catch ( DecoderException de ) { @@ -270,7 +263,6 @@ public class PagedSearchControlTest @Test public void testEncodePagedSearchControlEmptySize() throws Exception { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x0a ); bb.put( new byte[] { @@ -281,11 +273,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); - + PagedResultsDecorator decorator = container.getDecorator(); + try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail(); } catch ( DecoderException de ) @@ -301,7 +293,6 @@ public class PagedSearchControlTest @Test public void testEncodePagedSearchControlEmptyCookie() throws Exception { - Asn1Decoder decoder = new PagedResultsDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x07 ); bb.put( new byte[] { @@ -312,11 +303,11 @@ public class PagedSearchControlTest bb.flip(); PagedResultsContainer container = new PagedResultsContainer(); - container.setPagedSearchControl( new PagedResultsDecorator() ); - + PagedResultsDecorator decorator = container.getDecorator(); + try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); } catch ( DecoderException de ) {