directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1065063 - /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java
Date Sat, 29 Jan 2011 16:38:14 GMT
Author: akarasulu
Date: Sat Jan 29 16:38:13 2011
New Revision: 1065063

URL: http://svn.apache.org/viewvc?rev=1065063&view=rev
Log:
more test fixes

Modified:
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java?rev=1065063&r1=1065062&r2=1065063&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java
Sat Jan 29 16:38:13 2011
@@ -26,7 +26,6 @@ import static org.junit.Assert.assertNot
 
 import java.nio.ByteBuffer;
 
-import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 
@@ -86,7 +85,6 @@ public class PasswordPolicyResponseContr
     @Test
     public void testDecodeRespWithGraceAuthWarningAndError() throws Exception
     {
-        Asn1Decoder decoder = new PasswordPolicyResponseDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 0xA );
 
         bb.put( new byte[]
@@ -102,9 +100,8 @@ public class PasswordPolicyResponseContr
         PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
         container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator()
);
 
-        decoder.decode( bb, container );
-
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
+        control.decode( bb.array() );
         assertEquals( 1, control.getGraceAuthNsRemaining() );
         assertEquals( 1, control.getPasswordPolicyError().getValue() );
         
@@ -132,7 +129,6 @@ public class PasswordPolicyResponseContr
     @Test
     public void testDecodeRespWithTimeBeforeExpiryWarningOnly() throws Exception
     {
-        Asn1Decoder decoder = new PasswordPolicyResponseDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 7 );
 
         bb.put( new byte[]
@@ -147,9 +143,8 @@ public class PasswordPolicyResponseContr
         PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
         container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator()
);
 
-        decoder.decode( bb, container );
-
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
+        control.decode( bb.array() );
         assertEquals( 1, control.getTimeBeforeExpiration() );
         
         ByteBuffer buffer = ByteBuffer.allocate( 0x26 );
@@ -175,7 +170,6 @@ public class PasswordPolicyResponseContr
     @Test
     public void testDecodeRespWithGraceAuthWarningOnly() throws Exception
     {
-        Asn1Decoder decoder = new PasswordPolicyResponseDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 7 );
 
         bb.put( new byte[]
@@ -190,9 +184,8 @@ public class PasswordPolicyResponseContr
         PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
         container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator()
);
 
-        decoder.decode( bb, container );
-
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
+        
         assertEquals( 1, control.getGraceAuthNsRemaining() );
         
         ByteBuffer buffer = ByteBuffer.allocate( 0x26 );
@@ -218,7 +211,6 @@ public class PasswordPolicyResponseContr
     @Test
     public void testDecodeRespWithErrorOnly() throws Exception
     {
-        Asn1Decoder decoder = new PasswordPolicyResponseDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 5 );
 
         bb.put( new byte[]
@@ -232,9 +224,8 @@ public class PasswordPolicyResponseContr
         PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
         container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator()
);
 
-        decoder.decode( bb, container );
-
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
+        control.decode( bb.array() );
         assertEquals( 1, control.getPasswordPolicyError().getValue() );
         
         ByteBuffer buffer = ByteBuffer.allocate( 0x24 );
@@ -259,7 +250,6 @@ public class PasswordPolicyResponseContr
     @Test
     public void testDecodeRespWithoutWarningAndError() throws Exception
     {
-        Asn1Decoder decoder = new PasswordPolicyResponseDecoder();
         ByteBuffer bb = ByteBuffer.allocate( 2 );
 
         bb.put( new byte[]
@@ -272,9 +262,8 @@ public class PasswordPolicyResponseContr
         PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
         container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator()
);
 
-        decoder.decode( bb, container );
-
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
+        control.decode( bb.array() );
         assertNotNull( control );
         
         ByteBuffer buffer = ByteBuffer.allocate( 0x1D );



Mime
View raw message