jeudi 27 août 2015

Get runtime information, Junit and more.

This question How can I find out if code is running inside a JUnit test or not? But it only resolves around Junit and i would like to have more information then that.

Im building a framework that will be injected into other peoples code. But the important thing is that my framework should not be run during the Test phase. There is a legit reason why I need to exclude Junit but I rather not disclose that until my framework is ready.

So hopefully this question will not be harrased with "you should not do that its wrong" or similar responses.

I would like to know if there is any way that easily tells me (problematically) if the code thats running are in a Unit test engine or not.

In the other question there were many examples of getting the stacktrace and checking for org.junit and such to determine if junit is running.

Is there any other way that takes less performance and could be applicable not only for junit?

Aucun commentaire:

Enregistrer un commentaire