Closed
Description
openedon Nov 18, 2015
Deliverables
- Introduce
@TestTemplate
and accompanying extension point. - Determine if Parameter resolvers should be able to access the invocation context for test templates #704 should be included in M4.
- Determine if we need an
@InvocationIndex
annotation orTestTemplateInfo
type for injecting the current invocation index, etc. into@Test
,@BeforeEach
, and@AfterEach
methods.- See d2e3a4d
- Introduce
junit-jupiter-params
module- Merge initial contribution (Introduce junit-jupiter-params #728)
- Javadoc
-
@since
tags
-
- API annotations
- Add unit tests where missing (see TODOs)
- Resolve TODOs
- Document
@TestTemplate
and accompanying extension pointin User Guide andRelease Notes-
Provide example(s) in theWill be addresses in Document @TestTemplate and accompanying extension point in User Guide #762documentation
module and include in the User Guide.
-
- Document parameterized tests in User Guide and Release Notes
- Document the
junit-jupiter-params
module in the Dependency Metadata section. - Document the
junit-jupiter-params
module in the Dependency Diagram. - Provide example(s) in the
documentation
module and include in the User Guide.
- Document the
Original Issue Description
At the time of writing, the https://github.com/junit-team/junit-lambda/wiki/Prototype-Test-Decorators page does not have all that much detail, so this might already be considered.
It would be good if the library shipped with ready-to-use simple parameter annotations that could be used inside a single test instance. It would in many ways look like JUnit 4's @Parameterized
Runner, but for use inside a single class. When running the test, each @Parameterized
method would appear many times, once for each data set.
class MyTest {
// A simple test with a specified data set
@Test @Parameterized("mod10")
void testMod10(String value) { ... }
@Parameterized("mod10")
Collection<Object[]> getMod10Values { ... }
// Also including a method naming convention
@Test @Parameterized("mod11", name="{0}")
void testMod11(String value) { ... }
@Parameterized("mod11")
Collection<Object[]> getMod11Values { ... }
// In the absense of a @Parameterized data provider, use reflection
@Test @Parameterized("getMod12Values", name="{0}")
void testMod12(String value) { ... }
Collection<Object[]> getMod12Values{ ... }
}
Related Issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment