Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 45195 invoked from network); 29 Jan 2011 17:13:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jan 2011 17:13:23 -0000 Received: (qmail 29087 invoked by uid 500); 29 Jan 2011 17:13:23 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 29030 invoked by uid 500); 29 Jan 2011 17:13:23 -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 29023 invoked by uid 99); 29 Jan 2011 17:13:22 -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:13:22 +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:13:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8F47123889EA; Sat, 29 Jan 2011 17:13:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1065076 - /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java Date: Sat, 29 Jan 2011 17:13:01 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110129171301.8F47123889EA@eris.apache.org> Author: akarasulu Date: Sat Jan 29 17:13:01 2011 New Revision: 1065076 URL: http://svn.apache.org/viewvc?rev=1065076&view=rev Log: more test fixes Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java?rev=1065076&r1=1065075&r2=1065076&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java (original) +++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java Sat Jan 29 17:13:01 2011 @@ -31,9 +31,7 @@ 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.EncoderException; -import org.apache.directory.shared.asn1.ber.Asn1Decoder; import org.apache.directory.shared.ldap.model.message.controls.Subentries; -import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesDecoder; import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesDecorator; import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesContainer; import org.apache.directory.shared.util.Strings; @@ -56,7 +54,6 @@ public class SubEntryControlTest @Test public void testDecodeSubEntryVisibilityTrue() { - Asn1Decoder decoder = new SubentriesDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x03 ); bb.put( new byte[] { @@ -65,11 +62,11 @@ public class SubEntryControlTest bb.flip(); SubentriesContainer container = new SubentriesContainer(); - container.setSubentriesDecorator( new SubentriesDecorator() ); + SubentriesDecorator decorator = container.getSubentriesControl(); try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); } catch ( DecoderException de ) { @@ -77,7 +74,6 @@ public class SubEntryControlTest fail( de.getMessage() ); } - SubentriesDecorator decorator = container.getSubentriesControl(); assertTrue( ( ( Subentries ) decorator.getDecorated() ).isVisible() ); // test encoding try @@ -114,7 +110,6 @@ public class SubEntryControlTest @Test public void testDecodeSubEntryVisibilityFalse() { - Asn1Decoder decoder = new SubentriesDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x03 ); bb.put( new byte[] { @@ -123,11 +118,11 @@ public class SubEntryControlTest bb.flip(); SubentriesContainer container = new SubentriesContainer(); - container.setSubentriesDecorator( new SubentriesDecorator() ); - + SubentriesDecorator decorator = container.getSubentriesControl(); + try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); } catch ( DecoderException de ) { @@ -135,7 +130,6 @@ public class SubEntryControlTest fail( de.getMessage() ); } - SubentriesDecorator decorator = container.getSubentriesControl(); assertFalse( ( ( Subentries ) decorator.getDecorated() ).isVisible() ); // test encoding @@ -173,7 +167,6 @@ public class SubEntryControlTest @Test public void testDecodeSubEntryEmptyVisibility() { - Asn1Decoder decoder = new SubentriesDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x02 ); bb.put( new byte[] @@ -185,12 +178,11 @@ public class SubEntryControlTest // Allocate a LdapMessage Container SubentriesContainer container = new SubentriesContainer(); - container.setSubentriesDecorator( new SubentriesDecorator() ); - - // Decode a SubEntryControl PDU + SubentriesDecorator decorator = container.getSubentriesControl(); + try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point !!!" ); } catch ( DecoderException de ) @@ -206,7 +198,6 @@ public class SubEntryControlTest @Test public void testDecodeSubEntryBad() { - Asn1Decoder decoder = new SubentriesDecoder(); ByteBuffer bb = ByteBuffer.allocate( 0x03 ); bb.put( new byte[] @@ -218,12 +209,11 @@ public class SubEntryControlTest // Allocate a LdapMessage Container SubentriesContainer container = new SubentriesContainer(); - container.setSubentriesDecorator( new SubentriesDecorator() ); - - // Decode a SubEntryControl PDU + SubentriesDecorator decorator = container.getSubentriesControl(); + try { - decoder.decode( bb, container ); + decorator.decode( bb.array() ); fail( "We should never reach this point !!!" ); } catch ( DecoderException de )