com.sun.javatest.exec
Class ExecTool

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.sun.javatest.tool.Tool
                      extended by com.sun.javatest.exec.ExecTool
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ExecTool
extends Tool

The "Test Manager" tool, which allows a user to browse, configure, and run tests.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.javatest.tool.Tool
Tool.Observer
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class com.sun.javatest.tool.Tool
uif
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ExecTool(ExecToolManager mgr)
          Create a default, uninitialized ExecTool.
ExecTool(ExecToolManager mgr, InterviewParameters interviewParams)
          Create an ExecTool initialized to the contents of an interview object.
ExecTool(ExecToolManager mgr, TestSuite testSuite)
          Create an ExecTool for a specific test suite.
ExecTool(ExecToolManager mgr, WorkDirectory workDir)
          Create an ExecTool for a specific test suite and work directory.
 
Method Summary
 void closeLogger()
          Closes and removes log handler corresponding to this tool
 boolean containsTestSuite(java.io.File f)
          Check if this tool contains a test suite whose root file matches a specified file.
 boolean containsTestSuite(TestSuite ts)
          Check if this tool contains a given test suite.
 boolean containsWorkDirectory(java.io.File f)
          Check if this tool contains a work directory whose root file matches a specified file.
 void dispose()
          Release any resources this tool may be referencing.
 TestResultTable getActiveTestResultTable()
          Get the test result table currently in use for display.
protected  java.lang.String[] getCloseAlerts()
          Get a list (if any) of the reasons why it might be inadvisable to close the tool at this point.
 ContextManager getContextManager()
           
 ExecToolManager getExecToolManager()
           
 com.sun.javatest.exec.FilterConfig getFilterConfig()
          Get the currently loaded filter config, if any.
 InterviewParameters getInterviewParameters()
          Get the current configuration data for this tool.
 TestSuite[] getLoadedTestSuites()
          Get a list of any test suites that are being used by this tool.
 WorkDirectory[] getLoadedWorkDirectories()
          Get a list of any work directories that are being used by this tool.
 javax.swing.JMenuBar getMenuBar()
          Get the tool menu bar.
 java.awt.Dimension getPreferredSize()
           
 TestSuite getTestSuite()
          Get the currently loaded test suite, if any.
 UIFactory getUIF()
           
 WorkDirectory getWorkDirectory()
          Get the currently loaded work directory, if any.
 boolean isEmpty()
          Check if this tool is empty: in other words, check if it has a test suite loaded or not.
 void print(java.awt.print.Printable p)
           
 void printSetup()
           
 void resetWorkDirectory()
          Clears the current work directory
 void runTests()
          Run the tests specified by the current configuration for this tool.
 void runTests(java.lang.String[] urls)
          Run specified tests.
 void save(java.util.Map m)
          Save the primary state for this tool, for later restoration.
 void setWorkDir(WorkDirectory wd, boolean addToFileHistory)
           
 void showConfigEditor()
          Show the configuration editor for this tool.
 void showConfigEditor(java.awt.event.ActionListener l)
          Show the configuration editor for this tool, notifying an action listener when the editor is closed.
 void showConfigEditor(boolean runTestsWhenDone)
          Show the configuration editor for this tool, and optionally run the tests defined by the configuration when the editor is closed.
 void showMessage(java.util.ResourceBundle msgs, java.lang.String key)
           
 void showQuickStartWizard()
          Show the Quick Start Wizard.
 void showTemplateEditor()
          Show the configuration editor for this tool with current template
 void showWorkDirDialog(boolean allowTemplates)
           
 
Methods inherited from class com.sun.javatest.tool.Tool
addObserver, getCreationTime, getDesktop, getHelpBroker, getManager, getShortTitle, getTitle, getToolDialogs, removeObserver, setHelp, setHelp, setHelpOnButton, setI18NTitle, setI18NTitle, setI18NTitle, setShortTitle
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecTool

public ExecTool(ExecToolManager mgr)
Create a default, uninitialized ExecTool.

Parameters:
mgr - the manager for this tool

ExecTool

public ExecTool(ExecToolManager mgr,
                TestSuite testSuite)
         throws Interview.Fault,
                TestSuite.Fault
Create an ExecTool for a specific test suite.

Parameters:
mgr - the manager for this tool
testSuite - The test suite to be shown in this tool.
Throws:
TestSuite.Fault - if a problem occurs creating the configuration interview for this test suite.
Interview.Fault - if a problem occurs creating the configuration interview for this test suite.

ExecTool

public ExecTool(ExecToolManager mgr,
                WorkDirectory workDir)
         throws Interview.Fault,
                TestSuite.Fault
Create an ExecTool for a specific test suite and work directory.

Parameters:
mgr - the manager for this tool
workDir - The work directory to be shown in this tool.
Throws:
Interview.Fault - if a problem occurs creating the configuration interview for the test suite.
TestSuite.Fault - if a problem occurs creating the configuration interview for the test suite.

ExecTool

public ExecTool(ExecToolManager mgr,
                InterviewParameters interviewParams)
Create an ExecTool initialized to the contents of an interview object.

Parameters:
mgr - the manager for this tool
interviewParams - The interview object containing the test suite and work directory to be displayed.
Method Detail

dispose

public void dispose()
Description copied from class: Tool
Release any resources this tool may be referencing. This is for "destroying" this tool instance.

Overrides:
dispose in class Tool

getCloseAlerts

protected java.lang.String[] getCloseAlerts()
Description copied from class: Tool
Get a list (if any) of the reasons why it might be inadvisable to close the tool at this point. This will normally include information about unsaved data or tasks in progress.

Overrides:
getCloseAlerts in class Tool
Returns:
a list of alerts about why the user might not want to close the tool at this time; the list may be empty or null to indicate that there are no such reasons

getUIF

public UIFactory getUIF()

getContextManager

public ContextManager getContextManager()
Returns:
Null if the test suite has not been established, or if there is no context mananger available.

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Get the tool menu bar.

Specified by:
getMenuBar in class Tool
Returns:
a menu bar containing tool-specific menus

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

isEmpty

public boolean isEmpty()
Check if this tool is empty: in other words, check if it has a test suite loaded or not.

Returns:
true if there is no test suite loaded

getTestSuite

public TestSuite getTestSuite()
Get the currently loaded test suite, if any.

Returns:
the currently loaded test suite, or null if none.

getLoadedTestSuites

public TestSuite[] getLoadedTestSuites()
Description copied from class: Tool
Get a list of any test suites that are being used by this tool.

Overrides:
getLoadedTestSuites in class Tool
Returns:
a list of test suites being used by the tool, or null if none

containsTestSuite

public boolean containsTestSuite(TestSuite ts)
Check if this tool contains a given test suite.

Parameters:
ts - The test suite to check for.
Returns:
true if this tool contains the given test suite.

containsTestSuite

public boolean containsTestSuite(java.io.File f)
Check if this tool contains a test suite whose root file matches a specified file.

Parameters:
f - The root file of the test suite for which to check.
Returns:
true if this tool contains a test suite whose root file is the same as the specified file.

getWorkDirectory

public WorkDirectory getWorkDirectory()
Get the currently loaded work directory, if any.

Returns:
the currently loaded work directory, or null if none.

getLoadedWorkDirectories

public WorkDirectory[] getLoadedWorkDirectories()
Description copied from class: Tool
Get a list of any work directories that are being used by this tool.

Overrides:
getLoadedWorkDirectories in class Tool
Returns:
a list of work directories being used by the tool, or null if none

containsWorkDirectory

public boolean containsWorkDirectory(java.io.File f)
Check if this tool contains a work directory whose root file matches a specified file.

Parameters:
f - The root file of the work directory for which to check.
Returns:
true if this tool contains a work directory whose root file is the same as the specified file.

getInterviewParameters

public InterviewParameters getInterviewParameters()
Get the current configuration data for this tool.

Returns:
the current configuration data for this tool

getFilterConfig

public com.sun.javatest.exec.FilterConfig getFilterConfig()
Get the currently loaded filter config, if any.

Returns:
the currently loaded filter config, or null if none.

showQuickStartWizard

public void showQuickStartWizard()
Show the Quick Start Wizard.

Throws:
java.lang.IllegalStateException - if the tool already has a test suite loaded.

showConfigEditor

public void showConfigEditor(boolean runTestsWhenDone)
Show the configuration editor for this tool, and optionally run the tests defined by the configuration when the editor is closed.

Parameters:
runTestsWhenDone - true if the tests should automatically be run when the user closes the configuration editor, and false otherwise.

showTemplateEditor

public void showTemplateEditor()
Show the configuration editor for this tool with current template


runTests

public void runTests()
Run the tests specified by the current configuration for this tool.


runTests

public void runTests(java.lang.String[] urls)
Run specified tests.

Parameters:
urls - These names may either be paths to folders or test names. Empty string value in the array indicates that the whole test suite should be run.

save

public void save(java.util.Map m)
Save the primary state for this tool, for later restoration.

Specified by:
save in class Tool
Parameters:
m - The map in which to save the data

setWorkDir

public void setWorkDir(WorkDirectory wd,
                       boolean addToFileHistory)
                throws Interview.Fault,
                       TestSuite.Fault
Throws:
Interview.Fault
TestSuite.Fault

showWorkDirDialog

public void showWorkDirDialog(boolean allowTemplates)

showMessage

public void showMessage(java.util.ResourceBundle msgs,
                        java.lang.String key)

printSetup

public void printSetup()

print

public void print(java.awt.print.Printable p)

showConfigEditor

public void showConfigEditor()
Show the configuration editor for this tool.


showConfigEditor

public void showConfigEditor(java.awt.event.ActionListener l)
Show the configuration editor for this tool, notifying an action listener when the editor is closed.

Parameters:
l - the action listener that will be notified when the configuration editor is closed.

resetWorkDirectory

public void resetWorkDirectory()
                        throws TestSuite.Fault
Clears the current work directory

Throws:
TestSuite.Fault

closeLogger

public void closeLogger()
Closes and removes log handler corresponding to this tool


getActiveTestResultTable

public TestResultTable getActiveTestResultTable()
Get the test result table currently in use for display. This value provides a temporary answer if the work directory does not exist yet. If a work directory is available, the query is forwarded to that object.

Returns:
the test result table currently in use for display.

getExecToolManager

public ExecToolManager getExecToolManager()


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.