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.TestCase
Base class for IPS test cases.
- Author:
- Jan Ortmann
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidCompares the actual output (created by the business function) with the expected result.protected abstract voidExecutes the business function(s) to test.protected DocumentBuilderprotected abstract voidreadExpectedResult(Element expResultEl) Reads the expected result from the given Xml element.protected abstract voidReads the input for the test from the given Xml element.protected voidprotected voidprotected 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
-
Constructor Details
-
IpsTestCase
Creates a new test case.
-
-
Method Details
-
runTest
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.- Overrides:
runTestin classjunit.framework.TestCase- Throws:
Throwable
-
run
- Throws:
Exception
-
run
- Throws:
Exception
-
readInput
Reads the input for the test from the given Xml element. -
readExpectedResult
Reads the expected result from the given Xml element. -
execBusinessFcts
Executes the business function(s) to test.- Throws:
Exception- Any exception thrown by the business function is considered as an error.
-
execAsserts
Compares the actual output (created by the business function) with the expected result.- Throws:
Exception
-
getDocumentBuilder
- Throws:
ParserConfigurationException
-