org.ourgrid.peer.manager
Class EBPeerManagerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.ourgrid.peer.manager.EBPeerManagerTest
All Implemented Interfaces:
junit.framework.Test, PeerPreCommitTest, PreCommitTest, SelectiveTest, SpecialCareTest, StressTest

public class EBPeerManagerTest
extends junit.framework.TestCase
implements PeerPreCommitTest, SpecialCareTest


Field Summary
protected  AllocationManager allocationManager
          The Allocation.
protected  EBPeerManager ebPeerManager
          The object to be tested.
protected  RequestManager requestManager
          The EBRequestManager.
 
Constructor Summary
EBPeerManagerTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testComputeCommunityRedistribution()
           
 void testConsumerIsDead()
           
 void testConsumerIsDead3()
           
 void testConsumerIsDeadWithRemoteGum()
           
 void testDisposeOfForCommunityGuMs()
          Verifies if the disposed community gums are been distributed correctly.
 void testDisposeOfForLocalGuMs()
          Verifies if the disposed local gums are been distributed correctly.
 void testDisposeOfForNonExistentRequestID()
          Verifies if the disposeOf() method for a non existent requestID is working correctly.
 void testFinishRequest()
           
 void testGumsAreAllocatedAfterRequestExists()
           
 void testGumWasLost()
          Verifies the lostGuM() method called by local and community requests tries to provide another gums.
 void testGumWasLost2()
           
 void testHereIsGuMForCommunityGuMs()
          Verifies if the hereIsGuM() called by community is working correctly.
 void testHereIsGuMForCommunityGuMsWhenRequestDoesntExistOrFulfilled()
          Verifies if the hereIsGuM() is working correctly when the request is already fulfilled or doesn't exist.
 void testHereIsGuMForLocalGuMs()
          Verifies if the hereIsGuM() called by EBLocalGuMPFacade when there is more requests is working correctly.
 void testHereIsGumOfSameMachine()
           
 void testHereIsGuMOnlyWithRequestMadeByLocalGuMP()
          Verifies if the hereIsGuM() called by EBLocalGuMPFacade when there isn't another request is working correctly.
 void testLocalGumIsDeadAndUnwantedGum()
           
 void testLocalGumIsDeadWithNotAllocatedGums()
           
 void testOverloadWannaGuMsHereIsGuM()
          Verifies the wannaGuMs() and hereIsGuM() methods overloaded.
 void testPauseResume1()
           
 void testPauseResume2()
           
 void testRedistributeGums1()
          The redistributeGuMsByConsumer() test.
 void testRedistributeGums2()
          The redistributeGuMsByConsumer() atest.
 void testRedistributeGums3()
          The redistributeGuMsByConsumer() atest.
 void testRedistributeGums4()
           
 void testRedistributeGums5()
           
 void testRemoteUnwantedGum()
           
 void testUnwantedGumsAreNotAllocated()
           
 void testUnwantedGumsWithDifferentRequest()
           
 void testWannaGuMs1()
          Tests the basic functions os wannaGuMs() method.
 void testWannaGuMs2()
          Tests if the wannaGuMs() method is delivering the correct number of GuMs.
 void testWannaGuMs3()
          Tests the preemption.
 void testWannaGuMs4()
          This test verifies if the gums are been deallocated correctly.
 
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
 

Field Detail

allocationManager

protected AllocationManager allocationManager
The Allocation.


requestManager

protected RequestManager requestManager
The EBRequestManager.


ebPeerManager

protected EBPeerManager ebPeerManager
The object to be tested.

Constructor Detail

EBPeerManagerTest

public EBPeerManagerTest()
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

testHereIsGuMOnlyWithRequestMadeByLocalGuMP

public void testHereIsGuMOnlyWithRequestMadeByLocalGuMP()
Verifies if the hereIsGuM() called by EBLocalGuMPFacade when there isn't another request is working correctly.


testHereIsGuMForCommunityGuMsWhenRequestDoesntExistOrFulfilled

public void testHereIsGuMForCommunityGuMsWhenRequestDoesntExistOrFulfilled()
                                                                    throws RequestAlreadyExistsException,
                                                                           RequestDoesNotExistException
Verifies if the hereIsGuM() is working correctly when the request is already fulfilled or doesn't exist.

Throws:
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException

testHereIsGuMForLocalGuMs

public void testHereIsGuMForLocalGuMs()
                               throws RequestAlreadyExistsException,
                                      RequestDoesNotExistException
Verifies if the hereIsGuM() called by EBLocalGuMPFacade when there is more requests is working correctly.

Throws:
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException

testHereIsGuMForCommunityGuMs

public void testHereIsGuMForCommunityGuMs()
                                   throws RequestAlreadyExistsException,
                                          RequestDoesNotExistException
Verifies if the hereIsGuM() called by community is working correctly.

Throws:
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException

testOverloadWannaGuMsHereIsGuM

public void testOverloadWannaGuMsHereIsGuM()
                                    throws RequestAlreadyExistsException,
                                           RequestDoesNotExistException
Verifies the wannaGuMs() and hereIsGuM() methods overloaded.

Throws:
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException

testWannaGuMs1

public void testWannaGuMs1()
                    throws RequestAlreadyExistsException,
                           RequestDoesNotExistException
Tests the basic functions os wannaGuMs() method.

Throws:
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException

testWannaGuMs2

public void testWannaGuMs2()
                    throws RequestAlreadyExistsException,
                           RequestDoesNotExistException
Tests if the wannaGuMs() method is delivering the correct number of GuMs.

Throws:
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException

testWannaGuMs3

public void testWannaGuMs3()
                    throws RequestAlreadyExistsException,
                           RequestDoesNotExistException
Tests the preemption.

Throws:
RequestAlreadyExistsException
RequestAlreadyExistsException - Indicates that a request already exists.
RequestDoesNotExistException - s

testWannaGuMs4

public void testWannaGuMs4()
                    throws RequestAlreadyExistsException
This test verifies if the gums are been deallocated correctly.

Throws:
RequestAlreadyExistsException - If the request id already exists.

testPauseResume1

public void testPauseResume1()
                      throws RequestAlreadyExistsException,
                             RequestDoesNotExistException
Throws:
RequestAlreadyExistsException
RequestDoesNotExistException

testPauseResume2

public void testPauseResume2()
                      throws RequestAlreadyExistsException,
                             RequestDoesNotExistException
Throws:
RequestAlreadyExistsException
RequestDoesNotExistException

testDisposeOfForNonExistentRequestID

public void testDisposeOfForNonExistentRequestID()
                                          throws RequestAlreadyExistsException
Verifies if the disposeOf() method for a non existent requestID is working correctly.

Throws:
RequestAlreadyExistsException - If the request id already exists.

testDisposeOfForLocalGuMs

public void testDisposeOfForLocalGuMs()
                               throws RequestAlreadyExistsException,
                                      RequestDoesNotExistException
Verifies if the disposed local gums are been distributed correctly.

Throws:
RequestAlreadyExistsException - If the request id already exists.
RequestDoesNotExistException

testDisposeOfForCommunityGuMs

public void testDisposeOfForCommunityGuMs()
                                   throws RequestAlreadyExistsException,
                                          RequestDoesNotExistException
Verifies if the disposed community gums are been distributed correctly.

Throws:
RequestAlreadyExistsException - If the request id already exists.
RequestDoesNotExistException

testGumWasLost

public void testGumWasLost()
                    throws RequestAlreadyExistsException,
                           RequestDoesNotExistException
Verifies the lostGuM() method called by local and community requests tries to provide another gums.

Throws:
RequestAlreadyExistsException - If the request id already exists.
RequestDoesNotExistException

testGumWasLost2

public void testGumWasLost2()
                     throws java.rmi.RemoteException,
                            RequestAlreadyExistsException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException

testLocalGumIsDeadWithNotAllocatedGums

public void testLocalGumIsDeadWithNotAllocatedGums()

testRedistributeGums1

public void testRedistributeGums1()
                           throws RequestAlreadyExistsException,
                                  java.rmi.RemoteException
The redistributeGuMsByConsumer() test.

Throws:
RequestAlreadyExistsException - If the request id already exists.
java.rmi.RemoteException

testRedistributeGums2

public void testRedistributeGums2()
                           throws RequestAlreadyExistsException,
                                  java.rmi.RemoteException
The redistributeGuMsByConsumer() atest.

Throws:
RequestAlreadyExistsException - If the request id already exists.
java.rmi.RemoteException

testRedistributeGums3

public void testRedistributeGums3()
                           throws RequestAlreadyExistsException,
                                  java.rmi.RemoteException
The redistributeGuMsByConsumer() atest.

Throws:
RequestAlreadyExistsException - If the request id already exists.
java.rmi.RemoteException

testComputeCommunityRedistribution

public void testComputeCommunityRedistribution()

testRedistributeGums4

public void testRedistributeGums4()
                           throws RequestAlreadyExistsException,
                                  java.lang.InterruptedException,
                                  java.rmi.RemoteException
Throws:
RequestAlreadyExistsException
java.lang.InterruptedException
java.rmi.RemoteException

testRedistributeGums5

public void testRedistributeGums5()
                           throws RequestAlreadyExistsException,
                                  java.lang.InterruptedException,
                                  java.rmi.RemoteException
Throws:
RequestAlreadyExistsException
java.lang.InterruptedException
java.rmi.RemoteException

testGumsAreAllocatedAfterRequestExists

public void testGumsAreAllocatedAfterRequestExists()
                                            throws java.rmi.RemoteException,
                                                   RequestAlreadyExistsException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException

testUnwantedGumsAreNotAllocated

public void testUnwantedGumsAreNotAllocated()
                                     throws java.rmi.RemoteException,
                                            RequestAlreadyExistsException,
                                            RequestDoesNotExistException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException
RequestDoesNotExistException

testUnwantedGumsWithDifferentRequest

public void testUnwantedGumsWithDifferentRequest()
                                          throws java.rmi.RemoteException,
                                                 RequestAlreadyExistsException,
                                                 RequestDoesNotExistException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException
RequestDoesNotExistException

testLocalGumIsDeadAndUnwantedGum

public void testLocalGumIsDeadAndUnwantedGum()
                                      throws java.rmi.RemoteException,
                                             RequestAlreadyExistsException,
                                             RequestDoesNotExistException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException
RequestDoesNotExistException

testRemoteUnwantedGum

public void testRemoteUnwantedGum()
                           throws java.rmi.RemoteException,
                                  RequestAlreadyExistsException,
                                  java.net.MalformedURLException,
                                  java.rmi.NotBoundException,
                                  RequestDoesNotExistException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException
java.net.MalformedURLException
java.rmi.NotBoundException
RequestDoesNotExistException

testConsumerIsDead

public void testConsumerIsDead()
                        throws java.rmi.RemoteException,
                               RequestAlreadyExistsException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException

testFinishRequest

public void testFinishRequest()
                       throws java.rmi.RemoteException,
                              RequestAlreadyExistsException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException

testConsumerIsDeadWithRemoteGum

public void testConsumerIsDeadWithRemoteGum()
                                     throws java.rmi.RemoteException,
                                            RequestAlreadyExistsException,
                                            java.net.MalformedURLException,
                                            java.rmi.NotBoundException,
                                            RequestDoesNotExistException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException
java.net.MalformedURLException
java.rmi.NotBoundException
RequestDoesNotExistException

testConsumerIsDead3

public void testConsumerIsDead3()
                         throws java.rmi.RemoteException,
                                RequestAlreadyExistsException,
                                RequestDoesNotExistException,
                                java.net.MalformedURLException,
                                java.rmi.NotBoundException
Throws:
java.rmi.RemoteException
RequestAlreadyExistsException
RequestDoesNotExistException
java.net.MalformedURLException
java.rmi.NotBoundException

testHereIsGumOfSameMachine

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