org.semispace
Class ListenerStarvationTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.semispace.ListenerStarvationTest
All Implemented Interfaces:
junit.framework.Test

public class ListenerStarvationTest
extends junit.framework.TestCase

Starvation test. Thanks to Chris Mcfarlen of Yahoo for providing the scenario and the initial test code.

This test will fail with a large iteration number for reasons not pinpointed at the time of writing.


Nested Class Summary
static class ListenerStarvationTest.TestObject
           
 
Constructor Summary
ListenerStarvationTest(String testName)
          Create the test case
 
Method Summary
protected  void setUp()
           
 void testStarvation()
          When having several listeners and a combination of read and take, it possible for listeners to get starved when competing for resource.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListenerStarvationTest

public ListenerStarvationTest(String testName)
Create the test case

Parameters:
testName - name of the test case
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

testStarvation

public void testStarvation()
When having several listeners and a combination of read and take, it possible for listeners to get starved when competing for resource. In this test, this happens after 40 missed reads for a given reader.



Copyright © 2008-2012. All Rights Reserved.