edu.rice.cs.util.newjvm
Class IntegratedMasterSlaveTest.TestMasterJVM

java.lang.Object
  extended by edu.rice.cs.util.newjvm.AbstractMasterJVM
      extended by edu.rice.cs.util.newjvm.IntegratedMasterSlaveTest.TestMasterJVM
All Implemented Interfaces:
IntegratedMasterSlaveTest.TestMasterRemote, MasterRemote, Remote
Enclosing class:
IntegratedMasterSlaveTest

private static class IntegratedMasterSlaveTest.TestMasterJVM
extends AbstractMasterJVM
implements IntegratedMasterSlaveTest.TestMasterRemote


Field Summary
private  String _currentTest
           
private  CompletionMonitor _justQuit
          Field and lock used to signal slave quit events.
private  char _letter
          Field and lock used to signal letter change events.
private  Object _letterLock
           
private  IntegratedMasterSlaveTest.TestSlaveRemote _slave
          Field and lock used to signal slave connected events.
private static int WAIT_TIMEOUT
           
 
Constructor Summary
IntegratedMasterSlaveTest.TestMasterJVM()
           
 
Method Summary
 char getLetter()
           
protected  void handleSlaveConnected(SlaveRemote slave)
          Callback for when the slave JVM has connected, and the bidirectional communications link has been established.
protected  void handleSlaveQuit(int status)
          Callback for when the slave JVM has quit.
protected  void handleSlaveWontStart(Exception e)
          Callback for when the slave JVM fails to either run or respond to SlaveRemote.start(edu.rice.cs.util.newjvm.MasterRemote).
 void runImmediateQuitTest()
          In util-20020414-0647, if quitSlave were called between the time the slave was invoked and the time it registered, an IllegalStateException was thrown.
 void runTestSequence()
           
 
Methods inherited from class edu.rice.cs.util.newjvm.AbstractMasterJVM
checkStillAlive, dispose, invokeSlave, isDisposed, quitSlave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.rice.cs.util.newjvm.MasterRemote
checkStillAlive
 

Field Detail

WAIT_TIMEOUT

private static final int WAIT_TIMEOUT
See Also:
Constant Field Values

_justQuit

private final CompletionMonitor _justQuit
Field and lock used to signal slave quit events.


_slave

private volatile IntegratedMasterSlaveTest.TestSlaveRemote _slave
Field and lock used to signal slave connected events.


_letter

private volatile char _letter
Field and lock used to signal letter change events.


_letterLock

private final Object _letterLock

_currentTest

private volatile String _currentTest
Constructor Detail

IntegratedMasterSlaveTest.TestMasterJVM

public IntegratedMasterSlaveTest.TestMasterJVM()
Method Detail

runImmediateQuitTest

public void runImmediateQuitTest()
                          throws Exception
In util-20020414-0647, if quitSlave were called between the time the slave was invoked and the time it registered, an IllegalStateException was thrown. The correct behavior, which we test for here, is for the slave to quit as soon as it is started up.

Throws:
Exception

runTestSequence

public void runTestSequence()
                     throws Exception
Throws:
Exception

getLetter

public char getLetter()
Specified by:
getLetter in interface IntegratedMasterSlaveTest.TestMasterRemote

handleSlaveConnected

protected void handleSlaveConnected(SlaveRemote slave)
Description copied from class: AbstractMasterJVM
Callback for when the slave JVM has connected, and the bidirectional communications link has been established. Provides access to the newly-created slave JVM.

Specified by:
handleSlaveConnected in class AbstractMasterJVM

handleSlaveQuit

protected void handleSlaveQuit(int status)
Description copied from class: AbstractMasterJVM
Callback for when the slave JVM has quit.

Specified by:
handleSlaveQuit in class AbstractMasterJVM
Parameters:
status - The exit code returned by the slave JVM.

handleSlaveWontStart

protected void handleSlaveWontStart(Exception e)
Description copied from class: AbstractMasterJVM
Callback for when the slave JVM fails to either run or respond to SlaveRemote.start(edu.rice.cs.util.newjvm.MasterRemote).

Specified by:
handleSlaveWontStart in class AbstractMasterJVM
Parameters:
e - Exception that occurred during startup.