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
60122502
Commit
60122502
authored
Oct 21, 2015
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.2.x'
parents
c086a6a7
2e2ebeb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
EmbeddedServerPortFileWriter.java
...ork/boot/actuate/system/EmbeddedServerPortFileWriter.java
+2
-2
EmbeddedServerPortFileWriterTests.java
...oot/actuate/system/EmbeddedServerPortFileWriterTests.java
+11
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/system/EmbeddedServerPortFileWriter.java
View file @
60122502
/*
/*
* Copyright 201
0-2014
the original author or authors.
* Copyright 201
2-2015
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.
...
@@ -57,7 +57,7 @@ public class EmbeddedServerPortFileWriter
...
@@ -57,7 +57,7 @@ public class EmbeddedServerPortFileWriter
* 'application.port'.
* 'application.port'.
*/
*/
public
EmbeddedServerPortFileWriter
()
{
public
EmbeddedServerPortFileWriter
()
{
this
.
file
=
new
File
(
DEFAULT_FILE_NAME
);
this
(
new
File
(
DEFAULT_FILE_NAME
)
);
}
}
/**
/**
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/system/EmbeddedServerPortFileWriterTests.java
View file @
60122502
/*
/*
* Copyright 201
0-2014
the original author or authors.
* Copyright 201
2-2015
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.
...
@@ -66,7 +66,16 @@ public class EmbeddedServerPortFileWriterTests {
...
@@ -66,7 +66,16 @@ public class EmbeddedServerPortFileWriterTests {
}
}
@Test
@Test
public
void
overridePortFile
()
throws
Exception
{
public
void
overridePortFileWithDefault
()
throws
Exception
{
System
.
setProperty
(
"PORTFILE"
,
this
.
temporaryFolder
.
newFile
().
getAbsolutePath
());
EmbeddedServerPortFileWriter
listener
=
new
EmbeddedServerPortFileWriter
();
listener
.
onApplicationEvent
(
mockEvent
(
""
,
8080
));
assertThat
(
FileCopyUtils
.
copyToString
(
new
FileReader
(
System
.
getProperty
(
"PORTFILE"
))),
equalTo
(
"8080"
));
}
@Test
public
void
overridePortFileWithExplicitFile
()
throws
Exception
{
File
file
=
this
.
temporaryFolder
.
newFile
();
File
file
=
this
.
temporaryFolder
.
newFile
();
System
.
setProperty
(
"PORTFILE"
,
this
.
temporaryFolder
.
newFile
().
getAbsolutePath
());
System
.
setProperty
(
"PORTFILE"
,
this
.
temporaryFolder
.
newFile
().
getAbsolutePath
());
EmbeddedServerPortFileWriter
listener
=
new
EmbeddedServerPortFileWriter
(
file
);
EmbeddedServerPortFileWriter
listener
=
new
EmbeddedServerPortFileWriter
(
file
);
...
...
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