Package org.springframework.xd.dirt.server

Examples of org.springframework.xd.dirt.server.SingleNodeApplication


  protected void before() throws Throwable {
    originalConfigLocation = System.getProperty("spring.config.location");
    if (!StringUtils.isEmpty(configurationLocation)) {
      System.setProperty("spring.config.location", configurationLocation);
    }
    singleNodeApplication = new SingleNodeApplication();
    singleNodeApplication.run();
    WebApplicationContext configurableApplicationContext = (WebApplicationContext) singleNodeApplication.adminContext();
    Collection<Filter> filters = configurableApplicationContext.getBeansOfType(Filter.class).values();
    mockMvc = MockMvcBuilders.webAppContextSetup(configurableApplicationContext)
        .addFilters(filters.toArray(new Filter[filters.size()]))
View Full Code Here


  public void cleanup() {
    System.setProperties(previousSystemProp);
  }

  private void runTestAndExpect(String expected) {
    SingleNodeApplication application = new TestApplicationBootstrap().getSingleNodeApplication().run(
        "--transport", "local");

    // 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

  @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();
    }
View Full Code Here

  @BeforeClass
  public static void setUp() throws Exception {
    originalConfigLocation = System.getProperty("spring.config.location");
    System.setProperty("spring.config.location", "classpath:org/springframework/xd/shell/security/securedServerWithSsl.yml");
    singleNodeApplication = new SingleNodeApplication().run();
    adminPort = singleNodeApplication.adminContext().getEnvironment().resolvePlaceholders("${server.port}");
  }
View Full Code Here

   * running on this host. Configure the ModuleRegistry to include the project module.
   */
  @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

  @BeforeClass
  public static void setUp() throws Exception {
    originalConfigLocation = System.getProperty("spring.config.location");
    System.setProperty("spring.config.location", "classpath:org/springframework/xd/shell/security/securedServer.yml");
    singleNodeApplication = new SingleNodeApplication().run();
    adminPort = singleNodeApplication.adminContext().getEnvironment().resolvePlaceholders("${server.port}");
  }
View Full Code Here

TOP

Related Classes of org.springframework.xd.dirt.server.SingleNodeApplication

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.