Forum Discussion

nbathija's avatar
nbathija
Occasional Contributor
13 years ago

SoapuiPro 4.0 version is throwing an exception for Stream

On SoapUIPRO 4.0 version I am getting an exception for Stream reader. This works on 3.6.1 version


Groovy script:

import java.io.ByteArrayOutputStream

def endpoint = context.expand( '${memcacheDataSource#endpoint}' )
def ncCommand= "sudo sh memcachetest.sh " + endpoint
def process = ncCommand.execute()
ByteArrayOutputStream outStream = new ByteArrayOutputStream()
process.waitForProcessOutput(outStream, new ByteArrayOutputStream())
def output = outStream.toString().eachLine{line -> log.info line }
assert output != null, "Unable to connect to Memcache server -> [" + endpoint + " ]"

Exception:

Exception in thread "Thread-4" groovy.lang.GroovyRuntimeException: exception while dumping process stream
at org.codehaus.groovy.runtime.ProcessGroovyMethods$ByteDumper.run(ProcessGroovyMethods.java:484)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at org.codehaus.groovy.runtime.ProcessGroovyMethods$ByteDumper.run(ProcessGroovyMethods.java:480)
... 1 more

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Are you sure that the only difference is the version of soapUI?

    Could you try to make this example as minimal and static as possible so that we can try on our (Linux?) machines?


    Thanks

    Henrik
    eviware
  • nbathija's avatar
    nbathija
    Occasional Contributor
    I am positive.The same test case works very well on Soapui 3.6.1 version.
    I have pasted the shell script too which I am invoking from groovy script

    Here is test case:

    import java.io.ByteArrayOutputStream
    def endpoint = "abc.eng.yousendit.com"
    def ncCommand= "sudo sh memcachetest.sh " + endpoint
    def process = ncCommand.execute()
    ByteArrayOutputStream outStream = new ByteArrayOutputStream()
    process.waitForProcessOutput(outStream, new ByteArrayOutputStream())
    def output = outStream.toString().eachLine{line -> log.info line }
    assert output != null, "Unable to connect to Memcache server -> [" + endpoint + " ]"


    Shell script:


    #!/bin/sh

    sudo touch 'result.txt'
    echo 'stats' | nc $1 11211 > result.txt
    head -1 result.txt
    sudo rm -rf result.txt
  • nbathija's avatar
    nbathija
    Occasional Contributor
    Hi Henrik,

    Any updates on this issue? Were you able to reproduce this issue?

    Thanks,
    Noopur