diff options
Diffstat (limited to 'src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java')
-rw-r--r-- | src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java b/src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java new file mode 100644 index 0000000..d4ad73d --- /dev/null +++ b/src/test/java/org/onap/sdc/impl/ToscaParserGeneralUtilTest.java @@ -0,0 +1,23 @@ +package org.onap.sdc.impl; + +import org.testng.annotations.Test; +import org.onap.sdc.tosca.parser.utils.GeneralUtility; + +import static org.testng.Assert.assertTrue; + +public class ToscaParserGeneralUtilTest extends SdcToscaParserBasicTest { + + @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); + } +} |