Forum Discussion

soapuifan's avatar
soapuifan
Occasional Contributor
13 years ago

How to convey context to my class

Hi, as we all know the following objects are available in sopui test run.

testRunner
context
log


I wrote a class where I want to use the objects, so defined a constructor

MyClass(TestRunner tr, Context cn, Logger lg) {

blablabla
}

but when I create object of MyClass
then I receive error saying:

groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.pack.funny.MyClass(com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner, com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext, org.apache.log4j.Logger)

The problematic is Context. What type is context? How to successfully pass the object to my class

2 Replies

  • jazzyekim's avatar
    jazzyekim
    Occasional Contributor
    Hi!

    It has already written to you in your exception report - com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext

    I believe you should rewrite your class like this:


    import com.eviware.soapui.impl.wsdl.panels.support.*
    import org.apache.log4j.Logger

    MyClass(MockTestRunner tr, MockTestRunContext cn, Logger lg) {

    blablabla
    }