Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

292-jakarta-ee #313

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A clear and concise description of what you expected to happen.

**System information:**
- OS: [e.g. Linux, Windows, Mac]
- Java Version: [e.g. 8, 11]
- Java Version: [e.g. 11, 17]
- MicroShed Testing Version: [e.g. 0.4.2]

**Additional context**
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/microshed-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
projects: >
maven-app
everything-app
everything-jakarta-app
jdbc-app
kafka-app
- category: LIBERTY/PAYARA
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If your Pull Request results in the failure of this build it will not be reviewe

##### Requirements

- JDK 8 or higher
- JDK 11 or higher
- Docker (daemon or desktop)
<!-- TODO support podman/colima for builds -->

Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ subprojects {
group = 'org.microshed'
version = currentVersion

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11
compileJava.options.encoding = 'UTF-8'

repositories {
Expand All @@ -41,7 +41,7 @@ subprojects {
task updateVersion {
doLast {
if (!project.hasProperty('nextVersion'))
throw new GradleException("Must define '-PnextVersion=X.Y.Z' when running this task")
throw GradleException("Must define '-PnextVersion=X.Y.Z' when running this task")
def isRelease = !nextVersion.endsWith('SNAPSHOT')

println 'Updating project version: ' + currentVersion + ' --> ' + nextVersion
Expand Down
17 changes: 10 additions & 7 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
ext.title = "MicroShed Testing Framework"
description = "A test framework for black-box testing MicroProfile and JavaEE applications"
description="A test framework for black-box testing MicroProfile and Java EE applications"

dependencies {
compile 'org.junit.jupiter:junit-jupiter-api:5.10.1'
implementation group: 'cglib', name: 'cglib-nodep', version: '3.3.0'
implementation group: 'org.apache.cxf', name: 'cxf-rt-rs-client', version: '3.4.1'
implementation group: 'org.apache.cxf', name: 'cxf-rt-rs-extension-providers', version: '3.4.1'
implementation group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.7.2'
implementation group: 'org.eclipse', name: 'yasson', version: '1.0.11'
implementation group: 'org.glassfish', name: 'javax.json', version: '1.1.4'

implementation 'org.eclipse:yasson:1.0.11'
implementation 'org.glassfish:javax.json:1.1.4'

implementation 'cglib:cglib-nodep:3.3.0'
implementation 'org.apache.cxf:cxf-rt-rs-client:3.6.2'
implementation 'org.apache.cxf:cxf-rt-rs-extension-providers:3.6.2'
implementation 'org.bitbucket.b_c:jose4j:0.7.2'

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
}

Expand Down
64 changes: 64 additions & 0 deletions core/jakarta/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// This is a mock project that takes the core artifact and transforms it to use the Jakarta EE namespace

ext.title = "MicroShed Testing Framework"
description="A test framework for black-box testing MicroProfile and Jakarta EE applications"

configurations {
transformer
parent {extendsFrom compile}
}

dependencies {
compile 'org.junit.jupiter:junit-jupiter-api:5.10.1'

implementation 'org.eclipse:yasson:2.0.4'
implementation 'org.eclipse.parsson:parsson:1.0.5'

implementation 'cglib:cglib-nodep:3.3.0'
implementation 'org.apache.cxf:cxf-rt-rs-client:4.0.3'
implementation 'org.apache.cxf:cxf-rt-rs-extension-providers:4.0.3'
implementation 'org.bitbucket.b_c:jose4j:0.7.2'

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'

transformer 'org.eclipse.transformer:org.eclipse.transformer.cli:0.5.0'

parent project(':microshed-testing-core')
}

ext.parent_jar = configurations.parent.find{
it.name.startsWith("microshed-testing-core")
}
ext.transformed_jar = new File(projectDir, 'build/tmp/transformed/' + parent_jar.getName().replace('core', 'core-jakarta'))

//Deletes previously transformed jar otherwise transformer will produce an error
task cleanupTransform() {
if(transformed_jar.exists()) {
transformed_jar.delete()
}
}

//Creates the transformed archive in the build/tmp/transformed/ directory
task transform(type: JavaExec) {
dependsOn cleanupTransform
classpath = configurations.transformer
main = 'org.eclipse.transformer.cli.JakartaTransformerCLI'
args parent_jar, transformed_jar
}

//Creates an empty jar file in the build/libs directory
//since there are no source files
jar.dependsOn transform

//Overwrites the empty jar with the transformed jar in the build/libs directory
task overwrite(type: Copy) {
from(transformed_jar)
into('build/libs')
}

jar.finalizedBy overwrite

apply from: publishScript

publishToMavenLocal.dependsOn ':microshed-testing-core:publishToMavenLocal'

6 changes: 3 additions & 3 deletions docs/features/SupportedRuntimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Maven Dependency:
Example Dockerfile:

```
FROM openliberty/open-liberty:full-java8-openj9-ubi
FROM open-liberty:full-java11-openj9
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/dropins
```
Expand All @@ -39,7 +39,7 @@ Maven Dependency:
Example Dockerfile:

```
FROM payara/micro:5.193
FROM payara/micro:5.2022.5-jdk11
CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
ADD build/libs/myservice.war /opt/payara/deployments
```
Expand All @@ -59,7 +59,7 @@ Maven Dependency:
Example Dockerfile:

```
FROM payara/server-full:5.193
FROM payara/server-full:5.2022.5-jdk11
ADD target/myservice.war /opt/payara/deployments
```

Expand Down
2 changes: 1 addition & 1 deletion docs/features/Walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class PersonService {
Now assume we also have simple Dockerfile in our repository that packages up our application into a container which gets used in production.

```
FROM openliberty/open-liberty:full-java8-openj9-ubi
FROM open-liberty:full-java11-openj9
COPY src/main/liberty/config /config/
ADD target/myservice.war /config/dropins
```
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ provide the default logic for building an application container. For example, th
automatically produce a testable container image roughly equivalent to the following Dockerfile:

```
FROM openliberty/open-liberty:full-java8-openj9-ubi
FROM open-liberty:full-java11-openj9
COPY src/main/liberty/config /config/
ADD target/$APP_FILE /config/dropins
```
Expand Down
1 change: 1 addition & 0 deletions modules/liberty/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description = "Extensions for using MicroShed Testing with Liberty servers"

dependencies {
compile project(':microshed-testing-testcontainers')
compileOnly project(':microshed-testing-core')
}

apply from: publishScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public ImageFromDockerfile getDefaultImage(File appFile) {
final File configDir = new File("src/main/liberty/config");
final boolean configDirExists = configDir.exists() && configDir.canRead();
// Compose a docker image equivalent to doing:
// FROM openliberty/open-liberty:full-java8-openj9-ubi
// FROM FROM open-liberty:full-java11-openj9
// COPY src/main/liberty/config /config/
// RUN configure.sh
// ADD build/libs/<appFile> /config/dropins
Expand Down
1 change: 1 addition & 0 deletions modules/payara-micro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description = "Extensions for using MicroShed Testing with Payara Micro servers"

dependencies {
compile project(':microshed-testing-testcontainers')
compileOnly project(':microshed-testing-core')
}

apply from: publishScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public int getDefaultHttpsPort() {
public ImageFromDockerfile getDefaultImage(File appFile) {
String appName = appFile.getName();
// Compose a docker image equivalent to doing:
// FROM payara/micro:5.193
// FROM payara/micro:5.2022.5-jdk11
// CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
// ADD target/myservice.war /opt/payara/deployments/
ImageFromDockerfile image = new ImageFromDockerfile()
.withDockerfileFromBuilder(builder -> builder.from("payara/micro:5.193")
.withDockerfileFromBuilder(builder -> builder.from("payara/micro:5.2022.5-jdk11")
.cmd("--deploymentDir", "/opt/payara/deployments/", "--noCluster")
.add(appName, "/opt/payara/deployments/")
.build())
Expand Down
1 change: 1 addition & 0 deletions modules/payara-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description = "Extensions for using MicroShed Testing with Payara servers"

dependencies {
compile project(':microshed-testing-testcontainers')
compileOnly project(':microshed-testing-core')
}

apply from: publishScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public int getDefaultHttpsPort() {
public ImageFromDockerfile getDefaultImage(File appFile) {
String appName = appFile.getName();
// Compose a docker image equivalent to doing:
// FROM payara/server-full:5.193
// FROM payara/server-full:5.2022.5-jdk11
// ADD target/myservice.war /opt/payara/deployments/
ImageFromDockerfile image = new ImageFromDockerfile()
.withDockerfileFromBuilder(builder -> builder.from("payara/server-full:5.193")
.withDockerfileFromBuilder(builder -> builder.from("payara/server-full:5.2022.5-jdk11")
.add(appName, "/opt/payara/deployments/")
.build())
.withFileFromFile(appName, appFile);
Expand Down
1 change: 1 addition & 0 deletions modules/quarkus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description = "Extensions for using MicroShed Testing with Quarkus"

dependencies {
compile project(':microshed-testing-testcontainers')
compileOnly project(':microshed-testing-core')
compileOnly 'io.quarkus:quarkus-junit5:1.8.3.Final'
}

Expand Down
3 changes: 2 additions & 1 deletion modules/testcontainers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ sourceSets {
}

dependencies {
compile project(':microshed-testing-core')
compile 'org.testcontainers:junit-jupiter:1.19.1'
compileOnly project(':microshed-testing-core')
testCompile 'org.eclipse.microprofile.rest.client:microprofile-rest-client-api:1.4.1'
testCompile 'org.slf4j:slf4j-log4j12:1.7.36'
testCompile 'org.testcontainers:mockserver:1.19.1'
testCompile project(':microshed-testing-core')
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM openliberty/open-liberty:full-java8-openj9-ubi
FROM open-liberty:full-java11-openj9
2 changes: 1 addition & 1 deletion modules/testcontainers/src/test/resources/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM openliberty/open-liberty:full-java8-openj9-ubi
FROM open-liberty:full-java11-openj9
1 change: 1 addition & 0 deletions modules/wildfly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description = "Extensions for using MicroShed Testing with WildFly servers"

dependencies {
compile project(':microshed-testing-testcontainers')
compileOnly project(':microshed-testing-core')
}

apply from: publishScript
Expand Down
7 changes: 0 additions & 7 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ publishing {
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'aguibert'
name = 'Andy Guibert'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:ssh://[email protected]/MicroShed/microshed-testing.git'
developerConnection = 'scm:git:ssh://[email protected]/MicroShed/microshed-testing.git'
Expand Down
4 changes: 2 additions & 2 deletions sample-apps/everything-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openliberty/open-liberty:full-java8-openj9-ubi
FROM open-liberty:full-java11-openj9
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/dropins/

Expand All @@ -7,7 +7,7 @@ ADD build/libs/myservice.war /config/dropins/
#ADD build/libs/myservice.war /opt/jboss/wildfly/standalone/deployments/

# Payara
#FROM payara/micro:5.193
#FROM payara/micro5.2022.5-jdk11
#CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
#ADD build/libs/myservice.war /opt/payara/deployments

Expand Down
1 change: 1 addition & 0 deletions sample-apps/everything-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
providedCompile 'org.eclipse.microprofile:microprofile:2.1'
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.11.2'
testCompile project(':microshed-testing-testcontainers')
testCompile project(':microshed-testing-core')
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.36'
testCompile 'org.testcontainers:mockserver:1.19.1'
testCompile 'org.mock-server:mockserver-client-java:5.5.4'
Expand Down
16 changes: 16 additions & 0 deletions sample-apps/everything-jakarta-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM open-liberty:full-java11-openj9
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/dropins/

# Wildfly
#FROM jboss/wildfly
#ADD build/libs/myservice.war /opt/jboss/wildfly/standalone/deployments/

# Payara
#FROM payara/micro:5.2022.5-jdk11
#CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
#ADD build/libs/myservice.war /opt/payara/deployments

# TomEE (not working yet)
#FROM tomee:8-jre-8.0.0-M2-microprofile
#COPY build/libs/myservice.war /usr/local/tomee/webapps/
29 changes: 29 additions & 0 deletions sample-apps/everything-jakarta-app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins {
id 'war'
}

dependencies {
//TODO update to Jakarta EE 10 once compiling/testing with JDK 17
providedCompile 'jakarta.platform:jakarta.jakartaee-api:9.0.0'
//TODO update to 6.1 once using Jakarta EE 10
providedCompile 'org.eclipse.microprofile:microprofile:5.0'

compile 'org.mongodb:mongo-java-driver:3.11.2'

testCompile project(':microshed-testing-testcontainers')
testCompile project(':microshed-testing-core-jakarta')

testCompile 'org.slf4j:slf4j-log4j12:1.7.36'
testCompile 'org.testcontainers:mockserver:1.19.1'
testCompile 'org.mock-server:mockserver-client-java:5.5.4'
testCompile 'io.rest-assured:rest-assured:5.3.2'

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
}

war.archiveName 'myservice.war'
test.dependsOn 'war'

// Always re-run tests on every build for the sake of this sample
// In a real project, this setting would not be desirable
test.outputs.upToDateWhen { false }
Loading
Loading