summaryrefslogtreecommitdiffstats
path: root/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java')
-rw-r--r--sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java b/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java
new file mode 100644
index 0000000..b903867
--- /dev/null
+++ b/sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.impl;
+
+import org.testng.annotations.Test;
+import org.openecomp.sdc.tosca.parser.utils.GeneralUtility;
+
+import static org.testng.Assert.assertTrue;
+
+public class ToscaParserGeneralUtilTest extends BasicTest {
+
+ @Test
+ public void testVersionCompare() {
+ assertTrue(GeneralUtility.conformanceLevelCompare("2", "3.0") < 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("0.5", "0.5") == 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("0.5", "0.6") < 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("1.5", "2.6") < 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("0.2", "0.1") > 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("2", "1.15") > 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("2", "2.0.0") == 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("2.0", "2.0.0.0") == 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("2.", "2.0.0.0") == 0);
+ assertTrue(GeneralUtility.conformanceLevelCompare("2.0", "2.0.0.2") < 0);
+ }
+}