com.metamatrix.script.junit
Class BshTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.metamatrix.script.junit.BshTestCase
All Implemented Interfaces:
junit.framework.Test

public class BshTestCase
extends junit.framework.TestCase

BshTestCase class along with BshTestSuite ties the JUnit and BeanShell toghether. Using the combination of these, user can write test scripts using the BeanShell scripting language, and integrate,run and report results using JUnit framework.

usage: For example if we have a BeanShell script called "JUnitTest.bsh", that can be executed by using as follows.

 public MyTest extends TestCase{
 
     public static Test suite() {
                   BshTestSuite suite = new BshTestSuite();
                   suite.addTest("JUnitTest.bsh");
                   suite.addTest("Math.bsh");
                   return suite;
     }
 }
 
Currently the path to the script must be relative to the working directory or fully qualified.


Constructor Summary
BshTestCase(java.lang.String scriptName, bsh.BshMethod method, Interpreter interpreter)
           
 
Method Summary
protected  void runTest()
           
static junit.framework.Test suite()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, 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
 

Constructor Detail

BshTestCase

public BshTestCase(java.lang.String scriptName,
                   bsh.BshMethod method,
                   Interpreter interpreter)
Method Detail

suite

public static junit.framework.Test suite()

runTest

protected void runTest()
                throws java.lang.Throwable
Overrides:
runTest in class junit.framework.TestCase
Throws:
java.lang.Throwable
See Also:
TestCase.runTest()


Copyright © 2009. All Rights Reserved.