StorageReportSerializer extends XmlSerializer<StorageReport> { public StorageReportSerializer() { super(StorageReport.class, StorageReportBase.SCHEMA_NAME, StorageReportBase.SCHEMA_VERSION); } StorageReportSerializer();   }
@Test public void testStorageReportSerializer() { StorageReport report = createStorageReport(); StorageMetrics metrics = report.getStorageMetrics(); StorageReportSerializer serializer = new StorageReportSerializer(); String xml = serializer.serialize(report); assertNotNull(xml); StorageReport reportDeserialized = serializer.deserialize(xml); assertEquals(reportId, reportDeserialized.getReportId()); assertEquals(completionTime, reportDeserialized.getCompletionTime()); assertEquals(elapsedTime, reportDeserialized.getElapsedTime()); StorageMetrics metricsDeserialized = reportDeserialized.getStorageMetrics(); assertEquals(metrics.getTotalItems(), metricsDeserialized.getTotalItems()); assertEquals(metrics.getTotalSize(), metricsDeserialized.getTotalSize()); assertEquals(metrics.getStorageProviderMetrics().size(), metricsDeserialized.getStorageProviderMetrics().size()); assertEquals(report, reportDeserialized); assertEquals(xml, serializer.serialize(reportDeserialized)); }