Examples of computeLength()


Examples of org.apache.directory.shared.kerberos.messages.KrbPriv.computeLength()

        assertEquals( 5, krbPriv.getProtocolVersionNumber() );
        assertEquals( KerberosMessageType.KRB_PRIV, krbPriv.getMessageType() );
        assertNotNull( krbPriv.getEncPart() );

        int encodedLen = krbPriv.computeLength();
        assertEquals( streamLen, encodedLen );

        try
        {
            ByteBuffer bb = ByteBuffer.allocate( encodedLen );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.messages.KrbSafe.computeLength()

        assertEquals( 5, krbSafe.getProtocolVersionNumber() );
        assertEquals( KerberosMessageType.KRB_SAFE, krbSafe.getMessageType() );
        assertNotNull( krbSafe.getChecksum() );
        assertNotNull( krbSafe.getSafeBody() );

        int encodedLen = krbSafe.computeLength();
        assertEquals( streamLen, encodedLen );

        try
        {
            ByteBuffer bb = ByteBuffer.allocate( encodedLen );
View Full Code Here

Examples of org.apache.directory.shared.kerberos.messages.TgsRep.computeLength()

        }

        TgsRep tgsRep = tgsRepContainer.getTgsRep();

        // Check the encoding
        int length = tgsRep.computeLength();

        // Check the length
        assertEquals( 0xAC, length );

        // Check the encoding
View Full Code Here

Examples of org.apache.directory.shared.kerberos.messages.TgsReq.computeLength()

        TgsReq tgsReq = tgsReqContainer.getTgsReq();

        assertTrue( tgsReq instanceof TgsReq );

        // Check the encoding
        int length = tgsReq.computeLength();

        // Check the length
        assertEquals( 0x193, length );

        // Check the encoding
View Full Code Here

Examples of org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeDecorator.computeLength()

        EntryChange entryChange = (EntryChange) decorator.getDecorated();
        entryChange.setChangeType( ChangeType.MODDN );
        entryChange.setChangeNumber( 16 );
        entryChange.setPreviousDn( new Dn( "a=b" ) );
        bb = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
        String decoded = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }

View Full Code Here

Examples of org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsDecorator.computeLength()

        PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
        ctrl.setSize( 32 );
        ctrl.setCookie( Strings.getBytesUtf8("test") );

        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
        String decoded = Strings.dumpBytes( buffer.array() );
        String expected = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }
   
View Full Code Here

Examples of org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchDecorator.computeLength()

        PersistentSearchDecorator decorator = new PersistentSearchDecorator( codec );
        PersistentSearch ctrl = ( PersistentSearch ) decorator.getDecorated();
        ctrl.setChangesOnly( false );
        ctrl.setReturnECs( false );
        ctrl.setChangeTypes( 1 );
        bb = decorator.encode(ByteBuffer.allocate( decorator.computeLength() ) );
        String decoded = Strings.dumpBytes(bb.array());
        assertEquals( expected, decoded );
    }

    /**
 
View Full Code Here

Examples of org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator.computeLength()

        assertTrue( subentries.isVisible() );
       
        // test encoding
        try
        {
            ByteBuffer buffer = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
            String expected = Strings.dumpBytes( bb.array() );
            String decoded = Strings.dumpBytes( buffer.array() );
            assertEquals( expected, decoded );
        }
        catch( EncoderException e )
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationObject.computeLength()

        assertEquals( dn, certGenObj.getTargetDN() );
        assertEquals( dn, certGenObj.getIssuerDN() );
        assertEquals( dn, certGenObj.getSubjectDN() );
        assertEquals( keyAlgo, certGenObj.getKeyAlgorithm() );

        assertEquals( bufLen, certGenObj.computeLength() );

        try
        {
            ByteBuffer encodedBuf = certGenObj.encode();
            String encodedPdu = Strings.dumpBytes(encodedBuf.array());
View Full Code Here

Examples of org.apache.directory.shared.ldap.extras.extended.ads_impl.GracefulDisconnect.computeLength()

        assertEquals( 0, gracefulDisconnect.getTimeOffline() );
        assertEquals( 0, gracefulDisconnect.getDelay() );
        assertEquals( 0, gracefulDisconnect.getReplicatedContexts().size() );

        // Check the length
        assertEquals( 0x02, gracefulDisconnect.computeLength() );

        // Check the encoding
        try
        {
            ByteBuffer bb1 = gracefulDisconnect.encode();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.