Package org.apache.directory.shared.ldap.extras.controls

Examples of org.apache.directory.shared.ldap.extras.controls.PasswordPolicy


            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );

        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getGraceAuthNsRemaining() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here


            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );
       
        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getPasswordPolicyError().getValue() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );
       
        assertNotNull( passwordPolicy );
        assertTrue( passwordPolicy.hasResponse() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( "", Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );

        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getTimeBeforeExpiration() );
        assertEquals( 1, passwordPolicy.getResponse().getPasswordPolicyError().getValue() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );
       
        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getGraceAuthNsRemaining() );
        assertEquals( 1, passwordPolicy.getResponse().getPasswordPolicyError().getValue() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array())  );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );

        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getTimeBeforeExpiration() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );

        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getTimeBeforeExpiration() );
        assertEquals( 1, passwordPolicy.getResponse().getPasswordPolicyError().getValue() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );
       
        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getGraceAuthNsRemaining() );
        assertEquals( 1, passwordPolicy.getResponse().getPasswordPolicyError().getValue() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array())  );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );

        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getTimeBeforeExpiration() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator ) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator ) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

            } );

        bb.flip();

        PasswordPolicyDecorator control = new PasswordPolicyDecorator( codec, true );
        PasswordPolicy passwordPolicy = ( PasswordPolicy ) control.decode( bb.array() );

        assertTrue( passwordPolicy.hasResponse() );
        assertEquals( 1, passwordPolicy.getResponse().getGraceAuthNsRemaining() );
       
        ByteBuffer encoded = ( ( PasswordPolicyDecorator) passwordPolicy ).encode(
            ByteBuffer.allocate( ( ( PasswordPolicyDecorator) passwordPolicy ).computeLength() ) );
        assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.extras.controls.PasswordPolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.