Created
June 5, 2012 10:10
-
-
Save abreslav/2874147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void compareNamespaces(@NotNull NamespaceDescriptor nsa, @NotNull NamespaceDescriptor nsb, boolean includeObject, | |
@NotNull File txtFile) { | |
String serialized = new NamespaceComparator(includeObject).doCompareNamespaces(nsa, nsb); | |
try { | |
if (!txtFile.exists()) { | |
FileUtil.writeToFile(txtFile, serialized); | |
Assert.fail("Expected data file did not exist. Generating: " + txtFile); | |
} | |
String expected = FileUtil.loadFile(txtFile); | |
// compare with hardcopy: make sure nothing is lost in output | |
Assert.assertEquals(expected, serialized); | |
} | |
catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment