use of org.commonjava.indy.subsys.template.ScriptEngine in project indy by Commonjava.
the class HttpProxyTest method setup.
@Before
public void setup() throws Exception {
contentMetadata.clear();
core.initGalley();
final TransportManager transports = new TransportManagerImpl(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager())));
core.withTransportManager(transports);
core.initMissingComponents();
final HttproxConfig config = new HttproxConfig();
config.setEnabled(true);
proxyPort = config.getPort();
final BootOptions bootOpts = new BootOptions();
bootOpts.setBind(HOST);
storeManager = new MemoryStoreDataManager(true);
final IndyObjectMapper mapper = new IndyObjectMapper(true);
final DownloadManager downloadManager = new DefaultDownloadManager(storeManager, core.getTransferManager(), core.getLocationExpander(), new MockInstance<>(new MockContentAdvisor()));
DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, Executors.newSingleThreadExecutor());
ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
final ContentManager contentManager = new DefaultContentManager(storeManager, downloadManager, mapper, new SpecialPathManagerImpl(), new MemoryNotFoundCache(), contentDigester, Collections.<ContentGenerator>emptySet());
DataFileManager dfm = new DataFileManager(temp.newFolder(), new DataFileEventManager());
final TemplatingEngine templates = new TemplatingEngine(new GStringTemplateEngine(), dfm);
final ContentController contentController = new ContentController(storeManager, contentManager, templates, mapper, new MimeTyper());
KeycloakConfig kcConfig = new KeycloakConfig();
kcConfig.setEnabled(false);
final KeycloakProxyAuthenticator auth = new KeycloakProxyAuthenticator(kcConfig, config);
ScriptEngine scriptEngine = new ScriptEngine(dfm);
proxy = new HttpProxy(config, bootOpts, new ProxyAcceptHandler(config, storeManager, contentController, auth, core.getCache(), scriptEngine));
proxy.start();
}
use of org.commonjava.indy.subsys.template.ScriptEngine in project indy by Commonjava.
the class ValidationRuleParserTest method setUp.
@Before
public void setUp() throws Exception {
DataFileManager dfm = new DataFileManager(temp.newFolder("indy.root"), new DataFileEventManager());
parser = new ValidationRuleParser(new ScriptEngine(dfm), new ObjectMapper());
}
use of org.commonjava.indy.subsys.template.ScriptEngine 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);
downloadManager = new DefaultDownloadManager(storeManager, galleyParts.getTransferManager(), new IndyLocationExpander(storeManager), new MockInstance<>(new MockContentAdvisor()));
DirectContentAccess dca = new DefaultDirectContentAccess(downloadManager, Executors.newSingleThreadExecutor());
ContentDigester contentDigester = new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata));
contentManager = new DefaultContentManager(storeManager, downloadManager, new IndyObjectMapper(true), new SpecialPathManagerImpl(), new MemoryNotFoundCache(), contentDigester, Collections.<ContentGenerator>emptySet());
dataManager = new DataFileManager(temp.newFolder("data"), new DataFileEventManager());
validationsManager = new PromoteValidationsManager(dataManager, new PromoteConfig(), new ValidationRuleParser(new ScriptEngine(dataManager), new IndyObjectMapper(true)));
MavenModelProcessor modelProcessor = new MavenModelProcessor();
validator = new PromotionValidator(validationsManager, new PromotionValidationTools(contentManager, storeManager, galleyParts.getPomReader(), galleyParts.getMavenMetadataReader(), modelProcessor, galleyParts.getTypeMapper(), galleyParts.getTransferManager(), contentDigester), storeManager);
PromoteConfig config = new PromoteConfig();
manager = new PromotionManager(validator, contentManager, downloadManager, storeManager, config);
executor = Executors.newCachedThreadPool();
}
use of org.commonjava.indy.subsys.template.ScriptEngine in project indy by Commonjava.
the class PromoteValidationsManagerTest method setUp.
@Before
public void setUp() throws Exception {
fileManager = new DataFileManager(temp.newFolder("data"), new DataFileEventManager());
parser = new ValidationRuleParser(new ScriptEngine(fileManager), new ObjectMapper());
config = new PromoteConfig();
config.setEnabled(true);
}
use of org.commonjava.indy.subsys.template.ScriptEngine 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);
File rootDir = temp.newFolder("indy.root");
final DataFileManager dataFiles = new DataFileManager(rootDir, new DataFileEventManager());
validator = new ArtifactStoreValidator(fixture.getTransferManager());
ScriptEngine engine = new ScriptEngine(dataFiles);
detector = new TestImpliedRepositoryDetector(fixture.getPomReader(), storeManager, metadataManager, validator, engine, config);
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