Package org.apache.directory.shared.kerberos.components

Examples of org.apache.directory.shared.kerberos.components.TypedData


            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        if ( typedDataContainer.getTypedData() == null )
        {
            TypedData typedData = new TypedData();
            typedDataContainer.setTypedData( typedData );

            if ( IS_DEBUG )
            {
                LOG.debug( "TypedData created" );
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    protected void setIntegerValue( int value, TypedDataContainer typedDataContainer )
    {
        TypedData typedData = typedDataContainer.getTypedData();
        typedData.createNewTD();
        typedData.setCurrentDataType( value );

        typedDataContainer.setGrammarEndAllowed( true );
    }
View Full Code Here

        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData().size() );
        assertEquals( 2, typedData.getTypedData().size() );

        String[] expected = new String[]
            { "abcdef", "ghi" };
        int i = 0;

        for ( TypedData.TD td : typedData.getTypedData() )
        {
            assertEquals( 2, td.getDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), td.getDataValue() ) );
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( typedData.computeLength() );

        try
        {
            bb = typedData.encode( bb );

            // Check the length
            assertEquals( 0x21, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

        TypedDataContainer typedDataContainer = new TypedDataContainer();

        kerberosDecoder.decode( stream, typedDataContainer );

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData() );
        assertEquals( 1, typedData.getTypedData().size() );
        assertEquals( 2, typedData.getCurrentTD().getDataType() );
    }
View Full Code Here

            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        if ( typedDataContainer.getTypedData() == null )
        {
            TypedData typedData = new TypedData();
            typedDataContainer.setTypedData( typedData );

            if ( IS_DEBUG )
            {
                LOG.debug( "TypedData created" );
View Full Code Here

        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData().size() );
        assertEquals( 2, typedData.getTypedData().size() );

        String[] expected = new String[]
            { "abcdef", "ghi" };
        int i = 0;

        for ( TypedData.TD td : typedData.getTypedData() )
        {
            assertEquals( 2, td.getDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8( expected[i++] ), td.getDataValue() ) );
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( typedData.computeLength() );

        try
        {
            bb = typedData.encode( bb );

            // Check the length
            assertEquals( 0x21, bb.limit() );

            String encodedPdu = Strings.dumpBytes( bb.array() );
View Full Code Here

        TypedDataContainer typedDataContainer = new TypedDataContainer();

        kerberosDecoder.decode( stream, typedDataContainer );

        TypedData typedData = typedDataContainer.getTypedData();

        assertNotNull( typedData.getTypedData() );
        assertEquals( 1, typedData.getTypedData().size() );
        assertEquals( 2, typedData.getCurrentTD().getDataType() );
    }
View Full Code Here

            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
        }

        if ( typedDataContainer.getTypedData() == null )
        {
            TypedData typedData = new TypedData();
            typedDataContainer.setTypedData( typedData );


            if ( IS_DEBUG )
            {
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void setIntegerValue( int value, TypedDataContainer typedDataContainer )
    {
        TypedData typedData = typedDataContainer.getTypedData();
        typedData.createNewTD();
        typedData.setCurrentDataType( value );

        typedDataContainer.setGrammarEndAllowed( true );
    }
View Full Code Here

        catch ( DecoderException de )
        {
            fail( de.getMessage() );
        }

        TypedData typedData = typedDataContainer.getTypedData();
       
        assertNotNull( typedData.getTypedData().size() );
        assertEquals( 2, typedData.getTypedData().size() );
       
        String[] expected = new String[]{ "abcdef", "ghi" };
        int i = 0;
       
        for ( TypedData.TD td : typedData.getTypedData() )
        {
            assertEquals( 2, td.getDataType() );
            assertTrue( Arrays.equals( Strings.getBytesUtf8(expected[i++]), td.getDataValue() ) );
        }

        // Check the encoding
        ByteBuffer bb = ByteBuffer.allocate( typedData.computeLength() );
       
        try
        {
            bb = typedData.encode( bb );
   
            // Check the length
            assertEquals( 0x21, bb.limit() );
   
            String encodedPdu = Strings.dumpBytes(bb.array());
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.kerberos.components.TypedData

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.