{"id":25441440,"url":"https://github.com/bertcarnell/javaassertextensions","last_synced_at":"2026-07-06T21:31:13.042Z","repository":{"id":147421353,"uuid":"10315705","full_name":"bertcarnell/JavaAssertExtensions","owner":"bertcarnell","description":"Adds additional Assert methods to the JUnit implementation","archived":false,"fork":false,"pushed_at":"2018-01-20T03:14:27.000Z","size":201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T04:54:46.637Z","etag":null,"topics":["java","junit"],"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/bertcarnell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","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}},"created_at":"2013-05-27T13:49:15.000Z","updated_at":"2018-03-15T20:28:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"959d91df-7b49-4032-9cd6-4a7c838949f4","html_url":"https://github.com/bertcarnell/JavaAssertExtensions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertcarnell/JavaAssertExtensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2FJavaAssertExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2FJavaAssertExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2FJavaAssertExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2FJavaAssertExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertcarnell","download_url":"https://codeload.github.com/bertcarnell/JavaAssertExtensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertcarnell%2FJavaAssertExtensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35206987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"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":["java","junit"],"created_at":"2025-02-17T12:28:05.409Z","updated_at":"2026-07-06T21:31:13.009Z","avatar_url":"https://github.com/bertcarnell.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"JavaAssertExtensions\n====================\n\nAdds additional Assert methods to the [JUnit](http://junit.org/) framework\n\nPlease see the document contained [here]( http://bertcarnell.github.io/JavaAssertExtensions)\n\n[![Build Status](https://www.travis-ci.org/bertcarnell/JavaAssertExtensions.svg?branch=master)](https://www.travis-ci.org/bertcarnell/JavaAssertExtensions)\n[![codecov](https://codecov.io/gh/bertcarnell/JavaAssertExtensions/branch/master/graph/badge.svg)](https://codecov.io/gh/bertcarnell/JavaAssertExtensions)\n\n### Quick start guide for Maven Users\n- See the [bertcarnellMavenMicroRepo](https://github.com/bertcarnell/bertcarnellMavenMicroRepo) for directions on how to include this project in your application or library as a dependency\n- Import the methods into your Class\n\n```java\nimport static com.gmail.bertcarnell.assertextensions.ExceptionAssertExtensions.*;\nimport static com.gmail.bertcarnell.assertextensions.NumericAssertExtensions.*;\n```\n\n- Start writing tests using assertThrows\n\n```java\n    // check that an exception is thrown in Double.parseDouble(\"a\") using reflection\n    assertThrows(NumberFormatException.class, new Double(0), \"parseDouble\", \"a\");\n    // check that an exception is thrown from a constructor (Double(\"a\")) using reflection\n    assertConstuctorThrows(NumberFormatException.class, Double.class.getConstructor(String.class), \"a\");\n    // check that an exception is thrown using a Runnable to enclose the method call\n    assertThrows(NumberFormatException.class, new Runnable(){\n        @Override\n        public void run() {\n            Double.parseDouble(\"a\");\n        }\n    });\n    // check that an exception is thrown using a closure that allows for additional checks in the Catch\n    assertThrowsAndDoAssertsInCatch(NumberFormatException.class, new ExceptionAssertionsPerformer(){\n          @Override\n          public void performThrowingAction() {\n              Double.parseDouble(\"a\");\n          }\n          @Override\n          public void performAssertionsAfterCatch(Object th) throws Exception {\n              // if this metod is called, we know that the object is a NumberFormatException or assignable from NumberFormatException\n              NumberFormatException nfe = (NumberFormatException) th;\n              assertEquals(nfe.getMessage(), \"For input string: \\\"a\\\"\");\n          }\n     });\n```\n- Write tests using Log Relative Error\n\n```java\n     // assert that two numbers \"agree within 7 digits\"\n     assertEqualsLRE(1234.5678, 1234.5679, 7);\n```\n\n- Check the [JUnit](http://junit.org/) tests for the package to see more [examples](https://github.com/bertcarnell/JavaAssertExtensions/tree/master/AssertExtensions/src/test/java/com/gmail/bertcarnell/assertextensions) of tests that pass when the correct \u003ccode\u003eException\u003c/code\u003e is thrown, tests that fail when the wrong \u003ccode\u003eException\u003c/code\u003e is thrown, and tests that fail when no \u003ccode\u003eException\u003c/code\u003e is thrown.\n\n### Deploy this project to the [bertcarnellMavenMicroRepo](https://github.com/bertcarnell/bertcarnellMavenMicroRepo)\n\nThis project deploys artifacts to a local git clone which is pushed to [github.com](https://github.com) for use as a remote repo\n\nIn the project's \u003ccode\u003epom.xml\u003c/code\u003e:\n\n```xml\n\u003cproject\u003e\n  ...\n  \u003c!-- Identify the repository locations where the artifacts will eventually reside --\u003e\n  \u003cdistributionManagement\u003e\n      \u003c!-- Release repository --\u003e\n      \u003crepository\u003e\n          \u003c!-- this ID will be reflected in the build --\u003e\n          \u003cid\u003erepo\u003c/id\u003e\n          \u003c!-- This is the URL for the github.com project --\u003e \n          \u003curl\u003ehttps://raw.github.com/bertcarnell/bertcarnellMavenMicroRepo/master/releases\u003c/url\u003e\n      \u003c/repository\u003e\n      \u003c!-- Snapshot repository --\u003e\n      \u003csnapshotRepository\u003e\n          \u003cid\u003esnapshot-repo\u003c/id\u003e\n          \u003curl\u003ehttps://raw.github.com/bertcarnell/bertcarnellMavenMicroRepo/master/snapshots\u003c/url\u003e\n      \u003c/snapshotRepository\u003e\n  \u003c/distributionManagement\u003e\n\u003c/project\u003e\n```\n\nIf you are using [Netbeans](https://netbeans.org/), these actions can aid in the deployment.  In the \u003ccode\u003enbactions.xml\u003c/code\u003e file:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!-- Netbeans actions used by right-clicking on the project =\u003e Custom =\u003e deploy --\u003e\n\u003cactions\u003e\n        \u003c!-- Deploy snapshots --\u003e\n        \u003caction\u003e\n            \u003c!-- action name identifying this as custom --\u003e\n            \u003cactionName\u003eCUSTOM-deploy\u003c/actionName\u003e\n            \u003c!-- name that is displayed in the Netbeans context menu --\u003e\n            \u003cdisplayName\u003edeploy\u003c/displayName\u003e\n            \u003c!-- the goals to be executed --\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eclean\u003c/goal\u003e\n                \u003cgoal\u003esource:jar\u003c/goal\u003e\n                \u003cgoal\u003ejavadoc:jar\u003c/goal\u003e\n                \u003cgoal\u003edeploy\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003c!-- additional maven command line options --\u003e\n            \u003cproperties\u003e\n                \u003c!-- the file path is relative to the project pom.xml.  An absolute path can also be used --\u003e\n                \u003caltDeploymentRepository\u003esnapshot-repo::default::file:../../bertcarnellMavenMicroRepo/snapshots\u003c/altDeploymentRepository\u003e\n            \u003c/properties\u003e\n        \u003c/action\u003e\n        \u003c!-- Deploy releases --\u003e\n        \u003caction\u003e\n            \u003cactionName\u003eCUSTOM-deploy-release\u003c/actionName\u003e\n            \u003cdisplayName\u003edeploy-release\u003c/displayName\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eclean\u003c/goal\u003e\n                \u003cgoal\u003esource:jar\u003c/goal\u003e\n                \u003cgoal\u003ejavadoc:jar\u003c/goal\u003e\n                \u003cgoal\u003edeploy\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cproperties\u003e\n                \u003caltDeploymentRepository\u003erepo::default::file:../../bertcarnellMavenMicroRepo/releases\u003c/altDeploymentRepository\u003e\n            \u003c/properties\u003e\n        \u003c/action\u003e\n    \u003c/actions\u003e\n```\n\nThe artifacts can also be deployed on the command line:\n\n```\nmvn clean source:jar javadoc:jar deploy -DaltDeploymentRepository=snapshot-repo::default::file:../../bertcarnellMavenMicroRepo/snapshots\nmvn clean source:jar javadoc:jar deploy -DaltDeploymentRepository=repo::default::file:../../bertcarnellMavenMicroRepo/releases\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertcarnell%2Fjavaassertextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertcarnell%2Fjavaassertextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertcarnell%2Fjavaassertextensions/lists"}