Search in sources :

Example 6 with DataFileManager

use of org.commonjava.indy.subsys.datafile.DataFileManager 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);
}
Also used : DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) PromoteConfig(org.commonjava.indy.promote.conf.PromoteConfig) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Example 7 with DataFileManager

use of org.commonjava.indy.subsys.datafile.DataFileManager 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, "");
}
Also used : Group(org.commonjava.indy.model.core.Group) ArtifactStoreValidator(org.commonjava.indy.data.ArtifactStoreValidator) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) ImpliedRepoMetadataManager(org.commonjava.indy.implrepo.data.ImpliedRepoMetadataManager) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) GalleyMavenFixture(org.commonjava.maven.galley.testing.maven.GalleyMavenFixture) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) ImpliedRepoConfig(org.commonjava.indy.implrepo.conf.ImpliedRepoConfig) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) File(java.io.File) Before(org.junit.Before)

Example 8 with DataFileManager

use of org.commonjava.indy.subsys.datafile.DataFileManager 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());
}
Also used : DefaultContentDigester(org.commonjava.indy.core.content.DefaultContentDigester) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) DefaultContentManager(org.commonjava.indy.core.content.DefaultContentManager) ContentManager(org.commonjava.indy.content.ContentManager) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) GStringTemplateEngine(groovy.text.GStringTemplateEngine) DefaultContentManager(org.commonjava.indy.core.content.DefaultContentManager) DownloadManager(org.commonjava.indy.content.DownloadManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) MimeTyper(org.commonjava.indy.util.MimeTyper) SpecialPathManagerImpl(org.commonjava.maven.galley.io.SpecialPathManagerImpl) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) DirectContentAccess(org.commonjava.indy.content.DirectContentAccess) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) CacheHandle(org.commonjava.indy.subsys.infinispan.CacheHandle) TemplatingEngine(org.commonjava.indy.subsys.template.TemplatingEngine) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) StoreDataManager(org.commonjava.indy.data.StoreDataManager) DefaultDownloadManager(org.commonjava.indy.core.content.DefaultDownloadManager) DefaultDirectContentAccess(org.commonjava.indy.core.content.DefaultDirectContentAccess) Before(org.junit.Before)

Example 9 with DataFileManager

use of org.commonjava.indy.subsys.datafile.DataFileManager in project indy by Commonjava.

the class DataFileStoreDataManagerTest method setup.

@Before
public void setup() throws Exception {
    fileCfg = new DataFileConfiguration(temp.newFolder("data"), temp.newFolder("work"));
    final DataFileManager fileMgr = new DataFileManager(fileCfg, new DataFileEventManager());
    mgr = new DataFileStoreDataManager(fileMgr, new IndyObjectMapper(false), new StoreEventDispatcherStub(), new DefaultIndyConfiguration());
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) StoreEventDispatcherStub(org.commonjava.indy.core.data.testutil.StoreEventDispatcherStub) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) Before(org.junit.Before)

Example 10 with DataFileManager

use of org.commonjava.indy.subsys.datafile.DataFileManager in project indy by Commonjava.

the class AutoProxDataManagerDecoratorTest method setup.

@Before
public final void setup() throws Exception {
    rootDir = temp.newFolder("indy.root");
    autoproxDataDir = new File(rootDir, "data/autoprox");
    autoproxDataDir.mkdirs();
    File cacheDir = temp.newFolder();
    FileCacheProvider cache = new FileCacheProvider(cacheDir, new HashedLocationPathGenerator(), new NoOpFileEventManager(), new NoOpTransferDecorator());
    galley = new GalleyMavenBuilder(cache).withEnabledTransports(new HttpClientTransport(new HttpImpl(new MemoryPasswordManager()))).build();
    final DataFileManager dataFiles = new DataFileManager(rootDir, new DataFileEventManager());
    ruleParser = new ScriptRuleParser(new ScriptEngine(dataFiles));
    final AutoProxConfig indyConfig = new AutoProxConfig(autoproxDataDir.getName(), true);
    catalog = new AutoProxCatalogManager(dataFiles, indyConfig, ruleParser);
    storeDataManager = new TestAutoProxyDataManager(catalog, galley.getTransferManager());
    storeDataManager.install();
    storeDataManager.clear(summary);
    storeQuery = storeDataManager.query().packageType(MAVEN_PKG_KEY);
    System.setProperty("baseUrl", http.getBaseUri());
}
Also used : FileCacheProvider(org.commonjava.maven.galley.cache.FileCacheProvider) NoOpTransferDecorator(org.commonjava.maven.galley.io.NoOpTransferDecorator) HashedLocationPathGenerator(org.commonjava.maven.galley.io.HashedLocationPathGenerator) AutoProxConfig(org.commonjava.indy.autoprox.conf.AutoProxConfig) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) MemoryPasswordManager(org.commonjava.maven.galley.auth.MemoryPasswordManager) HttpImpl(org.commonjava.maven.galley.transport.htcli.HttpImpl) ScriptEngine(org.commonjava.indy.subsys.template.ScriptEngine) NoOpFileEventManager(org.commonjava.maven.galley.event.NoOpFileEventManager) GalleyMavenBuilder(org.commonjava.maven.galley.maven.GalleyMavenBuilder) HttpClientTransport(org.commonjava.maven.galley.transport.htcli.HttpClientTransport) ScriptRuleParser(org.commonjava.indy.autoprox.util.ScriptRuleParser) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) TestAutoProxyDataManager(org.commonjava.indy.autoprox.fixture.TestAutoProxyDataManager) File(java.io.File) Before(org.junit.Before)

Aggregations

DataFileManager (org.commonjava.indy.subsys.datafile.DataFileManager)11 DataFileEventManager (org.commonjava.indy.subsys.datafile.change.DataFileEventManager)10 Before (org.junit.Before)10 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)6 ScriptEngine (org.commonjava.indy.subsys.template.ScriptEngine)6 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)5 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)4 GStringTemplateEngine (groovy.text.GStringTemplateEngine)3 File (java.io.File)3 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)3 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)3 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)3 DefaultContentManager (org.commonjava.indy.core.content.DefaultContentManager)3 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)3 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)3 MemoryPasswordManager (org.commonjava.maven.galley.auth.MemoryPasswordManager)3 SpecialPathManagerImpl (org.commonjava.maven.galley.io.SpecialPathManagerImpl)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 ContentDigester (org.commonjava.indy.content.ContentDigester)2 ContentManager (org.commonjava.indy.content.ContentManager)2