org.ourgrid.common.fd
Class AbstractFailureDetectorTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.ourgrid.common.fd.AbstractFailureDetectorTest
All Implemented Interfaces:
junit.framework.Test, CommonTest, FailureDetectorTest, FastTest, PreCommitTest, SelectiveTest, StressTest

public class AbstractFailureDetectorTest
extends junit.framework.TestCase
implements FailureDetectorTest

Test case for AbstractFailureDetector.

See Also:
AbstractFailureDetector

Constructor Summary
AbstractFailureDetectorTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testGetFailureDetectorAddress()
           
 void testMonitorableStateChanged()
          Test if the FailureDetector is notifying when a Monitorade changes it state.
 void testMonitorableStateChanged2()
          Test if the FailureDetector is notifying when a Monitorade changes it state.
 void testRegistter()
          Verfiying if a monitorable is invoked.
 void testUnregister1()
          The same test above, but with two Monitorables and one Notifiable.
 void testUnregister2()
          Tests if the last interested in a monitorable unregister, then this monitorable must not be monitored any more.
 void testUnregister3()
          Now, two Notifiable are interested in the same Monitorable, so, if one Notifiable unregister, the Monitorable must continue to be monitored.
 void testWhenReencarnationNumberChanges()
          In this test the state will chance once but the name (that will be a encarnationNumber)
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Constructor Detail

AbstractFailureDetectorTest

public AbstractFailureDetectorTest()
Method Detail

setUp

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

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

testRegistter

public void testRegistter()
                   throws java.lang.Exception
Verfiying if a monitorable is invoked.


Throws:
java.lang.Exception - If anything wrong occurs

testUnregister1

public void testUnregister1()
                     throws java.lang.Exception
The same test above, but with two Monitorables and one Notifiable. So, when the notifiable unregister the interest in one, the other must continue to be monitored.

Throws:
java.lang.Exception - If anything wrong occurs

testUnregister2

public void testUnregister2()
                     throws java.lang.Exception
Tests if the last interested in a monitorable unregister, then this monitorable must not be monitored any more.

Throws:
java.lang.Exception - If anything wrong occurs

testUnregister3

public void testUnregister3()
                     throws java.lang.Exception
Now, two Notifiable are interested in the same Monitorable, so, if one Notifiable unregister, the Monitorable must continue to be monitored.

Throws:
java.lang.Exception - If anything wrong occurs

testMonitorableStateChanged

public void testMonitorableStateChanged()
                                 throws java.lang.Exception
Test if the FailureDetector is notifying when a Monitorade changes it state.

Throws:
java.lang.Exception - If anything wrong occurs

testMonitorableStateChanged2

public void testMonitorableStateChanged2()
                                  throws java.lang.Exception
Test if the FailureDetector is notifying when a Monitorade changes it state. Now the state will change twice

Throws:
java.lang.Exception - If anything wrong occurs

testWhenReencarnationNumberChanges

public void testWhenReencarnationNumberChanges()
                                        throws java.lang.Exception
In this test the state will chance once but the name (that will be a encarnationNumber)

Throws:
java.lang.Exception - If anything wrong occurs

testGetFailureDetectorAddress

public void testGetFailureDetectorAddress()
                                   throws java.lang.Exception
Throws:
java.lang.Exception