test « concurrency « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » concurrency » test 

1. Unit testing for safe publication    stackoverflow.com

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 ...

2. Long running methods from Java SDK for testing purposes    stackoverflow.com

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 ...

3. How can you test if a thread is the only remaining thread in Java?    stackoverflow.com

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 ...

4. How to test visibility of values between threads    stackoverflow.com

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) {
  ...

5. How can I effectively test (unit/integration) concurrent code in Java?    stackoverflow.com

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 ...

6. Unit testing real-time / concurrent software    stackoverflow.com

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 ...

7. concurrency in java - how to test it?    stackoverflow.com

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 ...

8. Junit to test concurrency    stackoverflow.com

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 ...

9. Suddenly lots of BrokenBarrierExceptions in a test    stackoverflow.com

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 ...

10. Validity of the concurrency test for instance and static methods    stackoverflow.com

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 ...

11. Is there any *real* solution for taking advantage of multiple cores when running a JUnit/TestNG test suite?    stackoverflow.com

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 ...

12. Concurrent JUnit testing    stackoverflow.com

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 ...

13. Is there a concurrency problem here? How to test it during development?    stackoverflow.com

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 ...

14. Forking jUnit with a selenium test using ant runs tests serially, not concurrently    stackoverflow.com

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 ...

15. How do we test Actors in Java?    stackoverflow.com

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 ...

16. jvm reordering/visibility effect test    stackoverflow.com

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 ...

17. Can the below class thread safety ever be broken; I am sure it can't be but just wanted to be doubly sure as it is not easy to test    stackoverflow.com

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() ...

18. Thread concurrency test    coderanch.com

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() ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.