|
T-Plan Robot Enterprise 3.4 Build No. 3.4-20130322.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.tplan.robot.scripting.interpret.AbstractTestScriptInterpret
com.tplan.robot.scripting.interpret.PlainTextInterpret
public class PlainTextInterpret
Fall back interpret ensuring that files that are not recognized as test scripts can be displayed and edited in the script editor.
T-Plan Robot Enterprise, (C) 2009-2013 T-Plan Limited. All rights reserved.
| Field Summary |
|---|
| Fields inherited from class com.tplan.robot.scripting.interpret.AbstractTestScriptInterpret |
|---|
compilationContext, DEFAULT_VARS, destroyed, doNotFireEvents, executing, executionContext, lastModified, manualStop, manualStopJustification, partiallyExecuting, PFLAG, scriptManager, scriptOwner, SFLAG, sourceURI, uri |
| Fields inherited from interface com.tplan.robot.scripting.interpret.TestScriptInterpret |
|---|
TYPE_JAVA, TYPE_PROPRIETARY, TYPE_UNKNOWN |
| Constructor Summary | |
|---|---|
PlainTextInterpret()
|
|
| Method Summary | |
|---|---|
boolean |
compile(ScriptingContext customContext)
Compile source code of the test script. |
int |
execute(ScriptingContext customContext)
Execute the test script. |
String |
getDescription()
Get plugin description to be displayed in the GUI. |
String |
getDisplayName()
Get short plugin name to be displayed in the GUI. |
StyledDocument |
getDocument()
Get the styled document holding source code of the test script. |
String[] |
getSupportedFileExtensions()
Get typical file extensions that should be handled by a particular implementation of a test script. |
int |
getType()
Get the test script type. |
String |
getTypeDescription()
Get the test script interpret type description. |
String |
getUniqueId()
Get unique ID associated with the plugin. |
boolean |
isPartialExecutionAllowed()
Indicate whether it is possible to execute just a part of the test script. |
boolean |
isPartialExecutionAllowed(int start,
int end,
int[] range)
Indicate whether it is possible to execute the specified part of the test script. |
boolean |
isSupportedTestScript()
|
void |
resetSelection()
Reset selection for partial execution purposes. |
void |
setSelection(int startOffset,
int endOffset)
Set the start and end offset for partial execution of a test script. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PlainTextInterpret()
| Method Detail |
|---|
public int getType()
TestScriptInterpret
public String getTypeDescription()
TestScriptInterpret
public String[] getSupportedFileExtensions()
TestScriptInterpretTestScriptInterpretFactory)
takes advantage of this method to create interpret instances for particular
test script files.
new String[] { "java" }.
If the method returns null, it means that there is no specific extension
for the script type handled by this class. The latter case applies for example
for the proprietary test script format which may be saved with any extension.
public boolean compile(ScriptingContext customContext)
throws InterpretErrorException
TestScriptInterpret
customContext - customized context for this validation. If the argument
is null, the interpret is supposed to obtain a preinitialized context instance
from the script manager through ScriptManager.createDefaultContext().
SyntaxErrorException
instances to the compilation context. The interpret is also supposed to fire
appropriate compilation script events through the associated script manager.
The context should be made available after compilation through
the TestScriptInterpret.getCompilationContext() method.
InterpretErrorException - should be thrown on an internal error or
illegal interpret state. The exception message gets typically displayed
or otherwise reported to the user.
public int execute(ScriptingContext customContext)
throws InterpretErrorException
TestScriptInterpret
customContext - customized context for this execution. If the argument
is null, the interpret is supposed to obtain a preinitialized context instance
from the script manager through ScriptManager.createDefaultContext().
The context should be made available after execution through
the TestScriptInterpret.getExecutionContext() method.
InterpretErrorException - should be thrown on an internal error or
illegal interpret state. The exception message gets typically displayed
or otherwise reported to the user.public boolean isPartialExecutionAllowed()
TestScriptInterpretIndicate whether it is possible to execute just a part of the test script. This is typically possible with scripting languages, such as the proprietary T-Plan Robot Enterprise one, where user can select part of the code in the editor and execute it. It is on the other hand not possible with test scripts written in Java.
Interprets returning true should expect the calls of the
TestScriptInterpret.setSelection(int, int) method. Interprets which do not support
this feature and return false should throw an exception when
the method is called.
public void setSelection(int startOffset,
int endOffset)
throws IllegalStateException
TestScriptInterpretTestScriptInterpret.getDocument()
method. Interprets which do not support partial executions (i.e. their
TestScriptInterpret.isPartialExecutionAllowed() method returns false) should throw
an IllegalStateException exception if this method gets called.
startOffset - start offset indicating position in the test script
document to start the execution from.endOffset - end offset in the test script where execution should be finished.
IllegalStateException - if the method gets called even though the TestScriptInterpret.isPartialExecutionAllowed()
method returns false to indicate that this mode is not supported.
public void resetSelection()
throws IllegalStateException
TestScriptInterpretTestScriptInterpret.isPartialExecutionAllowed() method returns false) should throw
an IllegalStateException exception if this method gets called.
IllegalStateException - if the method gets called even though the TestScriptInterpret.isPartialExecutionAllowed()
method returns false to indicate that this mode is not supported.public StyledDocument getDocument()
TestScriptInterpret
public String getDisplayName()
Plugin
public String getDescription()
Plugin
public String getUniqueId()
PluginGet unique ID associated with the plugin. The plugin manager uses the ID together with the version string to identify whether a plugin is already installed and whether a newer version of the same plugin is available.
The unique ID in fact identifies a particular plugin delivered by a particular vendor. Plugin developers are recommended to choose an ID and keep it constant for all versions of one particular plugin. The ID is never displayed in the GUI so it doesn't have to be a readable text. To avoid conflicts with other vendors it is recommended to elaborate vendor or author name and feature description into the ID, for example "custom RFB client implemented by John Doe".
public boolean isSupportedTestScript()
isSupportedTestScript in interface TestScriptInterpretisSupportedTestScript in class AbstractTestScriptInterpret
public boolean isPartialExecutionAllowed(int start,
int end,
int[] range)
TestScriptInterpret
start - selection start offsetend - selection end offsetrange - this is an optional output array (length >= 2) where the
interpret may specify the start and end elements that will be executed for the given
selection specified by [start, end]. These
|
T-Plan Robot Enterprise 3.4 Build No. 3.4-20130322.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||