### Question:
AbstractMetadataReport implements MetadataReport { public boolean retry() { return doHandleMetadataCollection(failedReports); } AbstractMetadataReport(URL reportServerURL); URL getUrl(); @Override String toString(); @Override void storeProviderMetadata(MetadataIdentifier providerMetadataIdentifier, FullServiceDefinition serviceDefinition); @Override void storeConsumerMetadata(MetadataIdentifier consumerMetadataIdentifier, Map<String, String> serviceParameterMap); void storeConsumerMetadataTask(MetadataIdentifier consumerMetadataIdentifier, Map<String, String> serviceParameterMap); boolean retry(); public MetadataReportRetry metadataReportRetry; }### Answer:
@Test public void testRetry() throws InterruptedException, ClassNotFoundException { String interfaceName = "org.apache.dubbo.metadata.integration.RetryTestService"; String version = "1.0.0.retry"; String group = null; String application = "vic.retry"; URL storeUrl = URL.valueOf("retryReport: RetryMetadataReport retryReport = new RetryMetadataReport(storeUrl, 2); retryReport.metadataReportRetry.retryPeriod = 400L; URL url = URL.valueOf("dubbo: Assertions.assertNull(retryReport.metadataReportRetry.retryScheduledFuture); Assertions.assertTrue(retryReport.metadataReportRetry.retryCounter.get() == 0); Assertions.assertTrue(retryReport.store.isEmpty()); Assertions.assertTrue(retryReport.failedReports.isEmpty()); storePrivider(retryReport, interfaceName, version, group, application); Thread.sleep(150); Assertions.assertTrue(retryReport.store.isEmpty()); Assertions.assertFalse(retryReport.failedReports.isEmpty()); Assertions.assertNotNull(retryReport.metadataReportRetry.retryScheduledFuture); Thread.sleep(2000L); Assertions.assertTrue(retryReport.metadataReportRetry.retryCounter.get() != 0); Assertions.assertTrue(retryReport.metadataReportRetry.retryCounter.get() >= 3); Assertions.assertFalse(retryReport.store.isEmpty()); Assertions.assertTrue(retryReport.failedReports.isEmpty()); }