3 Replies Latest reply on Nov 24, 2010 8:37 PM by aslak

    How to make a test enricher avaible

    iapazmino

      Hi,

       

      I've made a test enricher but to use it I need to add all the classes in every test case, even if it doesn't use them. If I don't a class not found exception related to the test enricherÅ› classes is thrown. Right now, the test enricher is added as test scoped dependency to the the project using it.

       

      How do I make my test enricher available without having to add the classes into the test package? Like the cdi test enricher for example.

        • 1. Re: How to make a test enricher avaible
          aslak

          Have you looked at the AuxiliaryArchiveAppender SPI, make that available on classpath, but only make the TestEnricher available in the AuxiliaryArchiveAppender returned Archive, archive.addServiceProvider(TestEnricher.class, Impl.class) 

           

          ?

          • 2. Re: How to make a test enricher avaible
            iapazmino

            Thanks a lot, almost there.

            Now I just need to add an annotation class in the test cases where I'm not using the test enricher at all.

            But I don't get why I need to add the classes in the deployment archive, either with addServiceProvider or addClasses, even when the test enricher is added as a dependency within the test scope.

            • 3. Re: How to make a test enricher avaible
              aslak

              Because the TestEnricher is executed inside the container, and how it is transfered to the container is via the deployment using the appender.

              1 of 1 people found this helpful