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
be40d000
Commit
be40d000
authored
Feb 14, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
parents
8939a7ee
1be794fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
ClassPathChangeUploader.java
.../boot/devtools/remote/client/ClassPathChangeUploader.java
+5
-4
ClassPathChangeUploaderTests.java
.../devtools/remote/client/ClassPathChangeUploaderTests.java
+4
-4
No files found.
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploader.java
View file @
be40d000
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -19,8 +19,8 @@ package org.springframework.boot.devtools.remote.client;
...
@@ -19,8 +19,8 @@ package org.springframework.boot.devtools.remote.client;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.ObjectOutputStream
;
import
java.io.ObjectOutputStream
;
import
java.net.ConnectException
;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.SocketException
;
import
java.net.URI
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.net.URL
;
...
@@ -117,9 +117,10 @@ public class ClassPathChangeUploader
...
@@ -117,9 +117,10 @@ public class ClassPathChangeUploader
logUpload
(
classLoaderFiles
);
logUpload
(
classLoaderFiles
);
return
;
return
;
}
}
catch
(
Connec
tException
ex
)
{
catch
(
Socke
tException
ex
)
{
logger
.
warn
(
"
Failed to connect
when uploading to "
+
this
.
uri
logger
.
warn
(
"
A failure occurred
when uploading to "
+
this
.
uri
+
". Upload will be retried in 2 seconds"
);
+
". Upload will be retried in 2 seconds"
);
logger
.
debug
(
"Upload failure"
,
ex
);
Thread
.
sleep
(
2000
);
Thread
.
sleep
(
2000
);
}
}
}
}
...
...
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java
View file @
be40d000
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -20,7 +20,7 @@ import java.io.ByteArrayInputStream;
...
@@ -20,7 +20,7 @@ import java.io.ByteArrayInputStream;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.ObjectInputStream
;
import
java.io.ObjectInputStream
;
import
java.net.
Connec
tException
;
import
java.net.
Socke
tException
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.LinkedHashSet
;
...
@@ -111,10 +111,10 @@ public class ClassPathChangeUploaderTests {
...
@@ -111,10 +111,10 @@ public class ClassPathChangeUploaderTests {
}
}
@Test
@Test
public
void
retriesOn
Connec
tException
()
throws
Exception
{
public
void
retriesOn
Socke
tException
()
throws
Exception
{
File
sourceFolder
=
this
.
temp
.
newFolder
();
File
sourceFolder
=
this
.
temp
.
newFolder
();
ClassPathChangedEvent
event
=
createClassPathChangedEvent
(
sourceFolder
);
ClassPathChangedEvent
event
=
createClassPathChangedEvent
(
sourceFolder
);
this
.
requestFactory
.
willRespond
(
new
Connec
tException
());
this
.
requestFactory
.
willRespond
(
new
Socke
tException
());
this
.
requestFactory
.
willRespond
(
HttpStatus
.
OK
);
this
.
requestFactory
.
willRespond
(
HttpStatus
.
OK
);
this
.
uploader
.
onApplicationEvent
(
event
);
this
.
uploader
.
onApplicationEvent
(
event
);
assertThat
(
this
.
requestFactory
.
getExecutedRequests
()).
hasSize
(
2
);
assertThat
(
this
.
requestFactory
.
getExecutedRequests
()).
hasSize
(
2
);
...
...
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