@Test public void testGetEntityMetadataAsync() throws InterruptedException, IOException { requests(); handler.async(); metadataSimpleService.getEntityMetadataAsync("defect", new MetadataService.MetadataCallback() { @Override public void metadataLoaded(final Metadata metadata) { handler.done(new Runnable() { @Override public void run() { Assert.assertFalse("Callback inside dispatch thread", SwingUtilities.isEventDispatchThread()); Assert.assertEquals("defect", metadata.getEntityType()); Assert.assertEquals(Integer.class, metadata.getField("id").getClazz()); Assert.assertEquals(metadata, metadataSimpleService.getEntityMetadata("defect")); final Thread t = Thread.currentThread(); metadataSimpleService.getEntityMetadataAsync("defect", new MetadataService.MetadataCallback() { @Override public void metadataLoaded(Metadata metadata) { Assert.assertEquals("Callback outside current thread although data should be cached", t, Thread.currentThread()); } @Override public void metadataFailed() { Assert.fail("Should have succeeded"); } }); } }); } @Override public void metadataFailed() { Assert.fail("Should have succeeded"); } }); }
void getEntityMetadataAsync(String entityType, MetadataService.MetadataCallback callback) { getValueAsync(entityType, MetadataService.Proxy.create(callback)); }
MetadataSimpleService extends AbstractCachingService<String, Metadata, AbstractCachingService.Callback<Metadata>> { void getEntityMetadataAsync(String entityType, MetadataService.MetadataCallback callback) { getValueAsync(entityType, MetadataService.Proxy.create(callback)); } }
MetadataSimpleService extends AbstractCachingService<String, Metadata, AbstractCachingService.Callback<Metadata>> { void getEntityMetadataAsync(String entityType, MetadataService.MetadataCallback callback) { getValueAsync(entityType, MetadataService.Proxy.create(callback)); } MetadataSimpleService(Project project); }
MetadataSimpleService extends AbstractCachingService<String, Metadata, AbstractCachingService.Callback<Metadata>> { void getEntityMetadataAsync(String entityType, MetadataService.MetadataCallback callback) { getValueAsync(entityType, MetadataService.Proxy.create(callback)); } MetadataSimpleService(Project project);  }
MetadataSimpleService extends AbstractCachingService<String, Metadata, AbstractCachingService.Callback<Metadata>> { void getEntityMetadataAsync(String entityType, MetadataService.MetadataCallback callback) { getValueAsync(entityType, MetadataService.Proxy.create(callback)); } MetadataSimpleService(Project project);   }