Search in sources :

Example 41 with HostedRepository

use of org.commonjava.indy.model.core.HostedRepository in project indy by Commonjava.

the class AbstractPromotionManagerTest method createTarget.

protected ArtifactStore createTarget(String changelog) throws Exception {
    HostedRepository target = new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "target");
    client.stores().create(target, changelog, HostedRepository.class);
    return target;
}
Also used : HostedRepository(org.commonjava.indy.model.core.HostedRepository)

Example 42 with HostedRepository

use of org.commonjava.indy.model.core.HostedRepository in project indy by Commonjava.

the class AbstractPromotionManagerTest method setupRepos.

@Before
public void setupRepos() throws Exception {
    final String changelog = "Setup " + name.getMethodName();
    final IndyPromoteClientModule module = client.module(IndyPromoteClientModule.class);
    System.out.printf("\n\n\n\nBASE-URL: %s\nPROMOTE-URL: %s\nROLLBACK-URL: %s\n\n\n\n", client.getBaseUrl(), module.promoteUrl(), module.rollbackUrl());
    source = new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "source");
    client.stores().create(source, changelog, HostedRepository.class);
    client.content().store(source.getKey(), first, new ByteArrayInputStream("This is a test".getBytes()));
    client.content().store(source.getKey(), second, new ByteArrayInputStream("This is a test".getBytes()));
    target = createTarget(changelog);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) IndyPromoteClientModule(org.commonjava.indy.promote.client.IndyPromoteClientModule) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Before(org.junit.Before)

Example 43 with HostedRepository

use of org.commonjava.indy.model.core.HostedRepository in project indy by Commonjava.

the class GroupNFCEntryClearedOnByPathPromoteTest method setupRepos.

@Before
public void setupRepos() throws IndyClientException {
    String message = "test setup";
    a = client.stores().create(new HostedRepository(MAVEN_PKG_KEY, HOSTED_A_NAME), message, HostedRepository.class);
    b = client.stores().create(new HostedRepository(MAVEN_PKG_KEY, HOSTED_B_NAME), message, HostedRepository.class);
    g = client.stores().create(new Group(MAVEN_PKG_KEY, GROUP_G_NAME, a.getKey()), message, Group.class);
    client.content().store(b.getKey(), PATH, new ByteArrayInputStream(POM_CONTENT.getBytes()));
}
Also used : Group(org.commonjava.indy.model.core.Group) ByteArrayInputStream(java.io.ByteArrayInputStream) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Before(org.junit.Before)

Example 44 with HostedRepository

use of org.commonjava.indy.model.core.HostedRepository in project indy by Commonjava.

the class PromotionManagerTest method prepareHostedRepos.

private void prepareHostedRepos() throws Exception {
    source = new HostedRepository(MAVEN_PKG_KEY, "source");
    storeManager.storeArtifactStore(source, new ChangeSummary(ChangeSummary.SYSTEM_USER, "test setup"), false, true, new EventMetadata());
    target = new HostedRepository(MAVEN_PKG_KEY, "target");
    storeManager.storeArtifactStore(target, new ChangeSummary(ChangeSummary.SYSTEM_USER, "test setup"), false, true, new EventMetadata());
}
Also used : ChangeSummary(org.commonjava.indy.audit.ChangeSummary) HostedRepository(org.commonjava.indy.model.core.HostedRepository) EventMetadata(org.commonjava.maven.galley.event.EventMetadata)

Example 45 with HostedRepository

use of org.commonjava.indy.model.core.HostedRepository in project indy by Commonjava.

the class GroupHostedMetadataRemergedOnPromoteTest method setupRepos.

@Before
public void setupRepos() throws IndyClientException {
    String message = "test setup";
    a = client.stores().create(new HostedRepository(HOSTED_A_NAME), message, HostedRepository.class);
    b = client.stores().create(new HostedRepository(HOSTED_B_NAME), message, HostedRepository.class);
    c = client.stores().create(new HostedRepository(HOSTED_C_NAME), message, HostedRepository.class);
    g = client.stores().create(new Group(GROUP_G_NAME, a.getKey(), b.getKey()), message, Group.class);
    client.content().store(a.getKey(), PATH, new ByteArrayInputStream(REPO_CONTENT_TEMPLATE.replaceAll("%version%", A_VERSION).getBytes()));
    client.content().store(b.getKey(), PATH, new ByteArrayInputStream(REPO_CONTENT_TEMPLATE.replaceAll("%version%", B_VERSION).getBytes()));
    client.content().store(c.getKey(), PATH, new ByteArrayInputStream(REPO_CONTENT_TEMPLATE.replaceAll("%version%", C_VERSION).getBytes()));
}
Also used : Group(org.commonjava.indy.model.core.Group) ByteArrayInputStream(java.io.ByteArrayInputStream) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Before(org.junit.Before)

Aggregations

HostedRepository (org.commonjava.indy.model.core.HostedRepository)169 Test (org.junit.Test)90 ByteArrayInputStream (java.io.ByteArrayInputStream)83 Group (org.commonjava.indy.model.core.Group)80 InputStream (java.io.InputStream)42 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)41 AbstractContentManagementTest (org.commonjava.indy.ftest.core.AbstractContentManagementTest)37 Before (org.junit.Before)37 StoreKey (org.commonjava.indy.model.core.StoreKey)32 Transfer (org.commonjava.maven.galley.model.Transfer)23 ConcreteResource (org.commonjava.maven.galley.model.ConcreteResource)19 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)16 IndyDataException (org.commonjava.indy.data.IndyDataException)15 EventMetadata (org.commonjava.maven.galley.event.EventMetadata)15 PackageMetadata (org.commonjava.indy.pkg.npm.model.PackageMetadata)13 ArtifactStore (org.commonjava.indy.model.core.ArtifactStore)12 VersionMetadata (org.commonjava.indy.pkg.npm.model.VersionMetadata)11 IndyClientException (org.commonjava.indy.client.core.IndyClientException)10 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)10 IndyWorkflowException (org.commonjava.indy.IndyWorkflowException)9