From 0cc135f35c17bb59428a28d3cfee2bc2f65c5528 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Thu, 25 Apr 2013 14:20:19 +0200 Subject: Splashscreen now strip commit id from released versions --- .../impls/defaultsplashscreen2012/BasePainterTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java index 53d499a..ec4b97a 100644 --- a/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java +++ b/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java @@ -105,4 +105,22 @@ public class BasePainterTest { } + + @Test + public void stripCommitFromVersion() { + Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4")); + Assert.assertEquals("1.4.2", BasePainter.stripCommitFromVersion("1.4.2")); + Assert.assertEquals("1.4pre", BasePainter.stripCommitFromVersion("1.4pre")); + Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+657tgkhyu4iy5")); + Assert.assertEquals("1.4.2", BasePainter.stripCommitFromVersion("1.4.2+887tgjh07tftvhjj")); + Assert.assertEquals("1.4pre+0977tyugg", BasePainter.stripCommitFromVersion("1.4pre+0977tyugg")); + + Assert.assertEquals("1.4pre+", BasePainter.stripCommitFromVersion("1.4pre+")); + Assert.assertEquals("1.4pre+foo+", BasePainter.stripCommitFromVersion("1.4pre+foo+")); + Assert.assertEquals("1.4pre+foo+bar", BasePainter.stripCommitFromVersion("1.4pre+foo+bar")); + + Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+")); + Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+foo+")); + Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+foo+bar")); + } } -- cgit v1.2.3