| lib.EditorTestCase
All known Subclasses: org.netbeans.test.java.editor.completiongui.GuiTest, org.netbeans.test.java.editor.formatting.BasicTest, org.netbeans.test.java.editor.codegeneration.GenerateCode, code_folding.CodeFoldingTest, lib.JavaEditorTestCase, editor_actions.EditorActionsTest,
EditorTestCase | public class EditorTestCase extends JellyTestCase (Code) | | author: Petr Felenda, Martin Roskanin |
Inner Class :public static interface ValueResolver | |
Method Summary | |
protected void | closeDefaultProject() Close the default project. | public void | closeDialog(String title) | public void | closeFile() Close file in open project. | public void | closeFileWithDiscard() Close file in open project. | public void | closeFileWithSave() Close file in open project. | protected void | closeProject(String projectName) | protected void | compareReferenceFiles(Document testDoc) Write the text of the passed document to the ref file
and compare the created .ref file with the golden file. | protected void | cutCopyViaStrokes(JEditorPaneOperator txtOper, int key, int mod) | protected ValueResolver | getClipboardResolver(JEditorPaneOperator txtOper, Transferable oldClipValue) | protected String | getDefaultProjectName() Get the default project name to be used
in
openDefaultProject() . | protected EditorOperator | getDefaultSampleEditorOperator() | final protected String | getDefaultSampleName() | final protected String | getDefaultSamplePackage() | protected void | openDefaultProject() Open default project determined
by
EditorTestCase.getDefaultProjectName() . | protected void | openDefaultSampleFile() | public void | openFile(String treeSubPackagePathToFile, String fileName) Open file in open project
Parameters: treeSubPath - e.g. | public void | openFile() | public void | openProject(String projectName) Open project. | protected void | openSourceFile(String dir, String srcName) Open a source file located in the "Source packages" in the editor. | protected void | pasteViaStrokes(ComponentOperator compOper, int key, int mod, ValueResolver resolver) | public void | waitForChildNode(String parentPath, String childName) Waits for a child node to be shown in the IDE. | public static boolean | waitMaxMilisForValue(int maxMiliSeconds, ValueResolver resolver, Object requiredValue) Method will wait max. |
WAIT_MAX_MILIS_FOR_CLIPBOARD | final public static int WAIT_MAX_MILIS_FOR_CLIPBOARD(Code) | | |
EditorTestCase | public EditorTestCase(String testMethodName)(Code) | | Creates a new instance of EditorTestCase.
Initializes default sample file name (package and name)
so that
EditorTestCase.openDefaultSampleFile() can be used.
The rule for naming is the same like for golden files
i.e. package corresponds to the class name and the file
name corresponds to test method name.
Parameters: testMethodName - name of the test methodthat should be executed. |
closeDefaultProject | protected void closeDefaultProject()(Code) | | Close the default project.
|
closeDialog | public void closeDialog(String title)(Code) | | Close dialog with added title
Parameters: title - dialog title |
closeFile | public void closeFile()(Code) | | Close file in open project.
|
closeFileWithDiscard | public void closeFileWithDiscard()(Code) | | Close file in open project.
|
closeFileWithSave | public void closeFileWithSave()(Code) | | Close file in open project.
|
closeProject | protected void closeProject(String projectName)(Code) | | |
compareReferenceFiles | protected void compareReferenceFiles(Document testDoc)(Code) | | Write the text of the passed document to the ref file
and compare the created .ref file with the golden file.
If the two files differ the test fails and generates the diff file.
Parameters: testDoc - document to be written to the .ref file and compared. |
cutCopyViaStrokes | protected void cutCopyViaStrokes(JEditorPaneOperator txtOper, int key, int mod)(Code) | | |
getClipboardResolver | protected ValueResolver getClipboardResolver(JEditorPaneOperator txtOper, Transferable oldClipValue)(Code) | | |
getDefaultProjectName | protected String getDefaultProjectName()(Code) | | Get the default project name to be used
in
openDefaultProject() .
The default value is "editor_test".
default project name |
getDefaultSampleEditorOperator | protected EditorOperator getDefaultSampleEditorOperator()(Code) | | |
getDefaultSampleName | final protected String getDefaultSampleName()(Code) | | |
getDefaultSamplePackage | final protected String getDefaultSamplePackage()(Code) | | |
openDefaultSampleFile | protected void openDefaultSampleFile()(Code) | | |
openFile | public void openFile(String treeSubPackagePathToFile, String fileName)(Code) | | Open file in open project
Parameters: treeSubPath - e.g. "Source Packages|test","sample1" |
openFile | public void openFile()(Code) | | Open the default file in open project
|
openProject | public void openProject(String projectName)(Code) | | Open project. Before opening the project is checked opened projects.
Parameters: projectName - is name of the project stored in .../editor/test/qa-functional/data/ directory. |
openSourceFile | protected void openSourceFile(String dir, String srcName)(Code) | | Open a source file located in the "Source packages" in the editor.
Parameters: dir - directory path with "|" separator. Parameters: srcName - source name without suffix. |
pasteViaStrokes | protected void pasteViaStrokes(ComponentOperator compOper, int key, int mod, ValueResolver resolver)(Code) | | |
waitForChildNode | public void waitForChildNode(String parentPath, String childName)(Code) | | Waits for a child node to be shown in the IDE. Needed for test
stabilization on slow machines.
Parameters: parentPath - full path for parent, | used as a delimiter Parameters: childName - name of the child node |
waitMaxMilisForValue | public static boolean waitMaxMilisForValue(int maxMiliSeconds, ValueResolver resolver, Object requiredValue)(Code) | | Method will wait max. maxMiliSeconds miliseconds for the requiredValue
gathered by resolver .
Parameters: maxMiliSeconds - maximum time to wait for requiredValue Parameters: resolver - resolver, which is gathering an actual value Parameters: requiredValue - if resolver value equals requiredValue the wait cycle is finished false if the given maxMiliSeconds time elapsed and the requiredValue wasn't obtained |
|
|