catch ( DecoderException e )
{
fail();
}
KrbError krbError = container.getKrbError();
String time = "20101119080043Z";
assertEquals( 5, krbError.getProtocolVersionNumber() );
assertEquals( KerberosMessageType.KRB_ERROR, krbError.getMessageType() );
assertEquals( time, krbError.getCTime().getDate() );
assertEquals( 1, krbError.getCusec() );
assertEquals( time, krbError.getSTime().getDate() );
assertEquals( 2, krbError.getSusec() );
assertEquals( ErrorType.KDC_ERR_NONE, krbError.getErrorCode() );
assertEquals( "crealm", krbError.getCRealm() );
assertEquals( "cname", krbError.getCName().getNameString() );
assertEquals( "realm", krbError.getRealm() );
assertEquals( "sname", krbError.getSName().getNameString() );
assertEquals( "etext", krbError.getEText() );
assertTrue( Arrays.equals( new byte[]
{ 0, 1 }, krbError.getEData() ) );
int encodedLen = krbError.computeLength();
assertEquals( streamLen, encodedLen );
ByteBuffer buffer = ByteBuffer.allocate( streamLen );
try
{
buffer = krbError.encode( buffer );
assertEquals( decoded, Strings.dumpBytes( buffer.array() ) );
}
catch ( EncoderException e )
{