Skip to content

Commit

Permalink
Merge pull request #128 from rieckpil/wildfly-adapter-module
Browse files Browse the repository at this point in the history
Introduce WildFly module
  • Loading branch information
aguibert committed Jan 10, 2020
2 parents 4028c7a + 745d59f commit 4d5dc4c
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 4 deletions.
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

0 comments on commit 4d5dc4c

Please sign in to comment.