Sfoglia il codice sorgente

Make sure to capture entire error body.

Sam Jaffe 6 anni fa
parent
commit
7ad9586aad

+ 6 - 2
src/test/java/org/leumasjaffe/json/schema/factory/SchemaFactoryTest.java

@@ -3,6 +3,8 @@ package org.leumasjaffe.json.schema.factory;
 import static org.junit.Assert.*;
 
 import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -43,8 +45,10 @@ public class SchemaFactoryTest {
 		try {
 			factory.create(readTree("{ \"$id\": \"unit-test-schema\", \"$schema\":\"http://json-schema.org/draft-06/schema#\" }"));
 		} catch (Throwable t) {
-			t.printStackTrace();
-			fail(t.getMessage());
+			final StringWriter sw = new StringWriter();
+			final PrintWriter pw = new PrintWriter(sw);
+			t.printStackTrace(pw);
+			fail(sw.toString());
 		}
 	}
 }