{"id":19923307,"url":"https://github.com/firebirdsql/firebird-testcontainers-java","last_synced_at":"2026-02-22T13:17:35.615Z","repository":{"id":57745021,"uuid":"189720288","full_name":"FirebirdSQL/firebird-testcontainers-java","owner":"FirebirdSQL","description":"Firebird-testcontainers-java is a module for Testcontainers.org to provide lightweight, throwaway instances of Firebird for JUnit tests.","archived":false,"fork":false,"pushed_at":"2025-01-30T10:03:34.000Z","size":138,"stargazers_count":9,"open_issues_count":2,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-07T13:11:11.344Z","etag":null,"topics":["docker","firebird","java","jaybird","junit","test-automation","testing"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FirebirdSQL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"mrotteveel","custom":"https://firebirdsql.org/en/donate/"}},"created_at":"2019-06-01T10:35:11.000Z","updated_at":"2025-01-30T10:03:37.000Z","dependencies_parsed_at":"2023-12-15T14:41:41.586Z","dependency_job_id":"3fd53e55-c41d-477b-9a5d-e255301d9bde","html_url":"https://github.com/FirebirdSQL/firebird-testcontainers-java","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Ffirebird-testcontainers-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Ffirebird-testcontainers-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Ffirebird-testcontainers-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Ffirebird-testcontainers-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FirebirdSQL","download_url":"https://codeload.github.com/FirebirdSQL/firebird-testcontainers-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252156832,"owners_count":21703362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","firebird","java","jaybird","junit","test-automation","testing"],"created_at":"2024-11-12T22:13:44.911Z","updated_at":"2026-02-22T13:17:35.603Z","avatar_url":"https://github.com/FirebirdSQL.png","language":"Java","readme":"firebird-testcontainers-java\n============================\n[![Java CI with Maven](https://github.com/FirebirdSQL/firebird-testcontainers-java/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/FirebirdSQL/firebird-testcontainers-java/actions/workflows/maven.yml?query=branch%3Amaster)\n[![MavenCentral](https://maven-badges.sml.io/sonatype-central/org.firebirdsql/firebird-testcontainers-java/badge.svg)](https://maven-badges.sml.io/sonatype-central/org.firebirdsql/firebird-testcontainers-java/)\n\nFirebird-testcontainers-java is a module for [Testcontainers](https://www.testcontainers.org/)\nto provide lightweight, throwaway instances of Firebird for JUnit tests.\n\nThe default Docker image used is [firebirdsql/firebird](https://hub.docker.com/r/firebirdsql/firebird), and also supports \n [jacobalberty/firebird](https://hub.docker.com/r/jacobalberty/firebird/).\n\nIf you want to use Firebird 2.5, use the 2.5.x-sc (SuperClassic) variant of \nthe `jacobalberty/firebird` image, or 2.5.9-ss as earlier versions of the 2.5.x-ss \n(SuperServer) variant seem to be broken. However, recently, it seems that the\n2.5.x-sc variants also no longer work reliably.\n\nPrerequisites\n-------------\n\n- Docker\n- A supported JVM testing framework\n\nSee [Testcontainers prerequisites](https://www.testcontainers.org/#prerequisites) for details.\n\nDependency\n----------\n\nIn addition to the firebird-testcontainers-java dependency, you will also need\nto explicitly depend on [Jaybird](https://github.com/FirebirdSQL/jaybird).\n\n### Gradle\n\n```groovy\ntestImplementation \"org.firebirdsql:firebird-testcontainers-java:2.0.0\"\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.firebirdsql\u003c/groupId\u003e\n    \u003cartifactId\u003efirebird-testcontainers-java\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nUsage\n-----\n\nFor extensive documentation, consult https://www.testcontainers.org/modules/databases/\n\n### JUnit support\n\nStarting with `firebird-testcontainers-java` 2.0.0, use of JUnit 4 is no longer\nsupported directly. If you still need JUnit 4 support, use `firebird-testcontainers-java`\n1.6.1, use URL based, or derive your own rule implementation to start and stop\nthe container.\n\nFor JUnit 5 support, add `org.testcontainers:testcontainers-junit-jupiter` as\na test dependency. Annotate the test class with `@Testcontainers`. Define\na `FirebirdContainer` static (shared by all tests), or instance (per test)\nfield. Annotate this field with `@Container`.\n\nThe container defines several `withXXX` methods for configuration.\n\nImportant standard options are:\n\n- `withUsername(String)` - Sets the username to create (defaults to `test`); sets docker environment variable `FIREBIRD_USER`. \\\n  For `jacobalberty/firebird`, if the value is `sysdba`, `FIREBIRD_USER` is not set.\n- `withPassword(String)` - Sets the password of the user (defaults to `test`); sets the docker environment variable `FIREBIRD_PASSWORD`. \\\n  For `jacobalberty/firebird`, if the username is `sysdba`, `ISC_PASSWORD` is set instead of `FIREBIRD_PASSWORD`. \\\n  For `firebirdsql/firebird`, if the username is `sysdba`, it also sets `FIREBIRD_ROOT_PASSWORD`.\n- `withDatabaseName(String)` - Sets the database name (defaults to `test`); sets docker environment variable `FIREBIRD_DATABASE`\n\nFirebird specific options are:\n\n- `withEnableLegacyClientAuth()` - (_Firebird 3+_) Enables `LegacyAuth` and uses it as the default for creating users, also relaxes `WireCrypt` to `Enabled`;\nsets docker environment variable `EnableLegacyClientAuth` (`jacobalberty/firebird`) or `FIREBIRD_USE_LEGACY_AUTH` (`firebirdsql/firebird`) to `true`;\npasses connection property `authPlugins` with value `Srp256,Srp,Legacy_Auth` if this property is not explicitly set through `withUrlParam`.\n- `withEnableWireCrypt` - (_Firebird 3+_) Relaxes `WireCrypt` from `Required` to `Enabled`; \nsets docker environment variable `EnableWireCrypt` (`jacobalberty/firebird`) to `true`, or `FIREBIRD_CONF_WireCrypt` (`firebirdsql/firebird`) to `Enabled`.\n- `withTimeZone(String)` - Sets the time zone (defaults to JVM default time zone); \n- sets docker environment variable `TZ` to the specified value\n- `withSysdbaPassword(String)` - Sets the SYSDBA password, but if `withUsername(String)` is set to `sysdba` (case-insensitive), this property is ignored and the value of `withPassword` is used instead; \nsets docker environment variable `ISC_PASSWORD` (`jacobalberty/firebird`) or `FIREBIRD_ROOT_PASSWORD` (`firebirdsql/firebird`) to the specified value.\n\nExample of use:\n\n```java\npackage org.firebirdsql.testcontainers.examples;\n\nimport org.firebirdsql.testcontainers.FirebirdContainer;\nimport org.junit.jupiter.api.Test;\nimport org.testcontainers.junit.jupiter.Container;\nimport org.testcontainers.junit.jupiter.Testcontainers;\n\nimport java.sql.*;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\n/**\n * Simple test demonstrating use of {@code @Testcontainers} and {@code @Container}.\n */\n@Testcontainers\npublic class ExampleContainerTest {\n\n  @Container\n  public final FirebirdContainer container = new FirebirdContainer(\"firebirdsql/firebird:5.0.3\")\n          .withUsername(\"testuser\")\n          .withPassword(\"testpassword\");\n\n  @Test\n  public void canConnectToContainer() throws Exception {\n    try (Connection connection = DriverManager\n            .getConnection(container.getJdbcUrl(), container.getUsername(), container.getPassword());\n         Statement stmt = connection.createStatement();\n         ResultSet rs = stmt.executeQuery(\"select CURRENT_USER from RDB$DATABASE\")) {\n      assertTrue(rs.next(), \"has row\");\n      assertEquals(\"TESTUSER\", rs.getString(1), \"user name\");\n    }\n  }\n}\n```\n\n### Testcontainers URL\n\nThe testcontainers URL defines the container and connects to it. As long as \nthere are active connections, the container will stay up.\n\nFor Firebird the URL format is:\n\n- `jdbc:tc:firebird[:\u003cimage-tag\u003e]://hostname/\u003cdatabasename\u003e[?\u003cproperty\u003e=\u003cvalue\u003e[\u0026\u003cproperty\u003e=\u003cvalue\u003e...]]`\n- `jdbc:tc:firebirdsql[:\u003cimage-tag\u003e]://hostname/\u003cdatabasename\u003e[?\u003cproperty\u003e=\u003cvalue\u003e[\u0026\u003cproperty\u003e=\u003cvalue\u003e...]]`\n\nWhere:\n\n- `\u003cimage-tag\u003e` (_optional, but recommended_) is the tag of the docker image to\n  use, otherwise the default is used (which might change between versions)\n- `\u003cdatabasename\u003e` (_optional_) is the name of the database (defaults to `test`)\n- `\u003cproperty\u003e` is a connection property (Jaybird properties **and** testcontainers\n  properties are possible) \\\n  Of special note are the properties:\n  - `user` (_optional_) specifies the username to create and connect (defaults to `test`)\n  - `password` (_optional_) specifies the password for the user (defaults to `test`)\n- `\u003cvalue\u003e` is the value of the property\n\nThese URLs use the `firebirdsql/firebird` images, except for tags starting with\n`2.`, `v2`, `v3`, `v4` or `v5`, which will select the `jacobalberty/firebird`\nimages for backwards compatibility.\n\nExample of use:\n\n```java\nimport org.junit.jupiter.api.Test;\n\nimport java.sql.*;\n\nimport static org.junit.jupiter.api.Assertions.*;\n\n/**\n * Simple test demonstrating use of url to instantiate container.\n */\nclass ExampleUrlTest {\n\n  @Test\n  void canConnectUsingUrl() throws Exception {\n    try (Connection connection = DriverManager\n            .getConnection(\"jdbc:tc:firebird://hostname/databasename?user=someuser\u0026password=somepwd\");\n         Statement stmt = connection.createStatement();\n         ResultSet rs = stmt.executeQuery(\"select CURRENT_USER from RDB$DATABASE\")) {\n      assertTrue(rs.next(), \"has row\");\n      assertEquals(\"SOMEUSER\", rs.getString(1), \"user name\");\n    }\n  }\n}\n```\n\nFor this type of use, it is not necessary to add `org.testcontainers:testcontainers-junit-jupiter`\nas a test dependency.\n\nLicense\n-------\n\nSee [LICENSE](LICENSE)\n","funding_links":["https://github.com/sponsors/mrotteveel","https://firebirdsql.org/en/donate/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebirdsql%2Ffirebird-testcontainers-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebirdsql%2Ffirebird-testcontainers-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebirdsql%2Ffirebird-testcontainers-java/lists"}