Search in sources :

Example 31 with HostedRepository

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

the class ArtifactRefs_DependencyTwoExtraGroups_RuleTest method start.

@Override
public void start() throws Throwable {
    super.start();
    otherSource = new HostedRepository("otherSource");
    otherSource = client.stores().create(otherSource, "Creating secondary content source", HostedRepository.class);
    other = new Group("other", otherSource.getKey());
    other = client.stores().create(other, "Creating secondary content group", Group.class);
    Logger logger = LoggerFactory.getLogger(getClass());
    logger.info("{} contains members: {}", other, other.getConstituents());
    thirdSource = new HostedRepository("thirdSource");
    thirdSource = client.stores().create(thirdSource, "Creating tertiary content source", HostedRepository.class);
    third = new Group("third", thirdSource.getKey());
    third = client.stores().create(third, "Creating tertiary content group", Group.class);
    logger.info("{} contains members: {}", third, third.getConstituents());
}
Also used : Group(org.commonjava.indy.model.core.Group) Logger(org.slf4j.Logger) HostedRepository(org.commonjava.indy.model.core.HostedRepository)

Example 32 with HostedRepository

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

the class FullRuleStack_GroupWithOneOfTwoHosts_RuleTest method start.

@Override
public void start() throws Throwable {
    super.start();
    hostTarget1 = new HostedRepository(PKG_TYPE_MAVEN, "hostTarget1");
    hostTarget1 = client.stores().create(hostTarget1, "Creating first host target", HostedRepository.class);
    hostTarget2 = new HostedRepository(PKG_TYPE_MAVEN, "hostTarget2");
    hostTarget2 = client.stores().create(hostTarget2, "Creating secondary host target", HostedRepository.class);
}
Also used : HostedRepository(org.commonjava.indy.model.core.HostedRepository)

Example 33 with HostedRepository

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

the class HostedMetadataRemergedOnPathPromoteSnapshotTest method setupRepos.

@Before
public void setupRepos() throws IndyClientException {
    String message = "test setup";
    a = new HostedRepository(PKG_TYPE_MAVEN, HOSTED_A_NAME);
    a.setAllowSnapshots(true);
    a = client.stores().create(a, message, HostedRepository.class);
    b = new HostedRepository(PKG_TYPE_MAVEN, HOSTED_B_NAME);
    b.setAllowSnapshots(true);
    b = client.stores().create(b, message, HostedRepository.class);
    g = client.stores().create(new Group(PKG_TYPE_MAVEN, GROUP_G_NAME, a.getKey()), message, Group.class);
    aPomPath = POM_PATH_TEMPLATE.replaceAll("%version%", A_VERSION);
    aPomContent = POM_CONTENT_TEMPLATE.replaceAll("%version%", A_VERSION);
    client.content().store(a.getKey(), aPomPath, new ByteArrayInputStream(aPomContent.getBytes()));
    aPreContent = REPO_CONTENT_TEMPLATE.replaceAll("%version%", A_VERSION);
    client.content().store(a.getKey(), PATH, new ByteArrayInputStream(aPreContent.getBytes()));
    // 
    bPomPath = POM_PATH_TEMPLATE.replaceAll("%version%", B_VERSION);
    bPomContent = POM_CONTENT_TEMPLATE.replaceAll("%version%", B_VERSION);
    client.content().store(b.getKey(), bPomPath, new ByteArrayInputStream(bPomContent.getBytes()));
    bContent = REPO_CONTENT_TEMPLATE.replaceAll("%version%", B_VERSION);
    client.content().store(b.getKey(), PATH, new ByteArrayInputStream(bContent.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 34 with HostedRepository

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

the class PromoteMetadataShouldSkipWithReadonlyTest method setupRepos.

@Before
public void setupRepos() throws Exception {
    String message = "test setup";
    target = client.stores().create(new HostedRepository(PKG_TYPE_MAVEN, HOSTED_TARGET_NAME), message, HostedRepository.class);
    source = client.stores().create(new HostedRepository(PKG_TYPE_MAVEN, HOSTED_SOURCE_NAME), message, HostedRepository.class);
    client.content().store(target.getKey(), HTTP_META_PATH, new ByteArrayInputStream(HTTP_META_CONTENT_TARGET.getBytes()));
    client.content().store(target.getKey(), MD5_META_PATH, new ByteArrayInputStream(MD5_META_CONTENT_TARGET.getBytes()));
    client.content().store(source.getKey(), HTTP_META_PATH, new ByteArrayInputStream(HTTP_META_CONTENT_SOURCE.getBytes()));
    client.content().store(source.getKey(), MD5_META_PATH, new ByteArrayInputStream(MD5_META_CONTENT_SOURCE.getBytes()));
    client.content().store(source.getKey(), ARTIFACT_PATH, new ByteArrayInputStream(ARTIFACT_CONTENT.getBytes()));
    target.setReadonly(true);
    client.stores().update(target, message);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) HostedRepository(org.commonjava.indy.model.core.HostedRepository) Before(org.junit.Before)

Example 35 with HostedRepository

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

the class PromoteWithExcludeFilterTest method setupRepos.

@Before
@Override
public void setupRepos() throws Exception {
    String changelog = "Setup " + name.getMethodName();
    // create b1
    b1 = new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "b1");
    client.stores().create(b1, changelog, HostedRepository.class);
    // store pom 1.0 to b1
    client.content().store(b1.getKey(), POM_PATH_TEMPLATE.replace("%version%", "1.0"), new ByteArrayInputStream(POM_CONTENT_TEMPLATE.replace("%version%", "1.0").getBytes()));
    // create target
    target = new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "target");
    client.stores().create(target, changelog, HostedRepository.class);
    // create g1
    g1 = new Group(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "build-1", b1.getKey(), target.getKey());
    client.stores().create(g1, changelog, Group.class);
    // create b2
    b2 = new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "b2");
    client.stores().create(b2, changelog, HostedRepository.class);
    // store pom 2.0 to b2
    client.content().store(b2.getKey(), POM_PATH_TEMPLATE.replace("%version%", "2.0"), new ByteArrayInputStream(POM_CONTENT_TEMPLATE.replace("%version%", "2.0").getBytes()));
    gBuilds = new Group(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, "g-builds", target.getKey());
    client.stores().create(gBuilds, changelog, Group.class);
}
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