Print expected and actual values on assertion error
authorJaroslav Tulach <jtulach@netbeans.org>
Sat, 26 Dec 2015 06:31:49 +0100
changeset 1038c1aabfb0bbb7
parent 1037 e390a06dbfac
child 1039 3ef632633f36
Print expected and actual values on assertion error
json-tck/src/main/java/net/java/html/json/tests/Utils.java
     1.1 --- a/json-tck/src/main/java/net/java/html/json/tests/Utils.java	Thu Dec 17 22:23:41 2015 +0100
     1.2 +++ b/json-tck/src/main/java/net/java/html/json/tests/Utils.java	Sat Dec 26 06:31:49 2015 +0100
     1.3 @@ -203,7 +203,7 @@
     1.4      
     1.5      static void assertNull(Object o, String msg) {
     1.6          if (o != null) {
     1.7 -            throw new AssertionError(msg);
     1.8 +            throw new AssertionError(msg + " but was: " + o);
     1.9          }
    1.10      }
    1.11  
    1.12 @@ -220,6 +220,6 @@
    1.13          if (a != null && a.equals(b)) {
    1.14              return;
    1.15          }
    1.16 -        throw new AssertionError(msg);
    1.17 +        throw new AssertionError(msg + " expecting: " + b + " actual: " + a);
    1.18      }
    1.19  }