Skip to content
This repository has been archived by the owner on Sep 21, 2018. It is now read-only.

Commit

Permalink
Prep 1.6.0 release (#11)
Browse files Browse the repository at this point in the history
* Bump POMs and Changelogs for 1.6.0 release

* Disable `useSSL` query param for Oracle/SQL Server modules
Temporary fix for testcontainers/testcontainers-java#568
  • Loading branch information
rnorth committed Jan 30, 2018
1 parent a191e1b commit 995dc7a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.6.0] - 2018-01-30
### Changes
- implement self-typing for better fluent builders. ([\#9](https://github.com/testcontainers/testcontainers-java-module-oracle-xe/pull/9))
- Updated to depend upon with Testcontainers core library v1.6.0

## [1.5.1] - 2017-12-19
### Changes
- Updated to depend upon with Testcontainers core library v1.5.1
Expand All @@ -17,6 +22,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Initial release following extraction from testcontainers-java repo

[1.6.0]: https://github.com/testcontainers/testcontainers-java-module-oracle-xe/releases/tag/1.6.0
[1.5.1]: https://github.com/testcontainers/testcontainers-java-module-oracle-xe/releases/tag/1.5.1
[1.5.0]: https://github.com/testcontainers/testcontainers-java-module-oracle-xe/releases/tag/1.5.0
[1.4.3]: https://github.com/testcontainers/testcontainers-java-module-oracle-xe/releases/tag/1.4.3
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>testcontainers-parent</artifactId>
<groupId>org.testcontainers</groupId>
<version>1.5.1</version><!-- TESTCONTAINERS RELEASE VERSION -->
<version>1.6.0</version><!-- TESTCONTAINERS RELEASE VERSION -->
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
32 changes: 31 additions & 1 deletion src/main/java/org/testcontainers/containers/OracleContainer.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
package org.testcontainers.containers;

import org.rnorth.ducttape.ratelimits.RateLimiter;
import org.rnorth.ducttape.ratelimits.RateLimiterBuilder;
import org.rnorth.ducttape.unreliables.Unreliables;
import org.testcontainers.utility.TestcontainersConfiguration;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.SQLException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

/**
* @author gusohal
*/
Expand All @@ -13,6 +22,11 @@ public class OracleContainer<SELF extends JdbcDatabaseContainer<SELF>> extends J
private static final int ORACLE_PORT = 1521;
private static final int APEX_HTTP_PORT = 8080;

private static final RateLimiter DB_CONNECT_RATE_LIMIT = RateLimiterBuilder.newBuilder()
.withRate(10, TimeUnit.SECONDS)
.withConstantThroughput()
.build();

public OracleContainer() {
super(IMAGE + ":latest");
}
Expand All @@ -28,7 +42,6 @@ protected Integer getLivenessCheckPort() {

@Override
protected void configure() {

addExposedPorts(ORACLE_PORT, APEX_HTTP_PORT);
}

Expand Down Expand Up @@ -70,4 +83,21 @@ public Integer getWebPort() {
public String getTestQueryString() {
return "SELECT 1 FROM DUAL";
}

// TODO: Replace with permanent solution to https://github.com/testcontainers/testcontainers-java/issues/568
@Override
public Connection createConnection(String queryString) throws SQLException {
final Properties info = new Properties();
info.put("user", this.getUsername());
info.put("password", this.getPassword());
final String url = this.getJdbcUrl() + queryString;

final Driver jdbcDriverInstance = getJdbcDriverInstance();

try {
return Unreliables.retryUntilSuccess(120, TimeUnit.SECONDS, () -> jdbcDriverInstance.connect(url, info));
} catch (Exception e) {
throw new SQLException("Could not create new connection", e);
}
}
}

0 comments on commit 995dc7a

Please sign in to comment.