| <!DOCTYPE html> |
| <!-- |
| | Generated by Apache Maven Doxia at 2021-02-13 |
| | Rendered using Apache Maven Fluido Skin 1.3.0 |
| --> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <meta name="Date-Revision-yyyymmdd" content="20210213" /> |
| <meta http-equiv="Content-Language" content="en" /> |
| <title>JUnit – About</title> |
| <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" /> |
| <link rel="stylesheet" href="./css/site.css" /> |
| <link rel="stylesheet" href="./css/print.css" media="print" /> |
| |
| |
| <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script> |
| |
| |
| |
| <link rel="stylesheet" href="./css/plain-links.css"/> |
| |
| |
| <link rel="stylesheet" href="./css/carousel.css"/> |
| |
| |
| <link rel="stylesheet" href="./css/junit-lambda.css"/> |
| |
| <link rel="stylesheet" href="./css/hopscotch-0.1.2.min.css" /><script src="scripts/index.js" type="text/javascript"></script> </head> |
| <body class="topBarEnabled"> |
| |
| |
| |
| |
| |
| |
| <a href="http://github.com/junit-team/junit4"> |
| <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;" |
| src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" |
| alt="Fork me on GitHub"> |
| </a> |
| |
| |
| |
| |
| |
| <div id="topbar" class="navbar navbar-fixed-top "> |
| <div class="navbar-inner"> |
| <div class="container"><div class="nav-collapse"> |
| |
| |
| <ul class="nav"> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">JUnit 4 <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| <li> <a href="index.html" title="Introduction">Introduction</a> |
| </li> |
| |
| <li> <a href="faq.html" title="Frequently asked questions">Frequently asked questions</a> |
| </li> |
| |
| <li> <a href="cookbook.html" title="Cookbook">Cookbook</a> |
| </li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Documentation <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| <li class="dropdown-submenu"> |
| <a href="project-info.html" title="Project Information">Project Information</a> |
| <ul class="dropdown-menu"> |
| <li> <a href="index.html" title="About">About</a> |
| </li> |
| <li> <a href="dependency-info.html" title="Dependency Information">Dependency Information</a> |
| </li> |
| <li> <a href="license.html" title="Project License">Project License</a> |
| </li> |
| <li> <a href="team-list.html" title="Project Team">Project Team</a> |
| </li> |
| <li> <a href="source-repository.html" title="Source Repository">Source Repository</a> |
| </li> |
| <li> <a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a> |
| </li> |
| <li> <a href="dependencies.html" title="Dependencies">Dependencies</a> |
| </li> |
| <li> <a href="dependency-convergence.html" title="Dependency Convergence">Dependency Convergence</a> |
| </li> |
| <li> <a href="integration.html" title="Continuous Integration">Continuous Integration</a> |
| </li> |
| <li> <a href="distribution-management.html" title="Distribution Management">Distribution Management</a> |
| </li> |
| </ul> |
| </li> |
| |
| <li class="dropdown-submenu"> |
| <a href="project-reports.html" title="Project Reports">Project Reports</a> |
| <ul class="dropdown-menu"> |
| <li> <a href="javadoc/latest/index.html" title="JavaDocs">JavaDocs</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| |
| |
| |
| |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| |
| <div class="container"> |
| <div id="banner"> |
| <div class="pull-left"> |
| <a href="./" id="bannerLeft"> |
| <img src="images/junit-logo.png" alt="JUnit"/> |
| </a> |
| </div> |
| <div class="pull-right"> </div> |
| <div class="clear"><hr/></div> |
| </div> |
| |
| <div id="breadcrumbs"> |
| <ul class="breadcrumb"> |
| |
| |
| <li class=""> |
| <a href="./" title="JUnit 4"> |
| JUnit 4</a> |
| </li> |
| <li class="divider ">/</li> |
| <li class="">About</li> |
| |
| |
| |
| <li id="publishDate" class="pull-right">Last Published: 2021-02-13</li> <li class="divider pull-right">|</li> |
| <li id="projectVersion" class="pull-right">Version: 4.13.2</li> |
| |
| </ul> |
| </div> |
| |
| |
| |
| <div id="bodyColumn" > |
| |
| |
| |
| |
| <p> |
| JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. |
| </p> |
| |
| <div id="carousel-main"> |
| |
| <div id="main-carousel" class="carousel slide"> |
| |
| <div class="carousel-inner"> |
| |
| <div class="item active"> |
| |
| <div class="carousel-content" id="junit-lambda-teaser"> |
| |
| <p><a class="externalLink" href="http://junit.org/junit5/"><img src="images/junit5-banner.png" alt="JUnit 5" style="height:120px; margin-top:20px" /></a></p> |
| </div> |
| |
| <div class="carousel-caption"> |
| |
| <p><b><a class="externalLink" href="http://junit.org/junit5/">JUnit 5 is released:</a></b></p> |
| |
| <p><a class="externalLink" href="http://junit.org/junit5/">Explore the new release!</a></p> |
| </div> |
| </div> |
| |
| <div class="item"> |
| |
| <div class="carousel-content"> |
| |
| <div> |
| <pre class="prettyprint"> |
| @Test |
| public void newArrayListsHaveNoElements() { |
| assertThat(new ArrayList<Integer>().size(), is(0)); |
| } |
| |
| @Test |
| public void sizeReturnsNumberOfElements() { |
| List<Object> instance = new ArrayList<Object>(); |
| instance.add(new Object()); |
| instance.add(new Object()); |
| assertThat(instance.size(), is(2)); |
| } |
| |
| </pre></div> |
| </div> |
| |
| <div class="carousel-caption"> |
| |
| <p><b>Annotations</b></p> |
| |
| <p>Start by marking your tests with <tt>@Test</tt>.</p> |
| </div> |
| </div> |
| |
| <div class="item"> |
| |
| <div class="carousel-content"> |
| |
| <div> |
| <pre class="prettyprint lang-java"> |
| @Test |
| public void lookupEmailAddresses() { |
| assertThat(new CartoonCharacterEmailLookupService().getResults("looney"), allOf( |
| not(empty()), |
| containsInAnyOrder( |
| allOf(instanceOf(Map.class), hasEntry("id", "56"), hasEntry("email", "roadrunner@fast.org")), |
| allOf(instanceOf(Map.class), hasEntry("id", "76"), hasEntry("email", "wiley@acme.com")) |
| ) |
| )); |
| } |
| |
| |
| |
| </pre></div> |
| </div> |
| |
| <div class="carousel-caption"> |
| |
| <p><b>Hamcrest matchers</b></p> |
| |
| <p>Make your assertions more expressive and get better failure reports in return. </p> |
| </div> |
| </div> |
| </div> |
| <a name="main-carousel-prev" id="main-carousel-prev" class="carousel-control left">‹</a> |
| <a name="main-carousel-next" id="main-carousel-next" class="carousel-control right">›</a> |
| </div> |
| </div> |
| |
| <p class="pagination-centered"> |
| <a href="javascript:startSiteTour()" class="btn btn-primary btn-large">Let's take a tour »</a> |
| </p> |
| |
| |
| <div class="container"> |
| |
| <div class="row"> |
| |
| <div class="span4" id="welcome-section"> |
| |
| <p><b>Welcome</b></p> |
| |
| <ul> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Download-and-Install">Download and install</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Getting-started">Getting started</a></li> |
| |
| <li>Release Notes |
| |
| <ul> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.13.2.md">4.13.2</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.13.1.md">4.13.1</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.13.md">4.13</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.12.md">4.12</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.11.md">4.11</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.10.md">4.10</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.9.1.md">4.9.1</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/blob/HEAD/doc/ReleaseNotes4.9.md">4.9</a></li> |
| </ul> |
| </li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Maintainer-documentation">Maintainer Documentation</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/I-want-to-help%21">I want to help!</a></li> |
| |
| <li><a class="externalLink" href="http://stackoverflow.com/questions/tagged/junit">Latest JUnit Questions on StackOverflow</a></li> |
| |
| <li><a href="javadoc/latest/index.html">JavaDocs</a></li> |
| |
| <li><a href="./faq.html">Frequently asked questions</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki">Wiki</a></li> |
| |
| <li><a href="./license.html">License</a></li> |
| </ul> |
| </div> |
| |
| <div class="span4" id="concepts-section"> |
| |
| <p><b>Usage and Idioms</b></p> |
| |
| <ul> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Assertions">Assertions</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Test-runners">Test Runners</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Aggregating-tests-in-suites">Aggregating tests in Suites</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Test-execution-order">Test Execution Order</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Exception-testing">Exception Testing</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Matchers-and-assertthat">Matchers and assertThat</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Ignoring-tests">Ignoring Tests</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Timeout-for-tests">Timeout for Tests</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Parameterized-tests">Parameterized Tests</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Assumptions-with-assume">Assumptions with Assume</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Rules">Rules</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Theories">Theories</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Test-fixtures">Test Fixtures</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Categories">Categories</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Use-with-Maven">Use with Maven</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Multithreaded-code-and-concurrency">Multithreaded code and Concurrency</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Java-contract-test-helpers">Java contract test helpers</a></li> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Continuous-testing">Continuous Testing</a></li> </ul> |
| </div> |
| |
| <div class="span4" id="thirdparty-section"> |
| |
| <p><b>Third-party extensions</b></p> |
| |
| <ul> |
| |
| <li><a class="externalLink" href="https://github.com/junit-team/junit4/wiki/Custom-runners">Custom Runners</a></li> |
| |
| <li> |
| <a class="externalLink" href="http://site.trajano.net/commons-testing/">net.trajano.commons:commons-testing for UtilityClassTestUtil</a> per #646</li> |
| |
| <li> |
| <a class="externalLink" href="http://stefanbirkner.github.io/system-rules">System Rules</a> – A collection of JUnit rules for testing code that uses java.lang.System.</li> |
| |
| <li> |
| <a class="externalLink" href="https://github.com/MichaelTamm/junit-toolbox">JUnit Toolbox</a> - Provides runners for parallel testing, a <tt>PoolingWait</tt> class to ease asynchronous testing, and a <tt>WildcardPatternSuite</tt> which allow you to specify wildcard patterns instead of explicitly listing all classes when you create a suite class.</li> |
| |
| <li> |
| <a class="externalLink" href="https://github.com/pholser/junit-quickcheck">junit-quickcheck</a> - QuickCheck-style parameter suppliers for JUnit theories. Uses <a class="externalLink" href="https://github.com/junit-team/junit.contrib/tree/HEAD/theories">junit.contrib's version of the theories machinery</a>, which respects generics on theory parameters.</li> </ul> |
| </div> |
| </div> |
| </div> |
| <script src="scripts/hopscotch-0.1.2.min.js" type="text/javascript"></script> |
| <script> |
| //<![CDATA[ |
| var tour = { |
| id: "welcome_tour", |
| steps:[ |
| { |
| target: "welcome-section", |
| placement: "right", |
| title: "First things first", |
| content: "Here are the links to the most important information" |
| }, |
| { |
| target: $('ul.nav')[0], |
| fixedElement: true, |
| placement: "bottom", |
| title: "Maven site documentation", |
| content: "Don't forget that the documentation generated by Maven is hiding up here" |
| }, |
| { |
| target: $('body a[href="http://github.com/junit-team/junit4"] img')[0], |
| placement: "left", |
| title: "Source code", |
| content: "The source code for JUnit is hosted on GitHub" |
| }, |
| { |
| target: "concepts-section", |
| placement: "right", |
| title: "Understanding JUnit", |
| content: "Find out more about how to do things with JUnit" |
| }, |
| { |
| target: "thirdparty-section", |
| placement: "left", |
| title: "Extending JUnit", |
| content: "Find out about third party extensions to the JUnit framework" |
| } |
| ] |
| } |
| window.startSiteTour = function(){ |
| hopscotch.startTour(tour); |
| return undefined; |
| }; |
| //]]> |
| </script> |
| |
| |
| </div> |
| </div> |
| |
| <hr/> |
| |
| <footer> |
| <div class="container"> |
| <div class="row span12">Copyright © 2002-2021 |
| <a href="http://www.junit.org">JUnit</a>. |
| All Rights Reserved. |
| |
| </div> |
| |
| |
| <p id="poweredBy" class="pull-right"> |
| <a href="http://maven.apache.org/" title="Built by Maven" class="builtBy"> |
| <img class="builtBy" alt="Built by Maven" src="images/logos/maven-feather.png" /> |
| </a> |
| </p> |
| |
| </div> |
| </footer> |
| </body> |
| </html> |