use of org.commonjava.indy.promote.model.PathsPromoteRequest in project indy by Commonjava.
the class PromoteRemoteReDownloadTest method run.
@Test
public void run() throws Exception {
PathsPromoteResult result = client.module(IndyPromoteClientModule.class).promoteByPath(new PathsPromoteRequest(source.getKey(), target.getKey(), PATH));
Set<String> pending = result.getPendingPaths();
assertThat(pending == null || pending.isEmpty(), equalTo(true));
Set<String> completed = result.getCompletedPaths();
assertThat(completed, notNullValue());
assertThat(completed.size(), equalTo(1));
assertThat(result.getError(), nullValue());
}
use of org.commonjava.indy.promote.model.PathsPromoteRequest in project indy by Commonjava.
the class HostedMetadataRemergedOnPathPromoteSnapshotTest method run.
@Test
@Category(EventDependent.class)
public void run() throws Exception {
// verify our initial state
assertMetadataContent(a, PATH, aPreContent);
PathsPromoteRequest request = new PathsPromoteRequest(b.getKey(), a.getKey(), new String[] { PATH, bPomPath });
// Pre-existing maven-metadata.xml should NOT cause a failure!
request.setFailWhenExists(true);
PathsPromoteResult response = promote.promoteByPath(request);
assertThat(response.succeeded(), equalTo(true));
waitForEventPropagation();
// Group G's metadata path P should reflect values in A and B
assertMetadataContent(g, PATH, AFTER_PROMOTE_CONTENT);
// Promotion to repo A should trigger re-merge of maven-metadata.xml, adding the version from repo B to that in A.
assertMetadataContent(a, PATH, AFTER_PROMOTE_CONTENT);
}
use of org.commonjava.indy.promote.model.PathsPromoteRequest in project indy by Commonjava.
the class HostedMetadataRemergedOnPathPromoteToReadonlyHostedTest method run.
@Test
@Category(EventDependent.class)
public void run() throws Exception {
// verify our initial state
assertMetadataContent(a, PATH, aPreContent);
PathsPromoteRequest request = new PathsPromoteRequest(b.getKey(), a.getKey(), bPomPath);
// Pre-existing maven-metadata.xml should NOT cause a failure!
request.setFailWhenExists(true);
PathsPromoteResult response = promote.promoteByPath(request);
assertThat(response.succeeded(), equalTo(true));
waitForEventPropagation();
// Promotion to repo A should trigger re-merge of maven-metadata.xml, adding the version from repo B to that in A.
assertMetadataContent(a, PATH, AFTER_PROMOTE_CONTENT);
}
use of org.commonjava.indy.promote.model.PathsPromoteRequest in project indy by Commonjava.
the class PromoteMetadataShouldSkipWithReadonlyTest method run.
@Test
@Category(EventDependent.class)
public void run() throws Exception {
PathsPromoteRequest request = new PathsPromoteRequest(source.getKey(), target.getKey(), ARTIFACT_PATH, HTTP_META_PATH, MD5_META_PATH);
request.setFailWhenExists(true);
PathsPromoteResult response = promote.promoteByPath(request);
assertThat(response.succeeded(), equalTo(true));
assertThat(response.getSkippedPaths().contains(HTTP_META_PATH), equalTo(true));
assertThat(response.getSkippedPaths().contains(MD5_META_PATH), equalTo(true));
assertThat(response.getSkippedPaths().contains(ARTIFACT_PATH), equalTo(true));
waitForEventPropagation();
}
use of org.commonjava.indy.promote.model.PathsPromoteRequest in project indy by Commonjava.
the class PromoteWithExcludeFilterTest method run.
@Test
public void run() throws Exception {
// Promote b1 to target
PathsPromoteResult result = client.module(IndyPromoteClientModule.class).promoteByPath(new PathsPromoteRequest(b1.getKey(), target.getKey()));
assertThat(result.getError(), nullValue());
String g1Metadata = getMetadataString(g1.getKey());
String gBuildsMetadata = getMetadataString(gBuilds.getKey());
/*
System.out.println( "g1 >>>\n" + g1Metadata );
System.out.println( "g-builds >>>\n" + gBuildsMetadata );
*/
assertThat(client.content().exists(g1.getKey(), METADATA_PATH), equalTo(true));
assertThat(client.content().exists(gBuilds.getKey(), METADATA_PATH), equalTo(true));
// Promote b2 to target
result = client.module(IndyPromoteClientModule.class).promoteByPath(new PathsPromoteRequest(b2.getKey(), target.getKey()));
assertThat(result.getError(), nullValue());
g1Metadata = getMetadataString(g1.getKey());
gBuildsMetadata = getMetadataString(gBuilds.getKey());
/*
System.out.println( "g1 >>>\n" + g1Metadata );
System.out.println( "g-builds >>>\n" + gBuildsMetadata );
*/
assertThat(client.content().exists(g1.getKey(), METADATA_PATH), equalTo(true));
assertThat(client.content().exists(gBuilds.getKey(), METADATA_PATH), equalTo(true));
// g_builds metadata is updated but g1 is excluded during metadata clean-up
assertThat(g1Metadata.contains("<latest>2.0</latest>"), equalTo(false));
assertThat(gBuildsMetadata.contains("<latest>2.0</latest>"), equalTo(true));
}
Aggregations