diff options
author | Pavel Aharoni <pa0916@att.com> | 2017-05-11 16:41:38 +0300 |
---|---|---|
committer | Pavel Aharoni <pa0916@att.com> | 2017-05-11 16:41:51 +0300 |
commit | af2d8ef12f6b75ae837fffdeaf5d152756cec6d6 (patch) | |
tree | 5595ae8a7dbc663792d625dab168d5c94358fc79 /sdc-tosca-parser/src/test/java/org/openecomp/sdc/impl/ToscaParserGeneralUtilTest.java | |
parent | 8182ddf3140f4345ccbcb0bec37ff174756ba2e0 (diff) |
[SDC-18] Tosca Parser conformance level - initial
Change-Id: I0d8d27f4b8085d918ecc94aace423d3216337f2d
Signed-off-by: Pavel Aharoni <pa0916@att.com>
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.java | 23 |
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); + } +} |