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

Commit

Permalink
add dev mode IT
Browse files Browse the repository at this point in the history
  • Loading branch information
awisniew90 committed Sep 27, 2019
1 parent 1b616d3 commit b00eac7
Show file tree
Hide file tree
Showing 9 changed files with 822 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?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>
</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>
</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>

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

0 comments on commit b00eac7

Please sign in to comment.