Java Doc for Script.java in  » Testing » abbot-1.0.1 » abbot » script » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » abbot 1.0.1 » abbot.script 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.script.Step
      abbot.script.Sequence
         abbot.script.Script

All known Subclasses:   abbot.script.Fixture,
Script
public class Script extends Sequence implements Resolver(Code)
Provide a structure to encapsulate actions invoked on GUI components and tests performed on those components. Scripts need to be short and concise (and therefore easy to read/write). Extensions don't have to be.

This takes a single filename as a constructor argument.

Use junit.extensions.abbot.ScriptFixture and junit.extensions.abbot.ScriptTestSuite to generate a suite by auto-generating a collection of Script s.


See Also:   StepRunner
See Also:   
See Also:   Fixture
See Also:   Launch



Field Summary
final public static  StringINTERPRETER
    
final protected static  StringUNTITLED
    
final public static  StringUNTITLED_FILE
    
static  booleanvalidate
    

Constructor Summary
public  Script()
     Create a new, empty Script.
public  Script(String filename)
     Create a Script from the given filename.
public  Script(Hierarchy h)
    
public  Script(String filename, Hierarchy h)
     Create a Script from the given file.
public  Script(Resolver parent, Map attributes)
    

Method Summary
public  ComponentReferenceaddComponent(Component comp)
     Add a new component reference for the given component.
public  voidaddComponentReference(ComponentReference ref)
     Add a component reference directly, replacing any existing one with the same ID.
 ComponentReferenceaddComponentReference(Element el)
     Add a new component reference to the script.
public  ElementaddContent(Element el)
     Save component references in addition to everything else.
public  voidaddStep(int index, Step step)
    
public  voidaddStep(Step step)
    
public  voidchangeFile(File file)
     Change the file system basis for the current script.
public  voidclear()
     Set up a blank script, discarding any current state.
public static  intcountLines(Sequence seq, int index)
     Return the number of XML lines in the given sequence that precede the given index.
protected static  MapcreateDefaultMap(String filename)
    
public  MapgetAttributes()
     Provide XML attributes for this Step.
public  ComponentReferencegetComponentReference(Component comp)
     Return the reference for the given component, or null if none yet exists.
public  ComponentReferencegetComponentReference(String name)
     Convert the given reference ID into a component reference.
public  CollectiongetComponentReferences()
     Returns a sorted collection of ComponentReferences.
public  StringgetContext(Step step)
     Return a meaningful description of where the Step came from.
public  ClassLoadergetContextClassLoader()
     Defer to the UIContext to obtain a ClassLoader , or use the current Thread 's context class loader.
public  StringgetDefaultDescription()
     Return a default description for this Script.
public  FilegetDirectory()
     All relative files should be accessed relative to this directory, which is the directory where the script resides.
public  FilegetFile()
     Return the file where this script is saved.
public static  FilegetFile(Step step)
     Return the file which defines the given step.
public  StringgetFilename()
     Return the (possibly relative) path to this script.
protected  StringgetFullXMLString()
    
public  HierarchygetHierarchy()
     Return the currently effective Hierarchy of components.
public static  intgetLine(Step step)
     Return the approximate line number of the given step.
public  StringgetName()
    
public  ObjectgetProperty(String name)
    
public  FilegetRelativeTo()
     By default, all pathnames are relative to the current working directory.
public  UIContextgetUIContext()
    
public  StringgetUsage()
    
public  StringgetVMArgs()
    
public  StringgetXMLTag()
    
public  booleanhasLaunch()
     Return whether this Script is launchable.
public  booleanhasTerminate()
    
public  booleanisAWTMode()
    
public  booleanisDirty()
     Has this script changed since the last save.
public  booleanisForked()
    
public static  booleanisScript(File file)
     Return whether the given file looks like a valid AWT script.
public  booleanisSlowPlayback()
    
public  voidload(Reader reader)
     Loads the XML test script.
public  voidload()
     Read the script from the currently set file.
protected  voidparseAttributes(Map map)
     Parse XML attributes for the Script.
protected  voidparseChild(Element el)
    
public static  FileresolveRelativeReferences(File file)
     It turns out that getAbsolutePath doesn't remove any relative path entries such as ..
protected  voidrunStep(StepRunner runner)
    
public  voidsave(Writer writer)
     Write the current state of the script to file.
public  voidsave()
     Write the script to file.
public  voidsetAWTMode(boolean awt)
    
public  voidsetFile(File file)
     Set the file system basis for this script object.
public  voidsetForked(boolean fork)
    
public  voidsetHierarchy(Hierarchy h)
    
public  voidsetProperty(String name, Object value)
    
public  voidsetRelativeTo(File dir)
     Indicate that when invoking toXML, a path relative to the given one should be shown.
public  voidsetSlowPlayback(boolean slow)
    
public  voidsetStep(int index, Step step)
     Replaces the step at the given index.
public  voidsetVMArgs(String args)
    
public  StringtoEditableString()
     Only thing directly editable on a script is its file path.

Field Detail
INTERPRETER
final public static String INTERPRETER(Code)



UNTITLED
final protected static String UNTITLED(Code)



UNTITLED_FILE
final public static String UNTITLED_FILE(Code)



validate
static boolean validate(Code)




Constructor Detail
Script
public Script()(Code)
Create a new, empty Script. Used as a temporary Resolver , uses the default Hierarchy . Hierarchy



Script
public Script(String filename)(Code)
Create a Script from the given filename. Uses the default Hierarchy . Hierarchy



Script
public Script(Hierarchy h)(Code)



Script
public Script(String filename, Hierarchy h)(Code)
Create a Script from the given file.



Script
public Script(Resolver parent, Map attributes)(Code)




Method Detail
addComponent
public ComponentReference addComponent(Component comp)(Code)
Add a new component reference for the given component.



addComponentReference
public void addComponentReference(ComponentReference ref)(Code)
Add a component reference directly, replacing any existing one with the same ID.



addComponentReference
ComponentReference addComponentReference(Element el) throws InvalidScriptException(Code)
Add a new component reference to the script. For use only when parsing a script.



addContent
public Element addContent(Element el)(Code)
Save component references in addition to everything else.



addStep
public void addStep(int index, Step step)(Code)



addStep
public void addStep(Step step)(Code)



changeFile
public void changeFile(File file)(Code)
Change the file system basis for the current script. Does not affect the script contents. Script.setFile(File)



clear
public void clear()(Code)
Set up a blank script, discarding any current state.



countLines
public static int countLines(Sequence seq, int index)(Code)
Return the number of XML lines in the given sequence that precede the given index. If the index is -1, return the number of XML lines used by the whole sequence.



createDefaultMap
protected static Map createDefaultMap(String filename)(Code)



getAttributes
public Map getAttributes()(Code)
Provide XML attributes for this Step. This class adds its filename.



getComponentReference
public ComponentReference getComponentReference(Component comp)(Code)
Return the reference for the given component, or null if none yet exists.



getComponentReference
public ComponentReference getComponentReference(String name)(Code)
Convert the given reference ID into a component reference. If it's not in the Script's list, returns null.



getComponentReferences
public Collection getComponentReferences()(Code)
Returns a sorted collection of ComponentReferences.



getContext
public String getContext(Step step)(Code)
Return a meaningful description of where the Step came from.



getContextClassLoader
public ClassLoader getContextClassLoader()(Code)
Defer to the UIContext to obtain a ClassLoader , or use the current Thread 's context class loader.
See Also:   Thread.getContextClassLoader



getDefaultDescription
public String getDefaultDescription()(Code)
Return a default description for this Script.



getDirectory
public File getDirectory()(Code)
All relative files should be accessed relative to this directory, which is the directory where the script resides. It will always return an absolute path.



getFile
public File getFile()(Code)
Return the file where this script is saved. Will always be an absolute path.



getFile
public static File getFile(Step step)(Code)
Return the file which defines the given step.



getFilename
public String getFilename()(Code)
Return the (possibly relative) path to this script.



getFullXMLString
protected String getFullXMLString()(Code)



getHierarchy
public Hierarchy getHierarchy()(Code)
Return the currently effective Hierarchy of components.



getLine
public static int getLine(Step step)(Code)
Return the approximate line number of the given step. File lines are one-based (there is no line zero).



getName
public String getName()(Code)



getProperty
public Object getProperty(String name)(Code)



getRelativeTo
public File getRelativeTo()(Code)
By default, all pathnames are relative to the current working directory.



getUIContext
public UIContext getUIContext()(Code)
The UIContext responsible for setting upa UI context for this script, ornull if the script has no UI to speak of.



getUsage
public String getUsage()(Code)



getVMArgs
public String getVMArgs()(Code)



getXMLTag
public String getXMLTag()(Code)



hasLaunch
public boolean hasLaunch()(Code)
Return whether this Script is launchable.



hasTerminate
public boolean hasTerminate()(Code)



isAWTMode
public boolean isAWTMode()(Code)



isDirty
public boolean isDirty()(Code)
Has this script changed since the last save.



isForked
public boolean isForked()(Code)



isScript
public static boolean isScript(File file)(Code)
Return whether the given file looks like a valid AWT script.



isSlowPlayback
public boolean isSlowPlayback()(Code)



load
public void load(Reader reader) throws InvalidScriptException, IOException(Code)
Loads the XML test script. Performs a check against the XML schema.
Parameters:
  reader - Provides the script data
throws:
  InvalidScriptException -
throws:
  IOException -



load
public void load() throws IOException(Code)
Read the script from the currently set file.



parseAttributes
protected void parseAttributes(Map map)(Code)
Parse XML attributes for the Script.



parseChild
protected void parseChild(Element el) throws InvalidScriptException(Code)



resolveRelativeReferences
public static File resolveRelativeReferences(File file)(Code)
It turns out that getAbsolutePath doesn't remove any relative path entries such as .. the alternative getCannonicalPath can cause problems with version control systems that make a lot of use of symolic links. For example a directory in a source control view might contain local checked out files and symlinks to un-checked out files (These files might be located on another machine in some cases). This means that files that are next to each other in the view appear to be in quite different paths when resolved using getCannonicalPath. Therefore we are reduced to tidying up the paths manually.
Parameters:
  file - The input file to tidy up. An absolute path with all . and .. removed
throws:
  IllegalArgumentException - If the number of ".." entries outnumberthose of the normal path entries.



runStep
protected void runStep(StepRunner runner) throws Throwable(Code)



save
public void save(Writer writer) throws IOException(Code)
Write the current state of the script to file.



save
public void save() throws IOException(Code)
Write the script to file. Note that this differs from the toXML for the script, which simply indicates the file on which it is based.



setAWTMode
public void setAWTMode(boolean awt)(Code)



setFile
public void setFile(File file)(Code)
Set the file system basis for this script object. Use this to set the file from which the existing script will be loaded.



setForked
public void setForked(boolean fork)(Code)



setHierarchy
public void setHierarchy(Hierarchy h)(Code)



setProperty
public void setProperty(String name, Object value)(Code)



setRelativeTo
public void setRelativeTo(File dir)(Code)
Indicate that when invoking toXML, a path relative to the given one should be shown. Note that this is a runtime setting only and never shows up in saved XML.



setSlowPlayback
public void setSlowPlayback(boolean slow)(Code)



setStep
public void setStep(int index, Step step)(Code)
Replaces the step at the given index.



setVMArgs
public void setVMArgs(String args)(Code)



toEditableString
public String toEditableString()(Code)
Only thing directly editable on a script is its file path.



Methods inherited from abbot.script.Sequence
protected Element addContent(Element el)(Code)(Java Doc)
public void addStep(int index, Step step)(Code)(Java Doc)
public void addStep(Step step)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public String getDefaultDescription()(Code)(Java Doc)
public Step getStep(int index)(Code)(Java Doc)
public String getUsage()(Code)(Java Doc)
public String getXMLTag()(Code)(Java Doc)
public int indexOf(Step step)(Code)(Java Doc)
protected void parseChild(Element el) throws InvalidScriptException(Code)(Java Doc)
protected void parseChildren(Element el) throws InvalidScriptException(Code)(Java Doc)
public void removeStep(Step step)(Code)(Java Doc)
public void removeStep(int index)(Code)(Java Doc)
protected void runStep() throws Throwable(Code)(Java Doc)
protected void runStep(StepRunner runner) throws Throwable(Code)(Java Doc)
public void setStep(int index, Step step)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public java.util.List steps()(Code)(Java Doc)
public String toEditableString()(Code)(Java Doc)

Methods inherited from abbot.script.Step
protected Element addAttributes(Element el)(Code)(Java Doc)
protected Element addContent(Element el)(Code)(Java Doc)
protected static Map createAttributeMap(Element el)(Code)(Java Doc)
public static Step createStep(Resolver resolver, String str) throws InvalidScriptException, IOException(Code)(Java Doc)
public static Step createStep(Resolver resolver, Element el) throws InvalidScriptException(Code)(Java Doc)
public Map getAttributes()(Code)(Java Doc)
abstract public String getDefaultDescription()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public Resolver getResolver()(Code)(Java Doc)
abstract public String getUsage()(Code)(Java Doc)
abstract public String getXMLTag()(Code)(Java Doc)
final protected void parseStepAttributes(Map attributes)(Code)(Java Doc)
public Class resolveClass(String className) throws ClassNotFoundException(Code)(Java Doc)
protected ComponentTester resolveTester(String className) throws ClassNotFoundException(Code)(Java Doc)
final public void run() throws Throwable(Code)(Java Doc)
abstract protected void runStep() throws Throwable(Code)(Java Doc)
public void setDescription(String desc)(Code)(Java Doc)
protected void setScriptError(Throwable thr)(Code)(Java Doc)
protected String simpleClassName(Class cls)(Code)(Java Doc)
public String toEditableString()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Element toXML()(Code)(Java Doc)
public static String toXMLString(XMLifiable obj)(Code)(Java Doc)
protected void usage()(Code)(Java Doc)
protected void usage(String details)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.