Package test

Examples of test.EchoString


       
        JAXBContext context = JAXBContext.newInstance("test");
       
        Unmarshaller u = context.createUnmarshaller();
        ByteArrayInputStream inputStream = new ByteArrayInputStream(echoSample.getBytes());
        EchoString jaxb = (EchoString)u.unmarshal(inputStream);
        JAXBSource src = new JAXBSource(context.createMarshaller(), jaxb);
       
        // Create a Block using the sample string as the content.  This simulates
        // what occurs on the outbound JAX-WS dispatch<Source> client
        Block block = f.createFrom(src, null, null);
View Full Code Here


    * @throws Exception
    */
   public void testSimple() throws Exception {
       Dispatch<Object> dispatch = getDispatch();
       ObjectFactory factory = new ObjectFactory();
       EchoString request = factory.createEchoString();        
       request.setInput("SYNC JAXB XML PAYLOAD TEST");
      
       // Invoke the Dispatch<Object>
        TestLogger.logger.debug(">> Invoking sync Dispatch with JAX-B Parameter");
       EchoString response = (EchoString) dispatch.invoke(request);
      
       assertNotNull(response);

        TestLogger.logger.debug(">> Response content: " + response.getInput());
      
       assertTrue("[ERROR] - Response object was null", response != null);
       assertTrue("[ERROR] - No content in response object", response.getInput() != null);
       assertTrue("[ERROR] - Zero length content in response", response.getInput().length() > 0);
       assertTrue(response.getInput().equals(request.getInput()));

   }
View Full Code Here

        OMDataSource ds = ((OMSourcedElement) om).getDataSource();
        assertTrue(ds instanceof JAXBDataSource);
        JAXBDataSource jaxbDS = (JAXBDataSource) ds;
        Object jaxbObject = jaxbDS.getObject();
        assertTrue(jaxbObject instanceof EchoString);
        EchoString result = (EchoString) jaxbObject;
        assertTrue(result.getInput().equals("Hello World"));
       
        // Make sure that the local name can be obtained without expansion
        String localName = om.getLocalName();
        assertTrue("echoString".equals(localName));
        ds = ((OMSourcedElement) om).getDataSource();
View Full Code Here

        OMDataSource ds = ((OMSourcedElement) om).getDataSource();
        assertTrue(ds instanceof JAXBDataSource);
        JAXBDataSource jaxbDS = (JAXBDataSource) ds;
        Object jaxbObject = jaxbDS.getObject();
        assertTrue(jaxbObject instanceof EchoString);
        EchoString result = (EchoString) jaxbObject;
        assertTrue(result.getInput().equals("Hello World"));
       
        // Make sure that the local name can be obtained without expansion
        String localName = om.getLocalName();
        assertTrue("echoString".equals(localName));
        ds = ((OMSourcedElement) om).getDataSource();
View Full Code Here

    QName portQName = new QName("http://test/", "EchoServicePort");

    public void testJAXBResolution() {
        try {
            ObjectFactory factory = new ObjectFactory();
            EchoString request = factory.createEchoString();        
            request.setInput("Operation resolution JAXB test");
            JAXBContext jbc = JAXBContext.newInstance(EchoString.class);
   
            Service service = Service.create(wsdlDocumentLocation, serviceQName);
            Dispatch<Object> dispatch = service.createDispatch(portQName, jbc, Service.Mode.PAYLOAD);
   
            // The InterceptableClientTestCase invoke will return the "request" as the response.
            EchoString response = (EchoString) dispatch.invoke(request);
        } catch (Exception e) {
            fail("Caught exception: " + e);
        }
        TestClientInvocationController testController = getInvocationController();
        InvocationContext ic = testController.getInvocationContext();
View Full Code Here

        MessageFactory factory = (MessageFactory) FactoryRegistry.getFactory(MessageFactory.class);
        Message msg = factory.create(Protocol.soap11);
       
        // Create a jaxb object
        ObjectFactory objFactory = new ObjectFactory();
        EchoString echo = objFactory.createEchoString();
        echo.setInput(INPUT);
       
        // Create the necessary JAXBContext
        JAXBContext jbc = JAXBContext.newInstance("test");
        JAXBBlockContext blockCtx = new JAXBBlockContext(jbc);
       
View Full Code Here

        MessageFactory factory = (MessageFactory) FactoryRegistry.getFactory(MessageFactory.class);
        Message msg = factory.create(Protocol.soap11);
       
        // Create a jaxb object
        ObjectFactory objFactory = new ObjectFactory();
        EchoString echo = objFactory.createEchoString();
        echo.setInput(input);
       
        // Create the necessary JAXBContext
        JAXBContext jbc = JAXBContext.newInstance("test");
        JAXBBlockContext blockCtx = new JAXBBlockContext(jbc);
       
View Full Code Here

        TestLogger.logger.debug("---------------------------------------");
        TestLogger.logger.debug("test: " + getName());

        // Create the input param
        ObjectFactory factory = new ObjectFactory();
        EchoString request = factory.createEchoString();        
        request.setInput("SYNC JAXB PAYLOAD TEST");
       
        // Invoke the Dispatch<Object>
        TestLogger.logger.debug(">> Invoking sync Dispatch with JAX-B Parameter");
        EchoStringResponse response = (EchoStringResponse) dispatchPayload.invoke(request);
       
View Full Code Here

        TestLogger.logger.debug("---------------------------------------");
        TestLogger.logger.debug("test: " + getName());
       
        // Create the input param
        ObjectFactory factory = new ObjectFactory();
        EchoString request = factory.createEchoString();        
        request.setInput("ASYNC(CALLBACK) JAXB PAYLOAD TEST");
       
        // Create the callback for async responses
        JAXBCallbackHandler<Object> callback = new JAXBCallbackHandler<Object>();
       
        // Invoke the Dispatch<Object> asynchronously
View Full Code Here

        TestLogger.logger.debug("---------------------------------------");
        TestLogger.logger.debug("test: " + getName());

        // Create the input param
        ObjectFactory factory = new ObjectFactory();
        EchoString request = factory.createEchoString();        
        request.setInput("ONE-WAY JAXB PAYLOAD TEST");
       
        // Invoke the Dispatch<Object> one-way
        TestLogger.logger.debug(">> Invoking one-way Dispatch with JAX-B Parameter");
        dispatchPayload.invokeOneWay(request);
       
View Full Code Here

TOP

Related Classes of test.EchoString

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.