Package org.springframework.boot.builder

Examples of org.springframework.boot.builder.SpringApplicationBuilder


  @Value("${local.server.port}")
  private int port = 1234;

  @Test
  public void echoEndpoint() throws Exception {
    ConfigurableApplicationContext context = new SpringApplicationBuilder(
        ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
        .properties(
            "websocket.uri:ws://localhost:" + this.port + "/echo/websocket")
        .run("--spring.main.web_environment=false");
    long count = context.getBean(ClientConfiguration.class).latch.getCount();
View Full Code Here


    assertEquals("Did you say \"Hello world!\"?", messagePayloadReference.get());
  }

  @Test
  public void reverseEndpoint() throws Exception {
    ConfigurableApplicationContext context = new SpringApplicationBuilder(
        ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
        .properties("websocket.uri:ws://localhost:" + this.port + "/reverse")
        .run("--spring.main.web_environment=false");
    long count = context.getBean(ClientConfiguration.class).latch.getCount();
    AtomicReference<String> messagePayloadReference = context
View Full Code Here

    }
  }

  @Test
  public void echoEndpoint() throws Exception {
    ConfigurableApplicationContext context = new SpringApplicationBuilder(
        ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
        .properties("websocket.uri:ws://localhost:" + PORT + "/ws/echo/websocket")
        .run("--spring.main.web_environment=false");
    long count = context.getBean(ClientConfiguration.class).latch.getCount();
    AtomicReference<String> messagePayloadReference = context
View Full Code Here

    assertEquals("Did you say \"Hello world!\"?", messagePayloadReference.get());
  }

  @Test
  public void reverseEndpoint() throws Exception {
    ConfigurableApplicationContext context = new SpringApplicationBuilder(
        ClientConfiguration.class, PropertyPlaceholderAutoConfiguration.class)
        .properties("websocket.uri:ws://localhost:" + PORT + "/ws/reverse").run(
            "--spring.main.web_environment=false");
    long count = context.getBean(ClientConfiguration.class).latch.getCount();
    AtomicReference<String> messagePayloadReference = context
View Full Code Here

    return application.sources(SampleJerseyApplication.class);
  }

  public static void main(String[] args) {
    new SampleJerseyApplication().configure(
        new SpringApplicationBuilder(SampleJerseyApplication.class)).run(args);
  }
View Full Code Here

@SpringBootApplication
@EnableConfigurationProperties(ServiceProperties.class)
public class SampleParentContextApplication {

  public static void main(String[] args) throws Exception {
    new SpringApplicationBuilder(Parent.class).child(
        SampleParentContextApplication.class).run(args);
  }
View Full Code Here

  @Configuration
  @MinimalWebConfiguration
  protected static class ChildConfiguration {
    // For manual testing
    public static void main(String[] args) {
      new SpringApplicationBuilder(ParentConfiguration.class).child(
          ChildConfiguration.class).run(args);
    }
View Full Code Here

      container.addErrorPages(new ErrorPage("/spring/error"));
    }

    // For manual testing
    public static void main(String[] args) {
      new SpringApplicationBuilder(TestConfiguration.class).properties(
          "server.servletPath:spring/*").run(args);
    }
 
View Full Code Here

    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
  }

  @Test
  public void errorPageAvailableWithParentContext() throws Exception {
    setup((ConfigurableWebApplicationContext) new SpringApplicationBuilder(
        ParentConfiguration.class).child(ChildConfiguration.class).run(
        "--server.port=0"));
    MvcResult response = this.mockMvc
        .perform(get("/error").accept(MediaType.TEXT_HTML))
        .andExpect(status().isOk()).andReturn();
View Full Code Here

    ApplicationContextTestUtils.closeAll(this.context);
  }

  @Test
  public void shutdownChild() throws Exception {
    this.context = new SpringApplicationBuilder(Config.class).child(Empty.class)
        .web(false).run();
    CountDownLatch latch = this.context.getBean(Config.class).latch;
    assertThat((String) getEndpointBean().invoke().get("message"),
        startsWith("Shutting down"));
    assertTrue(this.context.isActive());
View Full Code Here

TOP

Related Classes of org.springframework.boot.builder.SpringApplicationBuilder

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.