public void testProductTypeMethods() throws RepositoryManagerException, MalformedURLException, ConnectionException {
XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
fmClient.setDataTransfer(new LocalDataTransferFactory().createDataTransfer());
ProductType productType = fmClient.getProductTypeByName("GenericFile");
Hashtable<String, Object> productTypeHash = XmlRpcStructFactory.getXmlRpcProductType(productType);
ProductType convBackProdType = XmlRpcStructFactory.getProductTypeFromXmlRpc(productTypeHash);
assertTrue(productType.getProductTypeId().equals(convBackProdType.getProductTypeId()));
assertTrue(productType.getName().equals(convBackProdType.getName()));
assertTrue(productType.getDescription().equals(convBackProdType.getDescription()));
assertTrue(productType.getVersioner().equals(convBackProdType.getVersioner()));
assertTrue(productType.getProductRepositoryPath().equals(convBackProdType.getProductRepositoryPath()));
for (int i = 0; i < productType.getExtractors().size(); i++) {
ExtractorSpec spec1 = productType.getExtractors().get(i);
ExtractorSpec spec2 = convBackProdType.getExtractors().get(i);
assertTrue(spec1.getClassName().equals(spec2.getClassName()));
assertTrue(spec1.getConfiguration().equals(spec2.getConfiguration()));
}
for (int i = 0; i < productType.getHandlers().size(); i++) {
TypeHandler handler1 = productType.getHandlers().get(i);
TypeHandler handler2 = convBackProdType.getHandlers().get(i);
assertTrue(handler1.getClass().getCanonicalName().equals(handler2.getClass().getCanonicalName()));
assertTrue(handler1.getElementName().equals(handler2.getElementName()));
}
}