Forum Discussion
Hi Rupert, I am trying to use this java class, and it does not compile [because the import fails], it there a different class or method I should be using ?
import com.eviware.SoapUI.tools.SoapUITestCaseRunner;
public class run_soapui {
SoapUITestCaseRunner SoapUITestCaseRunner= newSoapUITestCaseRunner();
SoapUITestCaseRunner.setProjectFile("src/test/resources/WeatherSoapTest-SoapUI-project.xml");
SoapUITestCaseRunner.setProjectProperties(prop);
SoapUITestCaseRunner.setTestSuite("TestSuite 1");
SoapUITestCaseRunner.setTestCase("TestCase 1");
SoapUITestCaseRunner.run();
}
I can force this to compile by manually adding the soapui jar, but i would rather have maven take care of it....
Ok, if you're doing it that way then I personally wouldn't use the maven plugin.
If you want to run it programatically, that SoapUITestCaseRunner class is part of the main SoapUI lib, so I'd just manage the dependencies either:
1) By adding all jars to eclipse / classpath from SoapUI lib (easy / but not that nice, a lot of jars!)
2) Use Maven to bring in all the SoapUI dependencies (good, think Maven seems to manage the dependencies a little better than Gradle)
3) Use Gradle to bring in all the dependencies (quite nice) e.g.
dependencies {
compile(group: 'com.smartbear.soapui', name: 'soapui',
version:'5.1.2-m-SNAPSHOT') {
exclude(module: 'jms')
exclude(module: 'jtidy' )
exclude(module: 'cajo' )
}
compile files('/soapui-cookbook/chapter5/gradle/lib/jms-1.1.jar') // This one is a bit of a hack, Maven doesn't need to do this
}
4) Use Groovy an Grapes (quite slick)
@GrabResolver(name='soapui', root='http://www.soapui.org/repository/
maven2')
@Grab(group='com.smartbear.soapui', module='soapui', version='5.1.2-m-
SNAPSHOT')
@GrabExclude('jtidy:jtidy')
@GrabExclude('gnu.cajo:cajo')
- charlesfradley8 years agoContributor
Thanks Rupert, we are looking into it.
- charlesfradley8 years agoContributor
Quick response:
Option-1) At first I started out with option-1, but there are too many jars and it is taking forever
Option-2) This is our preferred approach. Do you know a good POM file for option-2 ? I would think it would be pretty standard, but I cannot find one on the net anywhere....
Option-3 and Option-4 ... I tried Gradle recently and could not get it to work ... I have given up on it, I have more success with Maven ... usually :-)
Thanks,
CFR.
- jameseg37 years agoNew Contributor
Hi Charles, did you ever get option 2 to work? I'm dealing with the same issue. Love to hear what you guys came up with.
Thanks in advance,
-James
Related Content
Recent Discussions
- 2 days agoruchisingh