Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

add dev mode IT #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions boost-maven/boost-maven-plugin/src/it/test-liberty-dev-mode/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?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>io.openliberty.tools.it</groupId>
<artifactId>test-liberty-dev-mode</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.0.1</version>
</dependency>
Comment on lines +24 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really have LMP as a dependency? That seems surprising.. Is the version meaningful (e.g used to run the child POM in the test) or is this just like a "recent-enough version to compile against"?

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkMode>once</forkMode>
<forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
<argLine>-enableassertions</argLine>
<workingDirectory>${project.build.directory}</workingDirectory>
<includes>
<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<mavenPluginVersion>@pom.version@</mavenPluginVersion>
<runtimeVersion>${runtimeVersion}</runtimeVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this runtimeVersion value coming from? (Our ITs are mostly not parameterized w/ runtime version)

</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>install</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if it's probably easier to leave these in though you'd think we'll only use 'ol'

<profile>
<id>ol</id>
<activation>
<property>
<name>boostRuntime</name>
<value>ol</value>
</property>
</activation>
</profile>
<profile>
<id>wlp</id>
<activation>
<property>
<name>boostRuntime</name>
<value>wlp</value>
</property>
</activation>
</profile>
<profile>
<id>tomee</id>
<activation>
<property>
<name>boostRuntime</name>
<value>tomee</value>
</property>
</activation>
<properties>
<skipITs>true</skipITs>
</properties>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.demo;

import javax.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.health.Health;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;

@Health
@ApplicationScoped
public class SystemHealth implements HealthCheck {
@Override
public HealthCheckResponse call() {
if (!System.getProperty("wlp.server.name").startsWith("defaultServer")) {
return HealthCheckResponse.named(HelloWorld.class.getSimpleName())
.withData("default server", "not available").down().build();
}
return HealthCheckResponse.named(HelloWorld.class.getSimpleName()).withData("default server", "available").up()
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?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>boost.it</groupId>
<artifactId>dev-sample-proj</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<boost_http_port>9000</boost_http_port>
</properties>

<pluginRepositories>
<!-- Configure Sonatype OSS Maven snapshots repository -->
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.microshed.boost.boms</groupId>
<artifactId>mp14-bom</artifactId>
<version>RUNTIME_VERSION</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that @pom.version@ thing doesn't work here? (I still haven't found the doc for that mechanism)

<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Boosters -->
<dependency>
<groupId>org.microshed.boost.runtimes</groupId>
<artifactId>openliberty</artifactId>
</dependency>
<dependency>
<groupId>org.microshed.boost.boosters</groupId>
<artifactId>jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.microshed.boost.boosters</groupId>
<artifactId>jsonp</artifactId>
</dependency>
<dependency>
<groupId>org.microshed.boost.boosters</groupId>
<artifactId>cdi</artifactId>
</dependency>
<dependency>
<groupId>org.microshed.boost.boosters</groupId>
<artifactId>mp-config</artifactId>
</dependency>
<dependency>
<groupId>org.microshed.boost.boosters</groupId>
<artifactId>mp-rest-client</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.microshed.boost.boosters</groupId>
<artifactId>mp-health</artifactId>
</dependency> -->
<!-- For tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>3.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>pom.xml</packagingExcludes>
</configuration>
</plugin>
<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<phase>test</phase>
<id>default-test</id>
<configuration>
<excludes>
<exclude>**/it/**</exclude>
</excludes>
<reportsDirectory>${project.build.directory}/test-reports/unit</reportsDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Enable Boost plugin -->
<plugin>
<groupId>org.microshed.boost</groupId>
<artifactId>boost-maven-plugin</artifactId>
<version>RUNTIME_VERSION</version>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<phase>integration-test</phase>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<includes>
<include>**/it/**/*.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>verify-results</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<summaryFile>${project.build.directory}/test-reports/it/failsafe-summary.xml</summaryFile>
<reportsDirectory>${project.build.directory}/test-reports/it</reportsDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.demo;

public class HelloWorld {

public String helloWorld() {
return "helloWorld";
}
}
Loading