fr.inria.peerunit.rmi.tester
Class DistributedTesterImpl

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

public class DistributedTesterImpl
extends AbstractTester
implements Tester, Coordinator, java.io.Serializable

The DistributedTester is both, a Tester and a Coordinator. As a Tester, it has a Coordinator, it registers a test case and executes test steps when requested by its Coordinator. As a coordinator, it accepts the registration of several testers and asks its testers to execute test steps.

Author:
sunye
See Also:
Serialized Form

Field Summary
 
Fields inherited from class fr.inria.peerunit.base.AbstractTester
defaults, globals, id
 
Constructor Summary
DistributedTesterImpl(java.lang.Class<?> klass, Bootstrapper boot, GlobalVariables gv, TesterUtil tu)
           
 
Method Summary
 void execute(MethodDescription md)
          Execute a test case action thanks to it description.
 void kill()
          Stop the tester.
 void methodExecutionFinished(ResultSet result)
           
 void quit(Tester t)
          Finish the test case and calculates the global oracle
 void register()
          Registers this distributed tester with the bootstrapper and receives an id.
 void registerMethods(Tester tester, java.util.Collection<MethodDescription> list)
           
 void registerTesters(java.util.List<Tester> l)
          Sets the testers that are controlled by this tester and informs the tester that this tester is their controller
 void setCoordinator(Coordinator coord)
          Sets the coordinator for this tester.
 void start()
          Starts the distributed tester: - Creates the local tester and the local coordinator
 
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

DistributedTesterImpl

public DistributedTesterImpl(java.lang.Class<?> klass,
                             Bootstrapper boot,
                             GlobalVariables gv,
                             TesterUtil tu)
                      throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

register

public void register()
Registers this distributed tester with the bootstrapper and receives an id.


registerTesters

public void registerTesters(java.util.List<Tester> l)
                     throws java.rmi.RemoteException
Sets the testers that are controlled by this tester and informs the tester that this tester is their controller

Specified by:
registerTesters in interface Coordinator
Throws:
java.rmi.RemoteException
See Also:
Coordinator.registerTesters(java.util.List)

registerMethods

public void registerMethods(Tester tester,
                            java.util.Collection<MethodDescription> list)
                     throws java.rmi.RemoteException
Specified by:
registerMethods in interface Coordinator
Throws:
java.rmi.RemoteException
See Also:
fr.inria.peerunit.Coordinator#registerMethods(fr.inria.peerunit.Tester, java.util.List)

execute

public void execute(MethodDescription md)
             throws java.rmi.RemoteException
Description copied from interface: Tester
Execute a test case action thanks to it description.

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:
java.lang.InterruptedException
java.rmi.RemoteException - because the method is distant
See Also:
Tester.execute(fr.inria.peerunit.parser.MethodDescription)

methodExecutionFinished

public void methodExecutionFinished(ResultSet result)
                             throws java.rmi.RemoteException
Specified by:
methodExecutionFinished in interface Coordinator
Throws:
java.rmi.RemoteException
See Also:
fr.inria.peerunit.Coordinator#methodExecutionFinished(Tester, fr.inria.peerunit.MessageType)

quit

public void quit(Tester t)
          throws java.rmi.RemoteException
Description copied from interface: Coordinator
Finish the test case and calculates the global oracle

Specified by:
quit in interface Coordinator
Throws:
java.rmi.RemoteException
See Also:
fr.inria.peerunit.Coordinator#quit(fr.inria.peerunit.Tester, fr.inria.peerunit.test.oracle.Verdicts)

kill

public void kill()
          throws java.rmi.RemoteException
Description copied from interface: Tester
Stop the tester.

Specified by:
kill in interface Tester
Throws:
java.rmi.RemoteException
See Also:
Tester.kill()

setCoordinator

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

Specified by:
setCoordinator in interface Tester
See Also:
Tester.setCoordinator(fr.inria.peerunit.Coordinator)

start

public void start()
           throws java.rmi.RemoteException
Starts the distributed tester: - Creates the local tester and the local coordinator. - Starts all child testers.

Specified by:
start in interface Tester
Throws:
java.rmi.RemoteException
java.lang.InterruptedException


Copyright © 2010. All Rights Reserved.