cancel
Showing results for 
Search instead for 
Did you mean: 

Eclipse / Maven integration of Soapui free edition ?

Contributor

Eclipse / Maven integration of Soapui free edition ?

Greetings,

 

I am trying to integrate SoapUI [free edition] into the Eclipse IDE to launch tests from there, and via Maven projects.

We would like to integrate SoapUI into Maven so we can perform continuous integration regression tests.


Most of the resources I have found, e.g. the docs on the Smartbear site, seem to assume that I have the pro edition of SoapUI.


Is it possible to integrate the free edition of SoapUI into Eclipse and/or Maven ?


Or will we have to buy the pro edition, or another product ?

14 REPLIES 14
Valued Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

Hi,

 

The free SoapUI Open Source should be able to run fine via Maven:

 

https://www.soapui.org/test-automation/maven/maven-2-x.html

 

You often see pro-only etc on the SoapUI wiki, but there are two versions of the Maven SoapUI plugin. Here is a very simple snippet for version 5.0.0:

...
<pluginRepositories>
           <pluginRepository>
             <id>SmartBearPluginRepository</id>
                <url>http://www.soapui.org/repository/maven2/</url>
           </pluginRepository>
</pluginRepositories>
  <build>
      <plugins>
          <plugin>
              <groupId>com.smartbear.soapui</groupId>
              <artifactId>soapui-maven-plugin</artifactId>
              <version>5.0.0</version>
              <executions>
                  <execution>
                      <phase>test</phase>
							<goals>
    							<goal>test</goal>
            				</goals>
            				<configuration>                         
            				<projectFile>src/test/resources/SOAPTest-soapui-project.xml</projectFile>
                           </configuration>
                       </execution>
                   </executions>
               </plugin>
           </plugins>
</build>
...

In terms of running SoapUI from within Eclipse, how exactly did you mean? Once the SoapUI dependencies are present, it can be quite easily run via Java, Groovy, Gradle, Maven..

 

In general, most things are possible in SoapUI O/S, sometimes with a little extra effort/thought and often with the help of Groovy scripts etc! :-) 

 

Regards,

Rupert

Author of SoapUI Cookbook
Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

 

Thanks Rupert!

Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

 

Hi Rupert and co,

 

I have added the above to my POM file, but I am still getting an import failure:

 

import com.eviware.SoapUI.tools.SoapUITestCaseRunner;   [cannot be resolved]

 

Do I need to add a jar file to the project ?  Or is maven supposed to take care of that ?

 

Thanks,

 

CFR.

 

My POM now looks like this:

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SoapUI_First</groupId>
<artifactId>SoapUI_First</artifactId>
<version>0.0.1-SNAPSHOT</version>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<phase>test
</phase>
<goals>
<goal>test
</goal>
</goals>
<configuration>
<projectFile>src/test/resources/SOAPTest-soapui-project.xml</projectFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

 

 

 

Valued Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

Hi,

 

Just to run Soapui project files with the Maven plugin, you should not need any additional libraries.

 

However, if your project contains Groovy scripts that require any libraries then these must be provided in the /ext folder, you can vary its location using a parameter:

mvn integration-test "-Dsoapui.ext.libraries=src/test/resources"

 

By the way there are newer versions of the maven plugin (the one in that pom is for version 5.0), take a look here for more options:

 

http://smartbearsoftware.com/repository/maven2/com/smartbear/soapui/soapui-maven-plugin/

Author of SoapUI Cookbook
Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

 

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....

 

 

Valued Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

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')

 

Author of SoapUI Cookbook
Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

 

Thanks Rupert, we are looking into it.

Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

 

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.

 

New Contributor

Re: Eclipse / Maven integration of Soapui free edition ?

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

New Here?
Join us and watch the welcome video:
Top Kudoed Authors