portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1737161 - /portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.3.0-POST-RELEASE/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/NumericVersionTest.java
Date Wed, 30 Mar 2016 20:25:46 GMT
Author: taylor
Date: Wed Mar 30 20:25:45 2016
New Revision: 1737161

URL: http://svn.apache.org/viewvc?rev=1737161&view=rev
Log:
Including r1735310 and r1735336 (UserSessionPreferences entity empty patch and VersionDeploymentManaagerPath)

Added:
    portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.3.0-POST-RELEASE/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/NumericVersionTest.java

Added: portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.3.0-POST-RELEASE/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/NumericVersionTest.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.3.0-POST-RELEASE/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/NumericVersionTest.java?rev=1737161&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.3.0-POST-RELEASE/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/NumericVersionTest.java
(added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-BRANCH-2.3.0-POST-RELEASE/components/jetspeed-portal/src/test/java/org/apache/jetspeed/tools/pamanager/NumericVersionTest.java
Wed Mar 30 20:25:45 2016
@@ -0,0 +1,32 @@
+package org.apache.jetspeed.tools.pamanager;
+
+import junit.framework.TestCase;
+
+public class NumericVersionTest extends TestCase {
+
+    public void testDotCompare() throws Exception {
+        assert(VersionedPortletApplicationManager.compareVersions("2.9.8", "2.10.0", true)
== -1);
+        assert(VersionedPortletApplicationManager.compareVersions("2.9.5.4.3.2.1", "2.9.5.4.3.2.1",
true) == 0);
+        assert(VersionedPortletApplicationManager.compareVersions("2.9.5.4.3.2.2", "2.9.5.4.3.2.1",
true) == 1);
+        assert(VersionedPortletApplicationManager.compareVersions("2.9.5.4.3.2.1", "2.9.5.4.3.2.2",
true) == -1);
+        assert(VersionedPortletApplicationManager.compareVersions("2.9", "2.9.5", true) ==
-1);
+        assert(VersionedPortletApplicationManager.compareVersions("2.9.5", "2.9", true) ==
1);
+        assert(VersionedPortletApplicationManager.compareVersions("2", "3", true) == -1);
+        assert(VersionedPortletApplicationManager.compareVersions("3", "2", true) == 1);
+        assert(VersionedPortletApplicationManager.compareVersions("3.4.3", "3.4.2", true)
== 1);
+        assert(VersionedPortletApplicationManager.compareVersions("3.4.2", "3.4.3", true)
== -1);
+
+        assert (VersionedPortletApplicationManager.compareVersions("a.b.c", "a.b.d", false)
== -1);
+        assert (VersionedPortletApplicationManager.compareVersions("aaaa", "bbb", false)
== -1);
+        assert (VersionedPortletApplicationManager.compareVersions("big", "Big", false) >
0);
+        boolean error = false;
+        try {
+            assert (VersionedPortletApplicationManager.compareVersions("a.b.c", "a.b.d",
true) == -1);
+        }
+        catch (NumberFormatException e)  {
+            error = true;
+        }
+        assert(error);
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message