use of aQute.bnd.version.MavenVersion in project bnd by bndtools.
the class ArchiveTest method testValueOf.
public void testValueOf() {
Archive a = Archive.valueOf("a.b.c:def:1.3");
assertEquals("a.b.c", a.revision.program.group);
assertEquals("def", a.revision.program.artifact);
assertEquals(new MavenVersion("1.3"), a.revision.version);
assertEquals("jar", a.extension);
assertEquals("", a.classifier);
assertEquals("a/b/c/def/1.3/def-1.3.jar", a.localPath);
assertEquals("a/b/c/def/1.3/def-1.3.jar", a.remotePath);
}
use of aQute.bnd.version.MavenVersion in project bnd by bndtools.
the class MavenVersionTest method testMajorMinor.
public void testMajorMinor() {
MavenVersion mv = MavenVersion.parseString("1.2");
assertEquals(new Version(1, 2), mv.getOSGiVersion());
}
use of aQute.bnd.version.MavenVersion in project bnd by bndtools.
the class MavenVersionTest method testNumericQualifier.
public void testNumericQualifier() {
MavenVersion mv = MavenVersion.parseString("1.2.3-01");
assertEquals(new Version(1, 2, 3, "01"), mv.getOSGiVersion());
mv = MavenVersion.parseString("1.2.3.01");
assertEquals(new Version(1, 2, 3, "01"), mv.getOSGiVersion());
}
use of aQute.bnd.version.MavenVersion in project bnd by bndtools.
the class MavenVersionTest method testInvalidVersion.
public void testInvalidVersion() {
try {
MavenVersion mv = MavenVersion.parseString("Not a number");
fail();
} catch (IllegalArgumentException e) {
// expected
}
}
use of aQute.bnd.version.MavenVersion in project bnd by bndtools.
the class MavenVersionTest method testSnapshot.
public void testSnapshot() {
MavenVersion mv = MavenVersion.parseString("1.2.3-SNAPSHOT");
assertEquals(new Version(1, 2, 3, "SNAPSHOT"), mv.getOSGiVersion());
assertTrue(mv.isSnapshot());
mv = MavenVersion.parseString("1.2-SNAPSHOT");
assertEquals(new Version(1, 2, 0, "SNAPSHOT"), mv.getOSGiVersion());
assertTrue(mv.isSnapshot());
mv = MavenVersion.parseString("1-SNAPSHOT");
assertEquals(new Version(1, 0, 0, "SNAPSHOT"), mv.getOSGiVersion());
assertTrue(mv.isSnapshot());
mv = MavenVersion.parseString("1.2.3.SNAPSHOT");
assertEquals(new Version(1, 2, 3, "SNAPSHOT"), mv.getOSGiVersion());
assertTrue(mv.isSnapshot());
mv = MavenVersion.parseString("1.2.3.BUILD-SNAPSHOT");
assertEquals(new Version(1, 2, 3, "BUILD-SNAPSHOT"), mv.getOSGiVersion());
assertTrue(mv.isSnapshot());
mv = MavenVersion.parseString("1.2-BUILD-SNAPSHOT");
assertEquals(new Version(1, 2, 0, "BUILD-SNAPSHOT"), mv.getOSGiVersion());
assertTrue(mv.isSnapshot());
}
Aggregations