Search in sources :

Example 1 with Indy

use of org.commonjava.indy.client.core.Indy in project indy by Commonjava.

the class ProxyRemoteKojiContentTest method proxyBinaryRemoteKojiArtifact.

@Ignore
@Test
public void proxyBinaryRemoteKojiArtifact() throws Exception {
    final String path = "org/apache/apache/18/apache-18.pom";
    Indy client = new Indy("http://localhost:8080/api", new IndyObjectMapper(Collections.emptySet()), Collections.emptySet()).connect();
    long elapse = getContent("build-x", client, path);
    // the remote store should have been added to brew-binaries group
    StoreListingDTO<RemoteRepository> repos = client.stores().listRemoteRepositories();
    for (RemoteRepository repo : repos.getItems()) {
        logger.debug("Repo " + repo.getName());
        if (repo.getName().startsWith(KOJI_ORIGIN)) {
            logger.debug("Koji repo patterns: " + repo.getPathMaskPatterns());
        }
    }
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) Indy(org.commonjava.indy.client.core.Indy) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with Indy

use of org.commonjava.indy.client.core.Indy in project indy by Commonjava.

the class ExternalKojiTest method setupExternalKojiBase.

@Before
public void setupExternalKojiBase() throws IndyClientException {
    client = new Indy("http://localhost:8080/api", new IndyObjectMapper(Collections.emptySet()), getAdditionalClientModules()).connect();
    Group proxyGroup = new Group("maven", kojiProxyGroupName);
    boolean exist = client.stores().exists(proxyGroup.getKey());
    if (!exist) {
        client.stores().create(proxyGroup, "adding brew-proxies", Group.class);
    }
    Group pseudoGroup = new Group("maven", pseudoGroupName);
    exist = client.stores().exists(pseudoGroup.getKey());
    if (!exist) {
        client.stores().create(pseudoGroup, "adding pseudo group", Group.class);
    }
}
Also used : Group(org.commonjava.indy.model.core.Group) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) Indy(org.commonjava.indy.client.core.Indy) Before(org.junit.Before)

Example 3 with Indy

use of org.commonjava.indy.client.core.Indy in project indy by Commonjava.

the class ProxyRemoteKojiContentTest method proxyRemoteKojiArtifact.

/**
     * Accessing an existing external Koji site and retrieve artifact. This is disabled by default. In order to run it,
     * you need an external Koji instance and start Indy via:
     * 1. export TEST_ETC=<your-koji-config-dir> => with proper settings for Koji url, pem, etc
     * 2. bin/test-setup.sh => to start Indy
     * 3. run this test
     */
@Ignore
@Test
public void proxyRemoteKojiArtifact() throws Exception {
    final String path = "org/dashbuilder/dashbuilder-all/0.4.0.Final-redhat-10/dashbuilder-all-0.4.0.Final-redhat-10.pom";
    Indy client = new Indy("http://localhost:8080/api", new IndyObjectMapper(Collections.emptySet()), Collections.emptySet()).connect();
    // would be slow the first time to get an artifact
    long elapse = getContent("build-x", client, path);
    logger.debug("Get (first) use " + elapse + " milliseconds");
    // the following get should have been cached and fast
    elapse = getContent("build-x", client, path);
    logger.debug("Get (second) use " + elapse + " milliseconds");
    // the remote store should have been added to builds-untested group
    StoreListingDTO<RemoteRepository> repos = client.stores().listRemoteRepositories();
    for (RemoteRepository repo : repos.getItems()) {
        logger.debug("Repo " + repo.getName());
        if (repo.getName().startsWith(KOJI_ORIGIN)) {
            logger.debug("Koji repo patterns: " + repo.getPathMaskPatterns());
        }
    }
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) Indy(org.commonjava.indy.client.core.Indy) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 4 with Indy

use of org.commonjava.indy.client.core.Indy in project indy by Commonjava.

the class DownloadDiagBundleTest method createIndyClient.

protected Indy createIndyClient() throws IndyClientException {
    SiteConfig config = new SiteConfigBuilder("indy", fixture.getUrl()).withRequestTimeoutSeconds(120).build();
    Collection<IndyClientModule> modules = getAdditionalClientModules();
    return new Indy(config, new MemoryPasswordManager(), new IndyObjectMapper(getAdditionalMapperModules()), modules.toArray(new IndyClientModule[modules.size()]));
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) SiteConfigBuilder(org.commonjava.util.jhttpc.model.SiteConfigBuilder) Indy(org.commonjava.indy.client.core.Indy) SiteConfig(org.commonjava.util.jhttpc.model.SiteConfig) MemoryPasswordManager(org.commonjava.util.jhttpc.auth.MemoryPasswordManager) IndyClientModule(org.commonjava.indy.client.core.IndyClientModule)

Example 5 with Indy

use of org.commonjava.indy.client.core.Indy in project indy by Commonjava.

the class AbstractIndyFunctionalTest method createIndyClient.

protected Indy createIndyClient() throws IndyClientException {
    SiteConfig config = new SiteConfigBuilder("indy", fixture.getUrl()).withRequestTimeoutSeconds(60).build();
    Collection<IndyClientModule> modules = getAdditionalClientModules();
    return new Indy(config, new MemoryPasswordManager(), new IndyObjectMapper(getAdditionalMapperModules()), modules.toArray(new IndyClientModule[modules.size()]));
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) SiteConfigBuilder(org.commonjava.util.jhttpc.model.SiteConfigBuilder) Indy(org.commonjava.indy.client.core.Indy) SiteConfig(org.commonjava.util.jhttpc.model.SiteConfig) MemoryPasswordManager(org.commonjava.util.jhttpc.auth.MemoryPasswordManager) IndyClientModule(org.commonjava.indy.client.core.IndyClientModule)

Aggregations

Indy (org.commonjava.indy.client.core.Indy)5 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)5 IndyClientModule (org.commonjava.indy.client.core.IndyClientModule)2 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)2 MemoryPasswordManager (org.commonjava.util.jhttpc.auth.MemoryPasswordManager)2 SiteConfig (org.commonjava.util.jhttpc.model.SiteConfig)2 SiteConfigBuilder (org.commonjava.util.jhttpc.model.SiteConfigBuilder)2 Ignore (org.junit.Ignore)2 Test (org.junit.Test)2 Group (org.commonjava.indy.model.core.Group)1 Before (org.junit.Before)1