Class IpsTestCaseBase

    • 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 void assertEquals​(java.lang.Object expectedValue, java.lang.Object actualValue, IpsTestResult result)
      Asserts that two objects are equal.
      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.
      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.
      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.
      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.
      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.
      protected void assertFalse​(boolean condition, IpsTestResult result)
      Asserts that a condition is false.
      protected void assertFalse​(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)
      Asserts that a condition is false.
      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.
      protected void assertNotNull​(java.lang.Object object, IpsTestResult result)
      Asserts that an object is not null.
      protected void assertNotNull​(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)
      Asserts that an object is not null.
      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.
      protected void assertNull​(java.lang.Object object, IpsTestResult result)
      Asserts that an object is null.
      protected void assertNull​(java.lang.Object object, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)
      Asserts that an object is null.
      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.
      protected void assertTrue​(boolean condition, IpsTestResult result)
      Asserts that a condition is true.
      protected void assertTrue​(boolean condition, IpsTestResult result, java.lang.String testObject, java.lang.String attribute)
      Asserts that a condition is true.
      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.
      abstract void executeAsserts​(IpsTestResult result)
      Method to execute several asserts and store the results in the given result object.
      abstract void executeBusinessLogic()
      Method to execute the business logic.
      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.
      void run​(IpsTestResult result)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IpsTestCaseBase

        public IpsTestCaseBase​(java.lang.String qName)
    • Method Detail

      • executeBusinessLogic

        public abstract void executeBusinessLogic()
                                           throws java.lang.Exception
        Method 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 value
        actualValue - the value which will be compared with the expected value
        result - 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 value
        actualValue - the value which will be compared with the expected value
        result - result object to which the assert result will be added
        testObject - 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 be null
      • 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 value
        actualValue - the value which will be compared with the expected value
        result - result object to which the assert result will be added
        testObject - 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 be null
        message - 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 checked
        result - 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
      • 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
        message - 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 checked
        result - 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
      • 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
        message - 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 checked
        result - 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
      • 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
        message - 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 checked
        result - 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
      • 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 checked
        result - result object to which the assert result will be added
        testObject - 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 be null
        message - 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 value
        actualValue - the actuel value
        result - result object to which the assert result will be added
        testObject - 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 be null
        message - an optional message test to describe the failure