Package org.springframework.integration.channel

Examples of org.springframework.integration.channel.AbstractMessageChannel


  @Test
  public void testInboundChannelAdapterParser() throws Exception {

    setUp("SmppInboundChannelAdapterParserTests.xml", getClass(), "smppInboundChannelAdapter");

    final AbstractMessageChannel outputChannel = TestUtils.getPropertyValue(this.consumer, "channel", AbstractMessageChannel.class);
    assertEquals("out", outputChannel.getComponentName());

    ExtendedSmppSession session = TestUtils.getPropertyValue(consumer, "smppSession", ExtendedSmppSession.class);
    assertNotNull(session);

    boolean autoStartup = TestUtils.getPropertyValue(consumer, "autoStartup" , Boolean.class);
View Full Code Here


  @Test
  public void testRetrievingOutboundGatewayParser() throws Exception {
    setUp("SmppOutboundGatewayParserTests.xml", getClass(), "smppOutboundGateway");


    final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class);
    assertEquals("in", inputChannel.getComponentName());

    final SmppOutboundGateway gateway = TestUtils.getPropertyValue(this.consumer, "handler", SmppOutboundGateway.class);

    long sendTimeout = TestUtils.getPropertyValue(gateway, "messagingTemplate.sendTimeout", Long.class);
    assertEquals(100, sendTimeout);

    ExtendedSmppSession session = TestUtils.getPropertyValue(gateway, "smppSession", ExtendedSmppSession.class);
    assertNotNull(session);

    TypeOfNumber ton = TestUtils.getPropertyValue(gateway, "defaultSourceAddressTypeOfNumber", TypeOfNumber.class);
    assertEquals(ton, TypeOfNumber.NETWORK_SPECIFIC);

    String sourceAddress = TestUtils.getPropertyValue(gateway, "defaultSourceAddress", String.class);
    assertEquals("123456789", sourceAddress);

    int order = TestUtils.getPropertyValue(gateway, "order", Integer.class);
    assertEquals(17, order);

    AbstractMessageChannel outputChannel = TestUtils.getPropertyValue(gateway, "outputChannel", AbstractMessageChannel.class);
    assertEquals("out", outputChannel.getComponentName());

    // this is not set, should be default value
    TimeFormatter timeFormatter = TestUtils.getPropertyValue(gateway, "timeFormatter", TimeFormatter.class);
    assertNotNull(timeFormatter);
  }
View Full Code Here

  @Test
  public void testRetrievingOutboundChannelAdapterParser() throws Exception {
    setUp("SmppOutboundChannelAdapterParserTests.xml", getClass());


    final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class);
    assertEquals("target", inputChannel.getComponentName());

    final SmppOutboundChannelAdapter gateway = TestUtils.getPropertyValue(this.consumer, "handler", SmppOutboundChannelAdapter.class);

    ExtendedSmppSession session = TestUtils.getPropertyValue(gateway, "smppSession", ExtendedSmppSession.class);
    assertNotNull(session);
View Full Code Here

    String sourceAddress = TestUtils.getPropertyValue(gateway, "defaultSourceAddress", String.class);
    assertEquals("123456789", sourceAddress);

    // channels
    AbstractMessageChannel requestChannel = TestUtils.getPropertyValue(gateway, "requestChannel", AbstractMessageChannel.class);
    assertEquals("requestChannel", requestChannel.getComponentName());
    AbstractMessageChannel outputChannel = TestUtils.getPropertyValue(gateway, "replyChannel", AbstractMessageChannel.class);
    assertEquals("replyChannel", outputChannel.getComponentName());
    AbstractMessageChannel errorChannel = TestUtils.getPropertyValue(gateway, "errorChannel", AbstractMessageChannel.class);
    assertEquals("errorChannel", errorChannel.getComponentName());

    // mappers
    InboundMessageMapper<?> inboundMessageMapper = TestUtils.getPropertyValue(gateway, "requestMapper", InboundMessageMapper.class);
    assertNotNull(inboundMessageMapper);
    OutboundMessageMapper<?> outboundMessageMapper = TestUtils.getPropertyValue(gateway, "messageConverter.outboundMessageMapper", OutboundMessageMapper.class);
View Full Code Here

  @Test
  public void testGatewayParser() throws Exception {
    setUp("JobLaunchingGatewayParserTests-context.xml", getClass());

    final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(this.consumer, "inputChannel", AbstractMessageChannel.class);
    assertEquals("requestChannel", inputChannel.getComponentName());

    final JobLaunchingMessageHandler jobLaunchingMessageHandler = TestUtils.getPropertyValue(this.consumer, "handler.jobLaunchingMessageHandler", JobLaunchingMessageHandler.class);

    assertNotNull(jobLaunchingMessageHandler);
View Full Code Here

    }
    SimpleModule sm = (SimpleModule) module;
    try {
      MimeType contentType = resolveContentType(contentTypeString, module);

      AbstractMessageChannel channel = getChannel(module, isInput);

      CompositeMessageConverter converters = null;
      try {
        converters = converterFactory.newInstance(contentType);
      }
      catch (ConversionException e) {
        throw new ModuleConfigurationException(e.getMessage() +
            "(" +
            module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString
            + ")");
      }

      Class<?> dataType = MessageConverterUtils.getJavaTypeForContentType(contentType,
          sm.getApplicationContext().getClassLoader());
      if (dataType == null) {
        throw new ModuleConfigurationException("Content type is not supported for " +
            module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString);
      }
      else {
        channel.setDatatypes(dataType);
        channel.setMessageConverter(converters);
      }

    }
    catch (Throwable t) {
      throw new ModuleConfigurationException(t.getMessage(), t);
View Full Code Here

TOP

Related Classes of org.springframework.integration.channel.AbstractMessageChannel

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.