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
896f20e1
Commit
896f20e1
authored
Mar 29, 2021
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve diagnostics of ClassPathFileSystemWatcherTests
Closes gh-25821
parent
c4b84ae9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
ClassPathChangedEvent.java
...mework/boot/devtools/classpath/ClassPathChangedEvent.java
+8
-1
ClassPathFileSystemWatcherTests.java
...t/devtools/classpath/ClassPathFileSystemWatcherTests.java
+5
-4
No files found.
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathChangedEvent.java
View file @
896f20e1
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
21
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -20,6 +20,7 @@ import java.util.Set;
import
org.springframework.boot.devtools.filewatch.ChangedFiles
;
import
org.springframework.context.ApplicationEvent
;
import
org.springframework.core.style.ToStringCreator
;
import
org.springframework.util.Assert
;
/**
...
...
@@ -64,4 +65,10 @@ public class ClassPathChangedEvent extends ApplicationEvent {
return
this
.
restartRequired
;
}
@Override
public
String
toString
()
{
return
new
ToStringCreator
(
this
).
append
(
"changeSet"
,
this
.
changeSet
)
.
append
(
"restartRequired"
,
this
.
restartRequired
).
toString
();
}
}
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java
View file @
896f20e1
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -27,6 +27,7 @@ import java.util.Map;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.io.TempDir
;
import
org.springframework.boot.devtools.filewatch.ChangedFile
;
import
org.springframework.boot.devtools.filewatch.FileSystemWatcher
;
import
org.springframework.boot.devtools.filewatch.FileSystemWatcherFactory
;
import
org.springframework.context.ApplicationListener
;
...
...
@@ -79,9 +80,9 @@ class ClassPathFileSystemWatcherTests {
}
Thread
.
sleep
(
500
);
}
assertThat
(
events
.
size
()).
isEqualTo
(
1
);
assertThat
(
events
.
get
(
0
).
getChangeSet
().
iterator
().
next
()
.
getFiles
().
iterator
().
next
().
getFile
()
)
.
isEqualTo
(
classFile
);
assertThat
(
events
).
hasSize
(
1
);
assertThat
(
events
.
get
(
0
).
getChangeSet
().
iterator
().
next
()
).
extracting
(
ChangedFile:
:
getFile
)
.
containsExactly
(
classFile
);
context
.
close
();
}
...
...
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