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
- Author:
- Joerg Ortmann
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertEquals(Object expectedValue, Object actualValue, IpsTestResult result) Asserts that two objects are equal.protected voidassertEquals(Object expectedValue, Object actualValue, IpsTestResult result, String testObject, String attribute) Asserts that two objects are equal.protected voidassertEquals(Object expectedValue, Object actualValue, IpsTestResult result, String testObject, String attribute, 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, String object, 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, String object, String attribute, 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, String testObject, String attribute) Asserts that a condition is false.protected voidassertFalse(boolean condition, IpsTestResult result, String testObject, String attribute, String message) Asserts that a condition is false.protected voidassertNotNull(Object object, IpsTestResult result) Asserts that an object is not null.protected voidassertNotNull(Object object, IpsTestResult result, String testObject, String attribute) Asserts that an object is not null.protected voidassertNotNull(Object object, IpsTestResult result, String testObject, String attribute, String message) Asserts that an object is not null.protected voidassertNull(Object object, IpsTestResult result) Asserts that an object is null.protected voidassertNull(Object object, IpsTestResult result, String testObject, String attribute) Asserts that an object is null.protected voidassertNull(Object object, IpsTestResult result, String testObject, String attribute, 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, String testObject, String attribute) Asserts that a condition is true.protected voidassertTrue(boolean condition, IpsTestResult result, String testObject, String attribute, 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 voidMethod to execute the business logic.protected voidfail(Object expectedValue, Object actualValue, IpsTestResult result, String testObject, String attribute, 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
-
Constructor Details
-
IpsTestCaseBase
-
-
Method Details
-
run
-
executeBusinessLogic
Method to execute the business logic.- Throws:
Exception
-
executeAsserts
Method to execute several asserts and store the results in the given result object.- Throws:
Exception
-
assertEquals
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(Object expectedValue, Object actualValue, IpsTestResult result, String testObject, 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(Object expectedValue, Object actualValue, IpsTestResult result, String testObject, String attribute, 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
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, String testObject, 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, String testObject, String attribute, 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
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, String testObject, 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, String testObject, String attribute, 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
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
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(Object object, IpsTestResult result, String testObject, String attribute, 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
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(Object object, IpsTestResult result, String testObject, 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(Object object, IpsTestResult result, String testObject, String attribute, 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, String object, 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, String object, String attribute, 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(Object expectedValue, Object actualValue, IpsTestResult result, String testObject, String attribute, 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
-