Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #21 Alternative Version with AssertionError hierarchy #25

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

mmichaelis
Copy link
Contributor

Overview

As the decision about #4 is not yet clear this is a solution to #21 as alternative of #23 reintroducingAssertionError to the hierarchy.


I hereby agree to the terms of the Open Test Alliance Contributor License Agreement.

Introducing a more generic way to provide additional information
for debugging upon assertion failures. The DebugInformation is
key-value based and can contain actual any information.

In addition to this extended the ValueWrapper (now renamed to
ValueDescriptor as it *describes* the value) so that it does some
effort to serialize objects applying some strategies. This way we
could also provide images as for example for UI tests.

The current state neither includes documentation, more tests and
misses the commonly used exception for all exceptions provided
inside here.

This approach also addresses issues:

* ota4j-team#20 support for exception creation strategies
* ota4j-team#4 detach AssertionError from exceptions here
* ota4j-team#9 partially, as you the debug information provided here should
  eventually merge into a standard test report.
Experience shows that you cannot even trust toString() of objects.
They sometimes fail with an exception. ValueDescriptor should
be robust against such behavior.
* Introduces DebuggableException as base for all exceptions which should provide
  debug information.
* Makes AssertionFailedException a DebuggableException
  Keeps actual/expected constructors for now.
* MultiFailuresException: Adjust newline to system line.separator
* Repackages DebuggableException-classes
* Introduces test helpers like for serialization and to do assertions on exceptions.
* Refactored ExceptionTestHelper to provide better/easier to understand
  support for testing DebuggableExceptions.
* Introduces test for DebuggableException
* Renames methods of DebugInformation to be similar to Map interface.
* Provide a lot more tests.
* Remove unused methods from AssertionFailedException about actual/expected.
Adjust Javadoc as the statements about actual/expected values are
not valid anymore.
As the decision about ota4j-team#4 is not yet clear and some points (support
of old frameworks/tests) this is an alternative introducing the
AssertionError again to the hierarchy... with the drawback of
duplicated code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant