org.ourgrid.test.functionaltests
Class NetworkOfFavoursFunctionalTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.ourgrid.test.functionaltests.NetworkOfFavoursFunctionalTests
All Implemented Interfaces:
junit.framework.Test, FunctionalStressTest, SelectiveTest, StressTest

public class NetworkOfFavoursFunctionalTests
extends junit.framework.TestCase
implements FunctionalStressTest

This test will group all functional tests that are related to redistribution and community requests. Each test must describe a scenario and also start and stop all functional test units that will be used.


Constructor Summary
NetworkOfFavoursFunctionalTests()
           
 
Method Summary
protected  void tearDown()
          Reset the FunctionTestsControl to clear any properties configuration that was used before.
 void testLocalPreemption()
          Test scenario:
- Peer A, Peer B, MyGrid at Peer A, Gums at Peer B, MyGrid at Peer B.
 void testMyGridPeerInteraction()
          Test scenario:
- MyGrid local and Peer local.
 void testNetworkOfFavorsRedistributions()
          Test scenario:
- A Community with 3 Peers, 3 MyGrids for each peer.
 void testNetworkOfFavorsRedistributions2()
           
 void testNetworkOfFavorsRedistributions3()
           
 void testPeerMyGridLocalAndMyGridLocal()
          Test scenario:
- Peer, two local MyGrids.
 void testPeerPeerCorepeerInteraction()
          Test scenario:
- Peer A, Peer B, MyGrid at Peer A, Gums at Peer B.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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

NetworkOfFavoursFunctionalTests

public NetworkOfFavoursFunctionalTests()
Method Detail

tearDown

protected void tearDown()
                 throws java.lang.Exception
Reset the FunctionTestsControl to clear any properties configuration that was used before.

Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception
See Also:
TestCase.tearDown()

testMyGridPeerInteraction

public void testMyGridPeerInteraction()
                               throws java.lang.Exception
Test scenario:
- MyGrid local and Peer local. Description:
- Test if a Gum is donated from a peer to another in a simple scenario. Functional tests units:
- Core peer,
- Peer A,
- Peer B,
- MyGrid.
Test scenario workflow:
- Start mygrid,
- Set mygrid with Peer A,
- Set Peer A corepeer,
- Set Peer B corepeer,
- Start Peer A,
- Start Peer B,
- Set Gums at Peer B,
- Add job at MyGrid,
- Wait until MyGrid job is finished,
- Clear scenario.

Throws:
java.lang.Exception - If any exception is thrown the test fails.

testPeerPeerCorepeerInteraction

public void testPeerPeerCorepeerInteraction()
                                     throws java.lang.Exception
Test scenario:
- Peer A, Peer B, MyGrid at Peer A, Gums at Peer B. Description:
- Test if a Gum is donated from a peer to another in a simple scenario. Functional tests units:
- Core peer,
- Peer A,
- Peer B,
- MyGrid.
Test scenario workflow:
- Start mygrid,
- Set mygrid with Peer A,
- Set Peer A corepeer,
- Set Peer B corepeer,
- Start Peer A,
- Start Peer B,
- Set Gums at Peer B,
- Add job at MyGrid,
- Wait until MyGrid job is finished,
- Clear scenario.

Throws:
java.lang.Exception - If any exception is thrown the test fails.

testLocalPreemption

public void testLocalPreemption()
                         throws java.lang.Exception
Test scenario:
- Peer A, Peer B, MyGrid at Peer A, Gums at Peer B, MyGrid at Peer B. Description:
- Tests if a local broker will have preference over a remote broker. Functional tests units:
- Core peer,
- Peer A,
- Peer B,
- MyGrid A.
- MyGrid B.
Test scenario workflow:
- Start MyGrid A,
- Set MyGrid A with Peer A,
- Start MyGrid B,
- Set MyGrid B with Peer B,
- Set Peer A corepeer,
- Set Peer B corepeer,
- Start Peer A,
- Start Peer B,
- Set Gums at Peer B,
- Add job at MyGrid A,
- Wait until MyGrid A job is running,
- Add job at MyGrid B,
- Wait until MyGrid B job is running,
- Verify that MyGrid A job is failed, - Wait until MyGrid B job is finished,
- Wait until MyGrid A job is finished,
- Clear scenario.

Throws:
java.lang.Exception - If any exception is thrown the test fails.

testPeerMyGridLocalAndMyGridLocal

public void testPeerMyGridLocalAndMyGridLocal()
                                       throws java.lang.Exception
Test scenario:
- Peer, two local MyGrids. Description:
- Tests if the peer do a local redistribution. Functional tests units:
- Peer,
- MyGrid A.
- MyGrid B.
Test scenario workflow:
- Start MyGrid A,
- Set MyGrid A with Peer,
- Start MyGrid B,
- Set MyGrid B with Peer,
- Start Peer,
- Set Gums at Peer,
- Add job at MyGrid A,
- Wait until MyGrid A job is running,
- Add job at MyGrid B,
- Wait until MyGrid B job is running,
- Verify that MyGrid A has the same number of gums than MyGrid B, - Clear scenario.

Throws:
java.lang.Exception - If any exception is thrown the test fails.

testNetworkOfFavorsRedistributions

public void testNetworkOfFavorsRedistributions()
                                        throws java.lang.Exception
Test scenario:
- A Community with 3 Peers, 3 MyGrids for each peer. Description:
- Tests if the remote peer do a local redistribution to the . Functional tests units:
- Peers: A, B and C,
- MyGrids: A, B and C.
Test scenario workflow:
- Start Core Peer - Start Peers A and B - Associate User Agents to respective peers - Start MyGrid B and associate to the Peer B - Add Job from MyGrid B (to receive machines from Peer A) - Wait until all jobs associated to MyGrid B is done. - Start Peer C - Start MyGrid C and associate to the Peer C - Add Job from MyGrid C (to receive machines from Peer A) - Wait until MyGrid C gets 4 machines - Start MyGrid A and associate to the Peer A (that have a considerable value into Network of Favors on Peer B) - Wait until MyGrid A gets 4 machines - Verify if MyGrid A have 4 machines and MyGrid C have 0 machines - Wait while finish jobs in MyGrid A - Clear scenario.

Throws:
java.lang.Exception - If any exception is thrown the test fails.

testNetworkOfFavorsRedistributions2

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

testNetworkOfFavorsRedistributions3

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