|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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()
FunctionalTestUnit
FunctionalTestUnit
.
getName
in interface FunctionalTestUnit
FunctionalTestUnit
.FunctionalTestUnit.getName()
public java.lang.String getHostname()
getHostname
in interface FunctionalTestUnit
public int getPort()
getPort
in interface FunctionalTestUnit
public java.lang.String getDefaultPropertiesFile()
FunctionalTestUnit
FunctionalTestUnit
.
getDefaultPropertiesFile
in interface FunctionalTestUnit
FunctionalTestUnit.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 FunctionalTestUnit
java.io.IOException
java.lang.Exception
public void stop() throws java.lang.Exception
PeerUnit
.
stop
in interface FunctionalTestUnit
java.io.IOException
java.lang.Exception
public void unsetGums() throws java.lang.Exception
java.lang.Exception
public boolean isRunning()
isRunning
in interface FunctionalTestUnit
java.io.IOException
public java.util.Collection<StatusEntry> gumsInState(AllocationStatus state) throws java.lang.Exception
state
- State of Gums to be returned
java.lang.Exception
public void destroy()
FunctionalTestUnit
FunctionalTestUnit
uses.
destroy
in interface FunctionalTestUnit
FunctionalTestUnit.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.Exception
public 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
FunctionalTestUnit
FunctionalTestUnit
has
stopped all work.
waitUntilWorkIsDone
in interface FunctionalTestUnit
java.lang.Exception
public boolean stillIdle() throws java.lang.Exception
FunctionalTestUnit
waitUntilWorkIsDone()
call.
stillIdle
in interface FunctionalTestUnit
java.lang.Exception
public void kill() throws java.lang.Exception
FunctionalTestUnit
System.exit()
kill
in interface FunctionalTestUnit
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |