Package org.apache.maven.index.artifact

Examples of org.apache.maven.index.artifact.Gav


  @Test
  public void testExclusive()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId() + ".exclusive", "exclusive", "1.0.0", null, "jar", 0, new Date().getTime(),
            "Simple Test Artifact", false, null, false, null);

    try {
      // should fail
      this.downloadArtifactFromGroup("exclusive-single", gav, "target/downloads/exclude");
View Full Code Here


  @Test
  public void testInclusive()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId() + ".inclusive", "inclusive", "1.0.0", null, "jar", 0, new Date().getTime(),
            "Simple Test Artifact", false, null, false, null);

    File artifact = this.downloadArtifactFromGroup("inclusive-single", gav, "target/downloads/include");

    String line = this.getFirstLineOfFile(artifact);
View Full Code Here

  @Test
  public void wagonSnapshotDeployTest()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId(), "simpleArtifact", "1.0.0-SNAPSHOT", null, "xml", 0,
            new Date().getTime(), "Simple Test Artifact", false, null, false, null);

    // file to deploy
    File fileToDeploy =
        this.getTestFile(gav.getArtifactId() + "." + gav.getExtension());

    // url to upload to
    String uploadURL = this.getBaseNexusUrl() + "service/local/artifact/maven/content";

    // the method we are calling
View Full Code Here

  @Test
  public void testBlocking()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId() + ".blocking", "blocking", "1.0.0", null, "jar", 0, new Date().getTime(),
            "Simple Test Artifact", false, null, false, null);

    try {

      this.downloadArtifactFromGroup("blocking-group", gav, "target/downloads/blocking");
View Full Code Here

  @Test
  public void deploySnapshotWithGavUsingRest()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId(), "uploadWithGav", "1.0.0-SNAPSHOT", null, "xml", 0,
            new Date().getTime(), "Simple Test Artifact", false, null, false, null);

    // file to deploy
    File fileToDeploy =
        this.getTestFile(gav.getArtifactId() + "." + gav.getExtension());

    // the Restlet Client does not support multipart forms: http://restlet.tigris.org/issues/show_bug.cgi?id=71

    // url to upload to
    String uploadURL = this.getBaseNexusUrl() + "service/local/artifact/maven/content";
View Full Code Here

  @Test
  public void deploySnapshotWithPomUsingRest()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId(), "uploadWithGav", "1.0.0-SNAPSHOT", null, "xml", 0,
            new Date().getTime(), "Simple Test Artifact", false, null, false, null);

    // file to deploy
    File fileToDeploy =
        this.getTestFile(gav.getArtifactId() + "." + gav.getExtension());

    File pomFile =
        this.getTestFile("pom.xml");

    // the Restlet Client does not support multipart forms: http://restlet.tigris.org/issues/show_bug.cgi?id=71
View Full Code Here

      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);

  }
View Full Code Here

      throws Exception
  {
    giveUserPrivilege(TEST_USER_NAME, "1000");
    TestContainer.getInstance().getTestContext().useAdminForRequests();

    Gav gav = GavUtil.newGav("nexus4038", "artifact", "1.0");
    assertTrue(Status.isSuccess(getDeployUtils().deployUsingGavWithRest(REPO_TEST_HARNESS_REPO, gav,
        getTestFile("artifact.jar"))));

    // timeline resolution is _one second_, so to be sure that ordering is kept he keep gaps between operations
    // bigger than one second
View Full Code Here

  @Test
  public void releaseMetaDataInSnapshotRepo()
      throws Exception
  {

    Gav gav =
        new Gav(this.getTestId(), "simple-artifact", "1.0.4", null, "jar", 0, new Date().getTime(),
            "Simple Test Artifact", false, null, false, null);

    // try to download it
    boolean fileWasDownloaded = true;
    try {
View Full Code Here

   * @throws IOException re-thrown if not an {@link FileNotFoundException}
   */
  protected void downloadArtifact(final String groupId, final String artifactId, final String version)
      throws IOException
  {
    final Gav gav = GavUtil.newGav(groupId, artifactId, version);
    try {
      downloadArtifactFromRepository(REPO, gav, "target/downloads/" + getTestId());
    }
    catch (FileNotFoundException e) {
      // ignore just fine
View Full Code Here

TOP

Related Classes of org.apache.maven.index.artifact.Gav

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.