Package org.servicemix.jbi.jaxp

Examples of org.servicemix.jbi.jaxp.StringSource


  public void testInOut() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOut mec = mef.createInOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOut mep = (InOut) provider.getChannel().accept(100L);
    assertNotNull(mep);
    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
    m = mep.createMessage();
    m.setContent(new StringSource(RESPONSE));
    mep.setOutMessage(m);
    provider.getChannel().send(mep);
    // Consumer side
    assertSame(mec, consumer.getChannel().accept(100L));
    assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
View Full Code Here


          // Provider side
          InOut mep = (InOut) provider.getChannel().accept(10000L);
          assertNotNull(mep);
          assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
          NormalizedMessage m = mep.createMessage();
          m.setContent(new StringSource(RESPONSE));
          mep.setOutMessage(m);
          provider.getChannel().send(mep);
        } catch (Exception e) {
          e.printStackTrace();
          fail();
        }
      }
    }).start();
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOut mec = mef.createInOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().sendSync(mec, 10000L);
    assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
    mec.setStatus(ExchangeStatus.DONE);
    consumer.getChannel().send(mec);
View Full Code Here

          // Provider side
          InOut mep = (InOut) provider.getChannel().accept(10000L);
          assertNotNull(mep);
          assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
          NormalizedMessage m = mep.createMessage();
          m.setContent(new StringSource(RESPONSE));
          mep.setOutMessage(m);
          provider.getChannel().sendSync(mep);
          assertEquals(ExchangeStatus.DONE, mep.getStatus());
        } catch (Exception e) {
          e.printStackTrace();
          fail();
        }
      }
    });
    t.start();
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOut mec = mef.createInOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().sendSync(mec, 10000L);
    assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
    mec.setStatus(ExchangeStatus.DONE);
    consumer.getChannel().send(mec);
View Full Code Here

  public void testInOutWithFault() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOut mec = mef.createInOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOut mep = (InOut) provider.getChannel().accept(100L);
    assertNotNull(mep);
    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
    m = mep.createMessage();
    m.setContent(new StringSource(RESPONSE));
    mep.setStatus(ExchangeStatus.ERROR);
    provider.getChannel().send(mep);
    // Consumer side
    assertSame(mec, consumer.getChannel().accept(100L));
    assertEquals(ExchangeStatus.ERROR, mec.getStatus());
View Full Code Here

  public void testInOptOutWithRep() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOptionalOut mec = mef.createInOptionalOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
    assertNotNull(mep);
    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
    m = mep.createMessage();
    m.setContent(new StringSource(RESPONSE));
    mep.setOutMessage(m);
    provider.getChannel().send(mep);
    // Consumer side
    assertSame(mec, consumer.getChannel().accept(100L));
    assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
View Full Code Here

  public void testInOptOutWithoutRep() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOptionalOut mec = mef.createInOptionalOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
    assertNotNull(mep);
View Full Code Here

  public void testInOptOutWithProviderFault() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOptionalOut mec = mef.createInOptionalOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
    assertNotNull(mep);
View Full Code Here

  public void testInOptOutWithRepAndConsumerFault() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    InOptionalOut mec = mef.createInOptionalOutExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
    assertNotNull(mep);
    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
    m = mep.createMessage();
    m.setContent(new StringSource(RESPONSE));
    mep.setOutMessage(m);
    provider.getChannel().send(mep);
    // Consumer side
    assertSame(mec, consumer.getChannel().accept(100L));
    assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
View Full Code Here

  public void testRobustInOnly() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    RobustInOnly mec = mef.createRobustInOnlyExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    RobustInOnly mep = (RobustInOnly) provider.getChannel().accept(100L);
    assertNotNull(mep);
View Full Code Here

  public void testRobustInOnlyWithFault() throws Exception {
    // Send message exchange
    MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
    RobustInOnly mec = mef.createRobustInOnlyExchange();
    NormalizedMessage m = mec.createMessage();
    m.setContent(new StringSource(PAYLOAD));
    mec.setInMessage(m);
    consumer.getChannel().send(mec);
    // Provider side
    RobustInOnly mep = (RobustInOnly) provider.getChannel().accept(100L);
    assertNotNull(mep);
View Full Code Here

TOP

Related Classes of org.servicemix.jbi.jaxp.StringSource

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.