Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeeTime
Kieker-TeeTime-Stages
Commits
40e69ece
Commit
40e69ece
authored
8 years ago
by
Lars Erik Blümke
Browse files
Options
Downloads
Patches
Plain Diff
Test case for ThreadsStatusDisplayFilter
parent
520db34b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/kieker/analysis/plugin/filter/sink/ThreadsStatusDisplayFilterTest.java
+59
-0
59 additions, 0 deletions
...is/plugin/filter/sink/ThreadsStatusDisplayFilterTest.java
with
59 additions
and
0 deletions
src/test/java/kieker/analysis/plugin/filter/sink/ThreadsStatusDisplayFilterTest.java
0 → 100644
+
59
−
0
View file @
40e69ece
package
kieker.analysis.plugin.filter.sink
;
import
static
org
.
hamcrest
.
core
.
Is
.
is
;
import
static
org
.
junit
.
Assert
.
assertThat
;
import
static
teetime
.
framework
.
test
.
StageTester
.
test
;
import
java.util.Date
;
import
java.util.concurrent.TimeUnit
;
import
org.junit.Before
;
import
org.junit.Test
;
import
kieker.common.record.jvm.ThreadsStatusRecord
;
public
class
ThreadsStatusDisplayFilterTest
{
private
ThreadsStatusRecord
record
;
private
ThreadsStatusDisplayFilter
threadsStatusFilter
;
private
final
int
numberOfEntries
=
3
;
private
final
TimeUnit
recordsTimeUnit
=
TimeUnit
.
MILLISECONDS
;
private
final
long
timestamp
=
1L
;
private
final
String
hostname
=
"test_host"
;
private
final
String
vmName
=
"test_vm"
;
private
final
long
threadCount
=
2
;
private
final
long
daemonThreadCount
=
1
;
private
final
long
peakThreadCount
=
4
;
private
final
long
totalStartedThreadCount
=
3
;
@Before
public
void
initializeThreadStatusDisplayFilter
()
{
record
=
new
ThreadsStatusRecord
(
timestamp
,
hostname
,
vmName
,
threadCount
,
daemonThreadCount
,
peakThreadCount
,
totalStartedThreadCount
);
threadsStatusFilter
=
new
ThreadsStatusDisplayFilter
(
numberOfEntries
,
recordsTimeUnit
);
}
@Test
public
void
xyPlotEntriesShouldBeCorrect
()
{
test
(
threadsStatusFilter
).
and
().
send
(
record
).
to
(
threadsStatusFilter
.
getInputPort
()).
start
();
final
Date
date
=
new
Date
(
TimeUnit
.
MILLISECONDS
.
convert
(
record
.
getLoggingTimestamp
(),
recordsTimeUnit
));
final
String
minutesAndSeconds
=
date
.
toString
().
substring
(
14
,
19
);
final
String
id
=
record
.
getHostname
()
+
" - "
+
record
.
getVmName
();
long
actualThreadCount
=
(
long
)
threadsStatusFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
THREADS
).
get
(
minutesAndSeconds
);
long
actualTotalStartedThreadCount
=
(
long
)
threadsStatusFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
TOTAL_THREADS
)
.
get
(
minutesAndSeconds
);
long
actualPeakThreadCount
=
(
long
)
threadsStatusFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
PEAK_THREADS
).
get
(
minutesAndSeconds
);
long
actualDaemonThreadCount
=
(
long
)
threadsStatusFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
DAEMON_THREADS
)
.
get
(
minutesAndSeconds
);
assertThat
(
actualThreadCount
,
is
(
threadCount
));
assertThat
(
actualTotalStartedThreadCount
,
is
(
totalStartedThreadCount
));
assertThat
(
actualPeakThreadCount
,
is
(
peakThreadCount
));
assertThat
(
actualDaemonThreadCount
,
is
(
daemonThreadCount
));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment