Search in sources :

Example 16 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project cas by apereo.

the class CasWebApplication method main.

/**
     * Main entry point of the CAS web application.
     *
     * @param args the args
     */
public static void main(final String[] args) {
    final Map<String, Object> properties = CasEmbeddedContainerUtils.getRuntimeProperties(Boolean.TRUE);
    final Banner banner = CasEmbeddedContainerUtils.getCasBannerInstance();
    new SpringApplicationBuilder(CasWebApplication.class).banner(banner).properties(properties).logStartupInfo(true).run(args);
}
Also used : Banner(org.springframework.boot.Banner) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 17 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project ratpack by ratpack.

the class Spring method spring.

/**
   *  Creates a registry backed by the given Spring Boot application class.
   *
   * @param clazz a Spring Boot application class
   * @param args any arguments to pass to the application
   * @return a registry that retrieves objects from the given application's bean factory
   * @see #spring(org.springframework.beans.factory.ListableBeanFactory)
   */
public static Registry spring(Class<?> clazz, String... args) {
    SpringApplicationBuilder springApplicationBuilder = new SpringApplicationBuilder(clazz);
    springApplicationBuilder.main(clazz);
    return spring(springApplicationBuilder, args);
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 18 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project spring-boot by spring-projects.

the class SpringApplicationHierarchyTests method testParent.

@Test
public void testParent() {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Child.class);
    builder.properties("flyway.enabled=false", "liquibase.enabled=false");
    builder.parent(Parent.class);
    this.context = builder.run("--server.port=0");
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) Test(org.junit.Test)

Example 19 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project spring-boot by spring-projects.

the class SpringApplicationHierarchyTests method testChild.

@Test
public void testChild() {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Parent.class);
    builder.properties("flyway.enabled=false", "liquibase.enabled=false");
    builder.child(Child.class);
    this.context = builder.run("--server.port=0");
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) Test(org.junit.Test)

Example 20 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project spring-boot by spring-projects.

the class SampleWebSocketsApplicationTests method reverseEndpoint.

@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.getBean(ClientConfiguration.class).messagePayload;
    context.close();
    assertThat(count).isEqualTo(0);
    assertThat(messagePayloadReference.get()).isEqualTo("Reversed: !dlrow olleH");
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

SpringApplicationBuilder (org.springframework.boot.builder.SpringApplicationBuilder)36 Test (org.junit.Test)32 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)17 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)13 DefaultTokenServices (org.springframework.security.oauth2.provider.token.DefaultTokenServices)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 URI (java.net.URI)1 RoutesCollector (org.apache.camel.spring.boot.RoutesCollector)1 Logger (org.slf4j.Logger)1 BeanDefinition (org.springframework.beans.factory.config.BeanDefinition)1 BeanDefinitionRegistry (org.springframework.beans.factory.support.BeanDefinitionRegistry)1 Banner (org.springframework.boot.Banner)1 SpringApplication (org.springframework.boot.SpringApplication)1 JmxAutoConfiguration (org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration)1 ParentContextApplicationContextInitializer (org.springframework.boot.builder.ParentContextApplicationContextInitializer)1 ApplicationStartingEvent (org.springframework.boot.context.event.ApplicationStartingEvent)1 ServerPortInfoApplicationContextInitializer (org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer)1 AnnotationConfigServletWebServerApplicationContext (org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext)1 ApplicationContext (org.springframework.context.ApplicationContext)1 ApplicationListener (org.springframework.context.ApplicationListener)1