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