Search in sources :

Example 1 with BasicBean

use of com.alipay.sofa.rpc.test.generic.bean.BasicBean in project sofa-rpc by sofastack.

the class GenericTest method assertGenericBasicBean.

private void assertGenericBasicBean(Object go) {
    assertEquals(go.getClass(), GenericObject.class);
    GenericObject genericObject = (GenericObject) go;
    assertEquals(BasicBean.class.getName(), genericObject.getType());
    BasicBean bb = new BasicBean((short) 12, new Short((short) 32), 21, new Integer(43), (byte) 12, new Byte((byte) 13), 1274646l, 873763l, (float) 1456.9877, (float) 1456.9877, 82837.93883, 82837.88, true, false);
    assertEquals(bb.getB(), genericObject.getField("b"));
    assertEquals(bb.getBb(), genericObject.getField("bb"));
    assertEquals(bb.getS(), genericObject.getField("s"));
    assertEquals(bb.getSs(), genericObject.getField("ss"));
    assertEquals(bb.getF(), genericObject.getField("f"));
    assertEquals(bb.getFf(), genericObject.getField("ff"));
    assertEquals(bb.getD(), genericObject.getField("d"));
    assertEquals(bb.getDd(), genericObject.getField("dd"));
    assertEquals(bb.getL(), genericObject.getField("l"));
    assertEquals(bb.getLl(), genericObject.getField("ll"));
    assertEquals(bb.getI(), genericObject.getField("i"));
    assertEquals(bb.getIi(), genericObject.getField("ii"));
    assertEquals(bb.isBo(), true);
    assertEquals(bb.getBbo(), false);
}
Also used : GenericObject(com.alipay.hessian.generic.model.GenericObject) BasicBean(com.alipay.sofa.rpc.test.generic.bean.BasicBean)

Example 2 with BasicBean

use of com.alipay.sofa.rpc.test.generic.bean.BasicBean in project sofa-rpc by sofastack.

the class GenericTest method testBasicBean.

private void testBasicBean(GenericService proxy) {
    BasicBean basicBean = new BasicBean((short) 12, new Short((short) 32), 21, new Integer(43), (byte) 12, new Byte((byte) 13), 1274646l, 873763l, (float) 1456.9877, (float) 1456.9877, 82837.93883, 82837.88, true, false);
    Object obj = proxy.$genericInvoke("helloBasicBean", new String[] { BasicBean.class.getName() }, new Object[] { basicBean });
    obj = GenericUtils.convertToObject(obj);
    assertEquals(obj, basicBean);
    obj = proxy.$genericInvoke("helloBasicBean", new String[] { BasicBean.class.getName() }, new Object[] { basicBean }, BasicBean.class);
    assertEquals(obj, basicBean);
    obj = GenericUtils.convertToGenericObject(obj);
    assertGenericBasicBean(obj);
}
Also used : GenericObject(com.alipay.hessian.generic.model.GenericObject) BasicBean(com.alipay.sofa.rpc.test.generic.bean.BasicBean)

Aggregations

GenericObject (com.alipay.hessian.generic.model.GenericObject)2 BasicBean (com.alipay.sofa.rpc.test.generic.bean.BasicBean)2