Cheap welding method reset?

We have an application that uses CDI welding. For our JUnit tests, we launch a new container for welding using the following trick: WeldJUnit4Runner

Since we have many tests, it takes a long time to run them, every time Weld starts and initializes. Is there a “reset” welding method so that we can get a fresh WeldContainer without Weld, which has to re-check the entire class path every time?

+4
source share
2 answers

Short answer: just stop open contexts.

: Weld Se (unit test) DeltaSpike Apache http://deltaspike.apache.org/.

, Java EE unit test JUnit Runner. https://github.com/NeoMorpheus/BeanTest

jglue.org/cdi-unit-user-guide/

+3

, Pax Exam.

reset Weld , library/project/Maven, Weld .

. CDI-.

0

Source: https://habr.com/ru/post/1526195/


All Articles