-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from rieckpil/wildfly-adapter-module
Introduce WildFly module
- Loading branch information
Showing
6 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
58 changes: 58 additions & 0 deletions
58
modules/wildfly/src/main/java/org/testcontainers/containers/wildfly/WildFlyAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...c/main/resources/META-INF/services/org.microshed.testing.testcontainers.spi.ServerAdapter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.testcontainers.containers.wildfly.WildFlyAdapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters