directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1468821 - in /directory/shared/trunk/ldap/extras: codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/ codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/ codec/src/test/java/org/apache/d...
Date Wed, 17 Apr 2013 10:12:04 GMT
Author: elecharny
Date: Wed Apr 17 10:12:04 2013
New Revision: 1468821

URL: http://svn.apache.org/r1468821
Log:
o Added toString() methods
o Simplified the tests

Modified:
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
    directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java

Modified: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java?rev=1468821&r1=1468820&r2=1468821&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
Wed Apr 17 10:12:04 2013
@@ -21,6 +21,7 @@ package org.apache.directory.api.ldap.ex
 
 
 import org.apache.directory.api.ldap.model.message.AbstractExtendedRequest;
+import org.apache.directory.api.util.Strings;
 
 
 /**
@@ -132,4 +133,49 @@ public class PwdModifyRequestImpl extend
 
         return response;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "PwdModifyRequest :" );
+        sb.append( "\n    UserIdentity : " );
+
+        if ( userIdentity != null )
+        {
+            sb.append( Strings.utf8ToString( userIdentity ) );
+        }
+        else
+        {
+            sb.append( "null" );
+        }
+
+        sb.append( "\n    oldPassword : " );
+
+        if ( oldPassword != null )
+        {
+            sb.append( Strings.utf8ToString( oldPassword ) );
+        }
+        else
+        {
+            sb.append( "null" );
+        }
+
+        sb.append( "\n    newPassword : " );
+
+        if ( newPassword != null )
+        {
+            sb.append( Strings.utf8ToString( newPassword ) );
+        }
+        else
+        {
+            sb.append( "null" );
+        }
+
+        return sb.toString();
+    }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java?rev=1468821&r1=1468820&r2=1468821&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
Wed Apr 17 10:12:04 2013
@@ -124,8 +124,20 @@ public class PasswordModifyRequest exten
     }
 
 
+    /**
+     * @return The internal PwdModifyRequest object
+     */
     public PwdModifyRequest getPwdModifyRequest()
     {
         return pwdModifyRequest;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return pwdModifyRequest.toString();
+    }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java?rev=1468821&r1=1468820&r2=1468821&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
Wed Apr 17 10:12:04 2013
@@ -30,6 +30,7 @@ import java.nio.ByteBuffer;
 import org.apache.directory.api.asn1.DecoderException;
 import org.apache.directory.api.asn1.EncoderException;
 import org.apache.directory.api.asn1.ber.Asn1Decoder;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyRequest;
 import org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyRequestContainer;
 import org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyRequestDecorator;
 import org.apache.directory.api.util.Strings;
@@ -76,18 +77,20 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNull( pwdModifyRequest.getUserIdentity() );
+        assertNull( pwdModifyRequest.getOldPassword() );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x02, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x02, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -130,19 +133,21 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( 0, pwdModifyRequestDecorator.getUserIdentity().length );
-        assertNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( 0, pwdModifyRequest.getUserIdentity().length );
+        assertNull( pwdModifyRequest.getOldPassword() );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x04, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x04, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -189,19 +194,21 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNull( pwdModifyRequest.getOldPassword() );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x08, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x08, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -251,20 +258,22 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertNotNull( pwdModifyRequestDecorator.getNewPassword() );
-        assertEquals( 0, pwdModifyRequestDecorator.getNewPassword().length );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNull( pwdModifyRequest.getOldPassword() );
+        assertNotNull( pwdModifyRequest.getNewPassword() );
+        assertEquals( 0, pwdModifyRequest.getNewPassword().length );
 
         // Check the length
-        assertEquals( 0x0A, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x0A, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -318,20 +327,22 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertNotNull( pwdModifyRequestDecorator.getNewPassword() );
-        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequestDecorator.getNewPassword()
) );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNull( pwdModifyRequest.getOldPassword() );
+        assertNotNull( pwdModifyRequest.getNewPassword() );
+        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequest.getNewPassword() ) );
 
         // Check the length
-        assertEquals( 0x0E, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x0E, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -380,20 +391,22 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( 0, pwdModifyRequestDecorator.getOldPassword().length );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( 0, pwdModifyRequest.getOldPassword().length );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x0A, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x0A, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -446,20 +459,22 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequestDecorator.getOldPassword()
) );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x0E, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x0E, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -515,21 +530,23 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequestDecorator.getOldPassword()
) );
-        assertNotNull( pwdModifyRequestDecorator.getNewPassword() );
-        assertEquals( 0, pwdModifyRequestDecorator.getNewPassword().length );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
+        assertNotNull( pwdModifyRequest.getNewPassword() );
+        assertEquals( 0, pwdModifyRequest.getNewPassword().length );
 
         // Check the length
-        assertEquals( 0x10, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x10, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -589,21 +606,23 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNotNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getUserIdentity()
) );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequestDecorator.getOldPassword()
) );
-        assertNotNull( pwdModifyRequestDecorator.getNewPassword() );
-        assertEquals( "ijkl", Strings.utf8ToString( pwdModifyRequestDecorator.getNewPassword()
) );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNotNull( pwdModifyRequest.getUserIdentity() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
+        assertNotNull( pwdModifyRequest.getNewPassword() );
+        assertEquals( "ijkl", Strings.utf8ToString( pwdModifyRequest.getNewPassword() ) );
 
         // Check the length
-        assertEquals( 0x14, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x14, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -646,19 +665,21 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( 0, pwdModifyRequestDecorator.getOldPassword().length );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNull( pwdModifyRequest.getUserIdentity() );
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( 0, pwdModifyRequest.getOldPassword().length );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x04, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x04, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -705,19 +726,21 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getOldPassword()
) );
-        assertNull( pwdModifyRequestDecorator.getNewPassword() );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNull( pwdModifyRequest.getUserIdentity() );
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
+        assertNull( pwdModifyRequest.getNewPassword() );
 
         // Check the length
-        assertEquals( 0x08, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x08, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -767,20 +790,22 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getOldPassword()
) );
-        assertNotNull( pwdModifyRequestDecorator.getNewPassword() );
-        assertEquals( 0, pwdModifyRequestDecorator.getNewPassword().length );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNull( pwdModifyRequest.getUserIdentity() );
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
+        assertNotNull( pwdModifyRequest.getNewPassword() );
+        assertEquals( 0, pwdModifyRequest.getNewPassword().length );
 
         // Check the length
-        assertEquals( 0x0A, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x0A, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 
@@ -834,20 +859,22 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PasswordModifyRequestDecorator pwdModifyRequestDecorator = container.getPasswordModifyRequest();
-        assertNull( pwdModifyRequestDecorator.getUserIdentity() );
-        assertNotNull( pwdModifyRequestDecorator.getOldPassword() );
-        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequestDecorator.getOldPassword()
) );
-        assertNotNull( pwdModifyRequestDecorator.getNewPassword() );
-        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequestDecorator.getNewPassword()
) );
+        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        assertNull( pwdModifyRequest.getUserIdentity() );
+        assertNotNull( pwdModifyRequest.getOldPassword() );
+        assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
+        assertNotNull( pwdModifyRequest.getNewPassword() );
+        assertEquals( "efgh", Strings.utf8ToString( pwdModifyRequest.getNewPassword() ) );
 
         // Check the length
-        assertEquals( 0x0E, pwdModifyRequestDecorator.getPasswordModifyRequest().computeLength()
);
+        assertEquals( 0x0E, ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+            .computeLength() );
 
         // Check the encoding
         try
         {
-            ByteBuffer bb1 = pwdModifyRequestDecorator.getPasswordModifyRequest().encode();
+            ByteBuffer bb1 = ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest()
+                .encode();
 
             String encodedPdu = Strings.dumpBytes( bb1.array() );
 



Mime
View raw message