Fwd: Impressions from trying to write an own Engine

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Impressions from trying to write an own Engine

JUnit - User mailing list
Hi everybody,
after looking at the JUnit-Lambda prototype, I was a little disappointed
that there was no TestEngine allowing to register tests by calling a test
method.

So I decided to write my own engine. I failed miserably, which was probably
due to me being really tired after a great conference I attended. So take
my impressions with a grain of salt, but anyway here are they:


1. (good) the API is simple (few methods to implement)

2. Why is discoverTest of type void? I think it should really return some
kind of collection of Tests/ a TestPlanSpecification, instead of getting a
TestPlanSpecification passed in. The merging with other results of other
engines should be task of the launcher

3. What is an Engine Descriptor, and why does my engine gets one passed as
an argument??? My Engine really should know how to describe itself ... but
wait an EngineDescriptor is some kind of TestDescriptor??? Is my engine a
test? doesn't make sense to me. If it describes a test, then why has it an
attribute isTest, which returns false by default?

4. Why is there an execute method in a TestEngine? If a TestEngine is
something (possibly) provided by a third party, it should not execute
tests. It should register them (along with all necessary and possible meta
information) and the core of JUnit should execute them.

5. How is the ReflectionUtils supposed to work?  I tried
findAllClassesInPackage
and findAllClassesInClasspathRoot, but didn't to manage to get anything out
of them, except null.

6. As mentioned above, I'm too stupid (or was too tired) to make it work.
If somebody wants to take a look, the poor results are in
https://github.com/schauder/junit-lambda/tree/lambda-engine

kind regards
Jens
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Impressions from trying to write an own Engine

JUnit - User mailing list
Hello Jens,

thank you for your feedback. We are still discussing some of the internals of the TestEngine and, therefore, are open for any kind of recommendations. After all, this is the first draft of the prototype.

We have also had a discussion on points 2 and 3 within the team, but we put it on the backlog as we wanted to have a very early prototype to gather feedback from the community. I think we will decide on them within the next iteration and invite you to provide feedback anytime.

Concerning your point 4: "Why is there an execute method in a TestEngine?“

The concept of a test engine covers both, lookup and execute tests. The core framework is not supposed to execute the tests itself, because a test engine could provide very specific test behavior, e.g. running cucumber tests, requiring a very specific execution path. Therefore, we decided that the engine is responsible for both. In case of the JUnit5TestEngine, we will provide extension points that can be used by extension providers to hook into the standard „Java testing“ test run circle. We are still working on this extension model, therefore, there is not much within the code, yet. Please be patient about this feature. I hope that we are able to provide it within the next iteration, too.

All the best,

Stefan


> Am 29.11.2015 um 19:41 schrieb Jens Schauder [hidden email] [junit] <[hidden email]>:
>
>
> Hi everybody,
> after looking at the JUnit-Lambda prototype, I was a little disappointed that there was no TestEngine allowing to register tests by calling a test method.
>
> So I decided to write my own engine. I failed miserably, which was probably due to me being really tired after a great conference I attended. So take my impressions with a grain of salt, but anyway here are they:
>
>
> 1. (good) the API is simple (few methods to implement)
>
> 2. Why is discoverTest of type void? I think it should really return some kind of collection of Tests/ a TestPlanSpecification, instead of getting a TestPlanSpecification passed in. The merging with other results of other engines should be task of the launcher
>
> 3. What is an Engine Descriptor, and why does my engine gets one passed as an argument??? My Engine really should know how to describe itself ... but wait an EngineDescriptor is some kind of TestDescriptor??? Is my engine a test? doesn't make sense to me. If it describes a test, then why has it an attribute isTest, which returns false by default?
>
> 4. Why is there an execute method in a TestEngine? If a TestEngine is something (possibly) provided by a third party, it should not execute tests. It should register them (along with all necessary and possible meta information) and the core of JUnit should execute them.
>
> 5. How is the ReflectionUtils supposed to work?  I tried findAllClassesInPackage and findAllClassesInClasspathRoot, but didn't to manage to get anything out of them, except null.
>
> 6. As mentioned above, I'm too stupid (or was too tired) to make it work. If somebody wants to take a look, the poor results are in https://github.com/schauder/junit-lambda/tree/lambda-engine <https://github.com/schauder/junit-lambda/tree/lambda-engine>
>
> kind regards
> Jens
>
>
>



[Non-text portions of this message have been removed]