Forum Discussion
Thank you
Now i have written the script like below, the script is executed fine where as
def table_count = ["python" , "C:/Pythonscripts/test.py", host,db_password,db_id]
def process = new ProcessBuilder(table_count).redirectErrorStream(true).start()
def count = 0
process.inputStream.eachLine {
count=log.warn(it)
assert count !=0 : "The table count is Zero or null"
}
process.waitFor()
return process.exitValue()
When i change the script to
def table_count = ["python" , "C:/Pythonscripts/test.py", host,db_password,db_id]
def process = new ProcessBuilder(table_count).redirectErrorStream(true).start()
def count = 0
process.inputStream.eachLine {
count=log.warn(it)
assert count ==0 : "The table count is Zero or null"
}
process.waitFor()
return process.exitValue()
i am getting error
java.lang.AssertionError: The table count is Zero or null. Expression: (count == 0). Values: count = null error at line: 17
In the error message its showing count = null but actual value is 44, So how in the error message the actual count i will get?
Thanks
- doubtsreadyapi5 years agoContributor
Hi nmrao
Thanks for the update i have kept assertion on log.warn(it), below is the new code i have written and it worked.
def table_count = ["python" , "C:/Pythonscripts/test.py", host,db_password,db_id]
def process = new ProcessBuilder(table_count).redirectErrorStream(true).start()
process.inputStream.eachLine {
log.info(it)assert it !=0 : "The count is Zero"
assert it != null : "The count is null"
}
process.waitFor()
return process.exitValue()
Related Content
- 9 years ago
- 8 years ago
- 5 years ago
Recent Discussions
- 5 days ago
- 10 days ago