use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method readArtifactContentEntries.
@Test
public void readArtifactContentEntries() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
List<ArtifactContentEntry> artifactContentEntries = browseService.getArtifactContentEntries("commons-logging", "commons-logging", "1.1", null, null, null, TEST_REPO_ID);
log.info("artifactContentEntries: {}", artifactContentEntries);
//
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(//
2).contains(//
new ArtifactContentEntry("org", false, 0, TEST_REPO_ID), new ArtifactContentEntry("META-INF", false, 0, TEST_REPO_ID));
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method searchArtifacts.
@Test
public void searchArtifacts() throws Exception {
// START SNIPPET: search-artifacts
BrowseService browseService = getBrowseService(authorizationHeader, true);
List<Artifact> artifactDownloadInfos = browseService.searchArtifacts("The Apache Software Foundation", TEST_REPO_ID, true);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(7);
// END SNIPPET: search-artifacts
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method getArtifactsByProjectVersionMetadata.
@Test
public void getArtifactsByProjectVersionMetadata() throws Exception {
// START SNIPPET: get-artifacts-by-project-version-metadata
BrowseService browseService = getBrowseService(authorizationHeader, true);
browseService.addMetadata("commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID);
List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata("wine", "bordeaux", TEST_REPO_ID);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(3);
// END SNIPPET: get-artifacts-by-project-version-metadata
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method metadatagetthenaddthendelete.
@Test
public void metadatagetthenaddthendelete() throws Exception {
try {
scanRepo(TEST_REPO_ID);
waitForScanToComplete(TEST_REPO_ID);
BrowseService browseService = getBrowseService(authorizationHeader, false);
Map<String, String> metadatas = toMap(browseService.getMetadatas("commons-cli", "commons-cli", "1.0", TEST_REPO_ID));
assertThat(metadatas).isNotNull().isEmpty();
browseService.addMetadata("commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID);
metadatas = toMap(browseService.getMetadatas("commons-cli", "commons-cli", "1.0", TEST_REPO_ID));
assertThat(metadatas).isNotNull().isNotEmpty().contains(MapEntry.entry("wine", "bordeaux"));
browseService.deleteMetadata("commons-cli", "commons-cli", "1.0", "wine", TEST_REPO_ID);
metadatas = toMap(browseService.getMetadatas("commons-cli", "commons-cli", "1.0", TEST_REPO_ID));
assertThat(metadatas).isNotNull().isEmpty();
} catch (ArchivaRestServiceException e) {
log.error(e.getMessage(), e);
throw e;
}
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method browsegroupIdWithReleaseStartNumber.
@Test
public void browsegroupIdWithReleaseStartNumber() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, false);
BrowseResult browseResult = browseService.browseGroupId("commons-logging.commons-logging", TEST_REPO_ID);
log.info("browseResult: {}", browseResult);
}
Aggregations