test.stress.timer
Class TimerTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by test.stress.timer.TimerTestCase
All Implemented Interfaces:
EventListener, NotificationListener, junit.framework.Test

public class TimerTestCase
extends junit.framework.TestCase
implements NotificationListener

Timer Stress Tests This test works by starting a lot of notifications at the start and checks the concurrency by performing lots of operations.

It then waits for the slow notifications to complete allowing any lag due to slower computers to be caught up with.

Any concurrency problem or dropped notifications should show up when the test times out and the target notifications are not reached.

Author:
Adrian Brock.

Constructor Summary
TimerTestCase(String s)
          Construct the test
 
Method Summary
 void handleNotification(Notification n, Object ignored)
          Handle the notification, just add it to the list
 void testTortureOne()
          Test the timer under stress conditions
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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

TimerTestCase

public TimerTestCase(String s)
Construct the test

Method Detail

testTortureOne

public void testTortureOne()
                    throws Exception
Test the timer under stress conditions

Throws:
Exception

handleNotification

public void handleNotification(Notification n,
                               Object ignored)
Handle the notification, just add it to the list

Specified by:
handleNotification in interface NotificationListener


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.