Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 44443 invoked from network); 29 Jan 2011 17:11:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jan 2011 17:11:29 -0000 Received: (qmail 26796 invoked by uid 500); 29 Jan 2011 17:11:28 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 26686 invoked by uid 500); 29 Jan 2011 17:11:27 -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 26675 invoked by uid 99); 29 Jan 2011 17:11:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jan 2011 17:11:27 +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:11:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 62E4E23889F7; Sat, 29 Jan 2011 17:11:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1065075 - /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java Date: Sat, 29 Jan 2011 17:11:03 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110129171103.62E4E23889F7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: akarasulu Date: Sat Jan 29 17:11:03 2011 New Revision: 1065075 URL: http://svn.apache.org/viewvc?rev=1065075&view=rev Log: more test fixes Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java 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=1065075&r1=1065074&r2=1065075&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 Sat Jan 29 17:11:03 2011 @@ -29,10 +29,8 @@ import java.nio.ByteBuffer; 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.model.message.controls.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.ldap.model.message.controls.ChangeType; import org.apache.directory.shared.util.Strings; @@ -90,7 +88,6 @@ public class PSearchControlTest @Test public void testDecodeModifyDNRequestSuccessChangeTypesAddModDN() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x0b ); bb.put( new byte[] { @@ -102,11 +99,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); } catch ( DecoderException de ) { @@ -121,6 +118,7 @@ public class PSearchControlTest assertEquals( false, ctrl.isReturnECs() ); } + /** * Test the decoding of a PSearchControl with a changes types which * value is 0 @@ -128,7 +126,6 @@ public class PSearchControlTest @Test public void testDecodeModifyDNRequestSuccessChangeTypes0() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x0b ); bb.put( new byte[] { @@ -140,11 +137,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); - + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); + try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point" ); } catch ( DecoderException de ) @@ -160,7 +157,6 @@ public class PSearchControlTest @Test public void testDecodeModifyDNRequestSuccessChangeTypes22() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x0b ); bb.put( new byte[] { @@ -172,11 +168,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point" ); } catch ( DecoderException de ) @@ -185,13 +181,13 @@ public class PSearchControlTest } } + /** * Test the decoding of a PSearchControl with a null sequence */ @Test public void testDecodeModifyDNRequestSuccessNullSequence() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x02 ); bb.put( new byte[] { @@ -200,11 +196,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point" ); } catch ( DecoderException de ) @@ -213,13 +209,13 @@ public class PSearchControlTest } } + /** * Test the decoding of a PSearchControl without changeTypes */ @Test public void testDecodeModifyDNRequestSuccessWithoutChangeTypes() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x08 ); bb.put( new byte[] { @@ -230,11 +226,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point" ); } catch ( DecoderException de ) @@ -243,13 +239,13 @@ public class PSearchControlTest } } + /** * Test the decoding of a PSearchControl without changeOnly */ @Test public void testDecodeModifyDNRequestSuccessWithoutChangesOnly() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x08 ); bb.put( new byte[] { @@ -260,11 +256,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point" ); } catch ( DecoderException de ) @@ -273,13 +269,13 @@ public class PSearchControlTest } } + /** * Test the decoding of a PSearchControl without returnECs */ @Test public void testDecodeModifyDNRequestSuccessWithoutReturnECs() { - Asn1Decoder decoder = new PersistentSearchDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x08 ); bb.put( new byte[] { @@ -290,11 +286,11 @@ public class PSearchControlTest bb.flip(); PersistentSearchContainer container = new PersistentSearchContainer(); - container.setPersistentSearchDecorator( new PersistentSearchDecorator() ); + PersistentSearchDecorator decorator = container.getPersistentSearchDecorator(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point" ); } catch ( DecoderException de )