Metadata metadata = new Metadata();
metadata.addMetadata("ProductType", "FooFile");
metadata.addMetadata("ProductionDate", "060804");
metadata.addMetadata("Filename", "foo.txt");
Reference r = new Reference();
product.getProductReferences().add(r);
MetadataBasedFileVersioner versioner = new MetadataBasedFileVersioner(
filePathSpec);
try {
versioner.createDataStoreReferences(product, metadata);
} catch (VersioningException e) {
fail(e.getMessage());
}
String expected = "file:/foo/bar/FooFile/some/other/path060804/foo.txt";
assertEquals("The reference: [" + r.getDataStoreReference()
+ "] is not equal to: [" + expected + "]", expected, r
.getDataStoreReference());
}