Search in sources :

Example 6 with MavenVersion

use of aQute.bnd.version.MavenVersion in project bnd by bndtools.

the class MavenVersionTest method testNull.

public void testNull() {
    MavenVersion mv = MavenVersion.parseString(null);
    assertEquals(new Version(0, 0, 0), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
}
Also used : MavenVersion(aQute.bnd.version.MavenVersion) Version(aQute.bnd.version.Version) MavenVersion(aQute.bnd.version.MavenVersion)

Example 7 with MavenVersion

use of aQute.bnd.version.MavenVersion in project bnd by bndtools.

the class MavenVersionTest method testEmptyString.

public void testEmptyString() {
    MavenVersion mv = MavenVersion.parseString("");
    assertEquals(new Version(0, 0, 0), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
    mv = MavenVersion.parseString("      	");
    assertEquals(new Version(0, 0, 0), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
}
Also used : MavenVersion(aQute.bnd.version.MavenVersion) Version(aQute.bnd.version.Version) MavenVersion(aQute.bnd.version.MavenVersion)

Example 8 with MavenVersion

use of aQute.bnd.version.MavenVersion in project bnd by bndtools.

the class MavenVersionTest method testQualifierWithDotSeparator.

public void testQualifierWithDotSeparator() {
    MavenVersion mv = MavenVersion.parseString("1.2.3.beta-1");
    assertEquals(new Version(1, 2, 3, "beta-1"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
    mv = MavenVersion.parseString("1.2.beta-1");
    assertEquals(new Version(1, 2, 0, "beta-1"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
    mv = MavenVersion.parseString("1.beta-1");
    assertEquals(new Version(1, 0, 0, "beta-1"), mv.getOSGiVersion());
    assertFalse(mv.isSnapshot());
}
Also used : MavenVersion(aQute.bnd.version.MavenVersion) Version(aQute.bnd.version.Version) MavenVersion(aQute.bnd.version.MavenVersion)

Example 9 with MavenVersion

use of aQute.bnd.version.MavenVersion in project bnd by bndtools.

the class MavenVersionTest method testMajor.

public void testMajor() {
    MavenVersion mv = MavenVersion.parseString("1");
    assertEquals(new Version(1), mv.getOSGiVersion());
}
Also used : MavenVersion(aQute.bnd.version.MavenVersion) Version(aQute.bnd.version.Version) MavenVersion(aQute.bnd.version.MavenVersion)

Example 10 with MavenVersion

use of aQute.bnd.version.MavenVersion in project bnd by bndtools.

the class MavenVersionTest method testMajorMinorMicro.

public void testMajorMinorMicro() {
    MavenVersion mv = MavenVersion.parseString("1.2.3");
    assertEquals(new Version(1, 2, 3), mv.getOSGiVersion());
}
Also used : MavenVersion(aQute.bnd.version.MavenVersion) Version(aQute.bnd.version.Version) MavenVersion(aQute.bnd.version.MavenVersion)

Aggregations

MavenVersion (aQute.bnd.version.MavenVersion)21 Version (aQute.bnd.version.Version)13 File (java.io.File)2 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)2 Archive (aQute.maven.api.Archive)1 Program (aQute.maven.api.Program)1 Revision (aQute.maven.api.Revision)1 ProgramMetadata (aQute.maven.provider.MetadataParser.ProgramMetadata)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 DefaultRepositorySystemSession (org.eclipse.aether.DefaultRepositorySystemSession)1 Artifact (org.eclipse.aether.artifact.Artifact)1 ArtifactRequest (org.eclipse.aether.resolution.ArtifactRequest)1 ArtifactResolutionException (org.eclipse.aether.resolution.ArtifactResolutionException)1 ArtifactResult (org.eclipse.aether.resolution.ArtifactResult)1 AbstractTransferListener (org.eclipse.aether.transfer.AbstractTransferListener)1 TransferCancelledException (org.eclipse.aether.transfer.TransferCancelledException)1 TransferEvent (org.eclipse.aether.transfer.TransferEvent)1