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
b152b98f
Commit
b152b98f
authored
Sep 29, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve diagnostics in DevTools integration tests
See gh-10454
parent
5cf48a29
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
10 deletions
+27
-10
DevToolsIntegrationTests.java
...amework/boot/devtools/tests/DevToolsIntegrationTests.java
+4
-2
JvmLauncher.java
.../org/springframework/boot/devtools/tests/JvmLauncher.java
+11
-4
LaunchedApplication.java
...ingframework/boot/devtools/tests/LaunchedApplication.java
+9
-1
LocalApplicationLauncher.java
...amework/boot/devtools/tests/LocalApplicationLauncher.java
+1
-1
RemoteApplicationLauncher.java
...mework/boot/devtools/tests/RemoteApplicationLauncher.java
+2
-2
No files found.
spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java
View file @
b152b98f
...
...
@@ -142,9 +142,11 @@ public class DevToolsIntegrationTests {
if
(
System
.
currentTimeMillis
()
>
end
)
{
throw
new
IllegalStateException
(
String
.
format
(
"server.port file was not written within 30 seconds. "
+
"Application output:%n%s"
,
+
"Application output:%n%s
%s
"
,
FileCopyUtils
.
copyToString
(
new
FileReader
(
this
.
launchedApplication
.
getStandardOut
()))));
this
.
launchedApplication
.
getStandardOut
())),
FileCopyUtils
.
copyToString
(
new
FileReader
(
this
.
launchedApplication
.
getStandardError
()))));
}
Thread
.
sleep
(
100
);
}
...
...
spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JvmLauncher.java
View file @
b152b98f
...
...
@@ -49,10 +49,10 @@ class JvmLauncher implements TestRule {
.
asList
(
System
.
getProperty
(
"java.home"
)
+
"/bin/java"
,
"-cp"
,
classpath
));
command
.
addAll
(
Arrays
.
asList
(
args
));
File
standardOut
=
new
File
(
this
.
outputDirectory
,
name
+
".out"
);
File
standardError
=
new
File
(
this
.
outputDirectory
,
name
+
".err"
);
Process
process
=
new
ProcessBuilder
(
command
.
toArray
(
new
String
[
command
.
size
()]))
.
redirectError
(
new
File
(
this
.
outputDirectory
,
name
+
".err"
))
.
redirectOutput
(
standardOut
).
start
();
return
new
LaunchedJvm
(
process
,
standardOut
);
.
redirectError
(
standardError
).
redirectOutput
(
standardOut
).
start
();
return
new
LaunchedJvm
(
process
,
standardOut
,
standardError
);
}
static
class
LaunchedJvm
{
...
...
@@ -61,9 +61,12 @@ class JvmLauncher implements TestRule {
private
final
File
standardOut
;
LaunchedJvm
(
Process
process
,
File
standardOut
)
{
private
final
File
standardError
;
LaunchedJvm
(
Process
process
,
File
standardOut
,
File
standardError
)
{
this
.
process
=
process
;
this
.
standardOut
=
standardOut
;
this
.
standardError
=
standardError
;
}
Process
getProcess
()
{
...
...
@@ -74,6 +77,10 @@ class JvmLauncher implements TestRule {
return
this
.
standardOut
;
}
File
getStandardError
()
{
return
this
.
standardError
;
}
}
}
spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/LaunchedApplication.java
View file @
b152b98f
...
...
@@ -29,11 +29,15 @@ class LaunchedApplication {
private
final
File
standardOut
;
private
final
File
standardError
;
private
final
Process
[]
processes
;
LaunchedApplication
(
File
classesDirectory
,
File
standardOut
,
Process
...
processes
)
{
LaunchedApplication
(
File
classesDirectory
,
File
standardOut
,
File
standardError
,
Process
...
processes
)
{
this
.
classesDirectory
=
classesDirectory
;
this
.
standardOut
=
standardOut
;
this
.
standardError
=
standardError
;
this
.
processes
=
processes
;
}
...
...
@@ -48,6 +52,10 @@ class LaunchedApplication {
return
this
.
standardOut
;
}
File
getStandardError
()
{
return
this
.
standardError
;
}
File
getClassesDirectory
()
{
return
this
.
classesDirectory
;
}
...
...
spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/LocalApplicationLauncher.java
View file @
b152b98f
...
...
@@ -37,7 +37,7 @@ public class LocalApplicationLauncher implements ApplicationLauncher {
LaunchedJvm
jvm
=
jvmLauncher
.
launch
(
"local"
,
createApplicationClassPath
(),
"com.example.DevToolsTestApplication"
,
"--server.port=0"
);
return
new
LaunchedApplication
(
new
File
(
"target/app"
),
jvm
.
getStandardOut
(),
jvm
.
getProcess
());
jvm
.
get
StandardError
(),
jvm
.
get
Process
());
}
protected
String
createApplicationClassPath
()
throws
Exception
{
...
...
spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java
View file @
b152b98f
...
...
@@ -48,8 +48,8 @@ abstract class RemoteApplicationLauncher implements ApplicationLauncher {
"--spring.devtools.remote.secret=secret"
,
"http://localhost:12345"
);
awaitRemoteSpringApplication
(
remoteSpringApplicationJvm
.
getStandardOut
());
return
new
LaunchedApplication
(
new
File
(
"target/remote"
),
applicationJvm
.
getStandardOut
(),
applicationJvm
.
get
Process
(),
remoteSpringApplicationJvm
.
getProcess
());
applicationJvm
.
getStandardOut
(),
applicationJvm
.
get
StandardError
(),
applicationJvm
.
getProcess
(),
remoteSpringApplicationJvm
.
getProcess
());
}
protected
abstract
String
createApplicationClassPath
()
throws
Exception
;
...
...
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