Forum Discussion
InterContinenta_1
12 years agoOccasional 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(){
}
}
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(){
}
}