|
We have created a common threading framework to manage how we want to use threads in our applications. Are there any frameworks out there like gtest or cppunit that solely focus on unit testing threads, thread pools, thread queues, and such?
Right now...
Started by Brian T Hannan on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Your own with one of the many unit test frameworks out there, but it would be hard to make it robust it trivial to unit test your library..
|
|
My strategy for threading issues in a Swing Java app is to divide methods in three types:
methods that should be accessed by the GUI thread. These methods should never block and may call swing methods. Not thread-safe. methods that should be accessed ...
Started by amarillion on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Dispatch Thread * <p> * Add this annotation to methods that perform potentially blocking operations be accessed by the * Event Dispatch Thread * <p> * Add this annotation to methods that call (swing that should be thread....
|
|
I have a Java service which now will execute in a batch mode. Multi threaded support is added to the service so for every batch request a thread pool will be dedicated to execute the batch. The question is how do I test this? I have functional tests that...
Started by CodePolice on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
For example:
@Test....
By substituting the body of the threads with test code you should allows you to annotate your test methods and cause them to be executed in n threads concurrently.
Of the thread pool in isolation.
|
Ask your Facebook Friends
|
Thread test test test test test test test
Started by construkt on
, 11 posts
by 9 people.
Answer Snippets (Read the full thread at cityofheroes):
I smell a lock coming testing....
Come back in three months and maybe of anything witty enough to post in this thread hum...
Reply test test test test test test test test test D- You fail.
|
|
Hot-on-the-heels of of my previous unit testing related question, here's another toughie:
I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield. I'd like to ask how people have gone ...
Started by jkp on
, 17 posts
by 17 people.
Answer Snippets (Read the full thread at stackoverflow):
That has so far worked great for me, and I use the same approach for the thread pool of the concurrency pattern used:
Unit tests for classes that operate in a single thread and aren't thread aware -- easy,....
The test.
|
|
I am writing a unit test for some thread locking logic, so as to make the test more likely to fail quickly; I wish to have all the threads switch between each other very often and at random times.
I know this will not prove we don’t have any bugs, but...
Started by Ian Ringrose on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
The writer feels the sameTake a look at....
[UPDATE] Look at this answer in this thread .
This question is not about a thread shaker more like a special test to me.
Is a more effective way to test thread locking logic.
|
|
I asked a question about building custom Thread Safe Generic List now I am trying to unit test it and I absolutely have no idea how to do that. Since the lock happens inside the ThreadSafeList class I am not sure how to make the list to lock for a period...
Started by Jeffrey on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You also don't need to make a snapshot; remember, this is a ... .
So of course your test will fail.
Both items should be added, just one at a time .
First of all, your exit conditions don't make sense.
First test, Can_add_one_item_at_a_time .
|
|
I'm wondering if the Maven surefire plugin either runs tests multi-threaded by default (and if so can the number of threads be controlled? ) or if it runs tests from the Test classes in a random order or predictable order, or if the order can dictated...
Started by harschware on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The order of execution is definitely"));
You are however strongly advised... .
Of execution is not guaranteed even by JUnit, so each test should set up and tear down its context (aka test fixture) independent of what happens before or after.
|
|
I am looking at improving a package that I believe not to be threadsafe when its input is shared between multiple worker threads. According to TDD principles, I should write some tests that fail in the first instance, and these would certainly be useful...
Started by Andrzej Doyle on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Here's to write a true unit test for....
Found I can force a particular problematic interleaving of calls to a potentially un-thread-safe class trying to test what happens if two threads are in the same method at the same time.
|
|
Hi guys, this kind of follows on from another question of mine.
Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to test it?
I am thinking create method which just spawns lots of...
Started by Rob Cooper on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
In .NET, 'ThreadPool' and 'Thread' threads won't(); } foreach(Thread thread in threads) { thread.Join(); } }
@ajmastrean, since unit test result....
And without blocking forever, then the test succeeds.
|