fr.inria.peerunit
Class TestCaseImpl

java.lang.Object
  extended by fr.inria.peerunit.TestCaseImpl
All Implemented Interfaces:
TestCase
Direct Known Subclasses:
SimpleTest

public abstract class TestCaseImpl
extends java.lang.Object
implements TestCase

An abstract implementation of TestCase interface. This class make available in the test case testing global variables who can't be known before runtime. A testing engineer will inherit from this class for define his test case.

Since:
1.0
Version:
1.0
Author:
Eduardo Almeida, Aboubakar Koïta
See Also:
TestCase

Constructor Summary
TestCaseImpl()
           
 
Method Summary
 void clear()
          Used to clear the Collection of testing global variables
 boolean containsKey(java.lang.Integer key)
          Returns true if the key key can be map in the global variables cache, return false else.
 java.lang.Object get(java.lang.Integer key)
          Used to retrieve a testing global variable.
 java.util.Map<java.lang.Integer,java.lang.Object> getCollection()
          Used to retrieve all peers of the testing global variables.
 int getId()
          Return the id of the tester executing the test.
 int getPeerName()
          Deprecated. 
 void kill()
          Kill the tester executing the test case
 void put(java.lang.Integer key, java.lang.Object object)
          Allow to test case to stock global variables who will accessed by all others participants through his tester.
 void setTester(Tester t)
          Set the tester in centralized architecture executing the test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestCaseImpl

public TestCaseImpl()
Method Detail

setTester

public void setTester(Tester t)
Set the tester in centralized architecture executing the test

Specified by:
setTester in interface TestCase
Parameters:
t - the tester instance

getId

public int getId()
Return the id of the tester executing the test.

Returns:
the id of the tester executing the test

getPeerName

@Deprecated
public int getPeerName()
                throws java.rmi.RemoteException
Deprecated. 

Remote method return the id of the tester executing the test.

Returns:
the id of the tester executing the test
Throws:
java.rmi.RemoteException - because the method is distant

put

public void put(java.lang.Integer key,
                java.lang.Object object)
Allow to test case to stock global variables who will accessed by all others participants through his tester.

Parameters:
key - the key of object
object - the variable to stock

getCollection

public java.util.Map<java.lang.Integer,java.lang.Object> getCollection()
                                                                throws java.rmi.RemoteException
Used to retrieve all peers of the testing global variables.

Returns:
all the peers of the testing global variables
Throws:
java.rmi.RemoteException - because the method is distant

kill

public void kill()
Kill the tester executing the test case


get

public java.lang.Object get(java.lang.Integer key)
Used to retrieve a testing global variable.

Parameters:
key - a key
Returns:
object a variable corresponding to the key

containsKey

public boolean containsKey(java.lang.Integer key)
                    throws java.rmi.RemoteException
Returns true if the key key can be map in the global variables cache, return false else.

Parameters:
key - a key
Returns:
true if we can map the key key, return false else
Throws:
java.rmi.RemoteException - because the method is distant

clear

public void clear()
           throws java.rmi.RemoteException
Used to clear the Collection of testing global variables

Throws:
java.rmi.RemoteException


Copyright © 2010. All Rights Reserved.