William_Willafo
15 years agoOccasional Contributor
[Res] Help extending soapui with external compiled JAR
Hi,
Novice java programmer here. I know this is not a programming help forum, but I have a question about soapUI's API.
I already have a custom compiled JAR file that contains classes and public functions that do things for me, such as modifying text files on my system and executing remote system commands. I call these functions from soapUI Groovy Test Steps.
Now I'm interested in hooking into some of soapUI's logging functions. I've figured out I have to (i think) import the soapui jar file (C:\Program Files\eviware\soapUI-Pro-3.5.1\lib\soapui-3.5.1.jar) into my Netbeans project.
Now I am unsure of what to do next. This is what I am trying to achieve:
1. Inside a Groovy Test Step, call my custom function. My custom function will perform some actions (as it currently does), and then be able to log messages to the current logger, i.e.:
2. If I am running the Groovy Test Step manually, my function should log to the testStep log output.
3. If I am running the TestCase/TestSuite/Project, my function should log to the corresponding logger.
Could anyone point me to the correct class and/or function to call on?
Currently, inside a groovy script I would simply say
But what I want to do is something like (pseudo-code):
My Java Source:
And use it in Groovy Test Step:
Either method would result is same effect. Except with 2nd method, my custom functions are able to output status messages to soapUI log output.
Thanks!
Novice java programmer here. I know this is not a programming help forum, but I have a question about soapUI's API.
I already have a custom compiled JAR file that contains classes and public functions that do things for me, such as modifying text files on my system and executing remote system commands. I call these functions from soapUI Groovy Test Steps.
Now I'm interested in hooking into some of soapUI's logging functions. I've figured out I have to (i think) import the soapui jar file (C:\Program Files\eviware\soapUI-Pro-3.5.1\lib\soapui-3.5.1.jar) into my Netbeans project.
Now I am unsure of what to do next. This is what I am trying to achieve:
1. Inside a Groovy Test Step, call my custom function. My custom function will perform some actions (as it currently does), and then be able to log messages to the current logger, i.e.:
2. If I am running the Groovy Test Step manually, my function should log to the testStep log output.
3. If I am running the TestCase/TestSuite/Project, my function should log to the corresponding logger.
Could anyone point me to the correct class and/or function to call on?
Currently, inside a groovy script I would simply say
log.info "Hello World from groovy!"
But what I want to do is something like (pseudo-code):
My Java Source:
package soapui.demo;
import com.eviware.soapui.....?????
public class MyDemo {
public static void HelloWorld() {
com.eviware.soapui....???.log.info("Hello World from custom JAR!")
}
}
And use it in Groovy Test Step:
import soapui.demo.MyDemo
MyDemo.HelloWorld;
Either method would result is same effect. Except with 2nd method, my custom functions are able to output status messages to soapUI log output.
Thanks!