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
b5843cfd
Commit
b5843cfd
authored
Mar 11, 2021
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.4.x'
parents
46baf462
24d729ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
RestartClassLoaderTests.java
...devtools/restart/classloader/RestartClassLoaderTests.java
+12
-12
No files found.
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java
View file @
b5843cfd
...
@@ -20,7 +20,6 @@ import java.io.File;
...
@@ -20,7 +20,6 @@ import java.io.File;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.net.URLClassLoader
;
import
java.net.URLClassLoader
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
...
@@ -219,17 +218,18 @@ class RestartClassLoaderTests {
...
@@ -219,17 +218,18 @@ class RestartClassLoaderTests {
}
}
@Test
@Test
void
packagePrivateClassLoadedByParentClassLoaderCanBeProxied
()
throws
MalformedURLException
{
void
packagePrivateClassLoadedByParentClassLoaderCanBeProxied
()
throws
IOException
{
new
ApplicationContextRunner
()
try
(
RestartClassLoader
restartClassLoader
=
new
RestartClassLoader
(
ExampleTransactional
.
class
.
getClassLoader
(),
.
withClassLoader
(
new
RestartClassLoader
(
ExampleTransactional
.
class
.
getClassLoader
(),
new
URL
[]
{
this
.
sampleJarFile
.
toURI
().
toURL
()
},
this
.
updatedFiles
))
{
new
URL
[]
{
this
.
sampleJarFile
.
toURI
().
toURL
()
},
this
.
updatedFiles
))
new
ApplicationContextRunner
().
withClassLoader
(
restartClassLoader
)
.
withUserConfiguration
(
ProxyConfiguration
.
class
).
run
((
context
)
->
{
.
withUserConfiguration
(
ProxyConfiguration
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasNotFailed
();
assertThat
(
context
).
hasNotFailed
();
ExampleTransactional
transactional
=
context
.
getBean
(
ExampleTransactional
.
class
);
ExampleTransactional
transactional
=
context
.
getBean
(
ExampleTransactional
.
class
);
assertThat
(
AopUtils
.
isCglibProxy
(
transactional
)).
isTrue
();
assertThat
(
AopUtils
.
isCglibProxy
(
transactional
)).
isTrue
();
assertThat
(
transactional
.
getClass
().
getClassLoader
())
assertThat
(
transactional
.
getClass
().
getClassLoader
())
.
isEqualTo
(
ExampleTransactional
.
class
.
getClassLoader
());
.
isEqualTo
(
ExampleTransactional
.
class
.
getClassLoader
());
});
});
}
}
}
private
String
readString
(
InputStream
in
)
throws
IOException
{
private
String
readString
(
InputStream
in
)
throws
IOException
{
...
...
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