| java.lang.Object abbot.script.Step abbot.script.Call abbot.script.Launch
All known Subclasses: abbot.script.Appletviewer,
Launch | public class Launch extends Call implements UIContext(Code) | | Provides scripted static method invocation. Usage:
<launch class="package.class" method="methodName" args="..."
classpath="..." [threaded=true]>
The args attribute is a comma-separated list of arguments to pass to the
class method, and may use square brackets to denote an array,
e.g. "[one,two,three]" will be interpreted as an array length 3
of String. The square brackets may be escaped ('\[' or '\]') to include
them literally in an argument.
The class path attribute may use either colon or semicolon as a path
separator, but should preferably use relative paths to avoid making the
containing script platform- and location-dependent.
In most cases, the classes under test will only be found under the
custom class path, and so the parent class loader will fail to find them.
If this is the case then the classes under test will be properly discarded
on each launch when a new class loader is created.
The 'threaded' attribute is provided in case your code under test requires
GUI event processing prior to returning from its invoked method. An
example might be a main method which invokes dialog and waits for the
response before continuing. In general, it's better to refactor the code
if possible so that the main method turns over control to the event
dispatch thread as soon as possible. Otherwise, if the application under
test is background threaded by the Launch step, any runtime exceptions
thrown from the launch code will cause errors in the launch step out of
sequence with the other script steps. While this won't cause any problems
for the Abbot framework, it can be very confusing for the user.
Note that if the "reload" attribute is set true (i.e. Abbot's class loader
is used to reload code under test), ComponentTester extensions must also be
loaded by that class loader, so the path to extensions should be included
in the Launch class path.
|
Inner Class :public interface ThreadedLaunchListener | |
Constructor Summary | |
public | Launch(Resolver resolver, Map attributes) | public | Launch(Resolver resolver, String description, String className, String methodName, String[] args) | public | Launch(Resolver resolver, String description, String className, String methodName, String[] args, String classpath, boolean threaded) |
getAttributes | public Map getAttributes()(Code) | | |
getContextClassLoader | public ClassLoader getContextClassLoader()(Code) | | Return the class loader that uses the classpath defined in this
step.
|
getDefaultDescription | public String getDefaultDescription()(Code) | | |
getTarget | protected Object getTarget(Method m)(Code) | | Return the target for the method invocation. All launch invocations
must be static, so this always returns null.
|
install | protected void install()(Code) | | Install the class loader context for the code being launched. The
context class loader for the current thread is modified.
|
isLaunched | public boolean isLaunched()(Code) | | Whether the code described by this launch step is currently active. |
isThreaded | public boolean isThreaded()(Code) | | |
launch | public void launch(StepRunner runner) throws Throwable(Code) | | Launches the UI described by this Launch step,
using the given runner as controller/monitor.
|
resolveClass | public Class resolveClass(String className) throws ClassNotFoundException(Code) | | Overrides the default implementation to always use the class loader
defined by this step. This works in cases where the Launch step has
not yet been added to a Script; otherwise the Script will provide an
implementation equivalent to this one.
|
setThreaded | public void setThreaded(boolean thread)(Code) | | |
setThreadedLaunchListener | public void setThreadedLaunchListener(ThreadedLaunchListener l)(Code) | | Set a listener to respond to events when the launch step is
threaded.
|
synchronizedRunStep | protected void synchronizedRunStep() throws Throwable(Code) | | |
terminate | public void terminate()(Code) | | Perform steps necessary to remove any setup performed by
this Launch step.
|
|
|