Package org.sonatype.nexus.rest.model

Examples of org.sonatype.nexus.rest.model.Maven2ArtifactInfoResource


        return null;
      }

      // if we are here, we have GAV, so just pack it and send it back
      Maven2ArtifactInfoResourceRespose response = new Maven2ArtifactInfoResourceRespose();
      Maven2ArtifactInfoResource data = new Maven2ArtifactInfoResource();
      response.setData(data);

      data.setGroupId(gav.getGroupId());
      data.setArtifactId(gav.getArtifactId());
      data.setBaseVersion(gav.getBaseVersion());
      data.setVersion(gav.getVersion());
      data.setExtension(gav.getExtension());
      data.setClassifier(gav.getClassifier());

      data.setDependencyXmlChunk(generateDependencyXml(gav));

      return response;
    }
  }
View Full Code Here


  }

  private void downloadAndVerify(Gav gav, String repoId)
      throws IOException
  {
    Maven2ArtifactInfoResource data = downloadViewResource(gav, repoId);

    Assert.assertEquals(data.getArtifactId(), gav.getArtifactId());
    Assert.assertEquals(data.getGroupId(), gav.getGroupId());

    if (gav.isSnapshot() && gav.getSnapshotTimeStamp() != null) {
      // time stamp snapshot
      String expectedVersion =
          gav.getVersion().replaceFirst(
              "SNAPSHOT",
              new SimpleDateFormat("yyyyMMdd.HHmmss").format(new Date(gav.getSnapshotTimeStamp())) + "-"
                  + gav.getSnapshotBuildNumber());
      Assert.assertEquals(data.getVersion(), expectedVersion);
    }
    else {
      // non snapshot
      Assert.assertEquals(data.getVersion(), gav.getVersion());
    }
    Assert.assertEquals(data.getBaseVersion(), gav.getBaseVersion());
    Assert.assertEquals(data.getClassifier(), gav.getClassifier());
    Assert.assertEquals(data.getExtension(), gav.getExtension());

    Assert.assertEquals(buildExpectedDepBlock(gav), data.getDependencyXmlChunk());
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.Maven2ArtifactInfoResource

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.