{"id":31645882,"url":"https://github.com/abaddon/hbasetestcontainer","last_synced_at":"2025-10-14T20:33:31.327Z","repository":{"id":39889835,"uuid":"419362128","full_name":"abaddon/HBaseTestContainer","owner":"abaddon","description":"An HBase container based on TestContainer ","archived":false,"fork":false,"pushed_at":"2024-01-30T17:13:24.000Z","size":74,"stargazers_count":2,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T05:35:52.763Z","etag":null,"topics":["container","hbase","java","test","testcontainers","testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abaddon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2021-10-20T14:22:05.000Z","updated_at":"2023-11-01T14:01:42.000Z","dependencies_parsed_at":"2024-01-30T18:59:19.551Z","dependency_job_id":null,"html_url":"https://github.com/abaddon/HBaseTestContainer","commit_stats":null,"previous_names":["abaddon/hbasetestcontainers"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/abaddon/HBaseTestContainer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abaddon%2FHBaseTestContainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abaddon%2FHBaseTestContainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abaddon%2FHBaseTestContainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abaddon%2FHBaseTestContainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abaddon","download_url":"https://codeload.github.com/abaddon/HBaseTestContainer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abaddon%2FHBaseTestContainer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020904,"owners_count":26086948,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["container","hbase","java","test","testcontainers","testing"],"created_at":"2025-10-07T05:17:10.364Z","updated_at":"2025-10-14T20:33:31.298Z","avatar_url":"https://github.com/abaddon.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.abaddon.testcontainer/hbasetestcontainer/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.abaddon.testcontainer/hbasetestcontainer)\n[![codecov](https://codecov.io/gh/abaddon/HBaseTestContainer/branch/main/graph/badge.svg?token=SSCF5PN321)](https://codecov.io/gh/abaddon/HBaseTestContainer)\n\n# HBaseTestContainer\n\nThe scope of this project is offer a simple way to execute tests with HBase.\n\nHBase uses hostnames to pass connection data back out of the container (from it's internal Zookeeper) and this behaviour creates 2 problems:\n1. a hostname is needed\n2. TestContainer follow this principle: _From the host's perspective Testcontainers actually exposes this on a random free port. This is by design, to avoid port collisions that may arise with locally running software or in between parallel test runs._\n\n## How it works\n\nThe class HBase Container breaks the Testcontainers' principle, mapping exposed ports to the same container ports.\nWith this workaround we can call HBase from the host or from the container using the same address.\n\n#### Important Note\nRemember to define a custom *hosts* file to use when you run your test.\nThis file has to contain something like this:\n\n``` \n127.0.0.1   hbase_container_name \n```\n\nYou can see an example in the repository.\n\nThere are multiple ways to load this files: below some of them:\n\n1. as java option: `-Djdk.net.hosts.file=./path/hosts`\n2. you can create a file on the root of the project `.mvn/jvm.config` and add the java option \n3. in the pom.xml, you can add the parameter in the surfer plugin like this: \n```\n\u003cproperties\u003e\n    \u003cjvm.options\u003e-Djdk.net.hosts.file=./path/hosts\u003c/jvm.options\u003e\n\u003c/properties\u003e\n...\n\u003cplugins\u003e\n    ...\n    \u003cplugin\u003e\n        \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e2.22.2\u003c/version\u003e\n        \u003cconfiguration\u003e\n            \u003cargLine\u003e${jvm.options}\u003c/argLine\u003e\n        \u003c/configuration\u003e\n    \u003c/plugin\u003e\n\u003c/plugin\u003e\n```\n\n## Usage\n\n1. Add the HBaseContainer as dependency in your pom.xml file. The last version is: [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.abaddon.testcontainer/hbasetestcontainer/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.abaddon.testcontainer/hbasetestcontainer) \n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.abaddon.testcontainer\u003c/groupId\u003e\n  \u003cartifactId\u003ehbasetestcontainer\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n2. Use HBaseContainer class in your test class:\n```\npublic class HBaseStoreTest {\n\n    private final static String HBASE_HOSTNAME = \"hbase-docker\";\n\n    @ClassRule\n    public static HBaseContainer hbaseContainer = new HBaseContainer(HBASE_HOSTNAME);\n\n\n    @Test\n    public void test() throws IOException {\n    \n    ....\n    \n    }\n```\n3. create a `hosts` file and load it when you run your tests (if you need it).\n\n## Extra features\n\n### Bind HBase data folder\nYou can use the method `withDataFolderBind(String hostPath)`. Where hostPath is the folder on the host.\nIf it's not exist it will be created automatically.\n\nAt the moment, the folder is deleted and recreated at each run.\n```\n    @ClassRule\n    public static HBaseContainer hbaseContainer = new HBaseContainer(HBASE_HOSTNAME)\n    .withDataFolderBind(\"./hbase_data\");;\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabaddon%2Fhbasetestcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabaddon%2Fhbasetestcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabaddon%2Fhbasetestcontainer/lists"}