|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ourgrid.test.functionalunits.PeerUnit
public class PeerUnit
PeerUnit will represents a peer that will be used to execute
functional tests of OurGrid. A default creation of a PeerUnit
will find and use a disponible port, address and any other detail that isn't
needed to a test. Also is possible interact between functional tests unit to
permit a easy way to create and mantain any test. This class will execute
scripts to control the peer.
| Method Summary | |
|---|---|
void |
destroy()
This method is used to delete enviroment files that the FunctionalTestUnit uses. |
java.lang.String |
getAddress()
Gets the address that this peer is published. |
java.lang.String |
getDefaultPropertiesFile()
Returns the default properties file that will be used by this FunctionalTestUnit. |
java.lang.String |
getHostname()
Get the hostname of the peer. |
java.io.File |
getIDFile()
Gets the idfile being used by this test peer. |
java.lang.String |
getName()
Returns the name of this FunctionalTestUnit. |
long |
getPeerID()
Get this peerID |
int |
getPort()
Get the port of the peer. |
java.lang.Double |
getRankingForPeer(PeerUnit peerUnit)
Getts the ranking of a given peer. |
java.io.File |
getRankingsFile()
Gets the rankings being used by this test peer. |
boolean |
gumsBeenSet()
Verifies if gums have been set. |
java.util.Collection<StatusEntry> |
gumsInState(AllocationStatus state)
Verify what gums are in a certain state at this peer. |
boolean |
isRunning()
Verify if this peer is running. |
void |
kill()
Kills this unit by calling System.exit() |
void |
setCorePeer(CorePeerUnit corePeer)
Set the core peer that this peer will contact. |
void |
setGums(UserAgentUnit... userAgentUnits)
Set the gums to be used by this PeerUnit. |
void |
setId(long peerID)
Sets the ID value of peer |
void |
setRankingsFile(java.util.Map<PeerUnit,java.lang.Double> rankings)
Sets the ranking file of Network of Favors |
void |
start()
Starts this PeerUnit. |
boolean |
stillIdle()
This method verifies if the functional test unit was not waken up since the last waitUntilWorkIsDone() call. |
void |
stop()
Stops this PeerUnit. |
void |
unsetGums()
Unsets gums being used at this PeerUnit. |
void |
waitUntilWorkIsDone()
This method will block until this FunctionalTestUnit has
stopped all work. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String getAddress()
public java.lang.String getName()
FunctionalTestUnitFunctionalTestUnit.
getName in interface FunctionalTestUnitFunctionalTestUnit.FunctionalTestUnit.getName()public java.lang.String getHostname()
getHostname in interface FunctionalTestUnitpublic int getPort()
getPort in interface FunctionalTestUnitpublic java.lang.String getDefaultPropertiesFile()
FunctionalTestUnitFunctionalTestUnit.
getDefaultPropertiesFile in interface FunctionalTestUnitFunctionalTestUnit.getDefaultPropertiesFile()
public void setCorePeer(CorePeerUnit corePeer)
throws java.lang.Exception
corePeer - CorePeerUnit object to be used as test.
java.lang.Exception
public void setGums(UserAgentUnit... userAgentUnits)
throws java.lang.Exception
PeerUnit. This method
will block until all gums are IDLE.
userAgentUnits - Units to be set at this peer.
java.lang.Exception - If gums could not ber set.public boolean gumsBeenSet()
public void start()
throws java.lang.Exception
PeerUnit.
start in interface FunctionalTestUnitjava.io.IOException
java.lang.Exception
public void stop()
throws java.lang.Exception
PeerUnit.
stop in interface FunctionalTestUnitjava.io.IOException
java.lang.Exception
public void unsetGums()
throws java.lang.Exception
java.lang.Exceptionpublic boolean isRunning()
isRunning in interface FunctionalTestUnitjava.io.IOException
public java.util.Collection<StatusEntry> gumsInState(AllocationStatus state)
throws java.lang.Exception
state - State of Gums to be returned
java.lang.Exceptionpublic void destroy()
FunctionalTestUnitFunctionalTestUnit uses.
destroy in interface FunctionalTestUnitFunctionalTestUnit.destroy()public java.io.File getIDFile()
public java.io.File getRankingsFile()
public void setId(long peerID)
throws java.lang.Exception
peerID - new ID
java.lang.Exception
public void setRankingsFile(java.util.Map<PeerUnit,java.lang.Double> rankings)
throws java.lang.Exception
rankings - Map containning the relations between Peers and value of
balance
java.io.FileNotFoundException - if file does not exists
java.io.IOException - if occurred a problem while manipulate the file
object
java.lang.Exceptionpublic long getPeerID()
public java.lang.Double getRankingForPeer(PeerUnit peerUnit)
throws java.rmi.RemoteException
peerUnit - Peer to get reanking from.
java.lang.Exception
java.rmi.RemoteException
public void waitUntilWorkIsDone()
throws java.lang.Exception
FunctionalTestUnitFunctionalTestUnit has
stopped all work.
waitUntilWorkIsDone in interface FunctionalTestUnitjava.lang.Exception
public boolean stillIdle()
throws java.lang.Exception
FunctionalTestUnitwaitUntilWorkIsDone() call.
stillIdle in interface FunctionalTestUnitjava.lang.Exception
public void kill()
throws java.lang.Exception
FunctionalTestUnitSystem.exit()
kill in interface FunctionalTestUnitjava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||