model = reader.read(fis, true);
}
String deployUrl = model.getDistributionManagement().getRepository().getUrl();
Gav gav =
new Gav(model.getGroupId(), model.getArtifactId(), model.getVersion(), null, model.getPackaging(), 0,
new Date().getTime(), model.getName(), false, null, false, null);
// Multi repository deploy
getDeployUtils().deployWithWagon("http", deployUrl, fileToDeploy, getRelitiveArtifactPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_REPO2), fileToDeploy,
getRelitiveArtifactPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_RELEASE_REPO), fileToDeploy,
getRelitiveArtifactPath(gav));
getDeployUtils().deployWithWagon("http", deployUrl, pomFile, getRelitivePomPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_REPO2), pomFile,
getRelitivePomPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_RELEASE_REPO), pomFile,
getRelitivePomPath(gav));
// if you deploy the same item multiple times to the same repo, that is only a single item
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_RELEASE_REPO), fileToDeploy,
getRelitiveArtifactPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_RELEASE_REPO), pomFile,
getRelitivePomPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_RELEASE_REPO), fileToDeploy,
getRelitiveArtifactPath(gav));
getDeployUtils().deployWithWagon("http",
deployUrl.replace(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_RELEASE_REPO), pomFile,
getRelitivePomPath(gav));
RepositoryMessageUtil.updateIndexes(NEXUS_TEST_HARNESS_REPO, NEXUS_TEST_HARNESS_REPO2,
NEXUS_TEST_HARNESS_RELEASE_REPO);
TaskScheduleUtil.waitForAllTasksToStop();
getEventInspectorsUtil().waitForCalmPeriod();
// Keyword search does collapse results, so we need _1_
// Not since NEXUS-3595, because we have only 3 hits, collapse will be overridden
List<NexusArtifact> results = getSearchMessageUtil().searchFor("crossArtifact");
Assert.assertEquals(results.size(), 3);
// GAV search does not
results = getSearchMessageUtil()
.searchForGav(gav.getGroupId(), gav.getArtifactId(), gav.getVersion(), gav.getExtension(), null, null);
Assert.assertEquals(results.size(), 3);
}