Search in sources :

Example 51 with SpringApplicationBuilder

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

the class ConsulDiscoveryClientAclTests method getInstancesForSecondServiceWorks.

@Test
public void getInstancesForSecondServiceWorks() throws Exception {
    new SpringApplicationBuilder(MyTestConfig.class).run("--spring.application.name=testSecondServiceAcl", "--server.port=0", "--spring.cloud.consul.discovery.preferIpAddress=true", "--consul.token=2d2e6b3b-1c82-40ab-8171-54609d8ad304");
    List<ServiceInstance> instances = discoveryClient.getInstances("testSecondServiceAcl");
    assertNotNull("second service instances was null", instances);
    assertFalse("second service instances was empty", instances.isEmpty());
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) ServiceInstance(org.springframework.cloud.client.ServiceInstance) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 52 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project x-pipe by ctripcorp.

the class AppTest method start.

private void start() throws Exception {
    ConfigurableApplicationContext context = new SpringApplicationBuilder(AppTest.class).run();
    initComponentRegistry(context);
    waitForAnyKeyToExit();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 53 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project goci by EBISPOT.

the class SolrIndexerApplication method main.

public static void main(String[] args) {
    System.out.println("Starting Solr indexing application...");
    ApplicationContext ctx = new SpringApplicationBuilder(SolrIndexerApplication.class).web(false).run(args);
    // ApplicationContext ctx = SpringApplicationBuilder.run(SolrIndexerApplication.class, args);
    System.out.println("Application executed successfully!");
    SpringApplication.exit(ctx);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 54 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project goci by EBISPOT.

the class MappingApplication method main.

public static void main(String... args) {
    String filename = "gwas_mapper.night.";
    System.setProperty("logfilename", filename);
    System.out.println("Starting mapping service...");
    SpringApplicationBuilder builder = new SpringApplicationBuilder(MappingApplication.class);
    SpringApplication app = builder.web(false).addCommandLineProperties(true).build(args);
    ApplicationContext ctx = app.run(args);
    System.out.println("Application executed successfully!");
    int code = app.exit(ctx);
    if (code > 0) {
        System.exit(code);
    }
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) SpringApplication(org.springframework.boot.SpringApplication) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Example 55 with SpringApplicationBuilder

use of org.springframework.boot.builder.SpringApplicationBuilder in project goci by EBISPOT.

the class DiagramGenerator method main.

public static void main(String[] args) {
    System.out.println("Starting diagram generator...");
    SpringApplicationBuilder builder = new SpringApplicationBuilder(DiagramGenerator.class);
    SpringApplication app = builder.web(false).addCommandLineProperties(true).build(args);
    ApplicationContext ctx = app.run(args);
    System.out.println("Application executed successfully!");
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) SpringApplication(org.springframework.boot.SpringApplication) 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