Package org.faktorips.runtime
Class IpsTestCase
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.faktorips.runtime.IpsTestCase
-
- All Implemented Interfaces:
junit.framework.Test
public abstract class IpsTestCase extends junit.framework.TestCaseBase class for IPS test cases.- Author:
- Jan Ortmann
-
-
Constructor Summary
Constructors Constructor Description IpsTestCase(java.lang.String name)Creates a new test case.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidexecAsserts()Compares the actual output (created by the business function) with the expected result.protected abstract voidexecBusinessFcts()Executes the business function(s) to test.protected javax.xml.parsers.DocumentBuildergetDocumentBuilder()protected abstract voidreadExpectedResult(org.w3c.dom.Element expResultEl)Reads the expected result from the given Xml element.protected abstract voidreadInput(org.w3c.dom.Element inputEl)Reads the input for the test from the given Xml element.protected voidrun(org.w3c.dom.Document doc)protected voidrun(org.w3c.dom.Element testCaseEl)protected voidrunTest()Implementation of the JUnitTestmethod that reads the test case data (input, expected output) from the test's resource, executes the business functions and compares the expected result with the actual result.-
Methods inherited from class junit.framework.TestCase
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, setUp, tearDown, toString
-
-
-
-
Method Detail
-
runTest
protected void runTest() throws java.lang.ThrowableImplementation of the JUnitTestmethod that reads the test case data (input, expected output) from the test's resource, executes the business functions and compares the expected result with the actual result.- Overrides:
runTestin classjunit.framework.TestCase- Throws:
java.lang.Throwable
-
run
protected void run(org.w3c.dom.Document doc) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
protected void run(org.w3c.dom.Element testCaseEl) throws java.lang.Exception- Throws:
java.lang.Exception
-
readInput
protected abstract void readInput(org.w3c.dom.Element inputEl)
Reads the input for the test from the given Xml element.
-
readExpectedResult
protected abstract void readExpectedResult(org.w3c.dom.Element expResultEl)
Reads the expected result from the given Xml element.
-
execBusinessFcts
protected abstract void execBusinessFcts() throws java.lang.ExceptionExecutes the business function(s) to test.- Throws:
java.lang.Exception- Any exception thrown by the business function is considered as an error.
-
execAsserts
protected abstract void execAsserts() throws java.lang.ExceptionCompares the actual output (created by the business function) with the expected result.- Throws:
java.lang.Exception
-
getDocumentBuilder
protected javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException- Throws:
javax.xml.parsers.ParserConfigurationException
-
-