seriybg / junit-easy-tools Goto Github PK
View Code? Open in Web Editor NEWJUnit 4 extensions
License: MIT License
JUnit 4 extensions
License: MIT License
@DataProducer
public static IntSupplier s1 = () -> 42;
@DataProducer
public static IntSupplier s2 = () -> 27;
public void testM(int i) {
}
testM
should run 2 times with values from both producers inserted.
Check out Qulice
Some annotation on the test method should make the test repeat it's execution as many time as is set it annotation parameter. Value injected to the test should be recalculate each time.
Example:
@Test
@Repeat(3)
public void testMethod(int i){
...
}
TestNG-like @factory feature
Using: http://www.javadoc.io/
Update pom.xml to version 0.2-SNAPSHOT
Looks like if we have two data producers of the same type, when using iteration over the tests method, only one DataProducer is used
the following code fails
private static final Queue<String> valuesWithNulls = new LinkedList<>();
@DataProducer
public static Supplier<String> producerWithNulls = valuesWithNulls::poll;
@DataProducer
public static Supplier<String> onlyNullSupplier = () -> null;
@Before
public void fillValues() throws Exception {
valuesWithNulls.add("firstString");
valuesWithNulls.add(null);
valuesWithNulls.add("thirdOne");
valuesWithNulls.add(null);
}
@Test
@ProducedValues(nullsAccepted = false, iterations = 4)
public void shouldNotAcceptNulls(String value) throws Exception {
assertThat(value).isNotNull();
}
For now zappr config matches uppercase letter with dash and letter
Fix to match: word #[digits]
Looks like version of jacoco needs to be updated
Should support:
@DataProducer
public static List<String> dataProducer() {
...
}
for test method:
@Test
public void test(String s) {
...
}
Fields of the following type in Test class must be calculated and injected as parameter in test method
Add supporting of:
Supplier
BooleanSupplier
IntSupplier
LongSupplier
DoubleSupplier
Like a JUnit @theory, there should be a parameter in annotation that tells if null are acceptable
@DataProducer
public static Supplier<String> first = () -> "first";
@DataProducer
public static Supplier<String> second = () -> "second";
@Test
//@ProducerValues(iterations = 2) -> in this case test method will be executed 4 time (2 times for each supplier)
public void test(String s) {
//Will be executed twice with both provided value from first and second suppliers
}
If for parameter in test method there is no @DataProducer of given type to inject, the test is silently ignored. It should throw Initialization exception.
The logic should be the same as for JUnit Theories
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.