Open cezarykluczynski opened 8 years ago
I have plans for a Java 8 version of this library that does not need JUnit rules. Which version of Java do you use?
@stefanbirkner It would be cool if this library could be framework-agnostic. I use Java 8.
It will. Unfortunately it will not be as easy to use as the rules and TestNG is does not have any extension points like rules. (http://stackoverflow.com/questions/6099633/does-testng-support-something-like-junit4s-rule)
Which rule are you looking for foremost?
@stefanbirkner As for now, I'm using ExpectedSystemExit. I haven't found any other way to test code that calls System.exit().
I keep you updated on the progress of the new library. Hopefully I can provide a first release for testing System.exti()
in the next few days.
@stefanbirkner Thanks!
Would this work for you:
@Test
public void test() {
int statusCode = catchSystemExit(() -> {
//here comes your code that calls System.exit(...)
});
assertEquals(0, statusCode);
}
@stefanbirkner Sure, looks right.
I started to create a library called System Lambda that solves the same testing problems like System Rules but without a dependency to a test framework. If that solves your problem, I will not provide a specific TestNG extension.
It will. Unfortunately it will not be as easy to use as the rules and TestNG is does not have any extension points like rules. (http://stackoverflow.com/questions/6099633/does-testng-support-something-like-junit4s-rule)
Are TestNG listeners suitable? http://testng.org/doc/documentation-main.html#testng-listeners
Hi.
Is there any chance for TestNG support?