public void testClean() throws IOException {
// Load the template.
String serializedTemplate = Utils
.readFile("data/validation/fisk12mapping.txt");
Template template = Template.unserialize(serializedTemplate);
// Parse the first file using the template.
String document0 = Utils.readFile("data/test/fisk1.html");
String correct0 = Utils.readFile("data/validation/fisk1.content.html");
String cleaned0 = template.clean(document0);
correct0 = correct0.replaceAll("\\s", "");
cleaned0 = cleaned0.replaceAll("\\s", "");
assertEquals(correct0, cleaned0);
// Parse the second file using the template.
String document1 = Utils.readFile("data/test/fisk2.html");
String correct1 = Utils.readFile("data/validation/fisk2.content.html");
String cleaned1 = template.clean(document1);
correct1 = correct1.replaceAll("\\s", "");
cleaned1 = cleaned1.replaceAll("\\s", "");
assertEquals(correct1, cleaned1);