Here are the examples of the java api org.springframework.boot.SpringApplication.setWebApplicationType() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
92 Examples
19
View Source File : DevToolPropertiesIntegrationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void postProcessEnablesIncludeStackTraceProperty() {
SpringApplication application = new SpringApplication(TestConfiguration.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
ConfigurableEnvironment environment = this.context.getEnvironment();
String property = environment.getProperty("server.error.include-stacktrace");
replacedertThat(property).isEqualTo(ErrorProperties.IncludeStacktrace.ALWAYS.toString());
}
19
View Source File : DevToolPropertiesIntegrationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void postProcessWhenRestarterDisabledAndRemoteSecretNotSetShouldNotAddPropertySource() {
Restarter.clearInstance();
Restarter.disable();
SpringApplication application = new SpringApplication(BeanConditionConfiguration.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
replacedertThatExceptionOfType(NoSuchBeanDefinitionException.clreplaced).isThrownBy(() -> this.context.getBean(MyBean.clreplaced));
}
19
View Source File : DevToolPropertiesIntegrationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void clreplacedPropertyConditionIsAffectedByDevToolProperties() {
SpringApplication application = new SpringApplication(ClreplacedConditionConfiguration.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
this.context.getBean(ClreplacedConditionConfiguration.clreplaced);
}
19
View Source File : DevToolPropertiesIntegrationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void beanMethodPropertyConditionIsAffectedByDevToolProperties() {
SpringApplication application = new SpringApplication(BeanConditionConfiguration.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
this.context.getBean(MyBean.clreplaced);
}
19
View Source File : LiquibaseServiceLocatorApplicationListenerTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void replaceServiceLocatorBacksOffIfNotPresent() throws IllegalAccessException {
SpringApplication application = new SpringApplication(Conf.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
resourceLoader.setClreplacedLoader(new ClreplacedHidingClreplacedLoader(CustomResolverServiceLocator.clreplaced));
application.setResourceLoader(resourceLoader);
this.context = application.run();
Object resolver = getClreplacedResolver();
replacedertThat(resolver).isInstanceOf(DefaultPackageScanClreplacedResolver.clreplaced);
}
19
View Source File : LiquibaseServiceLocatorApplicationListenerTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void replacesServiceLocator() throws IllegalAccessException {
SpringApplication application = new SpringApplication(Conf.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
Object resolver = getClreplacedResolver();
replacedertThat(resolver).isInstanceOf(SpringPackageScanClreplacedResolver.clreplaced);
}
19
View Source File : AnsiOutputApplicationListenerTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void disabled() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
Map<String, Object> props = new HashMap<>();
props.put("spring.output.ansi.enabled", "never");
application.setDefaultProperties(props);
this.context = application.run();
replacedertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.NEVER);
}
19
View Source File : AnsiOutputApplicationListenerTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void enabled() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
Map<String, Object> props = new HashMap<>();
props.put("spring.output.ansi.enabled", "ALWAYS");
application.setDefaultProperties(props);
this.context = application.run();
replacedertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.ALWAYS);
}
19
View Source File : AbstractSpringFunctionAdapterInitializer.java
License : Apache License 2.0
Project Creator : spring-cloud
License : Apache License 2.0
Project Creator : spring-cloud
private SpringApplication springApplication() {
Clreplaced<?> sourceClreplaced = this.configurationClreplaced;
SpringApplication application = new org.springframework.cloud.function.context.FunctionalSpringApplication(sourceClreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
return application;
}
19
View Source File : SofaServiceAndReferenceTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
@Test
public void testMultiSofaServiceWithSameInterfaceAndUniqueId() throws IOException {
String logRootPath = StringUtils.hasText(System.getProperty("logging.path")) ? System.getProperty("logging.path") : "./logs";
File sofaLog = new File(logRootPath + File.separator + "sofa-runtime" + File.separator + "common-error.log");
FileUtils.write(sofaLog, "", System.getProperty("file.encoding"));
Map<String, Object> properties = new HashMap<>();
properties.put("spring.application.name", "SofaServiceAndReferenceTest");
properties.put("logging.path", logRootPath);
SpringApplication springApplication = new SpringApplication(TestSofaServiceConfiguration.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.setDefaultProperties(properties);
springApplication.run();
String content = FileUtils.readFileToString(sofaLog, System.getProperty("file.encoding"));
replacedert.replacedertTrue(content.contains("SofaService was already registered: " + SofaBeanNameGenerator.generateSofaServiceBeanName(SampleService.clreplaced, "")));
}
19
View Source File : SofaServiceAndReferenceTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
@Test
public void testSofaReferenceOnMethodParameter() {
Map<String, Object> properties = new HashMap<>();
properties.put("spring.application.name", "SofaServiceAndReferenceTest");
Throwable throwable = null;
try {
SpringApplication springApplication = new SpringApplication(TestSofaReferenceConfiguration.clreplaced, RuntimeConfiguration.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.setDefaultProperties(properties);
springApplication.run();
} catch (Throwable t) {
throwable = t;
replacedert.replacedertEquals("Only jvm type of @SofaReference on parameter is supported.", t.getMessage());
}
replacedert.replacedertNotNull(throwable);
}
19
View Source File : SofaServiceAndReferenceTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
@Test
public void testMultiSofaServiceFactoryMethod() {
Map<String, Object> properties = new HashMap<>();
properties.put("spring.application.name", "SofaServiceAndReferenceTest");
SpringApplication springApplication = new SpringApplication(MultiSofaServiceConfiguration.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.setDefaultProperties(properties);
springApplication.run();
}
19
View Source File : HealthIndicatorCheckProcessorTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
private void initApplicationContext(boolean health) {
Map<String, Object> properties = new LinkedHashMap<>();
properties.put("disk-health-indicator.health", health);
properties.put("spring.application.name", "HealthIndicatorCheckProcessorTest");
SpringApplication springApplication = new SpringApplication(HealthIndicatorConfiguration.clreplaced);
springApplication.setDefaultProperties(properties);
springApplication.setWebApplicationType(WebApplicationType.NONE);
applicationContext = springApplication.run();
}
19
View Source File : HealthCheckConfigurationTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
private void initApplicationContext(Map<String, Object> properties, Clreplaced configuration) {
properties.put("spring.application.name", "HealthCheckConfigurationTest");
SpringApplication springApplication = new SpringApplication(configuration);
springApplication.setDefaultProperties(properties);
springApplication.setWebApplicationType(WebApplicationType.NONE);
applicationContext = springApplication.run();
}
19
View Source File : FlowableDefaultPropertiesEnvironmentPostProcessorTest.java
License : Apache License 2.0
Project Creator : flowable
License : Apache License 2.0
Project Creator : flowable
@Test
public void flowableDefaultPropertiesAreBeforeApplicationDefaultProperties() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
Map<String, Object> defaultProperties = new HashMap<>();
defaultProperties.put("foobar", "from-default-properties");
application.setDefaultProperties(defaultProperties);
context = application.run();
ConfigurableEnvironment environment = context.getEnvironment();
replacedertThat(environment.getPropertySources()).extracting(PropertySource::getName).containsExactly("configurationProperties", "systemProperties", "systemEnvironment", "random", "Config resource 'clreplaced path resource [application.properties]' via location 'optional:clreplacedpath:/'", "Config resource 'clreplaced path resource [application.yml]' via location 'optional:clreplacedpath:/'", "flowableDefaultConfig: [clreplacedpath:/flowable-default.properties]", "flowableDefaultConfig: [clreplacedpath:/flowable-default.yml]", "flowable-liquibase-override", "defaultProperties");
replacedertThat(environment.getProperty("foo")).isEqualTo("from-flowable-default-properties");
replacedertThat(environment.getProperty("bar")).isEqualTo("from-flowable-default-yaml");
replacedertThat(environment.getProperty("baz")).isEqualTo("from-application-properties");
replacedertThat(environment.getProperty("qux")).isEqualTo("from-application-yaml");
}
19
View Source File : FlowableDefaultPropertiesEnvironmentPostProcessorTest.java
License : Apache License 2.0
Project Creator : flowable
License : Apache License 2.0
Project Creator : flowable
@Test
public void flowableDefaultPropertiesAreBeLoaded() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
context = application.run();
ConfigurableEnvironment environment = context.getEnvironment();
replacedertThat(environment.getPropertySources()).extracting(PropertySource::getName).containsExactly("configurationProperties", "systemProperties", "systemEnvironment", "random", "Config resource 'clreplaced path resource [application.properties]' via location 'optional:clreplacedpath:/'", "Config resource 'clreplaced path resource [application.yml]' via location 'optional:clreplacedpath:/'", "flowableDefaultConfig: [clreplacedpath:/flowable-default.properties]", "flowableDefaultConfig: [clreplacedpath:/flowable-default.yml]", "flowable-liquibase-override");
replacedertThat(environment.getProperty("foo")).isEqualTo("from-flowable-default-properties");
replacedertThat(environment.getProperty("bar")).isEqualTo("from-flowable-default-yaml");
replacedertThat(environment.getProperty("baz")).isEqualTo("from-application-properties");
replacedertThat(environment.getProperty("qux")).isEqualTo("from-application-yaml");
}
19
View Source File : SpringBootBatchCommandLine.java
License : Apache License 2.0
Project Creator : devonfw
License : Apache License 2.0
Project Creator : devonfw
/**
* Initialize the application context and execute the operation.
* <p>
* The application context is closed after the operation has finished.
*
* @param operation The operation to start.
* @param configuration The sources of app context configuration.
* @param jobName The name of the job to launch/stop.
* @param parameters The parameters (key=value).
* @throws Exception in case of an error.
*/
public void execute(Operation operation, String configuration, String jobName, List<String> parameters) throws Exception {
SpringApplication app = new SpringApplication(Clreplaced.forName(configuration));
// no (web) server needed
app.setWebApplicationType(WebApplicationType.NONE);
// start the application
ConfigurableApplicationContext ctx = app.run(new String[0]);
// start injection for properties of this clreplaced (here), by manually invoking autowiring for the new context.
ctx.getAutowireCapableBeanFactory().autowireBeanProperties(this, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, false);
switch(operation) {
case START:
startBatch(ctx, jobName, parameters);
break;
case STOP:
stopBatch(ctx, jobName);
break;
default:
throw new RuntimeException("Unknown operation: " + operation);
}
}
19
View Source File : FamousMatchApplication.java
License : MIT License
Project Creator : AwakenCN
License : MIT License
Project Creator : AwakenCN
public static void main(String[] args) {
SpringApplication application = new SpringApplication(FamousMatchApplication.clreplaced);
// application.addListeners(new SchedulerConfig());
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);
}
19
View Source File : FamousBattleApplication.java
License : MIT License
Project Creator : AwakenCN
License : MIT License
Project Creator : AwakenCN
public static void main(String[] args) {
SpringApplication application = new SpringApplication(FamousBattleApplication.clreplaced);
// application.addListeners(new SchedulerConfig());
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);
}
18
View Source File : RestartScopeInitializerTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
private ConfigurableApplicationContext runApplication() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
return application.run();
}
18
View Source File : DevToolPropertiesIntegrationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void postProcessWhenRestarterDisabledAndRemoteSecretSetShouldAddPropertySource() {
Restarter.clearInstance();
Restarter.disable();
SpringApplication application = new SpringApplication(BeanConditionConfiguration.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
application.setDefaultProperties(Collections.singletonMap("spring.devtools.remote.secret", "donttell"));
this.context = application.run();
this.context.getBean(MyBean.clreplaced);
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileCascadingOverrideProfilesA() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=cascadingprofiles";
this.context = application.run(configName, "--spring.profiles.active=A");
replacedertVersionProperty(this.context, "E", "A", "C", "E");
replacedertThat(this.context.getEnvironment().getProperty("not-a")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-b")).isEqualTo("true");
replacedertThat(this.context.getEnvironment().getProperty("not-c")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-d")).isEqualTo("true");
replacedertThat(this.context.getEnvironment().getProperty("not-e")).isNull();
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileNegationLocalActiveProfiles() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=profilenegation-local-active-profiles";
this.context = application.run(configName);
replacedertVersionProperty(this.context, "NOT A", "B");
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileNegationOverrideLocalActiveProfiles() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=profilenegation-local-active-profiles";
this.context = application.run(configName, "--spring.profiles.active=C,A");
replacedertVersionProperty(this.context, null, "C", "A");
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileNegationWithActiveProfile() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=profilenegation";
this.context = application.run(configName, "--spring.profiles.active=C,A");
replacedertVersionProperty(this.context, null, "C", "A");
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileCascadingMultipleActiveProfilesViaPropertiesShouldPreserveOrder() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=cascadingprofiles";
this.context = application.run(configName, "--spring.profiles.active=A,B");
replacedertVersionProperty(this.context, "D", "A", "C", "E", "B", "D");
replacedertThat(this.context.getEnvironment().getProperty("not-a")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-b")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-c")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-d")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-e")).isNull();
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileCascading() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=cascadingprofiles";
this.context = application.run(configName);
replacedertVersionProperty(this.context, "D", "A", "C", "E", "B", "D");
replacedertThat(this.context.getEnvironment().getProperty("not-a")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-b")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-c")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-d")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-e")).isNull();
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileNegationWithProfileSpecificFile() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=profilenegation";
this.context = application.run(configName, "--spring.profiles.active=C,B");
replacedertVersionProperty(this.context, "NOT A", "C", "B");
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileCascadingOverrideProfilesB() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=cascadingprofiles";
this.context = application.run(configName, "--spring.profiles.active=B");
replacedertVersionProperty(this.context, "E", "B", "D", "E");
replacedertThat(this.context.getEnvironment().getProperty("not-a")).isEqualTo("true");
replacedertThat(this.context.getEnvironment().getProperty("not-b")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-c")).isEqualTo("true");
replacedertThat(this.context.getEnvironment().getProperty("not-d")).isNull();
replacedertThat(this.context.getEnvironment().getProperty("not-e")).isNull();
}
18
View Source File : ConfigFileApplicationListenerYamlProfileNegationTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void yamlProfileNegationDefaultProfile() {
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
String configName = "--spring.config.name=profilenegation";
this.context = application.run(configName);
replacedertVersionProperty(this.context, "NOT A");
}
18
View Source File : AnsiOutputApplicationListenerTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void disabledViaApplicationProperties() {
ConfigurableEnvironment environment = new StandardEnvironment();
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(environment, "spring.config.name=ansi");
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setEnvironment(environment);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
replacedertThat(AnsiOutputEnabledValue.get()).isEqualTo(Enabled.NEVER);
}
18
View Source File : SpringApplicationAdminMXBeanRegistrarTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void shutdownApp() throws InstanceNotFoundException {
final ObjectName objectName = createObjectName(OBJECT_NAME);
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
replacedertThat(this.context.isRunning()).isTrue();
invokeShutdown(objectName);
replacedertThat(this.context.isRunning()).isFalse();
// JMX cleanup
replacedertThatExceptionOfType(InstanceNotFoundException.clreplaced).isThrownBy(() -> this.mBeanServer.getObjectInstance(objectName));
}
18
View Source File : SpringApplicationAdminMXBeanRegistrarTests.java
License : Apache License 2.0
Project Creator : yuanmabiji
License : Apache License 2.0
Project Creator : yuanmabiji
@Test
public void environmentIsExposed() {
final ObjectName objectName = createObjectName(OBJECT_NAME);
SpringApplication application = new SpringApplication(Config.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run("--foo.bar=blam");
replacedertThat(isApplicationReady(objectName)).isTrue();
replacedertThat(isApplicationEmbeddedWebApplication(objectName)).isFalse();
replacedertThat(getProperty(objectName, "foo.bar")).isEqualTo("blam");
replacedertThat(getProperty(objectName, "does.not.exist.test")).isNull();
}
18
View Source File : WebfluxTemplateApplication.java
License : MIT License
Project Creator : TransEmpiric
License : MIT License
Project Creator : TransEmpiric
public static void main(String[] args) {
SpringApplication app = new SpringApplication(WebfluxTemplateApplication.clreplaced);
app.setWebApplicationType(WebApplicationType.REACTIVE);
app.run(args);
}
18
View Source File : TccCoordinatorExampleApplication.java
License : Apache License 2.0
Project Creator : SpringCloud
License : Apache License 2.0
Project Creator : SpringCloud
public static void main(String[] args) {
// SpringApplication.run(TccCoordinatorExampleApplication.clreplaced, args);
SpringApplication app = new SpringApplication(TccCoordinatorExampleApplication.clreplaced);
app.setWebApplicationType(WebApplicationType.NONE);
app.run(args);
}
18
View Source File : SagaServicecombExampleApplication.java
License : Apache License 2.0
Project Creator : SpringCloud
License : Apache License 2.0
Project Creator : SpringCloud
public static void main(String[] args) {
SpringApplication app = new SpringApplication(SagaServicecombExampleApplication.clreplaced);
app.setWebApplicationType(WebApplicationType.SERVLET);
app.run(args);
}
18
View Source File : ElasticsearchApplication.java
License : Apache License 2.0
Project Creator : spring-projects-experimental
License : Apache License 2.0
Project Creator : spring-projects-experimental
public static void main(String[] args) throws Exception {
SpringApplication app = new SpringApplication(ElasticsearchApplication.clreplaced);
app.setWebApplicationType(WebApplicationType.NONE);
app.run();
// To be able to measure memory consumption
Thread.currentThread().join();
}
18
View Source File : ReleaserApplication.java
License : Apache License 2.0
Project Creator : spring-cloud
License : Apache License 2.0
Project Creator : spring-cloud
public static void main(String[] args) {
SpringApplication application = new SpringApplication(ReleaserApplication.clreplaced);
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);
}
18
View Source File : SofaServiceAndReferenceTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
@Test
public void testSofaServiceWithMultipleBindings() {
Map<String, Object> properties = new HashMap<>();
properties.put("spring.application.name", "SofaServiceAndReferenceTest");
SpringApplication springApplication = new SpringApplication(MultipleBindingsSofaServiceConfiguration.clreplaced, RuntimeConfiguration.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.setDefaultProperties(properties);
ApplicationContext ctx = springApplication.run();
ServiceFactoryBean bean = ctx.getBean(ServiceFactoryBean.clreplaced);
replacedert.replacedertEquals(2, bean.getBindings().size());
replacedert.replacedertEquals(new BindingType("jvm"), bean.getBindings().get(0).getBindingType());
replacedert.replacedertEquals(new BindingType("jvm"), bean.getBindings().get(1).getBindingType());
}
18
View Source File : SofaServiceAndReferenceTest.java
License : Apache License 2.0
Project Creator : sofastack
License : Apache License 2.0
Project Creator : sofastack
@Test
public void testSofaReferenceOnStaticField() throws IOException, NoSuchFieldException {
String logRootPath = StringUtils.hasText(System.getProperty("logging.path")) ? System.getProperty("logging.path") : "./logs";
File sofaLog = new File(logRootPath + File.separator + "sofa-runtime" + File.separator + "sofa-default.log");
FileUtils.write(sofaLog, "", System.getProperty("file.encoding"));
Map<String, Object> properties = new HashMap<>();
properties.put("spring.application.name", "SofaServiceAndReferenceTest");
properties.put("logging.path", logRootPath);
SpringApplication springApplication = new SpringApplication(TestSofaReferenceOnMethodConfiguration.clreplaced, RuntimeConfiguration.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.setDefaultProperties(properties);
springApplication.run();
SampleService staticSampleService = SofaServiceAndReferenceTest.getStaticSampleService();
replacedert.replacedertNull(staticSampleService);
String content = FileUtils.readFileToString(sofaLog, System.getProperty("file.encoding"));
replacedert.replacedertTrue(content.contains("SofaReference annotation is not supported on static fields: " + SofaServiceAndReferenceTest.clreplaced.getDeclaredField("staticSampleService")));
}
18
View Source File : GraalDemoApplication.java
License : Apache License 2.0
Project Creator : sdeleuze
License : Apache License 2.0
Project Creator : sdeleuze
public static void main(String[] args) {
SpringApplication application = new SpringApplication(GraalDemoApplication.clreplaced) {
@Override
protected void load(ApplicationContext context, Object[] sources) {
// Disable the annotation bean definition reader because of https://github.com/oracle/graal/issues/630
}
};
application.setWebApplicationType(WebApplicationType.REACTIVE);
application.setApplicationContextClreplaced(ReactiveWebServerApplicationContext.clreplaced);
// Only functional registration is supported by now because of https://github.com/oracle/graal/issues/630
application.addInitializers((GenericApplicationContext context) -> {
context.registerBean(AutowiredAnnotationBeanPostProcessor.clreplaced);
context.registerBean(HttpHandler.clreplaced, () -> {
HandlerStrategies strategies = HandlerStrategies.withDefaults();
RouterFunction<ServerResponse> router = RouterFunctions.route(RequestPredicates.GET("/"), serverRequest -> ServerResponse.ok().syncBody("Hello Graal"));
return RouterFunctions.toHttpHandler(router, strategies);
});
context.registerBean(ReactiveWebServerFactory.clreplaced, () -> new NettyReactiveWebServerFactory());
});
application.run(args);
}
18
View Source File : WebFluxApplication.java
License : Apache License 2.0
Project Creator : IBM
License : Apache License 2.0
Project Creator : IBM
public static void main(String[] args) {
SpringApplication app = new SpringApplication(WebFluxApplication.clreplaced);
// prevent SpringBoot from starting a web server
app.setWebApplicationType(WebApplicationType.NONE);
app.run(args);
}
18
View Source File : KafkaStreamsApp.java
License : MIT License
Project Creator : gAmUssA
License : MIT License
Project Creator : gAmUssA
public static void main(String[] args) {
final SpringApplication application = new SpringApplication(KafkaStreamsApp.clreplaced);
// we don't need web/rest interface in this app
// but CF has default health check that will hit http port
// https://docs.cloudfoundry.org/devguide/deploy-apps/healthchecks.html#understand-healthchecks
application.setWebApplicationType(WebApplicationType.SERVLET);
application.run(args);
}
18
View Source File : LayuiAdminStartUp.java
License : MIT License
Project Creator : gameloft9
License : MIT License
Project Creator : gameloft9
public static void main(String[] args) {
SpringApplication app = new SpringApplication(LayuiAdminStartUp.clreplaced);
app.setBannerMode(Banner.Mode.OFF);
app.setWebApplicationType(WebApplicationType.SERVLET);
Set<String> sources = new HashSet<String>();
sources.add("clreplacedpath:applicationContext.xml");
app.setSources(sources);
app.run(args);
}
18
View Source File : ScooldServer.java
License : Apache License 2.0
Project Creator : Erudika
License : Apache License 2.0
Project Creator : Erudika
public static void main(String[] args) {
SpringApplication app = new SpringApplication(ScooldServer.clreplaced);
initConfig();
app.setAdditionalProfiles(Config.ENVIRONMENT);
app.setWebApplicationType(WebApplicationType.SERVLET);
app.run(args);
}
18
View Source File : SofaHmilyInventoryApplication.java
License : Apache License 2.0
Project Creator : dromara
License : Apache License 2.0
Project Creator : dromara
/**
* main.
*
* @param args args.
*/
public static void main(final String[] args) {
SpringApplication springApplication = new SpringApplication(SofaHmilyInventoryApplication.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.run(args);
}
18
View Source File : SofaHmilyAccountApplication.java
License : Apache License 2.0
Project Creator : dromara
License : Apache License 2.0
Project Creator : dromara
/**
* The entry point of application.
*
* @param args the input arguments
*/
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(SofaHmilyAccountApplication.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.run(args);
}
18
View Source File : DubboHmilyInventoryApplication.java
License : Apache License 2.0
Project Creator : dromara
License : Apache License 2.0
Project Creator : dromara
/**
* main.
*
* @param args args
*/
public static void main(final String[] args) {
SpringApplication springApplication = new SpringApplication(DubboHmilyInventoryApplication.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.run(args);
}
18
View Source File : DubboHmilyAccountApplication.java
License : Apache License 2.0
Project Creator : dromara
License : Apache License 2.0
Project Creator : dromara
/**
* main.
*
* @param args args.
*/
public static void main(final String[] args) {
SpringApplication springApplication = new SpringApplication(DubboHmilyAccountApplication.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.run(args);
}
18
View Source File : BrpcHmilyInventoryApplication.java
License : Apache License 2.0
Project Creator : dromara
License : Apache License 2.0
Project Creator : dromara
/**
* main.
*
* @param args args
*/
public static void main(final String[] args) {
SpringApplication springApplication = new SpringApplication(BrpcHmilyInventoryApplication.clreplaced);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication.run(args);
synchronized (BrpcHmilyInventoryApplication.clreplaced) {
try {
BrpcHmilyInventoryApplication.clreplaced.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
See More Examples