Search in sources :

Example 1 with VersionSpec

use of org.commonjava.atlas.maven.ident.version.VersionSpec in project atlas by Commonjava.

the class VersionParserTest method parseRangeWithStrings.

@Test
public void parseRangeWithStrings() throws Exception {
    final String range = "[2.0.12-redhat-1,2.0.12-redhat-2]";
    final VersionSpec parsed = new VersionParser(range).parse();
    System.out.println(parsed);
}
Also used : VersionParser(org.commonjava.atlas.maven.ident.version.parse.VersionParser) VersionSpec(org.commonjava.atlas.maven.ident.version.VersionSpec) Test(org.junit.Test)

Example 2 with VersionSpec

use of org.commonjava.atlas.maven.ident.version.VersionSpec in project atlas by Commonjava.

the class VersionParserTest method parseSingleVersionWithModifiedDateTimeFormat.

@Test
public void parseSingleVersionWithModifiedDateTimeFormat() throws Exception {
    final String version = "20031129.200437j";
    final VersionSpec parsed = new VersionParser(version).parse();
    System.out.println(parsed);
}
Also used : VersionParser(org.commonjava.atlas.maven.ident.version.parse.VersionParser) VersionSpec(org.commonjava.atlas.maven.ident.version.VersionSpec) Test(org.junit.Test)

Example 3 with VersionSpec

use of org.commonjava.atlas.maven.ident.version.VersionSpec in project atlas by Commonjava.

the class VersionParserTest method parseSingleVersionWithExtendedDateTimeFormat.

@Test
public void parseSingleVersionWithExtendedDateTimeFormat() throws Exception {
    final String version = "20031129.200437-600";
    final VersionSpec parsed = new VersionParser(version).parse();
    System.out.println(parsed);
}
Also used : VersionParser(org.commonjava.atlas.maven.ident.version.parse.VersionParser) VersionSpec(org.commonjava.atlas.maven.ident.version.VersionSpec) Test(org.junit.Test)

Example 4 with VersionSpec

use of org.commonjava.atlas.maven.ident.version.VersionSpec in project atlas by Commonjava.

the class VersionParserTest method parseSingleVersionWithPlusSeparator.

@Test
public void parseSingleVersionWithPlusSeparator() throws Exception {
    final String version = "9+181-r4173-1";
    final VersionSpec parsed = new VersionParser(version).parse();
    System.out.println(parsed);
}
Also used : VersionParser(org.commonjava.atlas.maven.ident.version.parse.VersionParser) VersionSpec(org.commonjava.atlas.maven.ident.version.VersionSpec) Test(org.junit.Test)

Example 5 with VersionSpec

use of org.commonjava.atlas.maven.ident.version.VersionSpec in project atlas by Commonjava.

the class ProjectVersionRefTest method constructWithStringVersionAndRenderStandardSpecMatches.

@Test
public void constructWithStringVersionAndRenderStandardSpecMatches() throws InvalidVersionSpecificationException {
    final String ver = "2.1.1.Final";
    final ProjectVersionRef ref = new SimpleProjectVersionRef("g", "a", ver);
    final VersionSpec spec = ref.getVersionSpec();
    assertThat(spec.renderStandard(), equalTo(ver));
}
Also used : ProjectVersionRef(org.commonjava.atlas.maven.ident.ref.ProjectVersionRef) SimpleProjectVersionRef(org.commonjava.atlas.maven.ident.ref.SimpleProjectVersionRef) SimpleProjectVersionRef(org.commonjava.atlas.maven.ident.ref.SimpleProjectVersionRef) VersionSpec(org.commonjava.atlas.maven.ident.version.VersionSpec) Test(org.junit.Test)

Aggregations

VersionSpec (org.commonjava.atlas.maven.ident.version.VersionSpec)11 Test (org.junit.Test)8 VersionParser (org.commonjava.atlas.maven.ident.version.parse.VersionParser)6 ArrayList (java.util.ArrayList)2 TreeMap (java.util.TreeMap)2 ProjectVersionRef (org.commonjava.atlas.maven.ident.ref.ProjectVersionRef)2 SimpleProjectVersionRef (org.commonjava.atlas.maven.ident.ref.SimpleProjectVersionRef)2 JoinString (org.commonjava.atlas.maven.ident.util.JoinString)2 InvalidVersionSpecificationException (org.commonjava.atlas.maven.ident.version.InvalidVersionSpecificationException)2 SingleVersion (org.commonjava.atlas.maven.ident.version.SingleVersion)2 GalleyMavenException (org.commonjava.maven.galley.maven.GalleyMavenException)2 ProjectVersionRefLocation (org.commonjava.maven.galley.maven.model.ProjectVersionRefLocation)2 MavenMetadataView (org.commonjava.maven.galley.maven.model.view.meta.MavenMetadataView)2 Location (org.commonjava.maven.galley.model.Location)2 VersionPhrase (org.commonjava.atlas.maven.ident.version.part.VersionPhrase)1