Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Use this tag for code whose main focus is high-performance testing of the actual functional code.
2
votes
Testing an Executor
Currently your test is biased to help the unit under test to pass. The delegateExecutor is chosen to be a Executors.newSingleThreadExecutor(), which actually forces the SingleQueuedElementExecutor to …
1
vote
Unit Test to verify number of times lazy initialization logic is executed for a data member
Why not keep this simple and test wether subsequent invocations really do return the same instance as before :
A a = new A("a", "b");
assertTrue(a.compute() == a.compute());
This way, there is no n …
4
votes
Accepted
Unit test an ExecutorService in a deamon
TaskProcessor
I see little reason why this should extend Thread, rather than simply implement Runnable
as a thread it is responsive to interruption, yet there is no way a client can interrupt this t …
17
votes
Accepted
Just a lowly counter that turned out to be surprisingly complicated
Is there a common Java library that serves a similar purpose, or am I
reinventing-the-wheel?
As far as I know the JRE doesn't offer this out of the box.
Are the semantics for null keys and …