Package org.faktorips.runtime.test
Class IpsTestCaseBase
- java.lang.Object
-
- org.faktorips.runtime.test.IpsTest2
-
- org.faktorips.runtime.test.IpsTestCaseBase
-
- Direct Known Subclasses:
IpsFormulaTestCase,IpsTestCase2
public abstract class IpsTestCaseBase extends IpsTest2
- Author:
- Joerg Ortmann
-
-
Constructor Summary
Constructors Constructor Description IpsTestCaseBase(java.lang.String qName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidassertEquals(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result)Asserts that two objects are equal.protected voidassertEquals(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that two objects are equal.protected voidassertEquals(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that two objects are equal.protected voidassertEqualsIgnoreScale(org.faktorips.values.Decimal expectedValue, org.faktorips.values.Decimal actualValue, IpsTestResult result)Deprecated.Decimal class already ignores the scale in it's equals method.protected voidassertEqualsIgnoreScale(org.faktorips.values.Decimal expectedValue, org.faktorips.values.Decimal actualValue, IpsTestResult result, java.lang.String object, java.lang.String attribute)Deprecated.Decimal class already ignores the scale in it's equals method.protected voidassertEqualsIgnoreScale(org.faktorips.values.Decimal expectedValue, org.faktorips.values.Decimal actualValue, IpsTestResult result, java.lang.String object, java.lang.String attribute, java.lang.String message)Deprecated.Decimal class already ignores the scale in it's equals method.protected voidassertFalse(boolean condition, IpsTestResult result)Asserts that a condition is false.protected voidassertFalse(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that a condition is false.protected voidassertFalse(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that a condition is false.protected voidassertNotNull(java.lang.Object object, IpsTestResult result)Asserts that an object is not null.protected voidassertNotNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that an object is not null.protected voidassertNotNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that an object is not null.protected voidassertNull(java.lang.Object object, IpsTestResult result)Asserts that an object is null.protected voidassertNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that an object is null.protected voidassertNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that an object is null.protected voidassertTrue(boolean condition, IpsTestResult result)Asserts that a condition is true.protected voidassertTrue(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that a condition is true.protected voidassertTrue(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that a condition is true.abstract voidexecuteAsserts(IpsTestResult result)Method to execute several asserts and store the results in the given result object.abstract voidexecuteBusinessLogic()Method to execute the business logic.protected voidfail(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Adds a new failure to the given result.voidrun(IpsTestResult result)-
Methods inherited from class org.faktorips.runtime.test.IpsTest2
countTestCases, getFullPath, getName, getQualifiedName, getRepository, setFullPath, setRepository
-
-
-
-
Method Detail
-
run
public void run(IpsTestResult result)
-
executeBusinessLogic
public abstract void executeBusinessLogic() throws java.lang.ExceptionMethod to execute the business logic.- Throws:
java.lang.Exception
-
executeAsserts
public abstract void executeAsserts(IpsTestResult result) throws java.lang.Exception
Method to execute several asserts and store the results in the given result object.- Throws:
java.lang.Exception
-
assertEquals
protected void assertEquals(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result)Asserts that two objects are equal. If they are not equal an ips test failure will be added to the given result object.- Parameters:
expectedValue- the expected valueactualValue- the value which will be compared with the expected valueresult- result object to which the assert result will be added
-
assertEquals
protected void assertEquals(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that two objects are equal. If they are not equal an ips test failure will be added to the given result object. The given object and attribute specifies the tested field.- Parameters:
expectedValue- the expected valueactualValue- the value which will be compared with the expected valueresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benull
-
assertEquals
protected void assertEquals(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that two objects are equal. If they are not equal an ips test failure will be added to the given result object with the given message. The given object and attribute specifies the tested field.- Parameters:
expectedValue- the expected valueactualValue- the value which will be compared with the expected valueresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benullmessage- an optional message test to describe the assert
-
assertTrue
protected void assertTrue(boolean condition, IpsTestResult result)Asserts that a condition is true. If it isn't an ips test failure will be added to the given result object.- Parameters:
condition- the condition which will be checkedresult- result object to which the assert result will be added
-
assertTrue
protected void assertTrue(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that a condition is true. If it isn't an ips test failure will be added to the given result object.- Parameters:
condition- the condition which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benull
-
assertTrue
protected void assertTrue(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that a condition is true. If it isn't an ips test failure will be added to the given result object.- Parameters:
condition- the condition which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benullmessage- an optional message test to describe the assert
-
assertFalse
protected void assertFalse(boolean condition, IpsTestResult result)Asserts that a condition is false. If it isn't an ips test failure will be added to the given result object.- Parameters:
condition- the condition which will be checkedresult- result object to which the assert result will be added
-
assertFalse
protected void assertFalse(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that a condition is false. If it isn't an ips test failure will be added to the given result object.- Parameters:
condition- the condition which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benull
-
assertFalse
protected void assertFalse(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that a condition is false. If it isn't an ips test failure will be added to the given result object.- Parameters:
condition- the condition which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benullmessage- an optional message test to describe the assert
-
assertNull
protected void assertNull(java.lang.Object object, IpsTestResult result)Asserts that an object is null. If it isn't an ips test failure will be added to the given result object.- Parameters:
object- the object which will be checkedresult- result object to which the assert result will be added
-
assertNull
protected void assertNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that an object is null. If it isn't an ips test failure will be added to the given result object.- Parameters:
object- the object which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benull
-
assertNull
protected void assertNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that an object is null. If it isn't an ips test failure will be added to the given result object.- Parameters:
object- the object which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benullmessage- an optional message test to describe the assert
-
assertNotNull
protected void assertNotNull(java.lang.Object object, IpsTestResult result)Asserts that an object is not null. If it isn't an ips test failure will be added to the given result object.- Parameters:
object- the object which will be checkedresult- result object to which the assert result will be added
-
assertNotNull
protected void assertNotNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)Asserts that an object is not null. If it isn't an ips test failure will be added to the given result object.- Parameters:
object- the object which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benull
-
assertNotNull
protected void assertNotNull(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Asserts that an object is not null. If it isn't an ips test failure will be added to the given result object.- Parameters:
object- the object which will be checkedresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object which will be checked. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute which will be checked, if the test object doesn't support attributes then this parameter could benullmessage- an optional message test to describe the assert
-
assertEqualsIgnoreScale
@Deprecated protected void assertEqualsIgnoreScale(org.faktorips.values.Decimal expectedValue, org.faktorips.values.Decimal actualValue, IpsTestResult result)Deprecated.Decimal class already ignores the scale in it's equals method.Asserts that an object is equal with ignored scale (e.g. 2.0 and 2.00 are equal with ignored scale). If it isn't an ips test failure will be added to the given result object.
-
assertEqualsIgnoreScale
@Deprecated protected void assertEqualsIgnoreScale(org.faktorips.values.Decimal expectedValue, org.faktorips.values.Decimal actualValue, IpsTestResult result, java.lang.String object, java.lang.String attribute)Deprecated.Decimal class already ignores the scale in it's equals method.Asserts that an object is equal with ignored scale (e.g. 2.0 and 2.00 are equal with ignored scale). If it isn't an ips test failure will be added to the given result object.
-
assertEqualsIgnoreScale
@Deprecated protected void assertEqualsIgnoreScale(org.faktorips.values.Decimal expectedValue, org.faktorips.values.Decimal actualValue, IpsTestResult result, java.lang.String object, java.lang.String attribute, java.lang.String message)Deprecated.Decimal class already ignores the scale in it's equals method.Asserts that an object is equal with ignored scale (e.g. 2.0 and 2.00 are equal with ignored scale). If it isn't an ips test failure will be added to the given result object.
-
fail
protected void fail(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result, java.lang.String testObject, java.lang.String attribute, java.lang.String message)Adds a new failure to the given result.- Parameters:
expectedValue- the expected valueactualValue- the actuel valueresult- result object to which the assert result will be addedtestObject- name of the test object in the test case type definition, identifies the object. If the test contains several instances with the same name then an index (starting with 0) must be added to the testObject string separated by "#" (e.g. TestObject#0, TestObject#1, ...). If the test object is a child object then the complete path to the object must be given, the path elements must be separated by "." (e.g. RootTestObject#0.ParentObject#0.ChildObject#0)attribute- name of the test attribute in the test case type definition, identifies the attribute, if the test object doesn't support attributes then this parameter could benullmessage- an optional message test to describe the failure
-
-