How would you unittest a safe-publication guarantee in Java?
To be concrete:
I have a Cache interface that has a method getOrLoad(K key, ObjectLoader loader). Thing is, if a Cache cannot find an ... |
I'm working through some tutorials and examples of java.util.concurrent package. Usually example authors put a placeholder marked with a comment 'long running task'. Since these examples are about concurrent programming I'm ... |
I want a thread in a Java program to loop until all other threads die, and then end the loop. How can I know when my loop thread is the ... |
What is the best way to test value visibility between threads?
class X {
private volatile Object ref;
public Object getRef() {
return ref;
}
public void setRef(Object newRef) {
...
|
I saw this post on SO already but it still begs the question, at least for Java. It seems that this should be a pressing issue for any app (i'm ... |
The classical unit testing is basically just putting x in and expecting y out, and automating that process. So it's good for testing anything that doesn't involve time. But then, most ... |
I'm on Java concurrency at the moment.
I don't know how to write negative scenario test.
I need a way to make deadlocks and I need a way to see that ... |
|
I'm trying to test java.util.concurrent.ConcurrentLinkedQueue when accessed via multiple threads. Mentioned below is my Junit test using RepeatedTest to run in two concurrent threads. My questions is: is it correct to ... |
After two years, one of my tests (testing some concurrent-db-transaction-stuff) suddenly starts failing with BrokenBarrierException on the build server. It used to work all the time, now it fails one out ... |
I wanted to validate the below test I wrote to validate the fact that two threads can concurrently access a static synchronized method and a non-static synchronized method (as locks is ... |
I know support exists for running JUnit or TestNG test suites in parallel, but it requires specific configuration (such as specifying thread counts, for example) and most importantly do not prevent ... |
I have a large JUnit test suite, where I'd quite like to run all the tests concurrently for two reasons:
- Exploit multiple cores to run the whole test suite faster
- Hopefully detect some ...
|
Scenario: There exists 'n' teams who each work on their virtual 'wall' (like facebook's wall). Each team sees only their own wall and the posts on it. The posts can be ... |
I have an Ant task that runs a batch of test cases that I have written, which runs perfectly fine... except Ant seems to be ignoring the fork="true" attribute in the ... |
The only thing I've seen so far is someone posting an example of testing a TypedActor. I take it there's no way of testing an UntypedActor through say Junit? Akka docs ... |
While writing some java article I'm trying to reproduce re-ordering in case of unsynchronized object costruction in multithreaded environment.
The case when a heavy object is constructed w/o synchonization/volatiles/finals and ... |
public class ThreadSafe implements ITaskCompletionListener {
private final Set<String> taskIds = new HashSet<String>();
private final Set<String> successfulIds = new HashSet<String>();
private final Set<String> cancelledIds = new HashSet<String>();
private final Set<String> errorIds = new HashSet<String>();
public ThreadSafe() ...
|
Hi, Welcome to JavaRanch! First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. A single name isn't enough. You can change your display name here. Thanks! Now, as to your question: you want to use wait() ... |