assertTrue(handler1.getElementName().equals(handler2.getElementName()));
}
}
public void testProductMethods() throws Exception {
XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
fmClient.setDataTransfer(new InPlaceDataTransferFactory().createDataTransfer());
Product product = new Product();
Product roundTripProduct = XmlRpcStructFactory.getProductFromXmlRpc(
XmlRpcStructFactory.getXmlRpcProduct(product));
assertEquals(product, roundTripProduct);
product = new Product();
product.setProductId("TestId");
product.setProductName("TestName");
product.setProductReferences(Lists.newArrayList(new Reference("file:///original/path", null, 2)));
product.setProductStructure("Flat");
product.setProductType(fmClient.getProductTypeByName("GenericFile"));
product.setRootRef(new Reference("file:///original/root", "file:///datastore/root", 3));
roundTripProduct = XmlRpcStructFactory.getProductFromXmlRpc(XmlRpcStructFactory.getXmlRpcProduct(product));
assertEquals(product, roundTripProduct);
Metadata m = new Metadata();
m.addMetadata("TestKey", "TestValue");
roundTripProduct = fmClient.getProductById(
fmClient.ingestProduct(product, m, true));
assertEquals(product, roundTripProduct);
}