Search in sources :

Example 71 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project java-chassis by ServiceComb.

the class TestClientApplication method main.

public static void main(String[] args) throws Exception {
    try {
        new SpringApplicationBuilder().web(WebApplicationType.NONE).sources(TestClientApplication.class).run(args);
        CategorizedTestCaseRunner.runCategorizedTestCase("consumer");
    } catch (Exception e) {
        TestMgr.failed("test case run failed", e);
        LOGGER.error("-------------- test failed -------------");
        LOGGER.error("", e);
        LOGGER.error("-------------- test failed -------------");
    }
    TestMgr.summary();
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 72 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project java-chassis by ServiceComb.

the class JaxrsServer method main.

public static void main(final String[] args) throws Exception {
    RestObjectMapperFactory.setDefaultRestObjectMapper(new RestObjectMapperWithStringMapper());
    RestObjectMapperFactory.setConsumerWriterMapper(new RestObjectMapperWithStringMapperNotWriteNull());
    new SpringApplicationBuilder().sources(JaxrsServer.class).web(WebApplicationType.NONE).build().run(args);
}
Also used : RestObjectMapperWithStringMapperNotWriteNull(org.apache.servicecomb.demo.RestObjectMapperWithStringMapperNotWriteNull) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) RestObjectMapperWithStringMapper(org.apache.servicecomb.demo.RestObjectMapperWithStringMapper)

Example 73 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project java-chassis by ServiceComb.

the class JaxrsClient method main.

public static void main(String[] args) throws Exception {
    RestObjectMapperFactory.setDefaultRestObjectMapper(new RestObjectMapperWithStringMapper());
    RestObjectMapperFactory.setConsumerWriterMapper(new RestObjectMapperWithStringMapperNotWriteNull());
    new SpringApplicationBuilder().sources(JaxrsClient.class).web(WebApplicationType.NONE).build().run(args);
    org.apache.servicecomb.demo.jaxrs.client.JaxrsClient.run();
    TestMgr.summary();
}
Also used : RestObjectMapperWithStringMapperNotWriteNull(org.apache.servicecomb.demo.RestObjectMapperWithStringMapperNotWriteNull) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) RestObjectMapperWithStringMapper(org.apache.servicecomb.demo.RestObjectMapperWithStringMapper)

Example 74 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project vft-capture by videofirst.

the class VfCapture method main.

public static void main(String[] args) {
    // Check to see if we're creating a password
    SecurityUtils.checkCreatePassword(args);
    // Create application
    SpringApplicationBuilder builder = new SpringApplicationBuilder(VfCapture.class);
    builder.headless(false).properties("spring.config.name:capture").run(args);
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 75 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project kylo by Teradata.

the class KyloUpgrader method upgrade.

public void upgrade() {
    System.setProperty(SpringApplication.BANNER_LOCATION_PROPERTY, "upgrade-banner.txt");
    ConfigurableApplicationContext upgradeCxt = new SpringApplicationBuilder(KyloUpgradeConfig.class).web(true).profiles(KYLO_UPGRADE).run();
    try {
        KyloUpgradeService upgradeService = upgradeCxt.getBean(KyloUpgradeService.class);
        // Keep upgrading until upgrade() returns true, i.e. we are up-to-date;
        while (!upgradeService.upgradeNext()) {
            ;
        }
    } finally {
        upgradeCxt.close();
    }
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Aggregations

SpringApplicationBuilder (org.springframework.boot.builder.SpringApplicationBuilder)319 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)170 Test (org.junit.Test)156 OutputDestination (org.springframework.cloud.stream.binder.test.OutputDestination)105 InputDestination (org.springframework.cloud.stream.binder.test.InputDestination)100 Test (org.junit.jupiter.api.Test)82 ApplicationContext (org.springframework.context.ApplicationContext)55 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)26 Environment (org.springframework.cloud.config.environment.Environment)19 Before (org.junit.Before)8 SpringApplication (org.springframework.boot.SpringApplication)8 Map (java.util.Map)7 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)7 ConsulClient (com.ecwid.consul.v1.ConsulClient)6 Message (org.springframework.messaging.Message)6 MessageHeaders (org.springframework.messaging.MessageHeaders)6 GenericMessage (org.springframework.messaging.support.GenericMessage)6 ArrayList (java.util.ArrayList)5 LinkedHashMap (java.util.LinkedHashMap)5 CountDownLatch (java.util.concurrent.CountDownLatch)5