summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorctranxuan@gmail.com2011-11-07 12:38:00 (EST)
committer Christopher Frost2011-11-07 12:38:00 (EST)
commit5640fe4245c3f05f52382f86779d05ecd1b05e82 (patch)
tree9f51aa020c416b744715b7666fbec1c414dbd4d8
parentc0f0d9285f460b5388932d6ec50cc82d0b675bd3 (diff)
downloadorg.eclipse.virgo.bundlor-5640fe4245c3f05f52382f86779d05ecd1b05e82.zip
org.eclipse.virgo.bundlor-5640fe4245c3f05f52382f86779d05ecd1b05e82.tar.gz
org.eclipse.virgo.bundlor-5640fe4245c3f05f52382f86779d05ecd1b05e82.tar.bz2
362405 Adding patch to support bigger version numbers
-rw-r--r--org.eclipse.virgo.bundlor.maven/src/main/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverter.java2
-rw-r--r--org.eclipse.virgo.bundlor.maven/src/test/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverterTests.java11
2 files changed, 9 insertions, 4 deletions
diff --git a/org.eclipse.virgo.bundlor.maven/src/main/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverter.java b/org.eclipse.virgo.bundlor.maven/src/main/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverter.java
index 61af00b..2452738 100644
--- a/org.eclipse.virgo.bundlor.maven/src/main/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverter.java
+++ b/org.eclipse.virgo.bundlor.maven/src/main/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverter.java
@@ -16,7 +16,7 @@ import java.util.regex.Pattern;
public final class MavenVersionNumberConverter {
- private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d)(\\.\\d)?(\\.\\d)?([\\.-]{1}.*)?");
+ private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+)?(\\.\\d+)?([\\.-]{1}.*)?");
public String convertToOsgi(String mavenVersionNumber) {
VersionBuilder versionBuilder = new VersionBuilder();
diff --git a/org.eclipse.virgo.bundlor.maven/src/test/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverterTests.java b/org.eclipse.virgo.bundlor.maven/src/test/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverterTests.java
index 1baadd5..be86598 100644
--- a/org.eclipse.virgo.bundlor.maven/src/test/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverterTests.java
+++ b/org.eclipse.virgo.bundlor.maven/src/test/java/org/eclipse/virgo/bundlor/maven/plugin/internal/MavenVersionNumberConverterTests.java
@@ -25,13 +25,18 @@ public class MavenVersionNumberConverterTests {
}
@Test
- public void minor() {
- assertEquals("1.0.0.SNAPSHOT", converter.convertToOsgi("1.0-SNAPSHOT"));
+ public void major10() {
+ assertEquals("10.0.0.SNAPSHOT", converter.convertToOsgi("10-SNAPSHOT"));
+ }
+
+ @Test
+ public void minor10() {
+ assertEquals("1.10.0.SNAPSHOT", converter.convertToOsgi("1.10-SNAPSHOT"));
}
@Test
public void micro() {
- assertEquals("1.0.0.SNAPSHOT", converter.convertToOsgi("1.0.0-SNAPSHOT"));
+ assertEquals("1.0.10.SNAPSHOT", converter.convertToOsgi("1.0.10-SNAPSHOT"));
}
@Test