--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concordion-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/c85b506d-b41f-465c-ae1d-d8ce428463f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Paul,I've done some very rudimentary investigation into JUnit5 integration and have some vague thoughts - basically I was contemplating using the @TestFactory annotation. It returns a lazily evaluated stream of tests. If it's properly lazily evaluated, then we should be able to add new fixtures discovered from concordion:run (and examples from the fixtures) to the stream and have them executed.But I haven't actually written code to test that hypothesis yet. And, to be honest, I'm time poor at the moment.Tim
On 4 July 2017 at 09:35, Paul Hicks <ten...@gmail.com> wrote:
I've been experimenting with gradle modules, sourceSets and whatnot in order to get java6 and java8 builds working nicely together. I have a passable implementation, which means I'm able to move on to JUnit5. Is JUnit5 work underway, and if so, can I help?
To get up to speed, I've been trying to design a solution for JUnit5 that uses a TestEngine for Concordion, since that fits best with JUnit's ideas of engines versus extensions: use different engines for running different types of tests/specs, and use extensions for smaller tweaks to the way things run. In trying to stick close to the existing JUnit4 implementation, I've not yet been able to sufficiently distinguish between the Jupiter engine and a potential Concordion engine to make it work. So I've redesigned a little and ended up with a choice which I'd like input on.
- Stick with the existing JUnit4+Concordion design, drop the idea of using a ConcordionTestEngine, and switch exclusively to the JUnit5 extension API. This will be easy, won't take long to implement, and can borrow a lot of code from the existing JUnit4 integration.
- Forget the JUnit4 way of doing things, create a new ConcordionTestEngine that discovers specs first, and then discovers fixtures from the specs. This would put (slightly) more constraints on the locations and naming of spec files, but would eliminate @Test annotations from fixtures. It might be a little scary at first but would mean no JUnit code in the fixtures (well, there would be assumptions and assertions, but you wouldn't need JUnit for that, you can go with AssertJ, Hamcrest, Fest, etc..). This will take longer and wouldn't be able to leverage much of the existing code.
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
Poetically, this solution is no longer suitable in V2 of the other tool :) I'll have to go with the TestEngine solution there.
bad class file: ZipFileIndexFileObject[/home/paulh/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-api/5.0.0-M4/50f95d68c674a30374c5f50e6ad5212d2c1a3cec/junit-jupiter-api-5.0.0-M4.jar(org/junit/jupiter/api/Test.class)]
class file has wrong version 52.0, should be 50.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import org.junit.jupiter.api.Test;
@ConcordionJUnit5
public class Junit5Test {
@ConcordionTests
public Iterable<DynamicTest> concordionTests;
@TestFactory
Iterable<DynamicTest> determineConcordionTests() {
return concordionTests;
}
}
Heh. The DynamicContainer stuff is very nice... my code is decidedly average :)
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concordion-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion-dev/f98ded53-cbb9-4d1a-af98-e7ec71686431%40googlegroups.com.
@ConcordionJUnit5
public class Junit5ParamResolverTest {
@TestFactory
Iterable<DynamicTest> determineConcordionTests(Iterable<DynamicTest> concordionTests) {
return concordionTests;
}
}
Thanks for the code Paul!I've made good progress with the junit5 integration. Basically, I've got tests running (and passing) that check that the @BeforeEach and @BeforeAll annotations are being processed correctly. The concordion concordion:example='before annotation doesn't work (yet), but that isn't far away now...There's a lot of cleanup to do (I copied and pasted lots of code out of the ConcordionRunner to get things working).The user interface is a bit ugly at the moment. Basically, I've got the minimum code a tester has to write down to this. I'd love to reduce it further...hopefully reading about DynamicContainer might mean we can get away without having a @TestFactory method - without this method, junit won't actually run the tests at the moment.@ConcordionJUnit5
public class Junit5Test {
@ConcordionTests
public Iterable<DynamicTest> concordionTests;
@TestFactory
Iterable<DynamicTest> determineConcordionTests() {
return concordionTests;
}
}
On 5 July 2017 at 16:43, Paul Hicks <ten...@gmail.com> wrote:
Heh. The DynamicContainer stuff is very nice... my code is decidedly average :)
--
You received this message because you are subscribed to the Google Groups "concordion-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion-dev+unsubscribe@googlegroups.com.
To post to this group, send email to concord...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion-dev.