Search in sources :

Example 1 with MavenArtifactVersion

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);
}
Also used : MavenArtifactVersion(org.jboss.galleon.universe.maven.repo.MavenArtifactVersion) Test(org.junit.Test)

Example 2 with MavenArtifactVersion

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")));
}
Also used : MavenArtifactVersion(org.jboss.galleon.universe.maven.repo.MavenArtifactVersion) MavenArtifactVersionRange(org.jboss.galleon.universe.maven.repo.MavenArtifactVersionRange) Test(org.junit.Test)

Example 3 with MavenArtifactVersion

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")));
}
Also used : MavenArtifactVersion(org.jboss.galleon.universe.maven.repo.MavenArtifactVersion) MavenArtifactVersionRange(org.jboss.galleon.universe.maven.repo.MavenArtifactVersionRange) Test(org.junit.Test)

Example 4 with MavenArtifactVersion

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")));
}
Also used : MavenArtifactVersion(org.jboss.galleon.universe.maven.repo.MavenArtifactVersion) MavenArtifactVersionRange(org.jboss.galleon.universe.maven.repo.MavenArtifactVersionRange) Test(org.junit.Test)

Example 5 with MavenArtifactVersion

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")));
}
Also used : MavenArtifactVersion(org.jboss.galleon.universe.maven.repo.MavenArtifactVersion) MavenArtifactVersionRange(org.jboss.galleon.universe.maven.repo.MavenArtifactVersionRange) Test(org.junit.Test)

Aggregations

MavenArtifactVersion (org.jboss.galleon.universe.maven.repo.MavenArtifactVersion)13 Test (org.junit.Test)11 MavenArtifactVersionRange (org.jboss.galleon.universe.maven.repo.MavenArtifactVersionRange)10 MavenLatestVersionNotAvailableException (org.jboss.galleon.universe.maven.MavenLatestVersionNotAvailableException)2 Path (java.nio.file.Path)1 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)1 InstallationException (org.eclipse.aether.installation.InstallationException)1 VersionRangeResolutionException (org.eclipse.aether.resolution.VersionRangeResolutionException)1 VersionRangeResult (org.eclipse.aether.resolution.VersionRangeResult)1 MavenUniverseException (org.jboss.galleon.universe.maven.MavenUniverseException)1 LocalArtifactVersionRangeResolver (org.jboss.galleon.universe.maven.repo.LocalArtifactVersionRangeResolver)1