tcl.lang
Class TclCmdTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by tcl.lang.TclCmdTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AppendCmdTest, ApplyCmdTest, BinaryCmdTest, CaseCmdTest, ClockCmdTest, CmdAHTest, CmdILTest, CmdMZTest, ConcatCmdText, EncodingCmdTest, ErrorCmdTest, EvalCmdTest, ExecCmdTest, ExprCmdTest, FileCmdTest, FileNameCmdTest, FileSystemCmdTest, ForCmdTest, ForeachCmdTest, FormatCmdTest, HistoryCmdTest, IfCmdTest, IncrCmdTest, InfoCmdTest, InterpCmdTest, IoCmdTest, JoinCmdTest, LassignCmdTest, LindexCmdTest, LinsertCmdTest, ListCmdTest, LlengthCmdTest, LrangeCmdTest, LrepeatCmdTest, LreplaceCmdTest, LreverseCmdTest, LsearchCmdTest, LsetCmdTest, MiscCmdTest, NamespaceCmdTest, PackageCmdTest, PidCmdTest, ProcCmdTest, PwdCmdTest, RegexCmdTest, RenameCmdTest, ScanCmdTest, SetCmdTest, SocketCmdTest, SourceCmdTest, SplitCmdTest, StringCmdTest, SubstCmdTest, SwitchCmdTest, TimerCmdTest, TraceCmdTest, UplevelCmdTest, UpvarCmdTest, WhileCmdTest

public class TclCmdTest
extends junit.framework.TestCase


Field Summary
static String EXEC_NAME
           
static String SHELL
           
static Class SHELL_CLASS
           
static String TCLTEST_NAMEOFEXECUTABLE
           
static String TCLTEST_VERBOSE
           
 
Constructor Summary
TclCmdTest()
           
 
Method Summary
protected  tcl.lang.Interp getInterp()
           
 void setUp()
           
 void tclTestCode(String code)
          Execute code, print results.
 void tclTestResource(String resName)
          Test a Tcl test file resource.
 void tclTestResource(String resName, List expectedFailureCases)
          Test a Tcl test file resource.
 void tclTestResource(String preTestCode, String resName, List expectedFailureCases)
          Test a Tcl test file resource.
 void tclTestResourceIgnoreFailures(String resName)
          Test a Tcl test file resource, test file is assumed to 'package require tcltest'.
 void tearDown()
           
 void test()
          Dummy test method to keep JUnit happy.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXEC_NAME

public static final String EXEC_NAME
See Also:
Constant Field Values

SHELL_CLASS

public static final Class SHELL_CLASS

SHELL

public static final String SHELL

TCLTEST_VERBOSE

public static final String TCLTEST_VERBOSE
See Also:
Constant Field Values

TCLTEST_NAMEOFEXECUTABLE

public static String TCLTEST_NAMEOFEXECUTABLE
Constructor Detail

TclCmdTest

public TclCmdTest()
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

tclTestCode

public void tclTestCode(String code)
                 throws Exception
Execute code, print results.

Parameters:
code -
Throws:
Exception

tclTestResourceIgnoreFailures

public void tclTestResourceIgnoreFailures(String resName)
                                   throws Exception
Test a Tcl test file resource, test file is assumed to 'package require tcltest'. Failures in tcl test cases are ignored.

Parameters:
resName - The name of a tcltest file as a resource path.
Throws:
Exception

tclTestResource

public void tclTestResource(String resName)
                     throws Exception
Test a Tcl test file resource. No failures are expected in running of the tcl test cases, if any occur, the junit test will fail.

Parameters:
resName - The name of a tcltest file as a resource path.
Throws:
Exception

tclTestResource

public void tclTestResource(String resName,
                            List expectedFailureCases)
                     throws Exception
Test a Tcl test file resource. Examine test output, check expected and unexpected test case failures, if any occur, the junit test will fail.

Parameters:
resName - The name of a tcltest file as a resource path.
expectedFailureCases - The list of expected test case failures (List of String).
Throws:
Exception

tclTestResource

public void tclTestResource(String preTestCode,
                            String resName,
                            List expectedFailureCases)
                     throws Exception
Test a Tcl test file resource. Examine test output, check expected and unexpected test case failures, if any occur, the junit test will fail.

Parameters:
preTestCode - A string of Tcl code to evaluate before running the test case. Hint: use TCLTEST_VERBOSE to show progress of tcl test cases.
resName - The name of a tcltest file as a resource path.
expectedFailureCases - The list of expected test case failures (List of String).
Throws:
Exception

test

public void test()
          throws Exception
Dummy test method to keep JUnit happy.

Throws:
Exception

getInterp

protected tcl.lang.Interp getInterp()
Returns:
the TCL interpreter


Copyright © 2013. All Rights Reserved.