Search in sources :

Example 1 with AtmiBrokerEnvXML

use of org.jboss.narayana.blacktie.jatmibroker.core.conf.AtmiBrokerEnvXML in project narayana by jbosstm.

the class ConnectionImplTest method test.

public void test() throws Exception {
    AtmiBrokerEnvXML xml = new AtmiBrokerEnvXML();
    Properties properties = xml.getProperties();
    TransportFactory factory = new TransportFactory(properties);
    Transport proxy = factory.createTransport();
    Sender serviceFactory = proxy.getSender("BAR", false);
    String aString = "Hello from Java Land";
    Receiver endpoint = proxy.createReceiver(1, null, null);
    serviceFactory.send(endpoint.getReplyTo(), (short) 0, 0, aString.getBytes(), aString.getBytes().length, 0, 0, 0, "X_OCTET", "");
    Message receive = endpoint.receive(0);
    assertNotNull(receive);
    String string = new String(receive.data).intern();
    String expectedResponse = "BAR SAYS HELLO";
    log.debug("Bar ServiceManager service_request response is " + string);
    log.debug("Bar ServiceManager service_request size of response is " + receive.len);
    assertEquals(string, expectedResponse);
    proxy.close();
    factory.close();
}
Also used : TransportFactory(org.jboss.narayana.blacktie.jatmibroker.core.transport.TransportFactory) Sender(org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender) Message(org.jboss.narayana.blacktie.jatmibroker.core.transport.Message) Receiver(org.jboss.narayana.blacktie.jatmibroker.core.transport.Receiver) AtmiBrokerEnvXML(org.jboss.narayana.blacktie.jatmibroker.core.conf.AtmiBrokerEnvXML) Properties(java.util.Properties) Transport(org.jboss.narayana.blacktie.jatmibroker.core.transport.Transport)

Example 2 with AtmiBrokerEnvXML

use of org.jboss.narayana.blacktie.jatmibroker.core.conf.AtmiBrokerEnvXML in project narayana by jbosstm.

the class TestConnection method setUp.

public void setUp() throws ConnectionException, ConfigurationException {
    AtmiBrokerEnvXML xml = new AtmiBrokerEnvXML();
    Properties properties = xml.getProperties();
    transportFactory = new TransportFactory(properties);
    serviceTransport = transportFactory.createTransport();
    clientTransport = transportFactory.createTransport();
}
Also used : TransportFactory(org.jboss.narayana.blacktie.jatmibroker.core.transport.TransportFactory) AtmiBrokerEnvXML(org.jboss.narayana.blacktie.jatmibroker.core.conf.AtmiBrokerEnvXML) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)2 AtmiBrokerEnvXML (org.jboss.narayana.blacktie.jatmibroker.core.conf.AtmiBrokerEnvXML)2 TransportFactory (org.jboss.narayana.blacktie.jatmibroker.core.transport.TransportFactory)2 Message (org.jboss.narayana.blacktie.jatmibroker.core.transport.Message)1 Receiver (org.jboss.narayana.blacktie.jatmibroker.core.transport.Receiver)1 Sender (org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender)1 Transport (org.jboss.narayana.blacktie.jatmibroker.core.transport.Transport)1