Package org.springframework.xd.dirt.test

Examples of org.springframework.xd.dirt.test.SingleNodeIntegrationTestSupport


      String processingChain, String moduleResourceLocation) {
    Assert.notNull(application, "application cannot be null");
    Assert.hasText(processingChain, "processingChain cannot be null or empty");
    Assert.hasText(streamName, "streamName cannot be null or empty");
    Assert.hasText(moduleResourceLocation, "moduleResourceLocation cannot be null or empty");
    this.integrationSupport = new SingleNodeIntegrationTestSupport(application);
    this.integrationSupport.addModuleRegistry(new ArchiveModuleRegistry(moduleResourceLocation));
    String streamDefinition = buildStreamDefinition(processingChain);
    stream = new StreamDefinition(streamName, streamDefinition);

    integrationSupport.createAndDeployStream(stream);
View Full Code Here


  public ExpectedException thrown = ExpectedException.none();

  @BeforeClass
  public static void setUp() {
    application = new TestApplicationBootstrap().getSingleNodeApplication().run();
    integrationSupport = new SingleNodeIntegrationTestSupport(application);
  }
View Full Code Here

   * @param transport the transport to be used by the test.
   */
  protected static void setUp(String transport) {
    testApplicationBootstrap = new TestApplicationBootstrap();
    singleNodeApplication = testApplicationBootstrap.getSingleNodeApplication().run("--transport", transport);
    integrationSupport = new SingleNodeIntegrationTestSupport(singleNodeApplication);
    if (transport.equalsIgnoreCase("local")) {
      testMessageBus = null;
    }
    else {
      testMessageBus.setMessageBus(integrationSupport.messageBus());
View Full Code Here

    // Set activate profiles AFTER the container has started, so we don't
    // interfere with container profiles themselves
    if (activeProfiles != null) {
      System.setProperty(AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, activeProfiles);
    }
    SingleNodeIntegrationTestSupport integrationSupport = new SingleNodeIntegrationTestSupport(application);

    String streamDefinition = String.format("queue:producer > %s > queue:consumer", dslDefinition);
    String streamName = "test";

    StreamDefinition testStream = new StreamDefinition(streamName, streamDefinition);
    integrationSupport.createAndDeployStream(testStream);

    MessageBus messageBus = integrationSupport.messageBus();

    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(messageBus).createNamedChannelSource("queue:producer");
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(messageBus).createNamedChannelSink("queue:consumer");

    source.sendPayload("ping");
    String result = (String) sink.receivePayload(5000);
    assertEquals(expected, result);

    source.unbind();
    sink.unbind();

    assertTrue("stream " + testStream.getName() + "not undeployed",
        integrationSupport.undeployAndDestroyStream(testStream));
    application.close();
  }
View Full Code Here

    application = new TestApplicationBootstrap().getSingleNodeApplication().run("--analytics", "memory");
    // Explicitly set this to true since RandomConfigurationSupport disables JMX by default.
    System.setProperty("XD_JMX_ENABLED", "true");
    adminContext = application.adminContext();
    moduleRegistry = adminContext.getBean(WriteableModuleRegistry.class);
    integrationTestSupport = new SingleNodeIntegrationTestSupport(application);
    integrationTestSupport.addModuleRegistry(new ArchiveModuleRegistry("classpath:/testmodules/"));
  }
View Full Code Here

  @BeforeClass
  public static synchronized void startUp() throws InterruptedException, IOException {
    RandomConfigurationSupport randomConfigSupport = new RandomConfigurationSupport();
    if (application == null) {
      application = new SingleNodeApplication().run("--transport", "local", "--analytics", "redis");
      integrationTestSupport = new SingleNodeIntegrationTestSupport(application);
      integrationTestSupport.addModuleRegistry(new ArchiveModuleRegistry("classpath:/spring-xd/xd/modules"));
      Bootstrap bootstrap = new Bootstrap(new String[] { "--port", randomConfigSupport.getAdminServerPort() });
      shell = bootstrap.getJLineShellComponent();
    }
    if (!shell.isRunning()) {
View Full Code Here

  @BeforeClass
  public static void setUp() {
    // Args not required. Just shown as an example.
    // Also, used to pick an unused port
    application = new TestApplicationBootstrap().getSingleNodeApplication().run("--transport", "local");
    integrationSupport = new SingleNodeIntegrationTestSupport(application);
  }
View Full Code Here

   */
  @BeforeClass
  public static void setUp() {
    RandomConfigurationSupport randomConfigSupport = new RandomConfigurationSupport();
    application = new SingleNodeApplication().run("--transport", "local", "--analytics", "redis");
    SingleNodeIntegrationTestSupport singleNodeIntegrationTestSupport = new SingleNodeIntegrationTestSupport
        (application);
    singleNodeIntegrationTestSupport.addModuleRegistry(new SingletonModuleRegistry(ModuleType.processor,
        moduleName));

  }
View Full Code Here

TOP

Related Classes of org.springframework.xd.dirt.test.SingleNodeIntegrationTestSupport

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.