Permalink
Browse files

print better error message

git-svn-id: http://liquibase.jira.com/svn/CORE/trunk@1536 e6edf6fb-f266-4316-afb4-e53d95876a76
  • Loading branch information...
1 parent 0b89817 commit fa985018c817a1af7feb5fd89a31fcd4b903c773 nvoxland committed Jul 11, 2010
@@ -377,9 +377,14 @@ private void printColumnComparison(SortedSet<Column> changedColumns,
}
}
- private void printComparision(String title, DiffComparison comparison,
- PrintStream out) {
+ private void printComparision(String title, DiffComparison comparison, PrintStream out) {
out.print(title + ":");
+
+ if (comparison == null) {
+ out.print("NULL");
+ return;
+ }
+
if (comparison.areTheSame()) {
out.println(" EQUAL");
} else {
@@ -27,12 +27,7 @@
import liquibase.test.DatabaseTestContext;
import liquibase.logging.LogFactory;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.io.StringWriter;
+import java.io.*;
import java.net.URL;
import java.util.*;
import java.sql.Statement;
@@ -411,7 +406,12 @@ public void testRerunDiffChangeLog() throws Exception {
DatabaseSnapshot migratedSnapshot = DatabaseSnapshotGeneratorFactory.getInstance().createSnapshot(database, null, null);
DiffResult finalDiffResult = new Diff(originalSnapshot, migratedSnapshot).compare();
- assertFalse(finalDiffResult.differencesFound());
+ try {
+ assertFalse(finalDiffResult.differencesFound());
+ } catch (AssertionError e) {
+ finalDiffResult.printResult(System.out);
+ throw e;
+ }
//diff to empty and drop all
Diff emptyDiff = new Diff(emptySnapshot, migratedSnapshot);

0 comments on commit fa98501

Please sign in to comment.