Forum Discussion

InterContinenta_1's avatar
InterContinenta_1
Occasional Contributor
11 years ago

maven dependancy for soapui pro jar

Hello,
I do not see the class File JUnitSecurityReportCollector or JUnitReportCollector in soapui-pro-4.6.2.jar file. I need to extend the class JUnitReportCollector.
Please let me know which jar file to be put in the pom dependancy to do the above.

So far I have as below. Thanks and Appreciate the Help.

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ihg.dec.apps</groupId>
<artifactId>B2BTest</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>B2BTest</name>
<url>http://maven.apache.org</url>
<properties>
<currentEnvironment>qa</currentEnvironment>
<targetEnvironement>utc</targetEnvironement>
</properties>
<profiles>
<profile>
<activation>
<property>
<name>automated</name>
</property>
</activation>
<properties>
<warExclude>WEB-INF/lib/*.jar</warExclude>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>central</id>
<url>http://maven.ihg.com:8181/artifactory/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://maven.ihg.com:8181/artifactory/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>private-releases</id>
<url>http://maven.ihg.com:8181/artifactory/private-releases</url>
<name>private-releases</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>sonar</id>
<url>http://repository.codehaus.org</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://maven.ihg.com:8181/artifactory/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://maven.ihg.com:8181/artifactory/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>4.6.2</version>
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>src/ihg/test/soap-ui/Ihg-b2b-soapui-project.xml</projectFile>
<!--<endpoint>http://qa.b2b.ihg.com</endpoint>-->
<host>${currentEnvironment}.b2b.ihg.com</host>
<!--<environment>qa</environment>-->
<!--<testSuite>B2B Regression TestSuite</testSuite>
<testCase>Travelport</testCase>-->
<outputFolder>target/soap-ui/${currentEnvironment}</outputFolder>
<junitReport>true</junitReport>
<printReport>true</printReport>
<exportAll>false</exportAll>
<reportName>IHG-B2BRegression-ProjectReport</reportName>
<reportFormat>PDF,HTML</reportFormat>
<testFailIgnore>true</testFailIgnore>
<globalProperties>
<value>environment=${currentEnvironment}</value>
<value>resultsPath=target/soap-ui/${currentEnvironment}/Results/</value>
<value>resultsComparePath=target/soap-ui/${targetEnvironement}/Results/</value>
<value>testcase_src=${project.basedir}/src/ihg/test/soap-ui/</value>
</globalProperties>
<soapuiProperties>
<property>
<name>soapui.home</name>
<value>${env.SOAPUI_HOME}/bin</value>
</property>
<property>
<name>soapui.ext.libraries</name>
<value>${env.SOAPUI_HOME}/bin/ext</value>
</property>
<property>
<name>soapui.scripting.library</name>
<value>${env.SOAPUI_HOME}/bin/scripts</value>
</property>
<property>
<name>soapui.logroot</name>
<value>${project.build.directory}/soap-ui/${currentEnvironment}/logs/</value>
</property>
<!-- To Override the Default JUnitCollector -->
<!--<property>
<name>soapui.junit.reportCollector</name>
<value>my.company.MyJunitCollector</value>
</property>-->
</soapuiProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}</directory>
<includes>
<include>*.log</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro</artifactId>
<version>4.6.2</version>
</dependency>
<dependency>
<groupId>eviware</groupId>
<artifactId>ext-xmlbeans</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
</dependencies>

</project>

5 Replies

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    hi InterContinentalHotelsGroup,

    the classes you are looking for are in the soapui (not pro) jar. As soapui-pro does not declare any dependencies, you have to do it in your pom.
    This means that, you should add the soapui dependency and remove the ext-xmlbeans dependency (code is not included in the soapui jar since 4.5.2)

    Regarding the extension of the JunitReport, have a look on the post provided by Marcus from SmartBear, it explains how you can use your custom JunitReport when running the soapui TestRunner
  • InterContinenta_1's avatar
    InterContinenta_1
    Occasional Contributor
    Thanks for the Reply.

    Do I have to install soapui 4.5.1.4 locally to run from moaven to see if the extended class is picking up when run?

    I have currently soapui-pro 4.6.2 installed.


    I changed the pom as below and my first test is to check if the new class gets picked. I placed the jar file under C:\Program Files\SmartBear\SoapUI-Pro-4.6.2\bin\ext.
    As you can see below, I just have an empty implementation for afterStep. But it appears that the report is generating as it was generating earlier.
    It doesn't appear that the new class got picked up.

    Thanks for the help.

    POM
    -----
    <?xml version="1.0" encoding="UTF-8"?>
    <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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ihg.dec.apps</groupId>
    <artifactId>B2BTest</artifactId>
    <packaging>jar</packaging>
    <version>1.0</version>
    <name>B2BTest</name>
    <url>http://maven.apache.org</url>
    <properties>
    <currentEnvironment>qa</currentEnvironment>
    <targetEnvironement>utc</targetEnvironement>
    </properties>
    <profiles>
    <profile>
    <activation>
    <property>
    <name>automated</name>
    </property>
    </activation>
    <properties>
    <warExclude>WEB-INF/lib/*.jar</warExclude>
    </properties>
    </profile>
    </profiles>
    <repositories>
    <repository>
    <id>central</id>
    <url>http://maven.ihg.com:8181/artifactory/releases</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>false</enabled>
    </snapshots>
    </repository>
    <repository>
    <id>snapshots</id>
    <url>http://maven.ihg.com:8181/artifactory/snapshots</url>
    <releases>
    <enabled>false</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </repository>
    <repository>
    <id>private-releases</id>
    <url>http://maven.ihg.com:8181/artifactory/private-releases</url>
    <name>private-releases</name>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>false</enabled>
    </snapshots>
    </repository>
    <repository>
    <id>sonar</id>
    <url>http://repository.codehaus.org</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>false</enabled>
    </snapshots>
    </repository>
    </repositories>
    <pluginRepositories>
    <pluginRepository>
    <id>central</id>
    <url>http://maven.ihg.com:8181/artifactory/releases</url>
    <releases>
    <enabled>true</enabled>
    </releases>
    <snapshots>
    <enabled>false</enabled>
    </snapshots>
    </pluginRepository>
    <pluginRepository>
    <id>snapshots</id>
    <url>http://maven.ihg.com:8181/artifactory/snapshots</url>
    <releases>
    <enabled>false</enabled>
    </releases>
    <snapshots>
    <enabled>true</enabled>
    </snapshots>
    </pluginRepository>
    <pluginRepository>
    <id>SmartBearPluginRepository</id>
    <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
    </pluginRepositories>
    <build>
    <plugins>
    <plugin>
    <groupId>com.github.redfish4ktc.soapui</groupId>
    <artifactId>maven-soapui-extension-plugin</artifactId>
    <version>4.5.1.5</version>

    <dependencies>
    <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.9</version>
    </dependency>
    </dependencies>
    <executions>
    <execution>
    <phase>test</phase>
    <goals>
    <goal>test</goal>
    </goals>
    <configuration>
    <projectFile>src/ihg/test/soap-ui/Ihg-b2b-soapui-project.xml</projectFile>
    <!--<endpoint>http://qa.b2b.ihg.com</endpoint>-->
    <host>${currentEnvironment}.b2b.ihg.com</host>
    <!--<environment>qa</environment>-->
    <!--<testSuite>B2B Regression TestSuite</testSuite>
    <testCase>Travelport</testCase>-->
    <outputFolder>target/soap-ui/${currentEnvironment}</outputFolder>
    <junitReport>true</junitReport>
    <printReport>true</printReport>
    <exportAll>false</exportAll>
    <reportName>IHG-B2BRegression-ProjectReport</reportName>
    <reportFormat>PDF,HTML</reportFormat>
    <testFailIgnore>true</testFailIgnore>
    <globalProperties>
    <value>environment=${currentEnvironment}</value>
    <value>resultsPath=target/soap-ui/${currentEnvironment}/Results/</value>
    <value>resultsComparePath=target/soap-ui/${targetEnvironement}/Results/</value>
    <value>testcase_src=${project.basedir}/src/ihg/test/soap-ui/</value>
    </globalProperties>
    <soapuiProperties>
    <property>
    <name>soapui.home</name>
    <value>${env.SOAPUI_HOME}/bin</value>
    </property>
    <property>
    <name>soapui.ext.libraries</name>
    <value>${env.SOAPUI_HOME}/bin/ext</value>
    </property>
    <property>
    <name>soapui.scripting.library</name>
    <value>${env.SOAPUI_HOME}/bin/scripts</value>
    </property>
    <property>
    <name>soapui.logroot</name>
    <value>${project.build.directory}/soap-ui/${currentEnvironment}/logs/</value>
    </property>
    <!-- To Override the Default JUnitCollector -->
    <property>
    <name>soapui.junit.reportCollector</name>
    <value>com.ihg.dec.b2b.test.junit.reports.B2BJUnitReportCollector</value>
    </property>

    </soapuiProperties>
    </configuration>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <configuration>
    <filesets>
    <fileset>
    <directory>${project.basedir}</directory>
    <includes>
    <include>*.log</include>
    </includes>
    <followSymlinks>false</followSymlinks>
    </fileset>
    </filesets>
    </configuration>
    </plugin>
    </plugins>
    </build>
    <dependencies>
    <dependency>
    <groupId>com.github.redfish4ktc.soapui</groupId>
    <artifactId>maven-soapui-extension-plugin</artifactId>
    <version>4.5.1.5</version>
    </dependency>
    </dependencies>

    </project>


    My JUnitReportCollector Extended Class
    ------------------------------------

    package com.ihg.dec.b2b.test.junit.reports;

    import java.util.HashMap;

    import com.eviware.soapui.model.testsuite.TestCase;
    import com.eviware.soapui.model.testsuite.TestCaseRunContext;
    import com.eviware.soapui.model.testsuite.TestCaseRunner;
    import com.eviware.soapui.model.testsuite.TestStep;
    import com.eviware.soapui.model.testsuite.TestStepResult;
    import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus;
    import com.eviware.soapui.report.JUnitReport;
    import com.eviware.soapui.report.JUnitReportCollector;


    /**
    * This Class Extends the SOAPUI's JUnitReportCollector
    *
    * @author Madhu.Chelikani@ihg.com
    *
    * @since Dec 11, 2013
    */

    public class B2BJUnitReportCollector extends JUnitReportCollector {

    HashMap<String, JUnitReport> reports;
    HashMap<TestCase, String> failures;
    HashMap<TestCase, Integer> errorCount;
    private int maxErrors;
    HashMap<TestCase, String> status;

    public B2BJUnitReportCollector() {
    this(0);
    }

    public B2BJUnitReportCollector(int maxErrors) {
    this.maxErrors = 0;

    this.maxErrors = maxErrors;
    this.reports = new HashMap<String, JUnitReport>();
    this.errorCount = new HashMap<TestCase, Integer>();
    this.failures = new HashMap<TestCase, String>();
    this.status = new HashMap<TestCase, String>();
    }

    @Override
    public void afterStep(TestCaseRunner testRunner, TestCaseRunContext runContext,
    TestStepResult result) {
    TestStep currentStep = result.getTestStep();
    TestCase testCase = currentStep.getTestCase();

    }

    private String getXML(){

    }


    }
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi,
    in the plugin declaration, you have to add your project as a dependency; then, the plugin will be able to access to your custom junit repot
    warn: you may have to install your project in your local maven repo before the plugin would be able to access it

    it should look like


    <plugin>
    <groupId>com.github.redfish4ktc.soapui</groupId>
    <artifactId>maven-soapui-extension-plugin</artifactId>
    <version>4.5.1.5</version>
    <dependencies>
    <dependency>
    <groupId>${project.groupId}</groupId>
    <artifactId>${project.artifactId}</artifactId>
    <version>${project.version}</version>
    </dependency>
    <dependency>
    ....
    </dependency>
    </dependencies>
    <configuration>
    ....
    </configuration>
    </plugin>
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi InterContinentalHotelsGroup,
    maven-soapui-extension-plugin now supports soapui 4.6.2 and 4.6.3, so you should be able to reproduce what you see with your "I have currently soapui-pro 4.6.2 installed"