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
59c66eaf
Commit
59c66eaf
authored
Feb 05, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct documented path for locked synchronizer's identity hashcode
Closes gh-15847
parent
ebcc53a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
ThreadDumpEndpointDocumentationTests.java
...b/documentation/ThreadDumpEndpointDocumentationTests.java
+22
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ThreadDumpEndpointDocumentationTests.java
View file @
59c66eaf
/*
/*
* 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.
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
endpoint
.
web
.
documentation
;
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
.
endpoint
.
web
.
documentation
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.locks.ReentrantLock
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.management.ThreadDumpEndpoint
;
import
org.springframework.boot.actuate.management.ThreadDumpEndpoint
;
...
@@ -42,6 +45,22 @@ public class ThreadDumpEndpointDocumentationTests
...
@@ -42,6 +45,22 @@ public class ThreadDumpEndpointDocumentationTests
@Test
@Test
public
void
threadDump
()
throws
Exception
{
public
void
threadDump
()
throws
Exception
{
ReentrantLock
lock
=
new
ReentrantLock
();
CountDownLatch
latch
=
new
CountDownLatch
(
1
);
new
Thread
(()
->
{
try
{
lock
.
lock
();
try
{
latch
.
await
();
}
finally
{
lock
.
unlock
();
}
}
catch
(
InterruptedException
ex
)
{
Thread
.
currentThread
().
interrupt
();
}
}).
start
();
this
.
mockMvc
.
perform
(
get
(
"/actuator/threaddump"
)).
andExpect
(
status
().
isOk
())
this
.
mockMvc
.
perform
(
get
(
"/actuator/threaddump"
)).
andExpect
(
status
().
isOk
())
.
andDo
(
MockMvcRestDocumentation
.
document
(
"threaddump"
,
.
andDo
(
MockMvcRestDocumentation
.
document
(
"threaddump"
,
preprocessResponse
(
limit
(
"threads"
)),
preprocessResponse
(
limit
(
"threads"
)),
...
@@ -111,7 +130,7 @@ public class ThreadDumpEndpointDocumentationTests
...
@@ -111,7 +130,7 @@ public class ThreadDumpEndpointDocumentationTests
+
"synchronizer."
)
+
"synchronizer."
)
.
optional
().
type
(
JsonFieldType
.
STRING
),
.
optional
().
type
(
JsonFieldType
.
STRING
),
fieldWithPath
(
fieldWithPath
(
"threads.[].lockedSynchronizers.[].identi
f
yHashCode"
)
"threads.[].lockedSynchronizers.[].identi
t
yHashCode"
)
.
description
(
.
description
(
"Identity hash code of the locked "
"Identity hash code of the locked "
+
"synchronizer."
)
+
"synchronizer."
)
...
@@ -187,6 +206,7 @@ public class ThreadDumpEndpointDocumentationTests
...
@@ -187,6 +206,7 @@ public class ThreadDumpEndpointDocumentationTests
"Time in milliseconds that the thread has spent "
"Time in milliseconds that the thread has spent "
+
"waiting. -1 if thread contention "
+
"waiting. -1 if thread contention "
+
"monitoring is disabled"
))));
+
"monitoring is disabled"
))));
latch
.
countDown
();
}
}
@Configuration
@Configuration
...
...
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