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
447c9ff2
Commit
447c9ff2
authored
Dec 02, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
0a8bc482
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
39 deletions
+48
-39
JmsAnnotationDrivenConfiguration.java
...t/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java
+1
-1
JmsAutoConfigurationTests.java
...ork/boot/autoconfigure/jms/JmsAutoConfigurationTests.java
+1
-1
CommandException.java
...rg/springframework/boot/cli/command/CommandException.java
+11
-0
TestFailedException.java
...gframework/boot/cli/command/test/TestFailedException.java
+12
-7
TestRunner.java
...org/springframework/boot/cli/command/test/TestRunner.java
+20
-28
CliTester.java
...src/test/java/org/springframework/boot/cli/CliTester.java
+1
-1
Ssl.java
...n/java/org/springframework/boot/context/embedded/Ssl.java
+2
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java
View file @
447c9ff2
...
@@ -57,7 +57,7 @@ class JmsAnnotationDrivenConfiguration {
...
@@ -57,7 +57,7 @@ class JmsAnnotationDrivenConfiguration {
ConnectionFactory
connectionFactory
)
{
ConnectionFactory
connectionFactory
)
{
DefaultJmsListenerContainerFactory
factory
=
new
DefaultJmsListenerContainerFactory
();
DefaultJmsListenerContainerFactory
factory
=
new
DefaultJmsListenerContainerFactory
();
factory
.
setConnectionFactory
(
connectionFactory
);
factory
.
setConnectionFactory
(
connectionFactory
);
factory
.
setPubSubDomain
(
properties
.
isPubSubDomain
());
factory
.
setPubSubDomain
(
this
.
properties
.
isPubSubDomain
());
if
(
this
.
transactionManager
!=
null
)
{
if
(
this
.
transactionManager
!=
null
)
{
factory
.
setTransactionManager
(
this
.
transactionManager
);
factory
.
setTransactionManager
(
this
.
transactionManager
);
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java
View file @
447c9ff2
...
@@ -33,8 +33,8 @@ import org.springframework.jms.annotation.EnableJms;
...
@@ -33,8 +33,8 @@ import org.springframework.jms.annotation.EnableJms;
import
org.springframework.jms.config.DefaultJmsListenerContainerFactory
;
import
org.springframework.jms.config.DefaultJmsListenerContainerFactory
;
import
org.springframework.jms.config.JmsListenerConfigUtils
;
import
org.springframework.jms.config.JmsListenerConfigUtils
;
import
org.springframework.jms.config.JmsListenerContainerFactory
;
import
org.springframework.jms.config.JmsListenerContainerFactory
;
import
org.springframework.jms.config.SimpleJmsListenerContainerFactory
;
import
org.springframework.jms.config.JmsListenerEndpoint
;
import
org.springframework.jms.config.JmsListenerEndpoint
;
import
org.springframework.jms.config.SimpleJmsListenerContainerFactory
;
import
org.springframework.jms.core.JmsMessagingTemplate
;
import
org.springframework.jms.core.JmsMessagingTemplate
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.core.JmsTemplate
;
import
org.springframework.jms.listener.DefaultMessageListenerContainer
;
import
org.springframework.jms.listener.DefaultMessageListenerContainer
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandException.java
View file @
447c9ff2
...
@@ -62,6 +62,16 @@ public class CommandException extends RuntimeException {
...
@@ -62,6 +62,16 @@ public class CommandException extends RuntimeException {
this
.
options
=
asEnumSet
(
options
);
this
.
options
=
asEnumSet
(
options
);
}
}
/**
* Create a new {@link CommandException} with the specified options.
* @param cause the underlying cause
* @param options the exception options
*/
public
CommandException
(
Throwable
cause
,
Option
...
options
)
{
super
(
cause
);
this
.
options
=
asEnumSet
(
options
);
}
private
EnumSet
<
Option
>
asEnumSet
(
Option
[]
options
)
{
private
EnumSet
<
Option
>
asEnumSet
(
Option
[]
options
)
{
if
(
options
==
null
||
options
.
length
==
0
)
{
if
(
options
==
null
||
options
.
length
==
0
)
{
return
EnumSet
.
noneOf
(
Option
.
class
);
return
EnumSet
.
noneOf
(
Option
.
class
);
...
@@ -100,6 +110,7 @@ public class CommandException extends RuntimeException {
...
@@ -100,6 +110,7 @@ public class CommandException extends RuntimeException {
* Re-throw the exception rather than dealing with it.
* Re-throw the exception rather than dealing with it.
*/
*/
RETHROW
RETHROW
}
}
}
}
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestFailedException.java
View file @
447c9ff2
/*
/*
* Copyright 201
4 original authors
* Copyright 201
2-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.
...
@@ -13,16 +13,21 @@
...
@@ -13,16 +13,21 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
org
.
springframework
.
boot
.
cli
.
command
.
test
;
package
org
.
springframework
.
boot
.
cli
.
command
.
test
;
import
org.springframework.boot.cli.command.CommandException
;
/**
/**
* Thrown when tests fail to execute
* Thrown when tests fail to execute
.
*
*
* @author Graeme Rocher
* @author Graeme Rocher
* @since 1.2
* @since 1.2
.0
*/
*/
public
class
TestFailedException
extends
RuntimeException
{
public
class
TestFailedException
extends
CommandException
{
public
TestFailedException
(
Throwable
cause
)
{
super
(
cause
);
public
TestFailedException
(
Throwable
cause
)
{
}
super
(
cause
,
Option
.
HIDE_MESSAGE
);
}
}
}
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java
View file @
447c9ff2
...
@@ -17,18 +17,19 @@
...
@@ -17,18 +17,19 @@
package
org
.
springframework
.
boot
.
cli
.
command
.
test
;
package
org
.
springframework
.
boot
.
cli
.
command
.
test
;
import
java.lang.annotation.Annotation
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.boot.cli.compiler.GroovyCompiler
;
import
org.springframework.boot.cli.compiler.GroovyCompiler
;
import
org.springframework.boot.groovy.DelegateTestRunner
;
import
org.springframework.boot.groovy.DelegateTestRunner
;
import
org.springframework.util.ReflectionUtils
;
/**
/**
* Compile and run groovy based tests.
* Compile and run groovy based tests.
*
*
* @author Phillip Webb
* @author Phillip Webb
* @author Graeme Rocher
*/
*/
public
class
TestRunner
{
public
class
TestRunner
{
...
@@ -63,17 +64,16 @@ public class TestRunner {
...
@@ -63,17 +64,16 @@ public class TestRunner {
runThread
.
start
();
runThread
.
start
();
runThread
.
setUncaughtExceptionHandler
(
new
Thread
.
UncaughtExceptionHandler
()
{
runThread
.
setUncaughtExceptionHandler
(
new
Thread
.
UncaughtExceptionHandler
()
{
@Override
@Override
public
void
uncaughtException
(
Thread
t
,
Throwable
e
)
{
public
void
uncaughtException
(
Thread
t
,
Throwable
ex
)
{
// rethrow exception
TestRunner
.
this
.
threadException
=
ex
;
threadException
=
e
;
}
}
});
});
runThread
.
join
();
runThread
.
join
();
if
(
threadException
!=
null
)
{
if
(
this
.
threadException
!=
null
)
{
T
hrowable
t
=
threadException
;
T
estFailedException
ex
=
new
TestFailedException
(
this
.
threadException
)
;
threadException
=
null
;
th
is
.
th
readException
=
null
;
throw
new
TestFailedException
(
t
)
;
throw
ex
;
}
}
}
}
...
@@ -150,30 +150,22 @@ public class TestRunner {
...
@@ -150,30 +150,22 @@ public class TestRunner {
ClassLoader
contextClassLoader
=
Thread
.
currentThread
()
ClassLoader
contextClassLoader
=
Thread
.
currentThread
()
.
getContextClassLoader
();
.
getContextClassLoader
();
Class
<?>
delegateClass
=
contextClassLoader
Class
<?>
delegateClass
=
contextClassLoader
.
loadClass
(
DelegateTestRunner
.
class
.
getName
());
.
loadClass
(
DelegateTestRunner
.
class
.
getName
());
Class
resultClass
=
contextClassLoader
.
loadClass
(
"org.junit.runner.Result"
);
Class
<?>
resultClass
=
contextClassLoader
Method
runMethod
=
delegateClass
.
getMethod
(
"run"
,
Class
[].
class
,
resultClass
);
.
loadClass
(
"org.junit.runner.Result"
);
Method
runMethod
=
delegateClass
.
getMethod
(
"run"
,
Class
[].
class
,
resultClass
);
Object
result
=
resultClass
.
newInstance
();
Object
result
=
resultClass
.
newInstance
();
runMethod
.
invoke
(
null
,
this
.
testClasses
,
result
);
runMethod
.
invoke
(
null
,
this
.
testClasses
,
result
);
Boolean
wasSuccessful
=
(
Boolean
)
resultClass
.
getMethod
(
"wasSuccessful"
).
invoke
(
result
);
boolean
wasSuccessful
=
(
Boolean
)
resultClass
.
getMethod
(
if
(!
wasSuccessful
)
{
"wasSuccessful"
).
invoke
(
result
);
try
{
if
(!
wasSuccessful
)
{
throw
new
RuntimeException
(
"Tests Failed."
);
throw
new
RuntimeException
(
"Tests Failed."
);
}
catch
(
Throwable
throwable
)
{
throw
new
RuntimeException
(
throwable
);
}
}
}
}
}
}
catch
(
ClassNotFoundException
e
)
{
}
throw
new
RuntimeException
(
"Exception occurred running tests: "
+
e
.
getMessage
(),
e
);
catch
(
Exception
ex
)
{
}
catch
(
NoSuchMethodException
e
)
{
ReflectionUtils
.
rethrowRuntimeException
(
ex
);
throw
new
RuntimeException
(
"Exception occurred running tests: "
+
e
.
getMessage
(),
e
);
}
catch
(
InstantiationException
e
)
{
throw
new
RuntimeException
(
"Exception occurred running tests: "
+
e
.
getMessage
(),
e
);
}
catch
(
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
"Exception occurred running tests: "
+
e
.
getMessage
(),
e
);
}
catch
(
InvocationTargetException
e
)
{
throw
new
RuntimeException
(
"Exception occurred running tests: "
+
e
.
getMessage
(),
e
);
}
}
}
}
}
}
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/CliTester.java
View file @
447c9ff2
...
@@ -81,7 +81,7 @@ public class CliTester implements TestRule {
...
@@ -81,7 +81,7 @@ public class CliTester implements TestRule {
try
{
try
{
this
.
commands
.
add
(
future
.
get
(
this
.
timeout
,
TimeUnit
.
MILLISECONDS
));
this
.
commands
.
add
(
future
.
get
(
this
.
timeout
,
TimeUnit
.
MILLISECONDS
));
return
getOutput
();
return
getOutput
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
x
)
{
return
getOutput
();
return
getOutput
();
}
}
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/Ssl.java
View file @
447c9ff2
...
@@ -26,7 +26,8 @@ package org.springframework.boot.context.embedded;
...
@@ -26,7 +26,8 @@ package org.springframework.boot.context.embedded;
public
class
Ssl
{
public
class
Ssl
{
/**
/**
* Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store.
* Whether client authentication is wanted ("want") or needed ("need"). Requires a
* trust store.
*/
*/
private
ClientAuth
clientAuth
;
private
ClientAuth
clientAuth
;
...
...
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