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

Introduce WildFly module #128

Merged
merged 3 commits into from
Jan 10, 2020
Merged
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
10 changes: 10 additions & 0 deletions modules/wildfly/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ext.title = "MicroShed Testing Framework :: WildFly extensions"
description = "Extensions for using MicroShed Testing with WildFly servers"

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

apply from: publishScript

publishToMavenLocal.dependsOn ':microshed-testing-testcontainers:publishToMavenLocal'
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2020 Philip Riecks
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.testcontainers.containers.wildfly;

import org.microshed.testing.testcontainers.spi.ServerAdapter;
import org.testcontainers.images.builder.ImageFromDockerfile;

import java.io.File;
import java.util.Optional;

public class WildFlyAdapter implements ServerAdapter {

@Override
public int getPriority() {
return PRIORITY_RUNTIME_MODULE;
}

@Override
public int getDefaultHttpPort() {
return 8080;
}

@Override
public int getDefaultHttpsPort() {
return 8443;
}

@Override
public ImageFromDockerfile getDefaultImage(File appFile) {
String appName = appFile.getName();
// Compose a docker image equivalent to doing:
// FROM jboss/wildfly:18.0.1.Final
// ADD target/myservice.war /opt/jboss/wildfly/standalone/deployments
ImageFromDockerfile image = new ImageFromDockerfile()
.withDockerfileFromBuilder(builder -> builder.from("jboss/wildfly:18.0.1.Final")
.add(appName, "/opt/jboss/wildfly/standalone/deployments")
.build())
.withFileFromFile(appName, appFile);
return image;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.testcontainers.containers.wildfly.WildFlyAdapter
10 changes: 10 additions & 0 deletions modules/wildfly/src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
log4j.rootLogger=INFO, stdout

log4j.appender=org.apache.log4j.ConsoleAppender
log4j.appender.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%r %p %c %x - %m%n

log4j.logger.org.aguibert.liberty=DEBUG
3 changes: 0 additions & 3 deletions sample-apps/wildfly-app/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion sample-apps/wildfly-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
providedCompile 'javax:javaee-api:8.0.1'
providedCompile 'org.eclipse.microprofile:microprofile:2.1'
testCompile project(':microshed-testing-testcontainers')
testCompile project(':microshed-testing-wildfly')
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.29'
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2'
}
Expand Down