Package org.apache.cxf.systest.aegis.mtom.fortest

Examples of org.apache.cxf.systest.aegis.mtom.fortest.DataHandlerBean


   
   
    @Test
    public void testMtomReply() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = client.produceDataHandlerBean();
        Assert.assertNotNull(dhBean);
        Assert.assertEquals(MtomTestImpl.STRING_DATA, dhBean.getDataHandler().getContent());
    }
View Full Code Here


    }

    @Test
    public void testAcceptDataHandler() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = new DataHandlerBean();
        dhBean.setName("some name");
        // some day, we might need this to be higher than some threshold.
        String someData = "This is the cereal shot from guns.";
        DataHandler dataHandler = new DataHandler(someData, "text/plain;charset=utf-8");
        dhBean.setDataHandler(dataHandler);
        client.acceptDataHandler(dhBean);
        DataHandlerBean accepted = impl.getLastDhBean();
        Assert.assertNotNull(accepted);
        String data = (String) accepted.getDataHandler().getContent();
        Assert.assertNotNull(data);
        Assert.assertEquals("This is the cereal shot from guns.", data);
    }
View Full Code Here

    }

    @Test
    public void testAcceptDataHandlerNoMTOM() throws Exception {
        setupForTest(false);
        DataHandlerBean dhBean = new DataHandlerBean();
        dhBean.setName("some name");
        // some day, we might need this to be longer than some threshold.
        String someData = "This is the cereal shot from guns.";
        DataHandler dataHandler = new DataHandler(someData, "text/plain;charset=utf-8");
        dhBean.setDataHandler(dataHandler);
        client.acceptDataHandler(dhBean);
        DataHandlerBean accepted = impl.getLastDhBean();
        Assert.assertNotNull(accepted);
        Object data = accepted.getDataHandler().getContent();
        Assert.assertNotNull(data);
        Assert.assertEquals("This is the cereal shot from guns.", data);
    }
View Full Code Here

    }

    @Test
    public void testMtomReply() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = client.produceDataHandlerBean();
        Assert.assertNotNull(dhBean);
        String result = IOUtils.toString(dhBean.getDataHandler().getInputStream(), "utf-8");
        Assert.assertEquals(MtomTestImpl.STRING_DATA, result);
    }
View Full Code Here

    //TODO: how do we see if MTOM actually happened?
    @Test
    public void testJaxWsMtomReply() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = jaxwsClient.produceDataHandlerBean();
        Assert.assertNotNull(dhBean);
        String result = IOUtils.toString(dhBean.getDataHandler().getInputStream(), "utf-8");
        Assert.assertEquals(MtomTestImpl.STRING_DATA, result);
    }
View Full Code Here

    }

    @Test
    public void testAcceptDataHandler() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = new DataHandlerBean();
        dhBean.setName("some name");
        // some day, we might need this to be higher than some threshold.
        String someData = "This is the cereal shot from guns.";
        DataHandler dataHandler = new DataHandler(someData, "text/plain;charset=utf-8");
        dhBean.setDataHandler(dataHandler);
        client.acceptDataHandler(dhBean);
        DataHandlerBean accepted = impl.getLastDhBean();
        Assert.assertNotNull(accepted);
        String data = (String) accepted.getDataHandler().getContent();
        Assert.assertNotNull(data);
        Assert.assertEquals("This is the cereal shot from guns.", data);
    }
View Full Code Here

    }

    @Test
    public void testAcceptDataHandlerNoMTOM() throws Exception {
        setupForTest(false);
        DataHandlerBean dhBean = new DataHandlerBean();
        dhBean.setName("some name");
        // some day, we might need this to be longer than some threshold.
        String someData = "This is the cereal shot from guns.";
        DataHandler dataHandler = new DataHandler(someData, "text/plain;charset=utf-8");
        dhBean.setDataHandler(dataHandler);
        client.acceptDataHandler(dhBean);
        DataHandlerBean accepted = impl.getLastDhBean();
        Assert.assertNotNull(accepted);
        InputStream data = accepted.getDataHandler().getInputStream();
        Assert.assertNotNull(data);
        String dataString = org.apache.commons.io.IOUtils.toString(data, "utf-8");
        Assert.assertEquals("This is the cereal shot from guns.", dataString);
    }
View Full Code Here

   
   
    @Test
    public void testMtomReply() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = client.produceDataHandlerBean();
        Assert.assertNotNull(dhBean);
        Assert.assertEquals(MtomTestImpl.STRING_DATA, dhBean.getDataHandler().getContent());
    }
View Full Code Here

    }

    @Test
    public void testAcceptDataHandler() throws Exception {
        setupForTest(true);
        DataHandlerBean dhBean = new DataHandlerBean();
        dhBean.setName("some name");
        // some day, we might need this to be higher than some threshold.
        String someData = "This is the cereal shot from guns.";
        DataHandler dataHandler = new DataHandler(someData, "text/plain;charset=utf-8");
        dhBean.setDataHandler(dataHandler);
        client.acceptDataHandler(dhBean);
        DataHandlerBean accepted = impl.getLastDhBean();
        Assert.assertNotNull(accepted);
        String data = (String) accepted.getDataHandler().getContent();
        Assert.assertNotNull(data);
        Assert.assertEquals("This is the cereal shot from guns.", data);
    }
View Full Code Here

    }

    @Test
    public void testAcceptDataHandlerNoMTOM() throws Exception {
        setupForTest(false);
        DataHandlerBean dhBean = new DataHandlerBean();
        dhBean.setName("some name");
        // some day, we might need this to be longer than some threshold.
        String someData = "This is the cereal shot from guns.";
        DataHandler dataHandler = new DataHandler(someData, "text/plain;charset=utf-8");
        dhBean.setDataHandler(dataHandler);
        client.acceptDataHandler(dhBean);
        DataHandlerBean accepted = impl.getLastDhBean();
        Assert.assertNotNull(accepted);
        Object data = accepted.getDataHandler().getContent();
        Assert.assertNotNull(data);
        Assert.assertEquals("This is the cereal shot from guns.", data);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.systest.aegis.mtom.fortest.DataHandlerBean

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.