Test on Vaadin with testbench - java

I Trying to test my app with vaadin testbench but when I try to run my test with
mvn clean verify he don`t start my server to execute the tests, I using this sample: https://vaadin.com/docs/-/part/testbench/testBench-tutorial.html and this is my pom.xml
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.lumera</groupId>
<artifactId>integra</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>integra</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<properties>
<vaadin.version>7.7.0</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<vaadin.testbench.version>4.1.0.alpha2</vaadin.testbench.version>
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customisations, this can also be "fetch" or
"cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.0.19.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.19.Final</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench-api</artifactId>
<version>${vaadin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>ckeditor-wrapper-for-vaadin</artifactId>
<version>7.10.9</version>
</dependency>
<dependency>
<groupId>org.vaadin.addon</groupId>
<artifactId>easyuploads</artifactId>
<version>7.4.6</version>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-grid-util</artifactId>
<version>1.0.8</version>
</dependency>
<dependency>
<groupId>de.steinwedel.vaadin.addon</groupId>
<artifactId>messagebox</artifactId>
<version>3.0.17</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-testbench</artifactId>
<version>4.1.0.alpha2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>vaadin-combobox-multiselect</artifactId>
<version>1.1.11</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>
But I have noted that when start my server before run tests, my test pass, but after run the tests he tried to start my server
I Put the original start/stop jetty
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
but don`t work.

I don't see any Jetty configuration described in the "Start the Server Automatically" section of the linked document. The start and stop goals which are there tied to the pre-integration-test/post-integration-test phase will take care of starting the server before integration tests are run and stopping it afterwards.
Finally you need to ensure that your test is run in the integration test phase and not in the unit test phase. If they are run in the unit test phase, the pre-integration-test phase has not yet been executed and the server has not been started. Name your test SomethingIT.java (not SomethingTest.java) to ensure that it is run in the integration test phase.

Related

Maven WebObjects, Wonder, maven build does not include framework resources (images etc)

I have worked with WebObjects for quite some time. I decided to move to a maven build and for some reason my associated frameworks resources are not being found in /Contents/Frameworks in the built product. So when I run the D2W application I am getting no Image files, stylesheets or any web files that are part of the frameworks.
The application appears to compile fine. but when run the application, resources from the frameworks are not being found. I found the referenced frameworks under Contents/Frameworks. I did attempt to use WOFrameworkBaseURL to point to /WebObjects/myappname/Frameworks and that did not solve the issue.
Here is my POM.XML
<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.mozaic</groupId>
<artifactId>mozaicv2</artifactId>
<packaging>woapplication</packaging>
<version>1.0-SNAPSHOT</version>
<name>mozaicv2 WebObjects Application</name>
<url>http://maven.apache.org</url>
<properties>
<!-- properties used for filtering and dependency management -->
<jvmtarget>1.6</jvmtarget>
<mainclass>com.nttdata.mozaicv2.application.Application</mainclass>
<webobjects.groupId>com.webobjects</webobjects.groupId>
<webobjects.version>5.4.3</webobjects.version>
<wonder.core.groupId>wonder.core</wonder.core.groupId>
<wonder.version>7.1</wonder.version>
<wonder.classifier>wo54</wonder.classifier>
</properties>
<repositories>
<!--
<repository>
<id>wocommunity</id>
<name>WOCommunity Maven 2 Releases Repository</name>
<url>http://maven.wocommunity.org/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
-->
<repository>
<id>wonder</id>
<name>WOCommunity Maven 2 Releases Repository</name>
<url>https://mvnrepository.com/artifact</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>wocommunity</id>
<name>WOCommunity Maven 2 Releases Repository</name>
<url>http://maven.wocommunity.org/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>${project.artifactId}</finalName>
<!--
<resources>
<resource>
<targetPath>Resources</targetPath>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<targetPath>Resources</targetPath>
<directory>${basedir}/src/main/components</directory>
</resource>
<resource>
<targetPath>WebServerResources</targetPath>
<directory>${basedir}/src/main/webserver-resources</directory>
</resource>
</resources>
-->
<plugins>
<plugin>
<groupId>org.objectstyle.woproject.maven2</groupId>
<artifactId>maven-wolifecycle-plugin</artifactId>
<version>2.0.17</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${jvmtarget}</source>
<target>${jvmtarget}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archiveClasses>true</archiveClasses>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>wonder.ajax</groupId>
<artifactId>Ajax</artifactId>
<version>7.1</version>
</dependency>
<dependency>
<groupId>wonder.eof</groupId>
<artifactId>ERAttributeExtension</artifactId>
<version>7.1</version>
</dependency>
<dependency>
<groupId>wonder.ajax</groupId>
<artifactId>ERCoolComponents</artifactId>
<version>7.1</version>
</dependency>
<dependency>
<groupId>wonder.core</groupId>
<artifactId>ERDirectToWeb</artifactId>
<version>7.1</version>
</dependency>
<dependency>
<groupId>${wonder.core.groupId}</groupId>
<artifactId>ERExtensions</artifactId>
<version>${wonder.version}</version>
</dependency>
<dependency>
<groupId>wonder.d2w</groupId>
<artifactId>ERModernDefaultSkin</artifactId>
<version>${wonder.version}</version>
</dependency>
<dependency>
<groupId>wonder.d2w</groupId>
<artifactId>ERModernDirectToWeb</artifactId>
<version>${wonder.version}</version>
</dependency>
<dependency>
<groupId>wonder.d2w</groupId>
<artifactId>ERModernLook</artifactId>
<version>7.1</version>
</dependency>
<dependency>
<groupId>${wonder.core.groupId}</groupId>
<artifactId>ERPrototypes</artifactId>
<version>${wonder.version}</version>
</dependency>
<!--webobjects-->
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaDirectToWeb</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaDTWGeneration</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaEOAccess</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaEOControl</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaEOProject</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaFoundation</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaJDBCAdaptor</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaWebObjects</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaWOExtensions</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaXML</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>wonder.misc</groupId>
<artifactId>WOLips</artifactId>
<version>${wonder.version}</version>
</dependency>
<dependency>
<groupId>${webobjects.groupId}</groupId>
<artifactId>JavaWOJSPServlet</artifactId>
<version>${webobjects.version}</version>
</dependency>
<dependency>
<groupId>${wonder.core.groupId}</groupId>
<artifactId>WOOgnl</artifactId>
<version>${wonder.version}</version>
</dependency>
<dependency>
<groupId>${wonder.core.groupId}</groupId>
<artifactId>ERServlet</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>```
Please help.
Thanks in advance.
This is where I would start:
<plugin>
<groupId>org.objectstyle.woproject.maven2</groupId>
<artifactId>maven-wolifecycle-plugin</artifactId>
<version>2.0.17</version>
<extensions>true</extensions>
</plugin>
That is quite an old version of the WOLifecycle Maven Plugin. Replace it with this:
<plugin>
<groupId>org.wocommunity</groupId>
<artifactId>wolifecycle-maven-plugin</artifactId>
<version>2.3</version>
<extensions>true</extensions>
</plugin>
If your issue persists, we can investigate further. As an aside, while I am happy to answer questions here on StackOverflow, there's probably a marginally larger community over on the WebObjects Development mailing list.

How to run feature files in parallel

I am trying to run my cucumber tests in parallel. At the moment they run sequentially and it takes an insane amount of time to run all the tests.
This is my current 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Salesforce</groupId>
<artifactId>Salesforce</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>Cucumber</module>
</modules>
<properties>
<maven.repo.url.releases>http://maven-repo2.iggroup.local:8081/nexus/content/repositories/ig.release
</maven.repo.url.releases>
<maven.repo.url.snapshots>http://maven-repo2.iggroup.local:8081/nexus/content/repositories/ig.snapshot
</maven.repo.url.snapshots>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cucumber.version>4.2.6</cucumber.version>
<junit.version>4.12</junit.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.mail/javax.mail -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>com.googlecode.java-diff-utils</groupId>
<artifactId>diffutils</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.selenium</groupId>
<artifactId>driver-binary-downloader-maven-plugin</artifactId>
<version>1.0.17</version>
<configuration>
<!-- root directory that downloaded driver binaries will be stored in -->
<rootStandaloneServerDirectory>./target/webdrivers</rootStandaloneServerDirectory>
<!-- Where you want to store downloaded zip files -->
<downloadedZipFileDirectory>./target/webdrivers</downloadedZipFileDirectory>
<!-- Location of a custom repository map -->
<customRepositoryMap>${project.basedir}/CustomRepositoryMap.xml</customRepositoryMap>
<!-- This will ensure that the plugin only downloads binaries for the current OS, this will override anything specified in the <operatingSystems> configuration -->
<onlyGetDriversForHostOperatingSystem>false</onlyGetDriversForHostOperatingSystem>
<!-- If set to false will download every version available (Other filters will be taken into account -->
<onlyGetLatestVersions>false</onlyGetLatestVersions>
<!-- Operating systems you want to download binaries for (Only valid options are: windows, linux, osx) -->
<operatingSystems>
<windows>false</windows>
<linux>true</linux>
<mac>false</mac>
</operatingSystems>
<!-- Provide a list of drivers and binary versions to download (this is a map so only one version can be specified per driver) -->
<getSpecificExecutableVersions>
<googlechrome>LATEST</googlechrome>
</getSpecificExecutableVersions>
<!-- Download 32bit binaries -->
<!--<thirtyTwoBitBinaries>false</thirtyTwoBitBinaries>-->
<!-- Download 64bit binaries -->
<!--<sixtyFourBitBinaries>true</sixtyFourBitBinaries>-->
</configuration>
<executions>
<execution>
<id>driverdownload</id>
<goals>
<goal>selenium</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- FOR PARALLELISM: -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<!-- UNCOMMENT - To add any exclusions if required -->
<!-- <excludes> <exclude>**/*IT*.java</exclude> </excludes> -->
<includes>
<!-- UNCOMMENT BELOW LINE - To execute feature files with a single
runner -->
<include>**/Default.java</include>
<!-- UNCOMMENT BELOW LINE - To execute feature files with multiple
runners -->
<!-- <include>**/*Runner.java</include> -->
</includes>
<!-- UNCOMMENT BELOW 3 LINES - To execute using parallel or combination
option -->
<parallel>methods</parallel>
<threadCount>2</threadCount>
<perCoreThreadCount>true</perCoreThreadCount>
<!-- UNCOMMENT BELOW 3 LINES - To execute using forking or combination
option -->
<!-- <forkCount>2</forkCount>
<reuseForks>true</reuseForks>
<reportsDirectory>${project.build.directory}/failsafe-reports_${surefire.forkNumber}</reportsDirectory> -->
</configuration>
</execution>
</executions>
</plugin>
<!-- Used for reporting the output: -->
<!-- <plugin>-->
<!-- <groupId>com.trivago.rta</groupId>-->
<!-- <artifactId>cluecumber-report-plugin</artifactId>-->
<!-- <version>1.7.2</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>report</id>-->
<!-- <phase>post-integration-test</phase>-->
<!-- <goals>-->
<!-- <goal>reporting</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- <configuration>-->
<!-- <sourceJsonReportDirectory>${project.build.directory}/json-cucumber-reports</sourceJsonReportDirectory>-->
<!-- <generatedHtmlReportDirectory>${project.build.directory}/generated-report</generatedHtmlReportDirectory>-->
<!-- <expandStepHooks>true</expandStepHooks>-->
<!-- </configuration>-->
<!-- </plugin>-->
</plugins>
<testSourceDirectory>src/test/java/runner</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test/resources/UAT_Regression
</directory>
</testResource>
</testResources>
</build>
<repositories>
<!-- Sonatype OSS -->
<repository>
<id>sonatype</id>
<name>Day CQ5 Repository (OSGI)</name>
<url>http://maven-repo2.iggroup.local:8081/nexus/content/repositories/sonatype-oss</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!-- Central mirror -->
<repository>
<id>central</id>
<name>Day CQ5 Repository (OSGI)</name>
<url>http://maven-repo2.iggroup.local:8081/nexus/content/repositories/central</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>atlassian-repo</id>
<name>Day CQ5 Repository (OSGI)</name>
<url>http://maven-repo2.iggroup.local:8081/nexus/content/repositories/atlassian.public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<id>central</id>
<url>http://maven-repo2.iggroup.local:8081/nexus/content/repositories/central</url>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<distributionManagement>
<repository>
<id>ig.releases</id>
<name>ig-repository</name>
<url>${maven.repo.url.releases}</url>
</repository>
<snapshotRepository>
<id>ig.snapshots</id>
<name>ig-repository</name>
<url>${maven.repo.url.snapshots}</url>
</snapshotRepository>
</distributionManagement>
</project>
And my project directory pretty much contains: src/main/java/com/automation/cucumber and this directory contains 2 folders; Steps (contains the step definitions) and utils (Helper methods).
And under src/main/test/resources/UAT_Regression I have my .feature files in here.
My runner class is located under:
src/test/java/runner/runner/RunCucumberIT.java
The above pom was coded to reflect what was in this repository as this had an example of cucumber tests running in parallel.
But when I try and run my runner class, it just pretty much runs them sequentially as opposed to parralelly so not sure why. Can anyone point out my mistake?
I am using WebDriver in my tests.

Spring PetClinic application showing error in pom.xml

I have imported the Spring PetClinic application but it is showing error in pom.xml. I have force updated Maven but still the problem persists. The error is as follows:-
Failed to execute goal on project spring-petclinic: Could not resolve dependencies
for project org.springframework.samples:spring-petclinic:jar:2.1.0.BUILD-SNAPSHOT:
Failed to collect dependencies at org.springframework.boot:spring-boot-starter-thymeleaf:jar:2.1.0.BUILD-SNAPSHOT
-> org.thymeleaf:thymeleaf-spring5:jar:3.0.10.RELEASE (ro.isdc.wro4j:wro4j-
maven-plugin:1.8.0:run:default:generate-resources)
The pom.xml is given below. The error is shown in the execution tag under groupId ro.isdc.wro4j.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
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>org.springframework.samples</groupId>
<artifactId>spring-petclinic</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
</parent>
<name>petclinic</name>
<properties>
<!-- Generic properties -->
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Web dependencies -->
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
<webjars-jquery.version>2.2.4</webjars-jquery.version>
<wro4j.version>1.8.0</wro4j.version>
<jacoco.version>0.8.2</jacoco.version>
</properties>
<dependencies>
<!-- Spring and Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Databases - Uses HSQL by default -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${webjars-jquery.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-ui</artifactId>
<version>${webjars-jquery-ui.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</dependency>
<!-- end of webjars -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information
if a META-INF/build-info.properties file is present -->
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>${project.build.sourceEncoding}</encoding.source>
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
<java.source>${maven.compiler.source}</java.source>
<java.target>${maven.compiler.target}</java.target>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Spring Boot Actuator displays build-related information if a git.properties
file is present at the classpath -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j.version}</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<cssDestinationFolder>${project.build.directory}/classes/static/resources/css</cssDestinationFolder>
<wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
<extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
<contextFolder>${basedir}/src/main/less</contextFolder>
</configuration>
<dependencies>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
In case, someone is facing issue with wro4j for PetClinic application.
Change wro4j version to 1.9.0, it works for openjdk version "11.0.3" 2019-04-16
<wro4j.version>1.9.0</wro4j.version>
You are using a wrong version in you Spring-boot parent dependency. You should use 2.0.6-RELEASE, or any other RELEASE version.
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<type>pom</type>
</dependency>
Hope it helps!
Which Java-Version do you use?
When building Spring petclinic on Java 9 or higher, problems with wroj have been reported https://github.com/wro4j/wro4j/pull/1041 .
These problems are solved in the code of wroj after version 1.8.0 https://github.com/wro4j/wro4j , but no version with this solution has been released https://github.com/wro4j/wro4j/branches .
So you have to build wroj version 1.8.1-SNAPSHOT yourself and use this version to build petclinic framework-version on Java 9 or higher.
We can fix this issue by simply run the below command from terminal/command prompt:
mvn spring-javaformat:apply

Unable to deploy heroku using jetty

I have a working app that runs locally. I have followed the instructions for running a heroku using jetty. When I run heroku create no errors. But when I do heroku create it gives me an application error. An important detail might be that the port i'm using is 8787, i'm not sure if thats relevant.
My pom.xml
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>org.test</groupId>
<artifactId>vaadin-app</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>vaadin-app</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<properties>
<vaadin.version>8.1.5</vaadin.version>
<vaadin.plugin.version>8.1.5</vaadin.plugin.version>
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customizations, this can also be "fetch" or "cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>9.3.3.v20150827</version>
<destFileName>jetty-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<stopPort>9999</stopPort>
<stopKey>foo</stopKey>
<stopWait>10</stopWait>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
This is my procfile
web: java $JAVA_OPTS -jar target/dependgit ency/jetty-runner.jar --port $PORT target/*.war
The only error I get is that its unable to access jarfile target/dependgit
My heroku logs
Here

Why tests sometimes build failed (maven-surefire-plugin)?

In Netbeans i wrote my projects using selenium. Sometimes projects build ok, sometimes build falied. I think, the problem is in maven-sunfire-plugins. But why from 48 builds only 3-4 is failed?
In jenkins console I see:
org.apache.maven.surefire.util.SurefireReflectionException:
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
POM file
<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>pl.com.mycompany.test</groupId>
<artifactId>selenium-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>selenium-test</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>central</id>
<url>http://maven-repo.myportal.pl:3080/artifactory/repo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://maven-repo.myportal.pl:3080/artifactory/repo</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>internal</id>
<name>Archiva Managed Internal Repository</name>
<url>http://maven-repo.myportal.pl:3080/archiva/repository/internal</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>selenium-test</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<compilerVersion>1.6</compilerVersion>
<source>1.6</source>
<target>1.6</target>
<!--<encoding>Cp1250</encoding> -->
<encoding>UTF-8</encoding>
<!--<encoding>ISO-8859-2</encoding> -->
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- Selenium -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.43.1</version>
</dependency>
<dependency>
<groupId>pl.com.mycompany.selenium.util</groupId>
<artifactId>selenium-listener</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>pl.com.mycompany.portal</groupId>
<artifactId>commons-portal</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>weblogic</groupId>
<artifactId>weblogic</artifactId>
<version>8.0</version>
</dependency>
<!-- TESTS -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- -->
<profiles>
<profile>
<id>2db</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
<properties>
<property>
<name>listener</name>
<value>pl.com.mycompany.selenium.util.TestNgRunSuiteListener</value>
</property>
</properties>
<systemProperties>
<property>
<name>job_name</name>
<value>${project.artifactId}</value>
</property>
</systemProperties>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Oddest is it a lot of builds its okey. From 48 builds only 3 throw this and I don't understand why.
Where is error?

Categories