Package org.apache.camel.dataformat.bindy.model.tab

Examples of org.apache.camel.dataformat.bindy.model.tab.PurchaseOrder


        template.sendBody("direct:unmarshal", "123\tCamel in Action\t2\tPlease hurry\tJane Doe\tJohn Doe\n");

        assertMockEndpointsSatisfied();

        List<Map> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
        PurchaseOrder order = (PurchaseOrder) rows.get(0).get(PurchaseOrder.class.getName());

        assertEquals(123, order.getId());
        assertEquals("Camel in Action", order.getName());
        assertEquals(2, order.getAmount());
        assertEquals("Please hurry", order.getOrderText());
        assertEquals("Jane Doe", order.getSalesRef());
        assertEquals("John Doe", order.getCustomerRef());
    }
View Full Code Here


    @Test
    public void testMarshal() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:marshal");
        mock.expectedBodiesReceived("123\tCamel in Action\t2\tPlease hurry\tJane Doe\tJohn Doe\n");

        PurchaseOrder order = new PurchaseOrder();
        order.setId(123);
        order.setName("Camel in Action");
        order.setAmount(2);
        order.setOrderText("Please hurry");
        order.setSalesRef("Jane Doe");
        order.setCustomerRef("John Doe");

        template.sendBody("direct:marshal", order);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

                        + "456\tCamel in Action\t2\t\t\n456\tCamel in Action\t1\t\t\t\n", Exchange.CONTENT_ENCODING, "iso8859-1");

        assertMockEndpointsSatisfied();

        List<Map<?, PurchaseOrder>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
        PurchaseOrder order = rows.get(0).get(PurchaseOrder.class.getName());

        assertEquals(123, order.getId());
        assertEquals("Camel in Action", order.getName());
        assertEquals(2, order.getAmount());
        assertNull(order.getOrderText());
        assertNull(order.getSalesRef());
        assertNull(order.getCustomerRef());
    }
View Full Code Here

    @Test
    public void testMarshalEmptyTrailingNoneRequiredFields() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:marshal");
        mock.expectedBodiesReceived("123\tCamel in Action\t2\t\t\t\n");

        PurchaseOrder order = new PurchaseOrder();
        order.setId(123);
        order.setName("Camel in Action");
        order.setAmount(2);
        order.setOrderText("");
        order.setSalesRef("");
        order.setCustomerRef("");

        template.sendBody("direct:marshal", order);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        template.sendBody("direct:unmarshal", "123\tCamel in Action\t2");

        assertMockEndpointsSatisfied();

        List<Map> rows = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
        PurchaseOrder order = (PurchaseOrder) rows.get(0).get(PurchaseOrder.class.getName());

        assertEquals(123, order.getId());
        assertEquals("Camel in Action", order.getName());
        assertEquals(2, order.getAmount());
    }
View Full Code Here

    @Test
    public void testMarshal() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:marshal");
        mock.expectedBodiesReceived("123\tCamel in Action\t2\n");

        PurchaseOrder order = new PurchaseOrder();
        order.setId(123);
        order.setName("Camel in Action");
        order.setAmount(2);

        template.sendBody("direct:marshal", order);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        template.sendBody("direct:unmarshal", "123\tCamel in Action\t2\tPlease hurry\tJane Doe\tJohn Doe\n");

        assertMockEndpointsSatisfied();

        List<Map<?, PurchaseOrder>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
        PurchaseOrder order = rows.get(0).get(PurchaseOrder.class.getName());

        assertEquals(123, order.getId());
        assertEquals("Camel in Action", order.getName());
        assertEquals(2, order.getAmount());
        assertEquals("Please hurry", order.getOrderText());
        assertEquals("Jane Doe", order.getSalesRef());
        assertEquals("John Doe", order.getCustomerRef());
    }
View Full Code Here

    @Test
    public void testMarshal() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:marshal");
        mock.expectedBodiesReceived("123\tCamel in Action\t2\tPlease hurry\tJane Doe\tJohn Doe\n");

        PurchaseOrder order = new PurchaseOrder();
        order.setId(123);
        order.setName("Camel in Action");
        order.setAmount(2);
        order.setOrderText("Please hurry");
        order.setSalesRef("Jane Doe");
        order.setCustomerRef("John Doe");

        template.sendBody("direct:marshal", order);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

                        + "456\tCamel in Action\t2\t\t\n456\tCamel in Action\t1\t\t\t\n", Exchange.CONTENT_ENCODING, "iso8859-1");

        assertMockEndpointsSatisfied();

        List<Map<?, PurchaseOrder>> rows = CastUtils.cast(mock.getReceivedExchanges().get(0).getIn().getBody(List.class));
        PurchaseOrder order = rows.get(0).get(PurchaseOrder.class.getName());

        assertEquals(123, order.getId());
        assertEquals("Camel in Action", order.getName());
        assertEquals(2, order.getAmount());
        assertNull(order.getOrderText());
        assertNull(order.getSalesRef());
        assertNull(order.getCustomerRef());
    }
View Full Code Here

    @Test
    public void testMarshalEmptyTrailingNoneRequiredFields() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:marshal");
        mock.expectedBodiesReceived("123\tCamel in Action\t2\t\t\t\n");

        PurchaseOrder order = new PurchaseOrder();
        order.setId(123);
        order.setName("Camel in Action");
        order.setAmount(2);
        order.setOrderText("");
        order.setSalesRef("");
        order.setCustomerRef("");

        template.sendBody("direct:marshal", order);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.dataformat.bindy.model.tab.PurchaseOrder

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.