fr.inria.peerunit.rmi.tester
Class TesterImpl

java.lang.Object
  extended by fr.inria.peerunit.base.AbstractTester
      extended by fr.inria.peerunit.rmi.tester.TesterImpl
All Implemented Interfaces:
StorageTester, Tester, java.io.Serializable, java.lang.Runnable, java.rmi.Remote

public class TesterImpl
extends AbstractTester
implements Tester, java.io.Serializable, java.lang.Runnable

Since:
1.0
Version:
1.0
Author:
Eduardo Almeida, Jeremy Masson, sunye
See Also:
fr.inria.peerUnit.Tester, fr.inria.peerunit.VolatileTester, StorageTester, Coordinator, java.util.concurrent.BlockingQueue, Serialized Form

Field Summary
 
Fields inherited from class fr.inria.peerunit.base.AbstractTester
defaults, globals, id
 
Constructor Summary
  TesterImpl(Bootstrapper boot, GlobalVariables gv)
          Used to give the identifier of the tester.
  TesterImpl(Bootstrapper boot, GlobalVariables gv, TesterUtil tu)
           
protected TesterImpl(GlobalVariables gv, int i, TesterUtil tu)
           
 
Method Summary
 void cleanUp()
           
 void execute(MethodDescription md)
          Used to add an action to be executed
 void kill()
          An example how to kill a peer YourTestClass test = new YourTestClass(); test.export(test.getClass()); test.run(); ... // code test.kill();
 void quit()
          Used to interrupt actions's execution.
 void registerTestCase(java.lang.Class<?> klass)
          Creates the peer and the test testCase.
 void run()
          starts the tester
 void setCoordinator(Coordinator c)
          Sets the coordinator for this tester.
 void start()
           
 
Methods inherited from class fr.inria.peerunit.base.AbstractTester
clear, containsKey, get, getCollection, getId, getPeerName, globalTable, initializeLogger, put, setId, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.inria.peerunit.Tester
getId
 
Methods inherited from interface fr.inria.peerunit.StorageTester
clear, containsKey, get, getCollection, put
 

Constructor Detail

TesterImpl

public TesterImpl(Bootstrapper boot,
                  GlobalVariables gv)
           throws java.rmi.RemoteException
Used to give the identifier of the tester.

Parameters:
klass - the coordinator which give the tester's identifier.
Throws:
java.rmi.RemoteException

TesterImpl

public TesterImpl(Bootstrapper boot,
                  GlobalVariables gv,
                  TesterUtil tu)
           throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

TesterImpl

protected TesterImpl(GlobalVariables gv,
                     int i,
                     TesterUtil tu)
Method Detail

setCoordinator

public void setCoordinator(Coordinator c)
Description copied from interface: Tester
Sets the coordinator for this tester.

Specified by:
setCoordinator in interface Tester

start

public void start()
           throws java.rmi.RemoteException
Specified by:
start in interface Tester
Throws:
java.rmi.RemoteException

run

public void run()
starts the tester

Specified by:
run in interface java.lang.Runnable
Throws:
java.lang.InterruptedException

registerTestCase

public void registerTestCase(java.lang.Class<?> klass)
Creates the peer and the test testCase. Sends the actions to be executed to the testCase.

Parameters:
klass - the Test Case Class.
Throws:
java.rmi.RemoteException
java.lang.SecurityException

execute

public void execute(MethodDescription md)
             throws java.rmi.RemoteException
Used to add an action to be executed

Specified by:
execute in interface Tester
Parameters:
md - is a instance of MathodDescription class containing all informations allowing the correct execution of the test case action that it describes.
Throws:
RemoteExcption
java.lang.InterruptedException
java.rmi.RemoteException - because the method is distant

kill

public void kill()
An example how to kill a peer YourTestClass test = new YourTestClass(); test.export(test.getClass()); test.run(); ... // code test.kill();

Specified by:
kill in interface Tester

quit

public void quit()
Used to interrupt actions's execution. Cleans the action list and asks coordinator to quit.


cleanUp

public void cleanUp()


Copyright © 2010. All Rights Reserved.