Java Code Examples for org.apache.ivy.core.settings.IvySettings#setDefaultCache()

The following examples show how to use org.apache.ivy.core.settings.IvySettings#setDefaultCache() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MirroredURLResolverTest.java    From ant-ivy with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    TestHelper.createCache();
    settings.setDefaultCache(TestHelper.cache);
    settings.setVariable("test.mirroredurl.mirrorlist-solo.url",
        this.getClass().getResource("mirrorlist-solo.txt").toExternalForm());
    settings.setVariable("test.mirroredurl.mirrorlist-failover.url", this.getClass()
            .getResource("mirrorlist-failover.txt").toExternalForm());
    settings.setVariable("test.mirroredurl.mirrorlist-fail.url",
        this.getClass().getResource("mirrorlist-fail.txt").toExternalForm());
    new XmlSettingsParser(settings).parse(MirroredURLResolverTest.class
            .getResource("mirror-resolver-settings.xml"));
}
 
Example 2
Source File: PackagerResolverTest.java    From ant-ivy with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    Message.setDefaultLogger(new DefaultMessageLogger(99));

    settings = new IvySettings();
    ResolveEngine engine = new ResolveEngine(settings, new EventManager(), new SortEngine(
            settings));
    cache = new File("build/cache");
    data = new ResolveData(engine, new ResolveOptions());
    cache.mkdirs();
    settings.setDefaultCache(cache);

    // Create work space with build and resource cache directories
    workdir = new File("build/test/PackagerResolverTest");
    builddir = new File(workdir, "build");
    cachedir = new File(workdir, "resources");
    cleanupTempDirs();
    if (!builddir.mkdirs() || !cachedir.mkdirs()) {
        throw new Exception("can't create directories under " + workdir);
    }
}
 
Example 3
Source File: IvyInternalDepResolver.java    From jeka with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an <code>IvySettings</code> to the specified repositories.
 */
private static IvySettings ivySettingsOf(JkRepoSet resolveRepos) {
    final IvySettings ivySettings = new IvySettings();
    IvyTranslations.populateIvySettingsWithRepo(ivySettings, resolveRepos);
    ivySettings.setDefaultCache(JkLocator.getJekaRepositoryCache().toFile());
    return ivySettings;
}
 
Example 4
Source File: UpdateSiteLoaderTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    IvySettings ivySettings = new IvySettings();
    cache = new File("build/cache");
    cache.mkdirs();
    ivySettings.setDefaultCache(cache);
    CacheResourceOptions options = new CacheResourceOptions();
    loader = new UpdateSiteLoader(ivySettings.getDefaultRepositoryCacheManager(), null, options, null);
}
 
Example 5
Source File: OSGiManifestParserTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_WARN));

    settings = new IvySettings();
    // prevent test from polluting local cache
    settings.setDefaultCache(new File("build/cache"));
}
 
Example 6
Source File: DualResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    cache = new File("build/cache");
    data = new ResolveData(engine, new ResolveOptions());
    cache.mkdirs();
    settings.setDefaultCache(cache);
}
 
Example 7
Source File: ChainResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    TestHelper.createCache();
    data = new ResolveData(engine, new ResolveOptions());
    settings.setDefaultCache(TestHelper.cache);
}
 
Example 8
Source File: IvyRepResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    TestHelper.createCache();
    settings.setDefaultCache(TestHelper.cache);
}
 
Example 9
Source File: JarResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    cache = new File("build/cache");
    data = new ResolveData(engine, new ResolveOptions());
    cache.mkdirs();
    settings.setDefaultCache(cache);
    cacheManager = (DefaultRepositoryCacheManager) settings.getDefaultRepositoryCacheManager();
}
 
Example 10
Source File: Maven2LocalTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    cache = new File("build/cache");
    data = new ResolveData(engine, new ResolveOptions());
    cache.mkdirs();
    settings.setDefaultCache(cache);
}
 
Example 11
Source File: URLResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    TestHelper.createCache();
    settings.setDefaultCache(TestHelper.cache);
}
 
Example 12
Source File: BintrayResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    settings.setDefaultCache(TestHelper.cache);
}
 
Example 13
Source File: FileSystemResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    cache = new File("build/cache");
    data = new ResolveData(engine, new ResolveOptions());
    cache.mkdirs();
    settings.setDefaultCache(cache);
    cacheManager = (DefaultRepositoryCacheManager) settings.getDefaultRepositoryCacheManager();
}
 
Example 14
Source File: IBiblioResolverTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    settings = new IvySettings();
    engine = new ResolveEngine(settings, new EventManager(), new SortEngine(settings));
    data = new ResolveData(engine, new ResolveOptions());
    TestHelper.createCache();
    settings.setDefaultCache(TestHelper.cache);
}
 
Example 15
Source File: TestHelper.java    From ant-ivy with Apache License 2.0 3 votes vote down vote up
/**
 * Init a test resolver as default, useful combined with
 * {@link #fillRepository(DependencyResolver, Collection)}.
 *
 * @param settings
 *            the settings to initialize
 * @return test settings
 */
public static IvySettings loadTestSettings(IvySettings settings) {
    settings.setDefaultCache(new File("build/test/cache"));
    settings.addResolver(newTestRepository());
    settings.setDefaultResolver("test");
    return settings;
}