diff --git a/rundeckapp/test/unit/JobsXMLCodecTests.groovy b/rundeckapp/test/unit/JobsXMLCodecTests.groovy index 78e5f43b187..c26b84049b0 100644 --- a/rundeckapp/test/unit/JobsXMLCodecTests.groovy +++ b/rundeckapp/test/unit/JobsXMLCodecTests.groovy @@ -728,6 +728,72 @@ class JobsXMLCodecTests extends GroovyTestCase { assertEquals "incorrect project","demo",jobs[0].project } + void testDecodeStringsShouldNotBeBoolean() { + def example1 = """ + + 1 + false + false + VERBOSE + false + + false + + + + + + false + + + false + + + + + + false + + + + + + + + + + 2 + false + + + +""" + def jobs = JobsXMLCodec.decode(example1) + assertNotNull jobs + assertEquals "false",jobs[0].jobName + assertEquals "false",jobs[0].groupPath + assertEquals "false",jobs[0].description + assertEquals false, jobs[0].nodeExcludePrecedence + assertEquals false, jobs[0].nodeKeepgoing + assertEquals "false", jobs[0].nodeInclude + assertEquals "false",jobs[0].project + assertEquals 1, jobs[0].workflow.commands.size() + assertEquals "false", jobs[0].workflow.commands[0].adhocRemoteString + assertEquals "false", jobs[0].workflow.commands[0].errorHandler.adhocLocalString + assertEquals "false", jobs[0].workflow.commands[0].errorHandler.argString + assertEquals false, jobs[0].workflow.commands[0].errorHandler.keepgoingOnSuccess + assertEquals 2, jobs[0].nodeThreadcount + assertEquals false, jobs[0].workflow.keepgoing + assertEquals 2, jobs[0].options.size() + def opts=new ArrayList(jobs[0].options) + assertEquals 'false', opts[0].name + assertEquals false, opts[0].enforced + assertEquals 'x', opts[1].name + assertEquals false, opts[1].required + assertEquals '9000636026', opts[1].defaultValue + } void testDecodeBackwardsCompatibility(){ /** * Backwards compatibility test, using pre 3.5 format for input