UTJML

edu.utep.cs.utjml.canica.tool
Class CanicaTestRunner

java.lang.Object
  extended by junit.runner.BaseTestRunner
      extended by edu.utep.cs.utjml.canica.tool.CanicaTestRunner
All Implemented Interfaces:
TestRunContext, junit.framework.TestListener

public class CanicaTestRunner
extends junit.runner.BaseTestRunner
implements TestRunContext

Author:
Angelica Berenice Perez Apr 21, 2006

Field Summary
 
Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
CanicaTestRunner(Class testClass)
          Constructor, (singleton technique)
 
Method Summary
protected  void aboutToStart(junit.framework.Test testSuite)
          It prepares the Test run view to start (adds the testSuite to the Listener,
protected  junit.runner.FailureDetailView createFailureDetailView()
          Creates the FailureDetailView
protected  junit.framework.TestResult createTestResult()
          It returns the test result object
protected  JTabbedPane createTestRunViews()
          It creates the JTabbedPane that will contain the two views, tests tree and failure view
 ListModel getFailures()
          Returns the failure model
 junit.framework.Test getTest(Class testClass)
          Returns the Test corresponding to the given suite.
 void handleTestSelected(junit.framework.Test test)
          Handles the selection of a Test.
protected  void initializeAndLinksOutput()
          Initializes failures objects and links this context with output, and failure detail view.
protected  void reset()
          It resets the visual objects in the OutputPane
static void run(Class test, OutputPaneable outputPane)
          It runs a test data file, given as arguments, the test data file and the outputPane interface to access the GUI objects.
protected  void runFailed(String message)
           
protected  void runFinished(junit.framework.Test testSuite)
          It tells the views that the run has finished
 void runSuite()
          It runs the suite
 void setSuite(String suiteName)
          It sets the file name to the output, and to a local reference
 void start(String[] args)
          Starts the TestRunner
 void testEnded(String testName)
           
 void testFailed(int status, junit.framework.Test test, Throwable t)
           
 void testStarted(String testName)
           
 void testViewChanged()
          Whenever a tab page is selected (one of the test view changed) it activates activity in it.
 
Methods inherited from class junit.runner.BaseTestRunner
addError, addFailure, clearStatus, elapsedTimeAsString, endTest, extractClassName, getFilteredTrace, getFilteredTrace, getLoader, getPreference, getPreference, getPreferences, getTest, inVAJava, loadSuiteClass, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, startTest, truncate, useReloadingTestSuiteLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CanicaTestRunner

public CanicaTestRunner(Class testClass)
Constructor, (singleton technique)

Method Detail

run

public static void run(Class test,
                       OutputPaneable outputPane)
It runs a test data file, given as arguments, the test data file and the outputPane interface to access the GUI objects.

Parameters:
test - Test data file (.class)
outputPane - Outputpane interface

start

public void start(String[] args)
Starts the TestRunner


setSuite

public void setSuite(String suiteName)
It sets the file name to the output, and to a local reference

Parameters:
suiteName - file name

runSuite

public void runSuite()
It runs the suite


getTest

public junit.framework.Test getTest(Class testClass)
Returns the Test corresponding to the given suite. This is a template method, subclasses override runFailed(), clearStatus().


testViewChanged

public void testViewChanged()
Whenever a tab page is selected (one of the test view changed) it activates activity in it.


testStarted

public void testStarted(String testName)
Specified by:
testStarted in class junit.runner.BaseTestRunner

testEnded

public void testEnded(String testName)
Specified by:
testEnded in class junit.runner.BaseTestRunner

testFailed

public void testFailed(int status,
                       junit.framework.Test test,
                       Throwable t)
Specified by:
testFailed in class junit.runner.BaseTestRunner

runFailed

protected void runFailed(String message)
Specified by:
runFailed in class junit.runner.BaseTestRunner

handleTestSelected

public void handleTestSelected(junit.framework.Test test)
Description copied from interface: TestRunContext
Handles the selection of a Test.

Specified by:
handleTestSelected in interface TestRunContext

getFailures

public ListModel getFailures()
Description copied from interface: TestRunContext
Returns the failure model

Specified by:
getFailures in interface TestRunContext

initializeAndLinksOutput

protected void initializeAndLinksOutput()
Initializes failures objects and links this context with output, and failure detail view.


createTestRunViews

protected JTabbedPane createTestRunViews()
It creates the JTabbedPane that will contain the two views, tests tree and failure view

Returns:
the JTabbedPane

reset

protected void reset()
It resets the visual objects in the OutputPane


createFailureDetailView

protected junit.runner.FailureDetailView createFailureDetailView()
Creates the FailureDetailView

Returns:

createTestResult

protected junit.framework.TestResult createTestResult()
It returns the test result object

Returns:
TestResult object

aboutToStart

protected void aboutToStart(junit.framework.Test testSuite)
It prepares the Test run view to start (adds the testSuite to the Listener,

Parameters:
testSuite -

runFinished

protected void runFinished(junit.framework.Test testSuite)
It tells the views that the run has finished

Parameters:
testSuite -

UTJML

UTJML is Copyright (C) 2004-2006 by University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the JML project.