Package org.jboss.soa.esb.actions

Examples of org.jboss.soa.esb.actions.TestBean


        builder.classAlias("TomsClass");
       
        ObjectToXStream objectToXStream = new ObjectToXStream(builder.build());
       
        Message oMsg = MessageFactory.getInstance().getMessage();
        oMsg.getBody().add(new TestBean("Tom", "1234"));
        objectToXStream.process(oMsg);
        String xml = (String)oMsg.getBody().get();

        XStream xstream = new XStream(new DomDriver());
        xstream.alias("TomsClass", TestBean.class);
        TestBean bean = new TestBean();

        assertTrue("Expected start with [<TomsClass>].  Got [" + xml + "]", xml.startsWith("<TomsClass>"));
        xstream.fromXML(xml, bean);
       
        assertEquals("Tom", bean.getName());
        assertEquals("1234", bean.getPhone());
    }
View Full Code Here


        builder.namespace(ns, "TomsClass");
       
        ObjectToXStream objectToXStream = new ObjectToXStream(builder.build());
       
        Message oMsg = MessageFactory.getInstance().getMessage();
        oMsg.getBody().add(new TestBean("Tom", "1234"));
        objectToXStream.process(oMsg);
        String xml = (String)oMsg.getBody().get();
        assertTrue( xml.contains( "TomsClass xmlns=\"" + ns ));
    }
View Full Code Here

        XStreamConfigBuilder builder = new XStreamConfigBuilder();
        builder.alias("TomsClass", TestBean.class.getName());
        ObjectToXStream objectToXStream = new ObjectToXStream(builder.build());
       
        Message message = MessageFactory.getInstance().getMessage();
        message.getBody().add(new TestBean("Tom", "1234"));
        objectToXStream.process(message);
       
        String expectedXml = "<TomsClass><name>Tom</name><phone>1234</phone></TomsClass>";
        String actualXml = (String) message.getBody().get();
        assertTrue("XML comparison", XMLHelper.compareXMLContent(expectedXml, actualXml));
View Full Code Here

        builder.alias("TomsClass", TestBean.class.getName());
        builder.fieldAlias("firstName", TestBean.class, "name");
        ObjectToXStream objectToXStream = new ObjectToXStream(builder.build());
       
        Message message = MessageFactory.getInstance().getMessage();
        message.getBody().add(new TestBean("Tom", "1234"));
        objectToXStream.process(message);
       
        String expectedXml = "<TomsClass><firstName>Tom</firstName><phone>1234</phone></TomsClass>";
        String actualXml = (String) message.getBody().get();
        assertTrue("XML comparison", XMLHelper.compareXMLContent(expectedXml, actualXml));
View Full Code Here

        builder.implicitCollection(TestBean.class.getName(), "addresses", "address", String.class.getName());
       
        ObjectToXStream objectToXStream = new ObjectToXStream(builder.build());
       
        Message message = MessageFactory.getInstance().getMessage();
        TestBean testBean = new TestBean("Tom", "1234");
        List<String> addresses = new ArrayList<String>();
        addresses.add("street1");
        addresses.add("street2");
        testBean.setAddresses(addresses);
        message.getBody().add(testBean);
        objectToXStream.process(message);
       
        String expectedXml = "<TomsClass><name>Tom</name><phone>1234</phone><address>street1</address><address>street2</address></TomsClass>";
        String actualXml = (String) message.getBody().get();
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.actions.TestBean

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.