if ( client == null ) client = getNewClient();
}
public void testService()
{
ISimpleTypes service = (ISimpleTypes) RemotingService.createService( SimpleTypes.class.getName(),
ISimpleTypes.class, client );
Object o = service.getString( "abcd" );
assertTrue( o instanceof String );
assertTrue( ((String) o).length() > 0 );
o = service.getBoolean( true );
assertTrue( o instanceof Boolean );
assertTrue( ((Boolean) o).booleanValue() );
o = service.getFloat( 4321 );
assertTrue( o instanceof Float );
assertEquals( o, new Float( 1234.0 ) );
o = service.getDouble( 4321 );
assertTrue( o instanceof Double );
assertEquals( o, new Double( 1234.0 ) );
o = service.getDecimal( new BigDecimal( 4321 ) );
assertTrue( o instanceof BigDecimal );
assertEquals( o, new BigDecimal( 1234.0 ) );
o = service.getInteger( 4321 );
assertTrue( o instanceof Integer );
assertEquals( o, new Integer( 1234 ) );
o = service.getShort( (short) 4321 );
assertTrue( o instanceof Short );
assertEquals( o, new Short( (short) 1234 ) );
o = service.getByte( (byte) 10 );
assertTrue( o instanceof Byte );
assertEquals( o, new Byte( (byte) 11 ) );
o = service.getBase64( new byte[] { (byte) 10 } );
assertTrue( o instanceof byte[] );
assertEquals( ((byte[]) o)[0], (byte) 11 );
}