Package test

Examples of test.ObjectFactory


       
        // Force marshal by type
        context.setProcessType(Data[].class);
       
        // Create an Data value
        ObjectFactory factory = new ObjectFactory();
        Data value[] = new Data[3];
        value[0] = factory.createData();
        value[0].setInput("Hello");
        value[1] = factory.createData();
        value[1].setInput("Beautiful");
        value[2] = factory.createData();
        value[2].setInput("World");
       
        // Create a JAXBElement.
        // To indicate "occurrence elements", the value is wrapped in
        // an OccurrenceArray
View Full Code Here


    QName serviceQName = new QName("http://test/", "EchoService");
    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);
View Full Code Here

    private LogicalMessageContext createSampleContext() throws Exception {
        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

    private Message createMessage(String input) throws Exception {
        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

    * Simple XML/HTTP Message Test
    * @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);
View Full Code Here

    public void testSyncPayload() throws Exception {
        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

    public void testAysncPayload() throws Exception {
        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>();
       
View Full Code Here

    public void testOneWayPayload() throws Exception {
        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

    public void testSyncMessage() throws Exception {
        TestLogger.logger.debug("---------------------------------------");
        TestLogger.logger.debug("test: " + getName());

        // Create the input param
        ObjectFactory factory = new ObjectFactory();
        EchoString echoString = factory.createEchoString();        
        echoString.setInput("SYNC JAXB MESSAGETEST");
       
        JAXBElement<Envelope> request = createJAXBEnvelope();
        request.getValue().getBody().getAny().add(echoString);
       
View Full Code Here

    public void testAysncMessage() throws Exception {
        TestLogger.logger.debug("---------------------------------------");
        TestLogger.logger.debug("test: " + getName());
       
        // Create the input param
        ObjectFactory factory = new ObjectFactory();
        EchoString echoString = factory.createEchoString();        
        echoString.setInput("ASYNC(CALLBACK) JAXB MESSAGE TEST");
       
        JAXBElement<Envelope> request = createJAXBEnvelope();
        request.getValue().getBody().getAny().add(echoString);
       
View Full Code Here

TOP

Related Classes of test.ObjectFactory

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.