}
in.close();
byte[] bytes = out.toByteArray();
Configuration conf = NutchConfiguration.create();
WebPage page = new WebPage();
page.setBaseUrl(new Utf8(url));
page.setContent(ByteBuffer.wrap(bytes));
MimeUtil mimeutil = new MimeUtil(conf);
String mtype = mimeutil.getMimeType(file);
page.setContentType(new Utf8(mtype));
new ParseUtil(conf).parse(url, page);
ByteBuffer bb = page.getFromMetadata(new Utf8("License-Url"));
assertEquals(license, new String(bb.array()));
bb = page.getFromMetadata(new Utf8("License-Location"));
assertEquals(location, new String(bb.array()));
bb = page.getFromMetadata(new Utf8("Work-Type"));
if (bb == null)
assertEquals(type, null);
else
assertEquals(type, new String(bb.array()));
}