edu.vub.at.actors.natives
Class DistributionTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
edu.vub.at.actors.natives.DistributionTest
- All Implemented Interfaces:
- junit.framework.Test
- public class DistributionTest
- extends junit.framework.TestCase
Fields inherited from class junit.framework.TestCase |
|
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
virtual1_
private ELVirtualMachine virtual1_
virtual2_
private ELVirtualMachine virtual2_
_TIMEOUT_
private static final int _TIMEOUT_
- See Also:
- Constant Field Values
testResult_
private boolean testResult_
DistributionTest
public DistributionTest()
setTestResult
protected void setTestResult(boolean value)
getTestResult
protected boolean getTestResult()
main
public static void main(java.lang.String[] args)
setUp
protected void setUp()
throws java.lang.Exception
- Throws:
java.lang.Exception
tearDown
protected void tearDown()
throws java.lang.Exception
- Throws:
java.lang.Exception
setUpActor
private ELActor setUpActor(ELVirtualMachine host)
throws InterpreterException
- Throws:
InterpreterException
setUpSuccessTrigger
private void setUpSuccessTrigger(ELActor processor)
throws java.lang.Exception
- Throws:
java.lang.Exception
setUpConnectionObservers
private void setUpConnectionObservers()
throws java.lang.Exception
- Throws:
java.lang.Exception
testVirtualMachineDiscovery
public void testVirtualMachineDiscovery()
- When a virtual machine joins the AmbientTalk JGroups channel, all virtual machines are
notified of this fact by the underlying distribution layer. Messages are sent to the
DiscoveryManager to notify it of a new vm which may host required services and to all
(far reference) listeners waiting for the appearance of that VM.
This test registers a dedicated listener to test the dispatching of connected and
disconnected messages to such listeners when appropriate.
testVirtualMachineDisconnection
public void testVirtualMachineDisconnection()
- When a virtual machine leaves the AmbientTalk JGroups channel, all virtual machines are
notified of this fact by the underlying distribution layer. Messages are sent to the
DiscoveryManager and to all (far reference) listeners connected to that VM.
This test registers a dedicated listener to test the dispatching of disconnected
messages to such listeners when appropriate.
testVirtualMachineDisconnectionRace
public void testVirtualMachineDisconnectionRace()
- This test registers a dedicated listener to test the dispatching of disconnected
messages. When the time lapse betwen connection and disconnection is too small,
the test may be subject to race conditions, hence we provide a version where
no wait is performed, to provoke them.
testServiceDiscovery
public void testServiceDiscovery()
throws java.lang.Exception
- Uses the when: discovered: and export: as: constructs to make an object on one virtual
machine accessible to another virtual machine.
- Throws:
java.lang.Exception
testProviderDisconnection
public void testProviderDisconnection()
throws java.lang.Exception
- This test uses the when: disconnected: to detect when a far reference has become
disconnected. We distinguish between two tests, depending on the role of the device
that falls away. If the provider disconnects, the subscriber hosting the far reference
is notified of this event through a JGroups View event which is propagated up.
- Throws:
java.lang.Exception
testSubscriberDisconnection
public void testSubscriberDisconnection()
throws java.lang.Exception
- This test uses the when: disconnected: to detect when a far reference has become
disconnected. We distinguish between two tests, depending on the role of the device
that falls away. If the subscriber disconnects, no JGroups View event is propagated up,
to allow disconnecting the far reference, instead the membershipNotifier must be
disconnected explicitly.
- Throws:
java.lang.Exception
notestSimple
public void notestSimple()