Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
cf655945
Commit
cf655945
authored
Aug 09, 2013
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
7bea9dd9
Changes
37
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
49 additions
and
157 deletions
+49
-157
AuditEventRepository.java
...ingframework/boot/actuate/audit/AuditEventRepository.java
+0
-2
EndpointWebMvcChildContextConfiguration.java
...utoconfigure/EndpointWebMvcChildContextConfiguration.java
+0
-5
SecurityAutoConfiguration.java
...boot/actuate/autoconfigure/SecurityAutoConfiguration.java
+0
-4
DefaultGaugeService.java
...ngframework/boot/actuate/metrics/DefaultGaugeService.java
+1
-0
InMemoryMetricRepository.java
...mework/boot/actuate/metrics/InMemoryMetricRepository.java
+2
-1
MetricRepository.java
...pringframework/boot/actuate/metrics/MetricRepository.java
+0
-6
ErrorController.java
...org/springframework/boot/actuate/web/ErrorController.java
+3
-0
ErrorConfigurationTests.java
...framework/boot/actuate/fixme/ErrorConfigurationTests.java
+0
-39
AutoConfigureAfter.java
...pringframework/boot/autoconfigure/AutoConfigureAfter.java
+5
-0
AutoConfigureBefore.java
...ringframework/boot/autoconfigure/AutoConfigureBefore.java
+5
-0
BatchAutoConfiguration.java
...work/boot/autoconfigure/batch/BatchAutoConfiguration.java
+0
-1
SearchStrategy.java
...ramework/boot/autoconfigure/condition/SearchStrategy.java
+2
-0
AbstractDataSourceConfiguration.java
...t/autoconfigure/jdbc/AbstractDataSourceConfiguration.java
+0
-2
DataSourceAutoConfiguration.java
.../boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+0
-1
HibernateJpaAutoConfiguration.java
.../autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java
+0
-1
ReactorAutoConfiguration.java
.../boot/autoconfigure/reactor/ReactorAutoConfiguration.java
+4
-1
ThymeleafAutoConfiguration.java
...t/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
+1
-1
CreateCommand.java
...a/org/springframework/boot/cli/command/CreateCommand.java
+0
-57
RunCommand.java
...java/org/springframework/boot/cli/command/RunCommand.java
+0
-2
SpringMvcCompilerAutoConfiguration.java
...ler/autoconfigure/SpringMvcCompilerAutoConfiguration.java
+0
-6
SpringApplicationRunner.java
...ingframework/boot/cli/runner/SpringApplicationRunner.java
+0
-2
GroovyTemplate.java
...org/springframework/boot/cli/template/GroovyTemplate.java
+0
-2
MessageControllerWebTests.java
...ngframework/boot/sample/ui/MessageControllerWebTests.java
+2
-1
Repackager.java
...ava/org/springframework/boot/loader/tools/Repackager.java
+2
-2
LaunchedURLClassLoader.java
...g/springframework/boot/loader/LaunchedURLClassLoader.java
+0
-1
RandomAccessData.java
...rg/springframework/boot/loader/data/RandomAccessData.java
+0
-1
ExplodedArchiveTests.java
...org/springframework/boot/loader/ExplodedArchiveTests.java
+2
-2
RandomAccessJarFileTests.java
...ngframework/boot/loader/jar/RandomAccessJarFileTests.java
+2
-2
ServletListenerRegistrationBean.java
...oot/context/embedded/ServletListenerRegistrationBean.java
+2
-2
OverrideSourcesTests.java
...t/java/org/springframework/boot/OverrideSourcesTests.java
+3
-0
BindingPreparationTests.java
...rg/springframework/boot/bind/BindingPreparationTests.java
+0
-1
PropertySourcesPropertyValuesTests.java
...amework/boot/bind/PropertySourcesPropertyValuesTests.java
+1
-1
JacksonParserTests.java
...a/org/springframework/boot/config/JacksonParserTests.java
+0
-3
YamlJsonParserTests.java
.../org/springframework/boot/config/YamlJsonParserTests.java
+0
-4
YamlProcessorTests.java
...a/org/springframework/boot/config/YamlProcessorTests.java
+2
-2
YamlPropertiesFactoryBeanTests.java
...framework/boot/config/YamlPropertiesFactoryBeanTests.java
+0
-2
ServletListenerRegistrationBeanTests.java
...ontext/embedded/ServletListenerRegistrationBeanTests.java
+10
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventRepository.java
View file @
cf655945
...
@@ -28,7 +28,6 @@ public interface AuditEventRepository {
...
@@ -28,7 +28,6 @@ public interface AuditEventRepository {
/**
/**
* Find audit events relating to the specified principal since the time provided.
* Find audit events relating to the specified principal since the time provided.
*
* @param principal the principal name to search for
* @param principal the principal name to search for
* @param after timestamp of earliest result required
* @param after timestamp of earliest result required
* @return audit events relating to the principal
* @return audit events relating to the principal
...
@@ -37,7 +36,6 @@ public interface AuditEventRepository {
...
@@ -37,7 +36,6 @@ public interface AuditEventRepository {
/**
/**
* Log an event.
* Log an event.
*
* @param event the audit event to log
* @param event the audit event to log
*/
*/
void
add
(
AuditEvent
event
);
void
add
(
AuditEvent
event
);
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java
View file @
cf655945
...
@@ -55,7 +55,6 @@ public class EndpointWebMvcChildContextConfiguration implements
...
@@ -55,7 +55,6 @@ public class EndpointWebMvcChildContextConfiguration implements
factory
.
setPort
(
this
.
managementServerProperties
.
getPort
());
factory
.
setPort
(
this
.
managementServerProperties
.
getPort
());
factory
.
setAddress
(
this
.
managementServerProperties
.
getAddress
());
factory
.
setAddress
(
this
.
managementServerProperties
.
getAddress
());
factory
.
setContextPath
(
this
.
managementServerProperties
.
getContextPath
());
factory
.
setContextPath
(
this
.
managementServerProperties
.
getContextPath
());
// TODO: Disable sessions
}
}
@Bean
@Bean
...
@@ -86,10 +85,6 @@ public class EndpointWebMvcChildContextConfiguration implements
...
@@ -86,10 +85,6 @@ public class EndpointWebMvcChildContextConfiguration implements
@ConditionalOnBean
(
name
=
"springSecurityFilterChain"
,
search
=
SearchStrategy
.
PARENTS
)
@ConditionalOnBean
(
name
=
"springSecurityFilterChain"
,
search
=
SearchStrategy
.
PARENTS
)
public
static
class
EndpointWebMvcChildContextSecurityConfiguration
{
public
static
class
EndpointWebMvcChildContextSecurityConfiguration
{
// FIXME reuse of security filter here is not good. What if totally different
// security config is required. Perhaps we can just drop it on the management
// port?
@Bean
@Bean
public
Filter
springSecurityFilterChain
(
HierarchicalBeanFactory
beanFactory
)
{
public
Filter
springSecurityFilterChain
(
HierarchicalBeanFactory
beanFactory
)
{
BeanFactory
parent
=
beanFactory
.
getParentBeanFactory
();
BeanFactory
parent
=
beanFactory
.
getParentBeanFactory
();
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/SecurityAutoConfiguration.java
View file @
cf655945
...
@@ -152,7 +152,6 @@ public class SecurityAutoConfiguration {
...
@@ -152,7 +152,6 @@ public class SecurityAutoConfiguration {
list
.
add
(
path
);
list
.
add
(
path
);
}
}
}
}
// FIXME makes more sense to secure endpoints with a different role
list
.
addAll
(
Arrays
.
asList
(
getEndpointPaths
(
true
)));
list
.
addAll
(
Arrays
.
asList
(
getEndpointPaths
(
true
)));
return
list
.
toArray
(
new
String
[
list
.
size
()]);
return
list
.
toArray
(
new
String
[
list
.
size
()]);
}
}
...
@@ -178,9 +177,6 @@ public class SecurityAutoConfiguration {
...
@@ -178,9 +177,6 @@ public class SecurityAutoConfiguration {
return
NO_PATHS
;
return
NO_PATHS
;
}
}
// FIXME this will still open up paths on the server when a management port is
// being used.
List
<
Endpoint
<?>>
endpoints
=
this
.
endpointHandlerMapping
.
getEndpoints
();
List
<
Endpoint
<?>>
endpoints
=
this
.
endpointHandlerMapping
.
getEndpoints
();
List
<
String
>
paths
=
new
ArrayList
<
String
>(
endpoints
.
size
());
List
<
String
>
paths
=
new
ArrayList
<
String
>(
endpoints
.
size
());
for
(
Endpoint
<?>
endpoint
:
endpoints
)
{
for
(
Endpoint
<?>
endpoint
:
endpoints
)
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/DefaultGaugeService.java
View file @
cf655945
...
@@ -28,6 +28,7 @@ public class DefaultGaugeService implements GaugeService {
...
@@ -28,6 +28,7 @@ public class DefaultGaugeService implements GaugeService {
private
MetricRepository
metricRepository
;
private
MetricRepository
metricRepository
;
/**
/**
* Create a new {@link DefaultGaugeService} instance.
* @param counterRepository
* @param counterRepository
*/
*/
public
DefaultGaugeService
(
MetricRepository
counterRepository
)
{
public
DefaultGaugeService
(
MetricRepository
counterRepository
)
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/InMemoryMetricRepository.java
View file @
cf655945
...
@@ -23,6 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
...
@@ -23,6 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.concurrent.ConcurrentMap
;
/**
/**
* {@link MetricRepository} implementation that stores metric in-memory.
*
* @author Dave Syer
* @author Dave Syer
*/
*/
public
class
InMemoryMetricRepository
implements
MetricRepository
{
public
class
InMemoryMetricRepository
implements
MetricRepository
{
...
@@ -31,7 +33,6 @@ public class InMemoryMetricRepository implements MetricRepository {
...
@@ -31,7 +33,6 @@ public class InMemoryMetricRepository implements MetricRepository {
@Override
@Override
public
void
increment
(
String
metricName
,
int
amount
,
Date
timestamp
)
{
public
void
increment
(
String
metricName
,
int
amount
,
Date
timestamp
)
{
// FIXME this might not be thread safe
Measurement
current
=
this
.
metrics
.
get
(
metricName
);
Measurement
current
=
this
.
metrics
.
get
(
metricName
);
if
(
current
!=
null
)
{
if
(
current
!=
null
)
{
Metric
metric
=
current
.
getMetric
();
Metric
metric
=
current
.
getMetric
();
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricRepository.java
View file @
cf655945
...
@@ -26,12 +26,6 @@ import java.util.Date;
...
@@ -26,12 +26,6 @@ import java.util.Date;
*/
*/
public
interface
MetricRepository
{
public
interface
MetricRepository
{
// FIXME perhaps revisit this, there is no way to get timestamps
// could also simply, leaving increment to counter service
// Perhaps findAll, findOne should return Measurements
// put(String name, Callback -> process(Metric)
void
increment
(
String
metricName
,
int
amount
,
Date
timestamp
);
void
increment
(
String
metricName
,
int
amount
,
Date
timestamp
);
void
set
(
String
metricName
,
double
value
,
Date
timestamp
);
void
set
(
String
metricName
,
double
value
,
Date
timestamp
);
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/ErrorController.java
View file @
cf655945
...
@@ -26,6 +26,9 @@ import org.springframework.stereotype.Controller;
...
@@ -26,6 +26,9 @@ import org.springframework.stereotype.Controller;
*/
*/
public
interface
ErrorController
{
public
interface
ErrorController
{
/**
* Returns the path of the error page.
*/
public
String
getErrorPath
();
public
String
getErrorPath
();
}
}
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/fixme/ErrorConfigurationTests.java
deleted
100644 → 0
View file @
7bea9dd9
/*
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
actuate
.
fixme
;
/**
* @author Dave Syer
*/
public
class
ErrorConfigurationTests
{
// private AnnotationConfigApplicationContext context;
//
// @Test
// public void testErrorEndpointConfiguration() throws Exception {
// this.context = new AnnotationConfigApplicationContext();
// this.context.register(ErrorConfiguration.class,
// ActuatorServerPropertiesConfiguration.class,
// PropertyPlaceholderAutoConfiguration.class);
// this.context.refresh();
// assertNotNull(this.context.getBean(ErrorEndpoint.class));
// ConfigurableEmbeddedServletContainerFactory factory = Mockito
// .mock(ConfigurableEmbeddedServletContainerFactory.class);
// this.context.getBean(EmbeddedServletContainerCustomizer.class).customize(factory);
// Mockito.verify(factory).addErrorPages(Mockito.any(ErrorPage.class));
// }
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureAfter.java
View file @
cf655945
...
@@ -30,5 +30,10 @@ import java.lang.annotation.Target;
...
@@ -30,5 +30,10 @@ import java.lang.annotation.Target;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
TYPE
})
@Target
({
ElementType
.
TYPE
})
public
@interface
AutoConfigureAfter
{
public
@interface
AutoConfigureAfter
{
/**
* The auto-configure classes that should have already been applied.
*/
Class
<?>[]
value
();
Class
<?>[]
value
();
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java
View file @
cf655945
...
@@ -30,5 +30,10 @@ import java.lang.annotation.Target;
...
@@ -30,5 +30,10 @@ import java.lang.annotation.Target;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
TYPE
})
@Target
({
ElementType
.
TYPE
})
public
@interface
AutoConfigureBefore
{
public
@interface
AutoConfigureBefore
{
/**
* The auto-configure classes that should have not yet been applied.
*/
Class
<?>[]
value
();
Class
<?>[]
value
();
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java
View file @
cf655945
...
@@ -36,7 +36,6 @@ import org.springframework.context.annotation.Configuration;
...
@@ -36,7 +36,6 @@ import org.springframework.context.annotation.Configuration;
public
class
BatchAutoConfiguration
{
public
class
BatchAutoConfiguration
{
@Bean
@Bean
// Harmless to always include this, but maybe could make it conditional as well
public
BatchDatabaseInitializer
batchDatabaseInitializer
()
{
public
BatchDatabaseInitializer
batchDatabaseInitializer
()
{
return
new
BatchDatabaseInitializer
();
return
new
BatchDatabaseInitializer
();
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SearchStrategy.java
View file @
cf655945
...
@@ -27,10 +27,12 @@ public enum SearchStrategy {
...
@@ -27,10 +27,12 @@ public enum SearchStrategy {
* Search only the current context
* Search only the current context
*/
*/
CURRENT
,
CURRENT
,
/**
/**
* Search all parents and ancestors, but not the current context
* Search all parents and ancestors, but not the current context
*/
*/
PARENTS
,
PARENTS
,
/**
/**
* Search the entire hierarchy
* Search the entire hierarchy
*
*
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/AbstractDataSourceConfiguration.java
View file @
cf655945
...
@@ -28,8 +28,6 @@ import org.springframework.util.StringUtils;
...
@@ -28,8 +28,6 @@ import org.springframework.util.StringUtils;
*/
*/
public
class
AbstractDataSourceConfiguration
{
public
class
AbstractDataSourceConfiguration
{
// TODO: add pool parameters
@Value
(
"${spring.database.driverClassName:}"
)
@Value
(
"${spring.database.driverClassName:}"
)
private
String
driverClassName
;
private
String
driverClassName
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
View file @
cf655945
...
@@ -86,7 +86,6 @@ public class DataSourceAutoConfiguration {
...
@@ -86,7 +86,6 @@ public class DataSourceAutoConfiguration {
@Configuration
@Configuration
@Conditional
(
DataSourceAutoConfiguration
.
SomeDatabaseCondition
.
class
)
@Conditional
(
DataSourceAutoConfiguration
.
SomeDatabaseCondition
.
class
)
// FIXME: make this @ConditionalOnBean(DataSource.class)
protected
static
class
JdbcTemplateConfiguration
{
protected
static
class
JdbcTemplateConfiguration
{
@Autowired
(
required
=
false
)
@Autowired
(
required
=
false
)
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.java
View file @
cf655945
...
@@ -78,7 +78,6 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
...
@@ -78,7 +78,6 @@ public class HibernateJpaAutoConfiguration extends JpaBaseConfiguration {
protected
void
configure
(
protected
void
configure
(
LocalContainerEntityManagerFactoryBean
entityManagerFactoryBean
)
{
LocalContainerEntityManagerFactoryBean
entityManagerFactoryBean
)
{
Map
<
String
,
Object
>
properties
=
entityManagerFactoryBean
.
getJpaPropertyMap
();
Map
<
String
,
Object
>
properties
=
entityManagerFactoryBean
.
getJpaPropertyMap
();
// FIXME: detect EhCache
properties
.
put
(
"hibernate.cache.provider_class"
,
properties
.
put
(
"hibernate.cache.provider_class"
,
"org.hibernate.cache.HashtableCacheProvider"
);
"org.hibernate.cache.HashtableCacheProvider"
);
if
(
StringUtils
.
hasLength
(
this
.
ddlAuto
)
&&
!
"none"
.
equals
(
this
.
ddlAuto
))
{
if
(
StringUtils
.
hasLength
(
this
.
ddlAuto
)
&&
!
"none"
.
equals
(
this
.
ddlAuto
))
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
View file @
cf655945
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
reactor
;
package
org
.
springframework
.
boot
.
autoconfigure
.
reactor
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
;
...
@@ -30,6 +31,8 @@ import reactor.core.Reactor;
...
@@ -30,6 +31,8 @@ import reactor.core.Reactor;
import
reactor.spring.context.ConsumerBeanPostProcessor
;
import
reactor.spring.context.ConsumerBeanPostProcessor
;
/**
/**
* {@link EnableAutoConfiguration Auto-configuration} for Reactor.
*
* @author Dave Syer
* @author Dave Syer
*/
*/
@Configuration
@Configuration
...
@@ -40,7 +43,7 @@ public class ReactorAutoConfiguration {
...
@@ -40,7 +43,7 @@ public class ReactorAutoConfiguration {
@Bean
@Bean
public
Environment
reactorEnvironment
()
{
public
Environment
reactorEnvironment
()
{
return
new
Environment
();
// TODO: use Spring Environment to configure?
return
new
Environment
();
}
}
@Bean
@Bean
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java
View file @
cf655945
...
@@ -46,7 +46,7 @@ import org.thymeleaf.templateresolver.ITemplateResolver;
...
@@ -46,7 +46,7 @@ import org.thymeleaf.templateresolver.ITemplateResolver;
import
org.thymeleaf.templateresolver.TemplateResolver
;
import
org.thymeleaf.templateresolver.TemplateResolver
;
/**
/**
* {@link EnableAutoConfiguration Auto-configuration} for Thymeleaf
templating
.
* {@link EnableAutoConfiguration Auto-configuration} for Thymeleaf.
*
*
* @author Dave Syer
* @author Dave Syer
*/
*/
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CreateCommand.java
deleted
100644 → 0
View file @
7bea9dd9
/*
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
import
joptsimple.OptionSet
;
import
org.springframework.boot.cli.Command
;
import
static
java
.
util
.
Arrays
.
asList
;
/**
* {@link Command} to 'create' a new spring groovy script.
*
* @author Phillip Webb
*/
public
class
CreateCommand
extends
OptionParsingCommand
{
public
CreateCommand
()
{
super
(
"create"
,
"Create an new spring groovy script"
,
new
CreateOptionHandler
());
}
@Override
public
String
getUsageHelp
()
{
return
"[options] <file>"
;
}
private
static
class
CreateOptionHandler
extends
OptionHandler
{
@Override
protected
void
options
()
{
option
(
asList
(
"overwite"
,
"f"
),
"Overwrite any existing file"
);
option
(
"type"
,
"Create a specific application type"
).
withOptionalArg
()
.
ofType
(
String
.
class
).
describedAs
(
"web, batch, integration"
);
}
@Override
protected
void
run
(
OptionSet
options
)
{
throw
new
IllegalStateException
(
"Not implemented"
);
// FIXME
}
}
}
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java
View file @
cf655945
...
@@ -121,8 +121,6 @@ public class RunCommand extends OptionParsingCommand {
...
@@ -121,8 +121,6 @@ public class RunCommand extends OptionParsingCommand {
if
(
"--"
.
equals
(
filename
))
{
if
(
"--"
.
equals
(
filename
))
{
break
;
break
;
}
}
// TODO: add support for strict Java compilation
// TODO: add support for recursive search in directory
if
(
filename
.
endsWith
(
".groovy"
)
||
filename
.
endsWith
(
".java"
))
{
if
(
filename
.
endsWith
(
".groovy"
)
||
filename
.
endsWith
(
".java"
))
{
File
file
=
new
File
(
filename
);
File
file
=
new
File
(
filename
);
if
(
file
.
isFile
()
&&
file
.
canRead
())
{
if
(
file
.
isFile
()
&&
file
.
canRead
())
{
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringMvcCompilerAutoConfiguration.java
View file @
cf655945
...
@@ -43,12 +43,6 @@ public class SpringMvcCompilerAutoConfiguration extends CompilerAutoConfiguratio
...
@@ -43,12 +43,6 @@ public class SpringMvcCompilerAutoConfiguration extends CompilerAutoConfiguratio
dependencies
.
add
(
"org.codehaus.groovy"
,
"groovy-templates"
,
dependencies
.
add
(
"org.codehaus.groovy"
,
"groovy-templates"
,
dependencies
.
getProperty
(
"groovy.version"
));
dependencies
.
getProperty
(
"groovy.version"
));
// FIXME restore Tomcat when we can get reload to work
// dependencies.ifMissingClasses("org.apache.catalina.startup.Tomcat")
// .add("org.apache.tomcat.embed", "tomcat-embed-core",
// dependencies.getProperty("tomcat.version"))
// .add("org.apache.tomcat.embed", "tomcat-embed-logging-juli",
// dependencies.getProperty("tomcat.version"));
}
}
@Override
@Override
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/runner/SpringApplicationRunner.java
View file @
cf655945
...
@@ -37,8 +37,6 @@ public class SpringApplicationRunner {
...
@@ -37,8 +37,6 @@ public class SpringApplicationRunner {
private
static
int
runnerCounter
=
0
;
private
static
int
runnerCounter
=
0
;
// FIXME logging
private
SpringApplicationRunnerConfiguration
configuration
;
private
SpringApplicationRunnerConfiguration
configuration
;
private
final
File
[]
files
;
private
final
File
[]
files
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/template/GroovyTemplate.java
View file @
cf655945
...
@@ -32,8 +32,6 @@ import org.codehaus.groovy.control.CompilationFailedException;
...
@@ -32,8 +32,6 @@ import org.codehaus.groovy.control.CompilationFailedException;
*/
*/
public
abstract
class
GroovyTemplate
{
public
abstract
class
GroovyTemplate
{
// FIXME is this used?
public
static
String
template
(
String
name
)
throws
IOException
,
public
static
String
template
(
String
name
)
throws
IOException
,
CompilationFailedException
,
ClassNotFoundException
{
CompilationFailedException
,
ClassNotFoundException
{
return
template
(
name
,
Collections
.<
String
,
Object
>
emptyMap
());
return
template
(
name
,
Collections
.<
String
,
Object
>
emptyMap
());
...
...
spring-boot-samples/spring-boot-sample-web-ui/src/test/java/org/springframework/boot/sample/ui/MessageControllerWebTests.java
View file @
cf655945
...
@@ -31,6 +31,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -31,6 +31,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@WebAppConfiguration
@WebAppConfiguration
@ContextConfiguration
(
classes
=
SampleWebUiApplication
.
class
)
@ContextConfiguration
(
classes
=
SampleWebUiApplication
.
class
)
public
class
MessageControllerWebTests
{
public
class
MessageControllerWebTests
{
@Autowired
@Autowired
private
WebApplicationContext
wac
;
private
WebApplicationContext
wac
;
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java
View file @
cf655945
...
@@ -88,8 +88,8 @@ public class Repackager {
...
@@ -88,8 +88,8 @@ public class Repackager {
}
}
/**
/**
* Repackage to the given destination so that it can be
run using '{@literal java -jar}
* Repackage to the given destination so that it can be
launched using '
* '
*
{@literal java -jar}
'
* @param destination the destination file (may be the same as the source)
* @param destination the destination file (may be the same as the source)
* @param libraries the libraries required to run the archive
* @param libraries the libraries required to run the archive
* @throws IOException
* @throws IOException
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/LaunchedURLClassLoader.java
View file @
cf655945
...
@@ -60,7 +60,6 @@ public class LaunchedURLClassLoader extends URLClassLoader {
...
@@ -60,7 +60,6 @@ public class LaunchedURLClassLoader extends URLClassLoader {
/**
/**
* Define a package before a {@code findClass} call is made. This is necessary to
* Define a package before a {@code findClass} call is made. This is necessary to
* ensure that the appropriate manifest for nested JARs associated with the package.
* ensure that the appropriate manifest for nested JARs associated with the package.
*
* @param name the class name being found
* @param name the class name being found
* @param packageName the pacakge
* @param packageName the pacakge
*/
*/
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessData.java
View file @
cf655945
...
@@ -29,7 +29,6 @@ public interface RandomAccessData {
...
@@ -29,7 +29,6 @@ public interface RandomAccessData {
/**
/**
* Returns an {@link InputStream} that can be used to read the underling data. The
* Returns an {@link InputStream} that can be used to read the underling data. The
* caller is responsible close the underlying stream.
* caller is responsible close the underlying stream.
*
* @return a new input stream that can be used to read the underlying data.
* @return a new input stream that can be used to read the underlying data.
*/
*/
InputStream
getInputStream
();
InputStream
getInputStream
();
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/ExplodedArchiveTests.java
View file @
cf655945
...
@@ -33,8 +33,6 @@ import org.junit.Before;
...
@@ -33,8 +33,6 @@ import org.junit.Before;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.rules.TemporaryFolder
;
import
org.junit.rules.TemporaryFolder
;
import
org.springframework.boot.loader.Archive
;
import
org.springframework.boot.loader.ExplodedArchive
;
import
org.springframework.boot.loader.Archive.Entry
;
import
org.springframework.boot.loader.Archive.Entry
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
...
@@ -76,6 +74,7 @@ public class ExplodedArchiveTests {
...
@@ -76,6 +74,7 @@ public class ExplodedArchiveTests {
}
}
}
}
this
.
archive
=
new
ExplodedArchive
(
this
.
rootFolder
);
this
.
archive
=
new
ExplodedArchive
(
this
.
rootFolder
);
jarFile
.
close
();
}
}
private
void
copy
(
InputStream
in
,
OutputStream
out
)
throws
IOException
{
private
void
copy
(
InputStream
in
,
OutputStream
out
)
throws
IOException
{
...
@@ -141,6 +140,7 @@ public class ExplodedArchiveTests {
...
@@ -141,6 +140,7 @@ public class ExplodedArchiveTests {
new
URL
[]
{
filteredArchive
.
getUrl
()
});
new
URL
[]
{
filteredArchive
.
getUrl
()
});
assertThat
(
classLoader
.
getResourceAsStream
(
"1.dat"
).
read
(),
equalTo
(
1
));
assertThat
(
classLoader
.
getResourceAsStream
(
"1.dat"
).
read
(),
equalTo
(
1
));
assertThat
(
classLoader
.
getResourceAsStream
(
"2.dat"
),
nullValue
());
assertThat
(
classLoader
.
getResourceAsStream
(
"2.dat"
),
nullValue
());
classLoader
.
close
();
}
}
private
Map
<
String
,
Archive
.
Entry
>
getEntriesMap
(
Archive
archive
)
{
private
Map
<
String
,
Archive
.
Entry
>
getEntriesMap
(
Archive
archive
)
{
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/RandomAccessJarFileTests.java
View file @
cf655945
...
@@ -34,8 +34,6 @@ import org.junit.rules.ExpectedException;
...
@@ -34,8 +34,6 @@ import org.junit.rules.ExpectedException;
import
org.junit.rules.TemporaryFolder
;
import
org.junit.rules.TemporaryFolder
;
import
org.springframework.boot.loader.TestJarCreator
;
import
org.springframework.boot.loader.TestJarCreator
;
import
org.springframework.boot.loader.data.RandomAccessDataFile
;
import
org.springframework.boot.loader.data.RandomAccessDataFile
;
import
org.springframework.boot.loader.jar.JarEntryFilter
;
import
org.springframework.boot.loader.jar.RandomAccessJarFile
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
hamcrest
.
Matchers
.
greaterThan
;
import
static
org
.
hamcrest
.
Matchers
.
greaterThan
;
...
@@ -75,6 +73,7 @@ public class RandomAccessJarFileTests {
...
@@ -75,6 +73,7 @@ public class RandomAccessJarFileTests {
public
void
createFromFile
()
throws
Exception
{
public
void
createFromFile
()
throws
Exception
{
RandomAccessJarFile
jarFile
=
new
RandomAccessJarFile
(
this
.
rootJarFile
);
RandomAccessJarFile
jarFile
=
new
RandomAccessJarFile
(
this
.
rootJarFile
);
assertThat
(
jarFile
.
getName
(),
notNullValue
(
String
.
class
));
assertThat
(
jarFile
.
getName
(),
notNullValue
(
String
.
class
));
jarFile
.
close
();
}
}
@Test
@Test
...
@@ -83,6 +82,7 @@ public class RandomAccessJarFileTests {
...
@@ -83,6 +82,7 @@ public class RandomAccessJarFileTests {
this
.
rootJarFile
,
1
);
this
.
rootJarFile
,
1
);
RandomAccessJarFile
jarFile
=
new
RandomAccessJarFile
(
randomAccessDataFile
);
RandomAccessJarFile
jarFile
=
new
RandomAccessJarFile
(
randomAccessDataFile
);
assertThat
(
jarFile
.
getName
(),
notNullValue
(
String
.
class
));
assertThat
(
jarFile
.
getName
(),
notNullValue
(
String
.
class
));
jarFile
.
close
();
}
}
@Test
@Test
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/ServletListenerRegistrationBean.java
View file @
cf655945
...
@@ -81,7 +81,7 @@ public class ServletListenerRegistrationBean<T extends EventListener> extends
...
@@ -81,7 +81,7 @@ public class ServletListenerRegistrationBean<T extends EventListener> extends
*/
*/
public
ServletListenerRegistrationBean
(
T
listener
)
{
public
ServletListenerRegistrationBean
(
T
listener
)
{
Assert
.
notNull
(
listener
,
"Listener must not be null"
);
Assert
.
notNull
(
listener
,
"Listener must not be null"
);
Assert
.
isTrue
(
isSupportedType
(
listener
),
"
EventLisener is not
a supported type"
);
Assert
.
isTrue
(
isSupportedType
(
listener
),
"
Listener is not of
a supported type"
);
this
.
listener
=
listener
;
this
.
listener
=
listener
;
}
}
...
@@ -91,7 +91,7 @@ public class ServletListenerRegistrationBean<T extends EventListener> extends
...
@@ -91,7 +91,7 @@ public class ServletListenerRegistrationBean<T extends EventListener> extends
*/
*/
public
void
setListener
(
T
listener
)
{
public
void
setListener
(
T
listener
)
{
Assert
.
notNull
(
listener
,
"Listener must not be null"
);
Assert
.
notNull
(
listener
,
"Listener must not be null"
);
Assert
.
isTrue
(
isSupportedType
(
listener
),
"
EventLisener is not
a supported type"
);
Assert
.
isTrue
(
isSupportedType
(
listener
),
"
Listener is not of
a supported type"
);
this
.
listener
=
listener
;
this
.
listener
=
listener
;
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/OverrideSourcesTests.java
View file @
cf655945
...
@@ -26,6 +26,9 @@ import org.springframework.context.annotation.Primary;
...
@@ -26,6 +26,9 @@ import org.springframework.context.annotation.Primary;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
/**
* Tests for {@link SpringApplication} {@link SpringApplication#setSources(java.util.Set)
* source overrides}.
*
* @author Dave Syer
* @author Dave Syer
*/
*/
public
class
OverrideSourcesTests
{
public
class
OverrideSourcesTests
{
...
...
spring-boot/src/test/java/org/springframework/boot/bind/BindingPreparationTests.java
View file @
cf655945
...
@@ -24,7 +24,6 @@ import java.util.Map;
...
@@ -24,7 +24,6 @@ import java.util.Map;
import
org.junit.Ignore
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.beans.BeanWrapperImpl
;
import
org.springframework.beans.BeanWrapperImpl
;
import
org.springframework.boot.bind.RelaxedDataBinder
;
import
org.springframework.boot.bind.RelaxedDataBinderTests.TargetWithNestedObject
;
import
org.springframework.boot.bind.RelaxedDataBinderTests.TargetWithNestedObject
;
import
org.springframework.context.expression.MapAccessor
;
import
org.springframework.context.expression.MapAccessor
;
import
org.springframework.core.convert.TypeDescriptor
;
import
org.springframework.core.convert.TypeDescriptor
;
...
...
spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java
View file @
cf655945
...
@@ -20,7 +20,6 @@ import java.util.Collections;
...
@@ -20,7 +20,6 @@ import java.util.Collections;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.bind.PropertySourcesPropertyValues
;
import
org.springframework.core.env.MapPropertySource
;
import
org.springframework.core.env.MapPropertySource
;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.core.env.MutablePropertySources
;
import
org.springframework.core.env.PropertySource
;
import
org.springframework.core.env.PropertySource
;
...
@@ -30,6 +29,7 @@ import static org.junit.Assert.assertEquals;
...
@@ -30,6 +29,7 @@ import static org.junit.Assert.assertEquals;
/**
/**
* Tests for {@link PropertySourcesPropertyValues}.
* Tests for {@link PropertySourcesPropertyValues}.
*
* @author Dave Syer
* @author Dave Syer
*/
*/
public
class
PropertySourcesPropertyValuesTests
{
public
class
PropertySourcesPropertyValuesTests
{
...
...
spring-boot/src/test/java/org/springframework/boot/config/JacksonParserTests.java
View file @
cf655945
...
@@ -16,9 +16,6 @@
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
boot
.
config
;
package
org
.
springframework
.
boot
.
config
;
import
org.springframework.boot.config.JacksonJsonParser
;
import
org.springframework.boot.config.JsonParser
;
/**
/**
* Tests for {@link JsonParser}.
* Tests for {@link JsonParser}.
...
...
spring-boot/src/test/java/org/springframework/boot/config/YamlJsonParserTests.java
View file @
cf655945
...
@@ -16,10 +16,6 @@
...
@@ -16,10 +16,6 @@
package
org
.
springframework
.
boot
.
config
;
package
org
.
springframework
.
boot
.
config
;
import
org.springframework.boot.config.JsonParser
;
import
org.springframework.boot.config.YamlJsonParser
;
/**
/**
* Tests for {@link YamlJsonParser}.
* Tests for {@link YamlJsonParser}.
*
*
...
...
spring-boot/src/test/java/org/springframework/boot/config/YamlProcessorTests.java
View file @
cf655945
...
@@ -19,7 +19,6 @@ import java.util.Map;
...
@@ -19,7 +19,6 @@ import java.util.Map;
import
java.util.Properties
;
import
java.util.Properties
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.config.YamlProcessor
;
import
org.springframework.boot.config.YamlProcessor.MatchCallback
;
import
org.springframework.boot.config.YamlProcessor.MatchCallback
;
import
org.springframework.core.io.ByteArrayResource
;
import
org.springframework.core.io.ByteArrayResource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
...
@@ -27,8 +26,9 @@ import org.springframework.core.io.Resource;
...
@@ -27,8 +26,9 @@ import org.springframework.core.io.Resource;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
/**
*
@author Dave Syer
*
Tests for {@link YamlProcessor}.
*
*
* @author Dave Syer
*/
*/
public
class
YamlProcessorTests
{
public
class
YamlProcessorTests
{
...
...
spring-boot/src/test/java/org/springframework/boot/config/YamlPropertiesFactoryBeanTests.java
View file @
cf655945
...
@@ -22,7 +22,6 @@ import java.util.Properties;
...
@@ -22,7 +22,6 @@ import java.util.Properties;
import
org.junit.Ignore
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.config.YamlPropertiesFactoryBean
;
import
org.springframework.boot.config.YamlProcessor.DocumentMatcher
;
import
org.springframework.boot.config.YamlProcessor.DocumentMatcher
;
import
org.springframework.boot.config.YamlProcessor.MatchStatus
;
import
org.springframework.boot.config.YamlProcessor.MatchStatus
;
import
org.springframework.boot.config.YamlProcessor.ResolutionMethod
;
import
org.springframework.boot.config.YamlProcessor.ResolutionMethod
;
...
@@ -194,7 +193,6 @@ public class YamlPropertiesFactoryBeanTests {
...
@@ -194,7 +193,6 @@ public class YamlPropertiesFactoryBeanTests {
"foo:\n- bar:\n spam: crap\n- baz\n- one: two\n three: four"
"foo:\n- bar:\n spam: crap\n- baz\n- one: two\n three: four"
.
getBytes
())
});
.
getBytes
())
});
Properties
properties
=
factory
.
getObject
();
Properties
properties
=
factory
.
getObject
();
// System.err.println(properties);
assertEquals
(
"crap"
,
properties
.
get
(
"foo[0].bar.spam"
));
assertEquals
(
"crap"
,
properties
.
get
(
"foo[0].bar.spam"
));
assertEquals
(
"baz"
,
properties
.
get
(
"foo[1]"
));
assertEquals
(
"baz"
,
properties
.
get
(
"foo[1]"
));
assertEquals
(
"two"
,
properties
.
get
(
"foo[2].one"
));
assertEquals
(
"two"
,
properties
.
get
(
"foo[2].one"
));
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/ServletListenerRegistrationBeanTests.java
View file @
cf655945
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
package
org
.
springframework
.
boot
.
context
.
embedded
;
package
org
.
springframework
.
boot
.
context
.
embedded
;
import
java.util.EventListener
;
import
javax.servlet.ServletContext
;
import
javax.servlet.ServletContext
;
import
javax.servlet.ServletContextListener
;
import
javax.servlet.ServletContextListener
;
...
@@ -57,4 +59,12 @@ public class ServletListenerRegistrationBeanTests {
...
@@ -57,4 +59,12 @@ public class ServletListenerRegistrationBeanTests {
verify
(
this
.
servletContext
).
addListener
(
this
.
listener
);
verify
(
this
.
servletContext
).
addListener
(
this
.
listener
);
}
}
@Test
public
void
cannotRegisterUnsupportedType
()
throws
Exception
{
this
.
thrown
.
expect
(
IllegalArgumentException
.
class
);
this
.
thrown
.
expectMessage
(
"Listener is not of a supported type"
);
new
ServletListenerRegistrationBean
<
EventListener
>(
new
EventListener
()
{
});
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment