Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- Deprecated `WaitStrategy` and implementations in favour of classes with same names in `org.testcontainers.containers.strategy` ([\#600](https://github.com/testcontainers/testcontainers-java/pull/600))
- Added `ContainerState` interface representing the state of a started container ([\#600](https://github.com/testcontainers/testcontainers-java/pull/600))
- Added `WaitStrategyTarget` interface which is the target of the new `WaitStrategy` ([\#600](https://github.com/testcontainers/testcontainers-java/pull/600))
- *Breaking:* Removed hard-coded `wnameless` Oracle database image name. Users should instead place a file on the classpath named `testcontainers.properties` containing `oracle.container.image=IMAGE`, where IMAGE is a suitable image name and tag/SHA hash. For information, the approach recommended by Oracle for creating an Oracle XE docker image is described [here](https://blogs.oracle.com/oraclewebcentersuite/implement-oracle-database-xe-as-docker-containers).
- Added `DockerHealthcheckWaitStrategy` that is based on Docker's built-in [healthcheck](https://docs.docker.com/engine/reference/builder/#healthcheck) ([\#618](https://github.com/testcontainers/testcontainers-java/pull/618)).

## [1.6.0] - 2018-01-28
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oracle.container.image=wnameless/oracle-xe-11g@sha256:15ff9ef50b4f90613c9780b589c57d98a8a9d496decec854316d96396ec5c085
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this module has Oracle module as a dependency where the property is already set. Doesn't it work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no; both of these modules have the properties file in src/test/resources, so that bit of the classpath isn't shared.

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@
public class OracleContainer extends JdbcDatabaseContainer {

public static final String NAME = "oracle";
public static final String IMAGE = TestcontainersConfiguration.getInstance()
.getProperties().getProperty("oracle.container.image","wnameless/oracle-xe-11g");

private static final int ORACLE_PORT = 1521;
private static final int APEX_HTTP_PORT = 8080;

private static String resolveImageName() {
String image = TestcontainersConfiguration.getInstance()
.getProperties().getProperty("oracle.container.image");

if (image == null) {
throw new IllegalStateException("An image to use for Oracle containers must be configured. " +
"To do this, please place a file on the classpath named `testcontainers.properties`, " +
"containing `oracle.container.image=IMAGE`, where IMAGE is a suitable image name and tag.");
}
return image;
}

public OracleContainer() {
super(IMAGE + "@sha256:15ff9ef50b4f90613c9780b589c57d98a8a9d496decec854316d96396ec5c085");
super(resolveImageName());
}

public OracleContainer(String dockerImageName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public boolean supports(String databaseType) {

@Override
public JdbcDatabaseContainer newInstance(String tag) {
return new OracleContainer(OracleContainer.IMAGE + ":" + tag);

if (!tag.equalsIgnoreCase("latest")) {
throw new UnsupportedOperationException("Oracle database tag should be set in the configured image name");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a PITA to support setting the tag via the JDBC URL, and it wasn't usable previously anyway. This could be improved, but perhaps only if there is demand.

}

return new OracleContainer();
}
}
29 changes: 29 additions & 0 deletions modules/oracle-xe/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
</encoder>
</appender>

<root level="debug">
<appender-ref ref="STDOUT"/>
</root>

<logger name="org.apache.http" level="WARN"/>
<logger name="com.github.dockerjava" level="WARN"/>
<logger name="org.zeroturnaround.exec" level="WARN"/>
<logger name="com.zaxxer.hikari" level="INFO"/>
<logger name="org.rnorth.tcpunixsocketproxy" level="INFO" />
<logger name="io.netty" level="WARN" />
<logger name="org.mongodb" level="INFO" />
<logger name="org.testcontainers.shaded" level="WARN"/>
<logger name="com.zaxxer.hikari" level="INFO"/>

<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>PROFILER</Marker>
<OnMatch>DENY</OnMatch>
</turboFilter>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oracle.container.image=wnameless/oracle-xe-11g@sha256:15ff9ef50b4f90613c9780b589c57d98a8a9d496decec854316d96396ec5c085