use of org.jboss.galleon.universe.maven.repo.MavenArtifactVersion in project galleon by wildfly.
the class MavenArtifactVersionTestCase method testNoQualifierComparison.
@Test
public void testNoQualifierComparison() throws Exception {
Assert.assertEquals(0, new MavenArtifactVersion("1.0.0").compareTo(new MavenArtifactVersion("1")));
Assert.assertEquals(0, new MavenArtifactVersion("1.0.0").compareTo(new MavenArtifactVersion("1.0")));
Assert.assertTrue(new MavenArtifactVersion("1.0.0").compareTo(new MavenArtifactVersion("1.0.1")) < 0);
Assert.assertTrue(new MavenArtifactVersion("1.1").compareTo(new MavenArtifactVersion("1.0.1")) > 0);
}
use of org.jboss.galleon.universe.maven.repo.MavenArtifactVersion in project galleon by wildfly.
the class MavenArtifactVersionRangeTestCase method testFromVersionExclusive.
@Test
public void testFromVersionExclusive() throws Exception {
MavenArtifactVersionRange range = parser.parseRange("(1.0,)");
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("0.5")));
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("1.0.0")));
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("1.0.1")));
}
use of org.jboss.galleon.universe.maven.repo.MavenArtifactVersion in project galleon by wildfly.
the class MavenArtifactVersionRangeTestCase method testUpToVersionInclusive.
@Test
public void testUpToVersionInclusive() throws Exception {
MavenArtifactVersionRange range = parser.parseRange("(,1.0]");
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("0.5")));
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("1.0.0")));
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("1.0.1")));
}
use of org.jboss.galleon.universe.maven.repo.MavenArtifactVersion in project galleon by wildfly.
the class MavenArtifactVersionRangeTestCase method testFromVersionInclusive.
@Test
public void testFromVersionInclusive() throws Exception {
MavenArtifactVersionRange range = parser.parseRange("[1.0,)");
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("0.5")));
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("1.0.0")));
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("1.0.1")));
}
use of org.jboss.galleon.universe.maven.repo.MavenArtifactVersion in project galleon by wildfly.
the class MavenArtifactVersionRangeTestCase method testExclusiveRange.
@Test
public void testExclusiveRange() throws Exception {
MavenArtifactVersionRange range = parser.parseRange("(1.2,1.3)");
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("1.2.0.Final")));
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("1.2.0.Alpha")));
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("1.2.5.Alpha")));
Assert.assertTrue(range.includesVersion(new MavenArtifactVersion("1.3.0.Alpha")));
Assert.assertFalse(range.includesVersion(new MavenArtifactVersion("1.3.0.Final")));
}
Aggregations