use of groovy.text.GStringTemplateEngine 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 groovy.text.GStringTemplateEngine in project indy by Commonjava.
the class SetBackSettingsManagerTest method setup.
@Before
public void setup() throws Exception {
storeManager = new MemoryStoreDataManager(true);
final File dataSrc = new File("./src/main/data");
final File data = temp.newFolder("data");
FileUtils.copyDirectory(dataSrc, data);
final DataFileConfiguration config = new DataFileConfiguration(data, temp.newFolder("work"));
final DataFileManager fileManager = new DataFileManager(config, new DataFileEventManager());
final TemplatingEngine templates = new TemplatingEngine(new GStringTemplateEngine(), fileManager);
manager = new SetBackSettingsManager(storeManager, templates, fileManager, new SetbackConfig(true));
}
use of groovy.text.GStringTemplateEngine in project indy by Commonjava.
the class ContentControllerTest method setup.
@Before
public void setup() throws Exception {
contentMetadata.clear();
fixture.initMissingComponents();
final StoreDataManager storeManager = new MemoryStoreDataManager(true);
final DownloadManager fileManager = new DefaultDownloadManager(storeManager, fixture.getTransferManager(), fixture.getLocationExpander());
final DirectContentAccess dca = new DefaultDirectContentAccess(fileManager, Executors.newSingleThreadExecutor());
final ContentManager contentManager = new DefaultContentManager(storeManager, fileManager, new IndyObjectMapper(true), new SpecialPathManagerImpl(), new MemoryNotFoundCache(), new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata)), Collections.<ContentGenerator>emptySet());
final TemplatingEngine templates = new TemplatingEngine(new GStringTemplateEngine(), new DataFileManager(fixture.getTemp().newFolder("indy-home"), new DataFileEventManager()));
content = new ContentController(storeManager, contentManager, templates, new IndyObjectMapper(true), new MimeTyper());
}
Aggregations