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);
}
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, "");
}
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());
}
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());
}
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());
}
Aggregations