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
147b048a
Commit
147b048a
authored
Aug 12, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x'
See gh-22909
parents
0d8719ad
2b1bb2f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
RemoteApplicationLauncher.java
...mework/boot/devtools/tests/RemoteApplicationLauncher.java
+18
-5
No files found.
spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java
View file @
147b048a
...
@@ -24,6 +24,7 @@ import java.util.List;
...
@@ -24,6 +24,7 @@ import java.util.List;
import
java.util.function.BiFunction
;
import
java.util.function.BiFunction
;
import
org.awaitility.Awaitility
;
import
org.awaitility.Awaitility
;
import
org.awaitility.core.ConditionTimeoutException
;
import
org.springframework.boot.devtools.RemoteSpringApplication
;
import
org.springframework.boot.devtools.RemoteSpringApplication
;
import
org.springframework.boot.devtools.tests.JvmLauncher.LaunchedJvm
;
import
org.springframework.boot.devtools.tests.JvmLauncher.LaunchedJvm
;
...
@@ -77,7 +78,7 @@ abstract class RemoteApplicationLauncher extends AbstractApplicationLauncher {
...
@@ -77,7 +78,7 @@ abstract class RemoteApplicationLauncher extends AbstractApplicationLauncher {
createRemoteSpringApplicationClassPath
(
classesDirectory
),
createRemoteSpringApplicationClassPath
(
classesDirectory
),
RemoteSpringApplication
.
class
.
getName
(),
"--spring.devtools.remote.secret=secret"
,
RemoteSpringApplication
.
class
.
getName
(),
"--spring.devtools.remote.secret=secret"
,
"http://localhost:"
+
port
);
"http://localhost:"
+
port
);
awaitRemoteSpringApplication
(
remoteSpringApplicationJvm
.
getStandardOut
()
);
awaitRemoteSpringApplication
(
remoteSpringApplicationJvm
);
return
remoteSpringApplicationJvm
.
getProcess
();
return
remoteSpringApplicationJvm
.
getProcess
();
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
...
@@ -105,10 +106,22 @@ abstract class RemoteApplicationLauncher extends AbstractApplicationLauncher {
...
@@ -105,10 +106,22 @@ abstract class RemoteApplicationLauncher extends AbstractApplicationLauncher {
.
getServerPort
();
.
getServerPort
();
}
}
private
void
awaitRemoteSpringApplication
(
File
standardOut
)
throws
Exception
{
private
void
awaitRemoteSpringApplication
(
LaunchedJvm
launchedJvm
)
throws
Exception
{
FileContents
contents
=
new
FileContents
(
standardOut
);
FileContents
contents
=
new
FileContents
(
launchedJvm
.
getStandardOut
());
Awaitility
.
waitAtMost
(
Duration
.
ofSeconds
(
30
)).
until
(
contents:
:
get
,
try
{
containsString
(
"Started RemoteSpringApplication"
));
Awaitility
.
waitAtMost
(
Duration
.
ofSeconds
(
30
)).
until
(
contents:
:
get
,
containsString
(
"Started RemoteSpringApplication"
));
}
catch
(
ConditionTimeoutException
ex
)
{
if
(!
launchedJvm
.
getProcess
().
isAlive
())
{
throw
new
IllegalStateException
(
"Process exited with status "
+
launchedJvm
.
getProcess
().
exitValue
()
+
" before producing expected standard output.\n\nStandard output:\n\n"
+
contents
.
get
()
+
"\n\nStandard error:\n\n"
+
new
FileContents
(
launchedJvm
.
getStandardError
()).
get
(),
ex
);
}
throw
ex
;
}
}
}
}
}
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