use of org.commonjava.maven.galley.testing.maven.GalleyMavenFixture in project indy by Commonjava.
the class PromotionManagerTest method setup.
@Before
public void setup() throws Exception {
contentMetadata.clear();
galleyParts = new GalleyMavenFixture(true, temp);
galleyParts.initMissingComponents();
storeManager = new MemoryStoreDataManager(true);
final DefaultIndyConfiguration indyConfig = new DefaultIndyConfiguration();
indyConfig.setNotFoundCacheTimeoutSeconds(1);
final ExpiringMemoryNotFoundCache nfc = new ExpiringMemoryNotFoundCache(indyConfig);
WeftExecutorService rescanService = new PoolWeftExecutorService("test-rescan-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
downloadManager = new DefaultDownloadManager(storeManager, galleyParts.getTransferManager(), new IndyLocationExpander(storeManager), new MockInstance<>(new MockContentAdvisor()), nfc, rescanService);
WeftExecutorService contentAccessService = new PoolWeftExecutorService("test-content-access-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, contentAccessService);
ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<>("content-metadata", contentMetadata));
specialPathManager = new SpecialPathManagerImpl();
contentManager = new DefaultContentManager(storeManager, downloadManager, new IndyObjectMapper(true), specialPathManager, new MemoryNotFoundCache(), contentDigester, new ContentGeneratorManager());
File tempData = temp.newFolder("data");
promoteDataManager = new PromoteDataFileManager(temp.newFolder("data", "promote"), new DataFileEventManager());
validationsManager = new PromoteValidationsManager(promoteDataManager, new PromoteConfig(), new ValidationRuleParser(new ScriptEngine(new DataFileManager(tempData, new DataFileEventManager())), new IndyObjectMapper(true)));
WeftExecutorService validateService = new PoolWeftExecutorService("test-validate-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
MavenModelProcessor modelProcessor = new MavenModelProcessor();
PromoteConfig config = new PromoteConfig();
validator = new PromotionValidator(validationsManager, new PromotionValidationTools(contentManager, storeManager, galleyParts.getPomReader(), galleyParts.getMavenMetadataReader(), modelProcessor, galleyParts.getTypeMapper(), galleyParts.getTransferManager(), contentDigester, null, config), storeManager, downloadManager, validateService, null);
WeftExecutorService svc = new PoolWeftExecutorService("test-executor", (ThreadPoolExecutor) Executors.newCachedThreadPool(), 2, 10f, false, null, null);
manager = new PromotionManager(validator, contentManager, downloadManager, storeManager, new Locker<>(), config, nfc, svc, svc, specialPathManager);
executor = Executors.newCachedThreadPool();
}
use of org.commonjava.maven.galley.testing.maven.GalleyMavenFixture in project indy by Commonjava.
the class ImpliedRepositoryDetectorTest method setup.
@Before
public void setup() throws Throwable {
fixture = new GalleyMavenFixture(temp);
fixture.initGalley();
fixture.withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager())));
fixture.before();
storeManager = new MemoryStoreDataManager(true);
metadataManager = new ImpliedRepoMetadataManager(new IndyObjectMapper(true));
final ImpliedRepoConfig config = new ImpliedRepoConfig();
config.setEnabled(true);
config.addEnabledGroupNamePattern(".*");
File rootDir = temp.newFolder("indy.root");
final DataFileManager dataFiles = new DataFileManager(rootDir, new DataFileEventManager());
validator = new ArtifactStoreValidator(fixture.getTransferManager());
final IndyObjectMapper mapper = new IndyObjectMapper(Collections.emptySet());
ScriptEngine engine = new ScriptEngine(dataFiles);
detector = new TestImpliedRepositoryDetector(fixture.getPomReader(), storeManager, metadataManager, validator, engine, config, mapper);
summary = new ChangeSummary(ChangeSummary.SYSTEM_USER, "test setup");
RemoteRepository remote = new RemoteRepository("test", "http://www.foo.com/repo");
Group group = new Group("group", remote.getKey());
storeManager.storeArtifactStore(remote, summary, false, true, new EventMetadata());
storeManager.storeArtifactStore(group, summary, false, true, new EventMetadata());
server.expect("HEAD", server.formatUrl("/repo/"), 200, "");
}
Aggregations