mockit.integration.testng.package-info Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmockit Show documentation
Show all versions of jmockit Show documentation
JMockit is a Java toolkit for developer (unit/integration) testing.
It contains mocking APIs and other tools, supporting both JUnit and TestNG.
The mocking APIs allow all kinds of Java code, without testability restrictions, to be tested
in isolation from selected dependencies.
/*
* Copyright (c) 2006-2011 Rogério Liesenfeld
* This file is subject to the terms of the MIT license (see LICENSE.txt).
*/
/**
* Provides integration with TestNG test runners, for versions 5.14+.
* Contains the {@link mockit.integration.testng.Initializer} test listener class that can be specified to TestNG at
* startup, as well as the "startup mock" implementation for integration with the TestNG test runner.
*
* This integration provides the same benefits to test code as the one for JUnit 4:
*
* -
* Unexpected invocations specified through the Mockups or the Expectations API are automatically verified just before
* the execution of a test ends (specifically, immediately after the execution of the test method).
*
* -
* Any mock classes applied with the Mockups API from inside a method annotated as a {@code @Test} or a
* {@code @BeforeMethod} will be discarded right after the execution of the test or the test method, respectively.
*
* -
* Any {@linkplain mockit.MockClass mock class} set up for the whole test class (either through a call to
* {@link mockit.Mockit#setUpMocks} from inside a {@code @BeforeClass} method, or by annotating the test class with
* {@link mockit.UsingMocksAndStubs}) will only apply to the tests in this same test class.
* That is, you should not explicitly tell JMockit to restore the mocked classes in an {@code @AfterClass} method.
*
* -
* Test methods will accept mock parameters, whose values are mocked instances automatically created by JMockit
* and passed by the test runner when the test method gets executed.
*
*
*/
package mockit.integration.testng;