Package org.switchyard.component.resteasy.util.support

Examples of org.switchyard.component.resteasy.util.support.Item


    @Test
    public void generateClassInstances() throws Exception {
        String[] intfs = {"org.switchyard.component.resteasy.util.support.WarehouseResource"};
        Object instance = ClassUtil.generateSingletons(intfs, this).get(0);
        Method method = instance.getClass().getMethod("getItem", Integer.class);
        Item response = (Item)method.invoke(instance, 1);
        Item apple = new Item(1, "Apple");
        Assert.assertTrue(response.equals(apple));
        method = instance.getClass().getMethod("addItem", Item.class);
        Item orange = new Item(2, "Orange");
        Assert.assertEquals("[2:Orange]", method.invoke(instance, orange));
        method = instance.getClass().getMethod("updateItem", Item.class);
        Item grape = new Item(2, "Grape");
        Assert.assertEquals("[2:Grape]", method.invoke(instance, grape));
        method = instance.getClass().getMethod("removeItem", Integer.class);
        //Assert.assertEquals("2", method.invoke(instance, 2));
        method = instance.getClass().getMethod("getItemCount");
        Assert.assertEquals(0, method.invoke(instance));
View Full Code Here


        String operationName = restMessageRequest.getOperationName();
        if (operationName.equals("getItem")) {
            Assert.assertTrue(input instanceof Integer);
            Assert.assertTrue((Integer)input == 1);
            Assert.assertFalse(oneWay);
            return new RESTEasyBindingData(new Item(1, "Apple"));
        } else if (operationName.equals("addItem") || operationName.equals("updateItem")) {
            Assert.assertTrue(input instanceof Item);
            Assert.assertFalse(oneWay);
            return new RESTEasyBindingData(((Item)input).toString());
        } else if (operationName.equals("removeItem")) {
View Full Code Here

TOP

Related Classes of org.switchyard.component.resteasy.util.support.Item

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.