Package org.faktorips.runtime.test
Class IpsTestCase2
- java.lang.Object
-
- org.faktorips.runtime.test.IpsTest2
-
- org.faktorips.runtime.test.IpsTestCaseBase
-
- org.faktorips.runtime.test.IpsTestCase2
-
public abstract class IpsTestCase2 extends IpsTestCaseBase
An ips test case defines the fixture to run a test. To define an ips test case
1) implement a subclass of IpsTestCase2
2) implement the method getRepository to create the runtime repository
3) implement the method executeBusinessLogic to execute the necessary business actions
4) implement the method executeAsserts to ensure the correct result of the test.- Author:
- Jan Ortmann
-
-
Constructor Summary
Constructors Constructor Description IpsTestCase2(java.lang.String qName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddExtensionAttribute(IModelObject modelObject, java.lang.String attributeName, java.lang.Object value)Adds a extension attribute value identified by the attribute name and the test object the attribute is related to.intcountTestCases()Returns the number of test cases in this test.java.lang.ObjectgetExtensionAttributeValue(IModelObject modelObject, java.lang.String attributeName)Returns the value of the given extension attribute identified by the attribute name and the model object the attribute is related to.protected abstract voidinitExpectedResultFromXml(org.w3c.dom.Element resultEl)Initialized the expected result from the given element.voidinitFromXml(org.w3c.dom.Element testCaseEl)Initialized the input and expected result objects from the xml.protected abstract voidinitInputFromXml(org.w3c.dom.Element inputEl)Initialized the input from the given element.java.lang.StringtoString()-
Methods inherited from class org.faktorips.runtime.test.IpsTestCaseBase
assertEquals, assertEquals, assertEquals, assertEqualsIgnoreScale, assertEqualsIgnoreScale, assertEqualsIgnoreScale, assertFalse, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotNull, assertNull, assertNull, assertNull, assertTrue, assertTrue, assertTrue, executeAsserts, executeBusinessLogic, fail, run
-
Methods inherited from class org.faktorips.runtime.test.IpsTest2
getFullPath, getName, getQualifiedName, getRepository, setFullPath, setRepository
-
-
-
-
Method Detail
-
initFromXml
public final void initFromXml(org.w3c.dom.Element testCaseEl)
Initialized the input and expected result objects from the xml.
-
addExtensionAttribute
protected void addExtensionAttribute(IModelObject modelObject, java.lang.String attributeName, java.lang.Object value)
Adds a extension attribute value identified by the attribute name and the test object the attribute is related to.
-
initInputFromXml
protected abstract void initInputFromXml(org.w3c.dom.Element inputEl)
Initialized the input from the given element.
-
initExpectedResultFromXml
protected abstract void initExpectedResultFromXml(org.w3c.dom.Element resultEl)
Initialized the expected result from the given element.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
countTestCases
public int countTestCases()
Description copied from class:IpsTest2Returns the number of test cases in this test. If this is a test the method returns 1, if this is a suite the number of test cases in the suite itself and all suites that are contained in this one.- Specified by:
countTestCasesin classIpsTest2
-
getExtensionAttributeValue
public java.lang.Object getExtensionAttributeValue(IModelObject modelObject, java.lang.String attributeName)
Returns the value of the given extension attribute identified by the attribute name and the model object the attribute is related to. Returnsnullif no such extension attributes exists.- Parameters:
modelObject- The model object for which the value of the extension attribute should be returnedattributeName- The name which identifies the extension attribute
-
-