Skip to content

Commit

Permalink
COH-21564 - Create Tests for REST Examples using Rest Assured (ce-mai…
Browse files Browse the repository at this point in the history
…n -> ce-20.06 @80506)

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v20.06/": change = 80507]
  • Loading branch information
tmiddlet2666 committed Jul 24, 2020
1 parent 52e0315 commit 2005c03
Show file tree
Hide file tree
Showing 3 changed files with 429 additions and 12 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/test-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2020 Oracle Corporation and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.

# This workflow will build and test the examples

name: Build and Test Examples

on:
push:
branches: [ v20.06 ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build Coherence With Maven
shell: bash
env:
MAVEN_USER: ${{ secrets.MavenUser }}
MAVEN_PASSWORD: ${{ secrets.MavenPassword }}
run: |
export DEV_ROOT=$(pwd)
mvn --file prj/pom.xml --batch-mode -e -s .github/maven/synoki.xml -DskipTests clean install
- name: Test Examples
shell: bash
env:
MAVEN_USER: ${{ secrets.MavenUser }}
MAVEN_PASSWORD: ${{ secrets.MavenPassword }}
run: |
echo "Testing REST Example"
mvn -B --file examples/rest/pom.xml -s .github/maven/synoki.xml clean verify
93 changes: 81 additions & 12 deletions examples/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,23 @@
<inceptionYear>2020</inceptionYear>

<properties>
<coherence.version>20.06.1-SNAPSHOT</coherence.version>
<com.sun.xml.bind.version>2.3.0</com.sun.xml.bind.version>
<coherence.group.id>com.oracle.coherence.ce</coherence.group.id>
<coherence.version>20.12-SNAPSHOT</coherence.version>
<http.port>8080</http.port>
<http.address>0.0.0.0</http.address>
<javax.activation.version>1.2.0</javax.activation.version>

<!-- dependencies -->
<version.lib.bedrock>5.0.19</version.lib.bedrock>
<version.lib.javax.activation>1.2.0</version.lib.javax.activation>
<version.lib.jersey-hk2>2.29</version.lib.jersey-hk2>
<version.lib.junit>5.6.2</version.lib.junit>
<version.lib.hamcrest>2.2</version.lib.hamcrest>
<version.lib.mockito>2.23.4</version.lib.mockito>
<version.lib.rest-assured>4.3.0</version.lib.rest-assured>
<version.lib.xml-bind>2.3.0</version.lib.xml-bind>

<version.plugin.failsafe>2.22.2</version.plugin.failsafe>

<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
Expand All @@ -35,44 +47,88 @@

<dependencies>
<dependency>
<groupId>com.oracle.coherence.ce</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence</artifactId>
<version>${coherence.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.coherence.ce</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-rest</artifactId>
<version>${coherence.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.coherence.ce</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-http-netty</artifactId>
<version>${coherence.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.29</version>
<version>${version.lib.jersey-hk2}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${com.sun.xml.bind.version}</version>
<version>${version.lib.xml-bind}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${com.sun.xml.bind.version}</version>
<version>${version.lib.xml-bind}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${com.sun.xml.bind.version}</version>
<version>${version.lib.xml-bind}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>${javax.activation.version}</version>
<version>${version.lib.javax.activation}</version>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${version.lib.rest-assured}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${version.lib.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${version.lib.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${version.lib.hamcrest}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${version.lib.mockito}</version>
<scope>test</scope>
</dependency>

<!-- oracle bedrock -->
<dependency>
<groupId>com.oracle.bedrock.coherence</groupId>
<artifactId>coherence-12.2.1</artifactId>
<version>${version.lib.bedrock}</version>
</dependency>
<dependency>
<groupId>com.oracle.bedrock.coherence</groupId>
<artifactId>coherence-12.2.1-testing-support</artifactId>
<version>${version.lib.bedrock}</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -132,7 +188,6 @@
<argument>-Dcoherence.wka=127.0.0.1</argument>
<argument>-Dcoherence.management=all</argument>
<argument>-Dcoherence.clusterport=5555</argument>
<argument>-Dcoherence.management=all</argument>
<!-- change the following if you wish to change the listen
address or port of the HTTP server -->
<argument>-Dcoherence.examples.rest.port=${http.port}</argument>
Expand Down Expand Up @@ -172,6 +227,20 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.plugin.failsafe}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 2005c03

Please sign in to comment.