{"id":38961549,"url":"https://github.com/gemfire/gemfire-testcontainers","last_synced_at":"2026-01-17T16:25:15.010Z","repository":{"id":180739902,"uuid":"621923025","full_name":"gemfire/gemfire-testcontainers","owner":"gemfire","description":"GemFire integration with Testcontainers","archived":false,"fork":false,"pushed_at":"2026-01-14T22:35:42.000Z","size":224,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":25,"default_branch":"main","last_synced_at":"2026-01-15T02:52:04.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gemfire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING_CLA.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-31T17:24:43.000Z","updated_at":"2026-01-14T22:35:46.000Z","dependencies_parsed_at":"2024-01-13T00:33:13.006Z","dependency_job_id":"98ad22dd-6af1-4d86-97d0-d1837c161281","html_url":"https://github.com/gemfire/gemfire-testcontainers","commit_stats":null,"previous_names":["gemfire/gemfire-testcontainers"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/gemfire/gemfire-testcontainers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-testcontainers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-testcontainers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-testcontainers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-testcontainers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gemfire","download_url":"https://codeload.github.com/gemfire/gemfire-testcontainers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-testcontainers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-17T16:25:14.918Z","updated_at":"2026-01-17T16:25:14.988Z","avatar_url":"https://github.com/gemfire.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VMware GemFire Testcontainers Integration\n\n[![maven](https://img.shields.io/maven-central/v/dev.gemfire/gemfire-testcontainers)](https://central.sonatype.com/artifact/dev.gemfire/gemfire-testcontainers/overview)\n![build](https://github.com/gemfire/gemfire-testcontainers/actions/workflows/build.yaml/badge.svg)\n[![javadoc](https://javadoc.io/badge2/dev.gemfire/gemfire-testcontainers/javadoc.svg)](https://javadoc.io/doc/dev.gemfire/gemfire-testcontainers)\n\nTestcontainers can be used to automatically instantiate and manage [VMware GemFire](https://docs.vmware.com/en/VMware-GemFire/index.html)\nclusters. This is enabled using the official [Docker images](https://hub.docker.com/r/gemfire/gemfire) for GemFire.\n\nNote that the default image is `gemfire/10` which will use the latest, published, `10.x` image.\n\n## Dependencies\n\nOfficial artifacts are published to VMware's commercial repository. Please follow the instructions\n[here](https://gemfire.dev/quickstart/java/) in order to set up your repository definitions.\n\nDependencies for Maven can then be added with:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003edev.gemfire\u003c/groupId\u003e\n  \u003cartifactId\u003egemfire-testcontainers\u003c/artifactId\u003e\n  \u003cversion\u003e3.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr, for gradle:\n```java\ntestImplementation 'dev.gemfire:gemfire-testcontainers:3.0.0'\n```\n\n_Note that from version 2.3 onwards, the group co-ordinate has changed from `com.vmware.gemfire` to\n`dev.gemfire`._\n\n## Example\n\nCreate a GemFire cluster and use it in your tests:\n\n```java\n    try (GemFireCluster cluster = new GemFireCluster()) {\n        cluster.acceptLicense();\n        cluster.start();\n    }\n```\n\nBy default, a single locator and 2 servers are created. Additional servers can be created using the\nparameterized `GemFireCluster` constructor. Some API calls require targeting a specific\nserver; servers are named `server-N` with numbering starting at `0`. Similarly, locators are named\n`locator-N`. These names are also set as network aliases in addition to the actual docker container\nnames.\n\n!!! warning \"EULA Acceptance\"\nDue to licensing restrictions you are required to accept an EULA for this container image.\nTo indicate that you accept the VMware GemFire image EULA, call the `acceptLicense()` method,\nor place a file at the root of the classpath named `container-license-acceptance.txt`,\ne.g. at `src/test/resources/container-license-acceptance.txt`. This file should contain the\nline: `foo/bar` (or, if you are overriding the docker image name/tag, update accordingly).\n\n    Please see the [`vmware-gemfire` image documentation](https://hub.docker.com/_/vmware-gemfire#environment-variables) for a link to the EULA document.\n\nNow your tests, or any other process running on your machine, can access the cluster by creating\na connection to the _locator_:\n\n```java\n    try (\n        ClientCache cache = new ClientCacheFactory()\n            .addPoolLocator(\"localhost\", cluster.getLocatorPort())\n            .create()\n    ) {\n        Region\u003cInteger, String\u003e region = cache\n            .\u003cInteger, String\u003ecreateClientRegionFactory(ClientRegionShortcut.PROXY)\n            .create(\"FOO\");\n\n        region.put(1, \"Hello World\");\n\n        assertThat(region.get(1)).isEqualTo(\"Hello World\");\n    }\n```\n\n## GFSH integration\n\nThe `gfsh` CLI utility is often used to configure a GemFire cluster. To facilitate this from within \nTestcontainers, a convenience method is provided to execute `gfsh` commands against the\ncluster:\n\n```java\n    cluster.gfsh(true,\n        \"list members\",\n        \"create region --name=ORDERS --type=REPLICATE\",\n        \"describe region --name=ORDERS\");\n```\n\nThis, effectively, creates a single script and executes it on the locator instance. The output can\noptionally be logged. This particular method should only be used once the cluster has started.\nIn order to run gfsh commands immediately at startup, you may instead use the `withGfsh` variant.\n\n```java\n    try (GemFireCluster cluster = new GemFireCluster()) {\n      cluster.withGfsh(\"create region --name=ORDERS --type=PARTITION_REDUNDANT\")\n        .acceptLicense()\n        .start();\n    }\n```\n\nIf additional options for gfsh connectivity are required then using the `Gfsh.Builder` would be\nappropriate. An instance of this Builder can be created using the `GemFireCluster.gfshBuilder()`\nmethod. Using this approach allows for configuring gfsh with various security as well as TLS\noptions. For example if a `SecurityManager` is configured gfsh would require a username and\npassword to connect:\n\n```java\n    Gfsh gfsh = cluster.gfshBuilder()\n        .withCredentials(\"username\", \"pa$$word\")\n        .withLogging(true)\n        .build();\n    gfsh.run(\"list members\");\n```\n\n## Additional configuration\n\nLocators and servers can be configured with specific GemFire parameters:\n\n```java\n    cluster.withGemFireProperty(LOCATOR_GLOB, \"security-manager\", SimpleSecurityManager.class.getName());\n```\n\n### Applying configuration to specific members\n\nMost of the configuration methods will take a simple glob pattern to target specific members. For\nexample `server-*` would apply the configuration all servers. Several general patterns are defined\nin `GemFireCluster`, namely: `ALL_GLOB`, `LOCATOR_GLOB` and `SERVER_GLOB`.\n\n### Using a cache.xml file\n\nIf required, the cluster can be configured with a custom `cache.xml` file. The file is retrieved\nas a resource and, as such, should be present on the classpath. The file is applied to\nall servers on startup.\n\n```java\n    cluster.withCacheXml(SERVER_GLOB, \"/test-cache.xml\");\n```\n\n### Classpath additions\n\nOne or more local directories may be exposed on the classpath of each member of the cluster:\n\n```java\n    cluster.withClasspath(ALL_GLOB, \"build/classes/java/main\", \"out/production/classes\");\n```\n\nThis will allow the local directory to be mounted (read-only) within each container and added to\nthe classpath.\n\n### PDX\n\nPDX can be configured by setting the regular expression of the default `ReflectionBasedAutoSerializer`\nand selecting the 'read serialized' option as necessary:\n\n```java\n    cluster.withPdx(\"com.example.*\", true);\n```\n\nMore details about PDX can be found [here](https://docs.vmware.com/en/VMware-GemFire/10.0/gf/developing-data_serialization-gemfire_pdx_serialization.html)\n\n### Copying files before startup\n\nIn some cases it may be necessary to copy files to members before GemFire starts up. For example\nto supply certificate files when using TLS. This can be done using the `withPreStart` method:\n\n```java\n    String CACHE_XML = \"/test-cache.xml\";\n    byte[] rawBytes = readAllBytes(Objects.requireNonNull(getClass().getResourceAsStream(CACHE_XML)));\n    Transferable fileData = Transferable.of(new String(rawBytes));\n\n    try (GemFireCluster cluster = new GemFireCluster()) {\n      cluster.withPreStart(SERVER_GLOB, x -\u003e x.copyFileToContainer(fileData, CACHE_XML));\n      cluster.withGemFireProperty(SERVER_GLOB, \"cache-xml-file\", CACHE_XML);\n      cluster.acceptLicense();\n      cluster.start();\n      ...\n    }\n```\n\n### Debugging\n\nJVM debugging can be enabled on an individual server:\n\n```java\n    cluster.withDebugPort(\"server-0\", 5005);\n```\n\nThis will expose port `5005` for debugging on server `0`. *Note that the server will wait for a\ndebugger to attach before continuing with start up.*\n\nIn order to log all container output to `stdout`, you can set the Java system property `-Dgemfire-testcontainers.log-container-output=true`.\n\n\n## Building and Testing\n\nIn order to build and test this code, you will need to register an account on the commercial\nGemFire repo: https://commercial-repo.pivotal.io/data3/gemfire-release-repo/gemfire. This will give\naccess to the necessary GemFire bits.\n\nWhen building, the credentials must be provided via the environment variables\n`COMMERCIAL_MAVEN_USERNAME` and `COMMERCIAL_MAVEN_PASSWORD`.\n\nYou will also need an account on, and login to Tanzunet / Harbor, in order to pull the GemFire image:\n\n```shell\ndocker login dev.registry.pivotal.io\n```\n\nNow you will be ready to build and test:\n\n```shell\n./gradlew build\n```\n\nIn order to use a different default image you can set the Java system property `gemfire.image`.\nTo use this when running the `gemfire-testcontainers` tests you can set this property as a Gradle\nproperty. For example:\n\n```shell\n./gradlew test -P gemfire.image=gemfire/10.0.27\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemfire%2Fgemfire-testcontainers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgemfire%2Fgemfire-testcontainers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemfire%2Fgemfire-testcontainers/lists"}