Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
456 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
if: tag is present | ||
|
||
language: java | ||
jdk: | ||
- openjdk8 | ||
|
||
sudo: required | ||
services: | ||
- docker | ||
|
||
jobs: | ||
include: | ||
|
||
- stage: deploy | ||
sudo: false | ||
services: [] | ||
install: skip | ||
script: skip | ||
deploy: | ||
provider: script | ||
script: ./gradlew -Pversion=$TRAVIS_TAG release --scan --no-daemon -i | ||
on: | ||
tags: true | ||
branch: master |
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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM redis | ||
FROM redis:2.6.17 | ||
|
||
CMD ["redis-server"] |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ services: | |
customredis: | ||
build: . | ||
normalredis: | ||
image: redis:latest | ||
image: redis:2.6.17 |
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
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,78 @@ | ||
# OrientDB Module | ||
|
||
!!! note | ||
This module is INCUBATING. While it is ready for use and operational in the current version of Testcontainers, it is possible that it may receive breaking changes in the future. See [our contributing guidelines](/contributing/#incubating-modules) for more information on our incubating modules policy. | ||
|
||
|
||
This module helps running [OrientDB](https://orientdb.org/download) using Testcontainers. | ||
|
||
Note that it's based on the [official Docker image](https://hub.docker.com/_/orientdb/) provided by OrientDB. | ||
|
||
## Usage example | ||
|
||
Declare your Testcontainer as a `@ClassRule` or `@Rule` in a JUnit 4 test or as static or member attribute of a JUnit 5 test annotated with `@Container` as you would with other Testcontainers. | ||
You can call `getDbUrl()` OrientDB container and build the `ODatabaseSession` by your own, but a more useful `getSession()` method is provided. | ||
On the JVM you would most likely use the [Java driver](https://github.com/). | ||
|
||
The following example uses the JUnit 5 extension `@Testcontainers` and demonstrates both the usage of the Java Client: | ||
|
||
```java tab="JUnit 5 example" | ||
@Testcontainers | ||
public class ExampleTest { | ||
|
||
@Container | ||
private static OrientDBContainer container = new OrientDBContainer(); | ||
|
||
@Test | ||
void testDbCreation() { | ||
|
||
final ODatabaseSession session = container.getSession(); | ||
|
||
session.command("CREATE CLASS Person EXTENDS V"); | ||
session.command("INSERT INTO Person set name='john'"); | ||
session.command("INSERT INTO Person set name='jane'"); | ||
|
||
assertThat(session.query("SELECT FROM Person").stream()).hasSize(2); | ||
} | ||
|
||
} | ||
``` | ||
|
||
You are not limited to Unit tests and can of course use an instance of the OrientDB Testcontainer in vanilla Java code as well. | ||
|
||
|
||
## Adding this module to your project dependencies | ||
|
||
Add the following dependency to your `pom.xml`/`build.gradle` file: | ||
|
||
```groovy tab='Gradle' | ||
testCompile "org.testcontainers:orientdb:{{latest_version}}" | ||
``` | ||
|
||
```xml tab='Maven' | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>orientdb</artifactId> | ||
<version>{{latest_version}}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
``` | ||
|
||
!!! hint | ||
Add the OrientDB Java client if you plan to access the Testcontainer: | ||
|
||
```groovy tab='Gradle' | ||
compile "com.orientechnologies:orientdb-client:3.0.24" | ||
``` | ||
|
||
```xml tab='Maven' | ||
<dependency> | ||
<groupId>com.orientechnologies</groupId> | ||
<artifactId>orientdb-client</artifactId> | ||
<version>3.0.24</version> | ||
</dependency> | ||
``` | ||
|
||
|
||
|
||
|
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
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
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
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
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 |
---|---|---|
|
@@ -85,4 +85,4 @@ nav: | |
- contributing.md | ||
- contributing_docs.md | ||
extra: | ||
latest_version: 1.12.3 | ||
latest_version: 1.12.5 |
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
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
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
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
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
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
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
Oops, something went wrong.