{
fail( de.getMessage() );
}
// Check the decoded HostAddress
HostAddress hostAddress = ( ( HostAddressContainer ) hostAddressContainer ).getHostAddress();
assertEquals( HostAddrType.ADDRTYPE_INET, hostAddress.getAddrType() );
assertTrue( Arrays.equals( Strings.getBytesUtf8( "192.168.0.1" ), hostAddress.getAddress() ) );
// Check the encoding
ByteBuffer bb = ByteBuffer.allocate( hostAddress.computeLength() );
try
{
bb = hostAddress.encode( bb );
// Check the length
assertEquals( 0x16, bb.limit() );
String encodedPdu = Strings.dumpBytes( bb.array() );