use of no.cantara.docsite.executor.ExecutorService in project SourceCodePortal by Cantara.
the class Application method initialize.
public static Application initialize(DynamicConfiguration configuration, int port) {
String host = configuration.evaluateToString("http.host");
CacheStore cacheStore = CacheInitializer.initialize(configuration);
ExecutorService executorService = ExecutorService.create();
ScheduledExecutorService scheduledExecutorService = ScheduledExecutorService.create(configuration, executorService, cacheStore);
RepositoryConfigLoader configLoader = new RepositoryConfigLoader(configuration, cacheStore);
ApplicationController applicationController = new ApplicationController(configuration.evaluateToString("http.cors.allow.origin"), configuration.evaluateToString("http.cors.allow.header"), configuration.evaluateToBoolean("http.cors.allow.origin.test"), port, configuration, executorService, scheduledExecutorService, cacheStore);
return new Application(configuration, host, port, executorService, scheduledExecutorService, cacheStore, configLoader, applicationController);
}
use of no.cantara.docsite.executor.ExecutorService in project SourceCodePortal by Cantara.
the class GitHubPageServiceTest method testName.
@Ignore
// (enabled = false)
@Test
public void testName() {
ExecutorService executorService = ExecutorService.create();
executorService.start();
DynamicConfiguration configuration = configuration();
CacheStore cacheStore = cacheStore(configuration);
RepositoryConfigLoader loader = new RepositoryConfigLoader(configuration, cacheStore);
loader.load();
cacheStore.getRepositories().forEach(rg -> {
// TODO lookup CacheGroupKey for CacheKey and pass that to worker task
// TODO use CacheGroupKey for pages
// executorService.queue(new FetchPageTask(configuration, executorService, cacheStore, rg.getKey(), rg.getValue().readmeURL));
LOG.trace("{} - {}", rg.getKey(), rg.getValue().apiReadmeURL.getExternalURL());
// cacheStore.getReadmeContents().get(cacheStore.getCacheKeys().get(rg.getKey().asCacheKey()));
});
executorService.shutdown();
}
use of no.cantara.docsite.executor.ExecutorService in project SourceCodePortal by Cantara.
the class RepositoryConfigLoaderTest method testRepositoryConfig.
@Test(enabled = false)
public void testRepositoryConfig() throws Exception {
ExecutorService executorService = ExecutorService.create();
executorService.start();
DynamicConfiguration configuration = configuration();
CacheStore cacheStore = cacheStore(configuration);
RepositoryConfigLoader service = new RepositoryConfigLoader(configuration, cacheStore);
service.load();
assertTrue(cacheStore.getRepositoryGroupsByGroupId("SourceCodePortal-t").size() > 1);
assertTrue(cacheStore.getRepositoryGroupsByGroupId("Whydah-t").size() > 15);
LOG.trace(JsonbFactory.prettyPrint(cacheStore.getConfiguredRepositories()));
}
Aggregations