org.drools.smf
Class SMFTestFrameWork

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.drools.smf.SMFTestFrameWork
All Implemented Interfaces:
junit.framework.Test

public abstract class SMFTestFrameWork
extends junit.framework.TestCase

Author:
mproctor SMTTestFrameWork is a base class for unit testing Semantic Implementations The semantic implementation unit test simply needs to extend this class along with setup method that instructs SMFTEstFrameWork which semantic url to instantiate for testing. public class JavaSemanticTest extends SMFTestFrameWork { public JavaSemanticTest( String name ) { super( name ); } public void setUp() throws Exception { super.setUp("java"); } } Each class that extends SMFTestFrameWork must create 3 data files; conditions.data, consequences.data. Each file is read depending the testType, a List of the specified tests extracted from the file; usig the delimeter to seperate each test block. Each testType has a corresponding private helper method to instantiate a Condition, Consequence for each test using the specified parameters

Nested Class Summary
static class SMFTestFrameWork.Cheese
          Simple nested class used with testing
 
Constructor Summary
SMFTestFrameWork(String name)
           
 
Method Summary
static boolean conditionExceptionTest()
           
static void consequenceExceptionTest()
           
 void setUp(String semantic, Set imports)
          Reads in the specified data file and extracts to a List of tests using the delimter
 void testConditions()
          Tests each of the extracted tests from conditions.data
 void testConsequences()
          Tests each of the extracted tests from consequences.data
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, 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

SMFTestFrameWork

public SMFTestFrameWork(String name)
Method Detail

setUp

public void setUp(String semantic,
                  Set imports)
           throws Exception
Reads in the specified data file and extracts to a List of tests using the delimter

Throws:
Exception

testConditions

public void testConditions()
                    throws Exception
Tests each of the extracted tests from conditions.data

Throws:
Exception

testConsequences

public void testConsequences()
                      throws Exception
Tests each of the extracted tests from consequences.data

Throws:
Exception

conditionExceptionTest

public static boolean conditionExceptionTest()
                                      throws Exception
Throws:
Exception

consequenceExceptionTest

public static void consequenceExceptionTest()
                                     throws Exception
Throws:
Exception


Copyright © 2001-2004 The Codehaus. All Rights Reserved.