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
    Constructor
    Description
    Creates a new test case.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Compares the actual output (created by the business function) with the expected result.
    protected abstract void
    Executes the business function(s) to test.
    protected DocumentBuilder
     
    protected abstract void
    Reads the expected result from the given Xml element.
    protected abstract void
    readInput(Element inputEl)
    Reads the input for the test from the given Xml element.
    protected void
     
    protected void
    run(Element testCaseEl)
     
    protected void
    Implementation of the JUnit Test method 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • IpsTestCase

      public IpsTestCase(String name)
      Creates a new test case.
  • Method Details

    • runTest

      protected void runTest() throws Throwable
      Implementation of the JUnit Test method 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:
      runTest in class junit.framework.TestCase
      Throws:
      Throwable
    • run

      protected void run(Document doc) throws Exception
      Throws:
      Exception
    • run

      protected void run(Element testCaseEl) throws Exception
      Throws:
      Exception
    • readInput

      protected abstract void readInput(Element inputEl)
      Reads the input for the test from the given Xml element.
    • readExpectedResult

      protected abstract void readExpectedResult(Element expResultEl)
      Reads the expected result from the given Xml element.
    • execBusinessFcts

      protected abstract void execBusinessFcts() throws Exception
      Executes the business function(s) to test.
      Throws:
      Exception - Any exception thrown by the business function is considered as an error.
    • execAsserts

      protected abstract void execAsserts() throws Exception
      Compares the actual output (created by the business function) with the expected result.
      Throws:
      Exception
    • getDocumentBuilder

      protected DocumentBuilder getDocumentBuilder() throws ParserConfigurationException
      Throws:
      ParserConfigurationException