Examples of ServiceInvoker


Examples of org.jboss.soa.esb.client.ServiceInvoker

        esbConfig.uninstallRegistry();
        esbConfig.resetESBProperties();
    }

    public void test_String2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new String(personXmlBytes));
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }

    public void test_bytes2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(personXmlBytes);
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }

    public void test_InputStream2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new ByteArrayInputStream(personXmlBytes));
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }

    public void test_Reader2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new StringReader(new String(personXmlBytes)));
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }

    public void test_String2Bytes() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "Bytes");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new String(personXmlBytes));
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", new String((byte[]) message.getBody().get()));
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", new String((byte[]) message.getBody().get()));
    }

    public void test_Object2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "Person");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new Person1("Tom", 300));
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom\" is=\"300\">", message.getBody().get());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("<someone called=\"Tom\" is=\"300\">", message.getBody().get());
    }

    public void test_Object2Object() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "Person2Person");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new Person1("Tom", 300));
        message = invoker.deliverSync(message, 30000);

        Person2 person2 = (Person2) message.getBody().get();
        assertEquals("Tom", person2.getName());
        assertEquals(300, person2.getAge());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        assertEquals("Tom", person2.getName());
        assertEquals(300, person2.getAge());
    }

    public void test_SourceResult() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();
        SourceResult sourceResult = new SourceResult();
        StringResult result = new StringResult();

        sourceResult.setSource(new ByteSource(personXmlBytes));
        sourceResult.setResult(result);

        message.getBody().add(sourceResult);
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", result.getResult());
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

      esbMessage.getHeader().setCall(call);
     
      // set body contents with args[2], and send
      esbMessage.getBody().add(args[2]);
     
        new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
    }
View Full Code Here

Examples of org.jboss.soa.esb.client.ServiceInvoker

        test("profile1", "<someone called=\"Tom Fennelly\" is=\"21\">");
        test("profile2", "<person name=\"Tom Fennelly\" age=\"21\">");
    }

    private void test(String profile, String expected) throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        // Create the message and set the profile on it...
        message.getBody().add(new String(personXmlBytes));
        message.getProperties().setProperty(Properties.MESSAGE_PROFILE, profile);

        message = invoker.deliverSync(message, 30000);

        assertEquals(expected, message.getBody().get());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.