A programmer-oriented testing framework for Java.

Related tags

Testing junit4
Overview
Comments
  • Maven project junit:junit:jar

    Maven project junit:junit:jar

    I created this artifact because we agreed we want to have the Maven build process.

    I would like to deploy this project to Maven central Snapshot repositories under version 4.11.1-SNAPSHOT, and notify the JUnit community to test. For the first looking the build outcome is useful.

    IMHO the release plan could be like this: 4.11-SNAPSHOT for #332 4.11.1-SNAPSHOT for this pull request 4.11.2-SNAPSHOT for OSGi + Maven pull request

    What you think?

    I obviously do not have server credentials user/psswd to deploy to Maven central.

    opened by Tibor17 96
  • Configurable Categories

    Configurable Categories

    Categories in suite should be multiple in annotations Categories.IncludeCategory and Categories.ExcludeCategory, and configurable by system properties as well. This pull request referst to discussions in #142 and my old pull request #354 closed by my mistake #461.

    opened by Tibor17 64
  • Junit should be an osgi bundle

    Junit should be an osgi bundle

    I sometimes use junit assertions even in production code to make sure no invalid data slips through. As some of my applications run under osgi it would be very handy if junit already was a valid osgi bundle.

    As far as I can tell it would only be necessary to switch the to packaging in the pom to bundle and add the maven bundle pllugin. I can provide a patch if that helps.

    Christian

    feature needs more info 
    opened by cschneider 62
  • Add option for user to specify runner for parameterized tests

    Add option for user to specify runner for parameterized tests

    Test that are run with the Parameterized suite currently default to a specific runner. This change adds a @ParameterizedRunWith annotation that allows a user to specify which runner the suite should use for each Test case so the user can over-ride specific functionality within the runner.

    parameterized 
    opened by mc1arke 51
  • Upgrade to Hamcrest 1.3

    Upgrade to Hamcrest 1.3

    • Matchers in JUnitMatchers that are now provided by hamcrest-core are deprecated.
    • The static methods now delegate to CoreMatchers
    • The four Matcher classes copied from Hamcrest have been deleted.
    • Using CoreMatchers where possible

    Important: In some but not all cases, this change will cause compile errors for people using JUnitMatchers.hasItem(s), both(), and either().

    Merging this pull request would fix #36.

    opened by marcphilipp 51
  • --filter option implemented.

    --filter option implemented.

    Currently SuiteTest.suiteShouldBeOKwithNonDefaultConstructor() fails but I don't know what ought to be done about that. Under what circumstances does it make sense to have a Suite with no SuiteClasses? Suggestions?

    I'll also be refactoring out the command line processing as per @kcooney and will writing more tests for the code that has changed.

    feature 
    opened by noel-yap 47
  • #727 Fail on timeout displays stack of stuck thread

    #727 Fail on timeout displays stack of stuck thread

    New class: ExceptionWithThread.java (subclass of Exception that keeps information about some other relevant thread). Changed: FailOnTimeout.java (starts test in a new ThreadGroup; on timeout, looks at running threads in ThreadGroup to see which one it thinks got stuck, creates an ExceptionWithThread if it finds one); Failure.java (displays stack for the "relevant thread" if it handles an ExceptionWithThread)

    opened by adam-beneschan 44
  • Improvement: Concurrent Queue in RunNotifier instead of Old Synchronized ArrayList

    Improvement: Concurrent Queue in RunNotifier instead of Old Synchronized ArrayList

    The old RunNotifier uses synchronized ArrayList in Listeners.

    Without the synchronization the concurrently modified Listeners throw ConcurrentModificationException on iterator.

    This synchronization is no longer needed with ConcurrentLinkedQueue because it is already thread safe and non-blocking.

    This change will speed up tests because of not having any locks.

    opened by Tibor17 43
  • Parameterized runner should name tests better than sequential numbers

    Parameterized runner should name tests better than sequential numbers

    Right now the test names are named sequentially 0,1, etc in Parameterized:

    @Override protected String getName() { return String.format("[%s]", fParameterSetNumber); }

    @Override protected String testName(final Method method) { return String.format("%s[%s]", method.getName(), fParameterSetNumber); }

    It would help if the data themselves were to be used in determining the name. Proposed alternatives for name (which has to be determinited statically before Test is instantiated):

    • call toString on first parameter
    • call the a newly added names attribute to Parameters annotation (with default empty names for compatibility) public String[] names() default {};
    • call a public, static (!) method annotated by newly-defined @TestName and accepting the same arguments as the constructor

    I can provide (again) a patch. This issue was tracked as http://sourceforge.net/tracker/?func=detail&atid=365278&aid=1742040&group_id=15278 and https://sourceforge.net/tracker/?func=detail&atid=365278&aid=1630834&group_id=15278 I can submit a patch if needed

    feature parameterized 
    opened by anshnd 42
  • Flexible ParallelComputer

    Flexible ParallelComputer

    The ParallelComputer with unlimited Thread pool size is not enugh.

    Thus I added methods with parameters where the user can change the Thread pool as he likes.

    Opened discussion #518 and got the consensus to update ParallelComputer.

    methods(ExecutorService) classes(ExecutorService) classesAndMethodsUnbounded() classesAndMethodsBounded(int nThreads) classesAndMethods(ThreadPoolExecutor) classesAndMethods(ThreadPoolExecutor pool, int minConcurrentMethods) classesAndMethods(ExecutorService poolClasses, ExecutorService poolMethods)

    opened by Tibor17 41
  • junit-dep not uploaded to Maven repository since 4.5

    junit-dep not uploaded to Maven repository since 4.5

    I see versions 4.6 and 4.7 of the bundled-libraries version of JUnit in the Maven Central repo, but no junit-dep. Can this be added by whoever is doing the uploads?

    bug regression 
    opened by MichaelHackett 41
  • GitHub Workflows security hardening

    GitHub Workflows security hardening

    This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted. It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.

    opened by sashashura 0
  • Make Assert failNotEquals public

    Make Assert failNotEquals public

    I had to implement a custom equal function but I cannot report the failure with the existing functionality of Assert class. I wanted to reuse the function Assert.failNotEquals but it's private, not sure why. Can you make it public?

    opened by Martin-Office 1
  • Possibility to specify suite classes in custom Categories subclasses constructor

    Possibility to specify suite classes in custom Categories subclasses constructor

    If subclassing the Suite class one can implement a constructor which can invoke a custom static method to specify test suite classes. This is currently not possible with subclasses ob Categories.

    Therefore i propose this small fix to expose the constructor with the signature Categories(RunnerBuilder, Class, Class[]) to subclasses.

    opened by dbratusa 0
  • @Rule execution order looks to have been guaranteed since 4.12 but is not documented as such

    @Rule execution order looks to have been guaranteed since 4.12 but is not documented as such

    My understanding is that https://github.com/junit-team/junit4/commit/c75dcc28810aeb1c918ee7430981b31f41742ea7#diff-f35409420f2540415a9878beaf5a537248f301b6c683bb87a11016be3c9dc8b8R55 caused JUnit to begin processing @Rule fields in a defined order. The @Rule Javadoc, however, still states that the order is defined by the JVM's reflection API.

    It would be good to know whether the intent is to commit to this order or not. I suppose that the current doc is technically wrong either way, since the current order is not dependent on the JVM reflection API :) But mainly I want to know how safe this is to rely on. Thanks.

    (Sorry if I missed some past discussion in my searching or if I've misunderstood something.)

    opened by cpovirk 1
Releases(r4.13.2)
Owner
JUnit
A programmer-oriented testing framework for Java.
JUnit
A modern testing and behavioural specification framework for Java 8

Introduction If you're a Java developer and you've seen the fluent, modern specification frameworks available in other programming languages such as s

Richard Warburton 250 Sep 12, 2022
The Enterprise-ready testing and specification framework.

Spock Framework Spock is a BDD-style developer testing and specification framework for Java and Groovy applications. To learn more about Spock, visit

Spock Framework 3.3k Jan 5, 2023
TestNG testing framework

Documentation available at TestNG's main web site. Release Notes 7.4.0 7.3.0 7.1.0 7.0.0 Need help? Before opening a new issue, did you ask your quest

Cedric Beust 1.8k Jan 5, 2023
Layout and functional testing framework for websites

Galen Framework master: Galen is an open-source tool for testing layout and responsive design of web applications. It is also a powerfull functional t

Galen Framework 1.4k Dec 10, 2022
Initial example of Object Oriented Programming, with Java

Programación - Alumnos Clase Ejemplo inicial de Programación Orientada a Objetos, con Java. Nuestra primeras clases, con usos, abusos, y algunos tests

José Luis González Sánchez 13 Dec 27, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 31, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 25, 2022
Advanced Java library for integration testing, mocking, faking, and code coverage

Codebase for JMockit 1.x releases - Documentation - Release notes How to build the project: use JDK 1.8 or newer use Maven 3.6.0 or newer; the followi

The JMockit Testing Toolkit 439 Dec 9, 2022
ScalaTest is a free, open-source testing toolkit for Scala and Java programmers

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

ScalaTest 1.1k Dec 26, 2022
Isolated MinIO container management for Java code testing

TestContainers for MinIO MinIO support for the test containers project. Installation Unfortunately, TestContainers for MinIO is not available in any p

Olsi Qose 3 Sep 30, 2022
Toolkit for testing multi-threaded and asynchronous applications

ConcurrentUnit A simple, zero-dependency toolkit for testing multi-threaded code. Supports Java 1.6+. Introduction ConcurrentUnit was created to help

Jonathan Halterman 406 Dec 30, 2022
Cucumber DSL for testing RESTful Web Services

cukes-rest takes simplicity of Cucumber and provides bindings for HTTP specification. As a sugar on top, cukes-rest adds steps for storing and using r

C.T.Co 100 Oct 18, 2022
Randomized Testing (Core JUnit Runner, ANT, Maven)

RANDOMIZED TESTING ================== JUnit test runner and plugins for running JUnit tests with pseudo-randomness. See the following for more infor

null 167 Dec 26, 2022
JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Pact Foundation 962 Dec 31, 2022
Captures log entries for unit testing purposes

LogCaptor Install with maven <dependency> <groupId>io.github.hakky54</groupId> <artifactId>logcaptor</artifactId> <version>2.4.0</version>

null 215 Jan 1, 2023
🎉Back end module of Sonic UI automation testing platform. Sonic-UI自动化测试平台后端模块。

?? Sonic UI automation testing platform. English | 简体中文 Background What is sonic ? Nowadays, automation testing, remote control and other technologies

Eason 1.7k Jan 1, 2023
JVM version of Pact Enables consumer driven contract testing

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

Pact Foundation 961 Dec 30, 2022
State of the art mutation testing system for the JVM

Pitest (aka PIT) is a state of the art mutation testing system for Java and the JVM. Read all about it at http://pitest.org Releases 1.7.3 #952 Mutate

Henry Coles 1.5k Dec 26, 2022