Polish
This commit is contained in:
parent
aa3f0556dc
commit
beaddb2362
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2013 the original author or authors.
|
* Copyright 2013-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -26,8 +26,6 @@ import org.crsh.plugin.PluginLifeCycle;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.beans.MutablePropertyValues;
|
import org.springframework.beans.MutablePropertyValues;
|
||||||
import org.springframework.boot.actuate.autoconfigure.CrshAutoConfiguration;
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.ShellProperties;
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellProperties;
|
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellProperties;
|
||||||
import org.springframework.boot.actuate.autoconfigure.ShellProperties.JaasAuthenticationProperties;
|
import org.springframework.boot.actuate.autoconfigure.ShellProperties.JaasAuthenticationProperties;
|
||||||
import org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties;
|
import org.springframework.boot.actuate.autoconfigure.ShellProperties.KeyAuthenticationProperties;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -127,16 +127,16 @@ public class CodahaleMetricWriterTests {
|
||||||
public void run() {
|
public void run() {
|
||||||
for (int i = 0; i < 10000; i++) {
|
for (int i = 0; i < 10000; i++) {
|
||||||
try {
|
try {
|
||||||
Metric<Integer> metric1 = new Metric<Integer>(
|
Metric<Integer> metric1 = new Metric<Integer>("timer.test.service",
|
||||||
"timer.test.service", this.index);
|
this.index);
|
||||||
this.writer.set(metric1);
|
this.writer.set(metric1);
|
||||||
|
|
||||||
Metric<Integer> metric2 = new Metric<Integer>(
|
Metric<Integer> metric2 = new Metric<Integer>(
|
||||||
"histogram.test.service", this.index);
|
"histogram.test.service", this.index);
|
||||||
this.writer.set(metric2);
|
this.writer.set(metric2);
|
||||||
|
|
||||||
Metric<Integer> metric3 = new Metric<Integer>(
|
Metric<Integer> metric3 = new Metric<Integer>("gauge.test.service",
|
||||||
"gauge.test.service", this.index);
|
this.index);
|
||||||
this.writer.set(metric3);
|
this.writer.set(metric3);
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException iae) {
|
catch (IllegalArgumentException iae) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -33,8 +33,7 @@ import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} that configures the
|
* {@link EnableAutoConfiguration Auto-configuration} that configures the
|
||||||
* {@link ConfigurableEmbeddedServletContainer} from a {@link ServerProperties}
|
* {@link ConfigurableEmbeddedServletContainer} from a {@link ServerProperties} bean.
|
||||||
* bean.
|
|
||||||
*
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link JmsTemplateAutoConfiguration}.
|
* Tests for {@link JmsTemplateAutoConfiguration}.
|
||||||
*
|
*
|
||||||
* @author Greg Turnquist
|
* @author Greg Turnquist
|
||||||
*/
|
*/
|
||||||
public class JmsTemplateAutoConfigurationTests {
|
public class JmsTemplateAutoConfigurationTests {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -25,6 +25,8 @@ import org.springframework.data.mongodb.core.MongoTemplate;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Tests for {@link MongoAutoConfiguration}.
|
||||||
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*/
|
*/
|
||||||
public class MongoAutoConfigurationTests {
|
public class MongoAutoConfigurationTests {
|
||||||
|
|
|
@ -75,8 +75,10 @@ public class JarCommandIT {
|
||||||
assertThat(invocation.getErrorOutput(), equalTo(""));
|
assertThat(invocation.getErrorOutput(), equalTo(""));
|
||||||
assertThat(invocation.getStandardOutput(), containsString("Hello World!"));
|
assertThat(invocation.getStandardOutput(), containsString("Hello World!"));
|
||||||
assertThat(invocation.getStandardOutput(), containsString("/public/public.txt"));
|
assertThat(invocation.getStandardOutput(), containsString("/public/public.txt"));
|
||||||
assertThat(invocation.getStandardOutput(), containsString("/resources/resource.txt"));
|
assertThat(invocation.getStandardOutput(),
|
||||||
|
containsString("/resources/resource.txt"));
|
||||||
assertThat(invocation.getStandardOutput(), containsString("/static/static.txt"));
|
assertThat(invocation.getStandardOutput(), containsString("/static/static.txt"));
|
||||||
assertThat(invocation.getStandardOutput(), containsString("/templates/template.txt"));
|
assertThat(invocation.getStandardOutput(),
|
||||||
|
containsString("/templates/template.txt"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
package sample.actuator.log4j;
|
package sample.actuator.log4j;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -31,13 +29,15 @@ import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
import org.springframework.test.context.web.WebAppConfiguration;
|
import org.springframework.test.context.web.WebAppConfiguration;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic integration tests for service demo application.
|
* Basic integration tests for service demo application.
|
||||||
*
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
*/
|
*/
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@SpringApplicationConfiguration(classes=SampleActuatorApplication.class)
|
@SpringApplicationConfiguration(classes = SampleActuatorApplication.class)
|
||||||
@WebAppConfiguration
|
@WebAppConfiguration
|
||||||
@IntegrationTest
|
@IntegrationTest
|
||||||
@DirtiesContext
|
@DirtiesContext
|
||||||
|
|
|
@ -52,8 +52,8 @@ public class SampleWebSecureApplication extends WebMvcConfigurerAdapter {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
// Set user password to "password" for demo purposes only
|
// Set user password to "password" for demo purposes only
|
||||||
new SpringApplicationBuilder(SampleWebSecureApplication.class).properties("security.user.password=password").run(
|
new SpringApplicationBuilder(SampleWebSecureApplication.class).properties(
|
||||||
args);
|
"security.user.password=password").run(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,7 +68,8 @@ public class SpringBootPlugin implements Plugin<Project> {
|
||||||
enhanceRunTask(project);
|
enhanceRunTask(project);
|
||||||
addRunAppTask(project);
|
addRunAppTask(project);
|
||||||
if (project.getTasks().withType(JavaExec.class).isEmpty()) {
|
if (project.getTasks().withType(JavaExec.class).isEmpty()) {
|
||||||
// Add the ApplicationPlugin so that a JavaExec task is available (run) to enhance
|
// Add the ApplicationPlugin so that a JavaExec task is available (run) to
|
||||||
|
// enhance
|
||||||
project.getPlugins().apply(ApplicationPlugin.class);
|
project.getPlugins().apply(ApplicationPlugin.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +112,8 @@ public class SpringBootPlugin implements Plugin<Project> {
|
||||||
if (!project.getTasksByName("compileJava", false).isEmpty()) {
|
if (!project.getTasksByName("compileJava", false).isEmpty()) {
|
||||||
if (!project.getTasksByName("compileGroovy", false).isEmpty()) {
|
if (!project.getTasksByName("compileGroovy", false).isEmpty()) {
|
||||||
runJarTask.dependsOn("compileJava", "compileGroovy");
|
runJarTask.dependsOn("compileJava", "compileGroovy");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
runJarTask.dependsOn("compileJava");
|
runJarTask.dependsOn("compileJava");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -144,7 +144,8 @@ public class RelaxedPropertyResolver implements PropertyResolver {
|
||||||
Assert.isInstanceOf(ConfigurableEnvironment.class, this.resolver,
|
Assert.isInstanceOf(ConfigurableEnvironment.class, this.resolver,
|
||||||
"SubProperties not available.");
|
"SubProperties not available.");
|
||||||
ConfigurableEnvironment env = (ConfigurableEnvironment) this.resolver;
|
ConfigurableEnvironment env = (ConfigurableEnvironment) this.resolver;
|
||||||
return PropertySourceUtils.getSubProperties(env.getPropertySources(), this.prefix, keyPrefix);
|
return PropertySourceUtils.getSubProperties(env.getPropertySources(),
|
||||||
|
this.prefix, keyPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2013 the original author or authors.
|
* Copyright 2012-2014 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -62,8 +62,7 @@ public class EmbeddedServletContainerCustomizerBeanPostProcessor implements
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void postProcessBeforeInitialization(
|
private void postProcessBeforeInitialization(ConfigurableEmbeddedServletContainer bean) {
|
||||||
ConfigurableEmbeddedServletContainer bean) {
|
|
||||||
for (EmbeddedServletContainerCustomizer customizer : getCustomizers()) {
|
for (EmbeddedServletContainerCustomizer customizer : getCustomizers()) {
|
||||||
customizer.customize(bean);
|
customizer.customize(bean);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.springframework.boot.context.config;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
import org.junit.rules.ExpectedException;
|
||||||
import org.springframework.boot.context.config.DelegatingApplicationContextInitializer;
|
|
||||||
import org.springframework.boot.test.EnvironmentTestUtils;
|
import org.springframework.boot.test.EnvironmentTestUtils;
|
||||||
import org.springframework.context.ApplicationContextException;
|
import org.springframework.context.ApplicationContextException;
|
||||||
import org.springframework.context.ApplicationContextInitializer;
|
import org.springframework.context.ApplicationContextInitializer;
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
import org.junit.rules.ExpectedException;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.context.config.DelegatingApplicationListener;
|
|
||||||
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
|
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
|
||||||
import org.springframework.boot.test.EnvironmentTestUtils;
|
import org.springframework.boot.test.EnvironmentTestUtils;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class LogbackLoggingSystemTests {
|
||||||
this.loggingSystem.beforeInitialize();
|
this.loggingSystem.beforeInitialize();
|
||||||
ILoggerFactory factory = StaticLoggerBinder.getSingleton().getLoggerFactory();
|
ILoggerFactory factory = StaticLoggerBinder.getSingleton().getLoggerFactory();
|
||||||
LoggerContext context = (LoggerContext) factory;
|
LoggerContext context = (LoggerContext) factory;
|
||||||
Logger root = context.getLogger(Logger.ROOT_LOGGER_NAME);
|
Logger root = context.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
|
||||||
assertNotNull(root.getAppender("CONSOLE"));
|
assertNotNull(root.getAppender("CONSOLE"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue