net.sf.jsequnit.diagram
Class TestMethodRunner

java.lang.Object
  extended by net.sf.jsequnit.diagram.TestMethodRunner
Direct Known Subclasses:
JUnitTestMethodRunner

public abstract class TestMethodRunner
extends Object

Abstract class executing a given method in a separate Java virtual machine. It implements the design pattern "template method", where subclasses have to provide the debug VM.

Author:
RatzinJ

Constructor Summary
TestMethodRunner()
           
 
Method Summary
 com.sun.jdi.VirtualMachine getDebugVm(String qualifiedTestMethod, String testExecutionClasspath)
          Setup a new Java virtual machine that is connected for debugging purposes.
protected  com.sun.jdi.connect.AttachingConnector getSocketAttachingConnector()
          Returns the Socket Launcher that is capable to connect to a running VM for debugging.
protected  com.sun.jdi.connect.LaunchingConnector getSunCommandLineLauncher()
          Return the Sun VM Launcher that is capable to execute a Java program from command line before connecting to it.
protected abstract  com.sun.jdi.VirtualMachine setupDebugVM(String qualifiedTestMethod, String testExecutionClasspath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestMethodRunner

public TestMethodRunner()
Method Detail

setupDebugVM

protected abstract com.sun.jdi.VirtualMachine setupDebugVM(String qualifiedTestMethod,
                                                           String testExecutionClasspath)

getDebugVm

public com.sun.jdi.VirtualMachine getDebugVm(String qualifiedTestMethod,
                                             String testExecutionClasspath)
Setup a new Java virtual machine that is connected for debugging purposes.

Parameters:
qualifiedTestMethod - The fully qualified name of a test method that is executed in the target virtual machine.
testExecutionClasspath - The classpath used to execute the qualifiedTestMethod
Returns:
The Java VM ready to execute the given method.

getSunCommandLineLauncher

protected com.sun.jdi.connect.LaunchingConnector getSunCommandLineLauncher()
Return the Sun VM Launcher that is capable to execute a Java program from command line before connecting to it.

Returns:
LaunchingConnector of type SunCommandLineLauncher

getSocketAttachingConnector

protected com.sun.jdi.connect.AttachingConnector getSocketAttachingConnector()
Returns the Socket Launcher that is capable to connect to a running VM for debugging.

Returns:
AttachingConnector of type SocketAttachingConnector


Copyright © 2011. All Rights Reserved.