1 Reply Latest reply on Oct 12, 2019 2:58 PM by platzda

    Writing an Arquillian Extension that runs an intergration-test as a system-test

    platzda

      Hi,

      I have noticed that there are interesting projects like GitHub - dcm4che/WarpUnit: A lightweight framework for grey-box testing of server-side Java applications that allows to …  and GitHub - arquillian/arquillian-extension-warp: Warp fills the void between client-side and server-side testing.  that allow to write tests that can have test-code that runs as a client outside of the appserver/container and some code to run within the container.

      For some larger enterprise applications this fills a gap for me as i would like to leave my application/EAR running but somehow inject some custom test-code to run within the appserver. The idea is somehow a "best of both worlds" approach between integration-testing and system-testing. ...at least for my use-case.

      I have written down my thoughts here if you care for the details: Improving on Integration-Testing (with Arquillian)

       

      What like to prototype is writing an arquillian extension that allows me to run an integrations-tests outside the apps-server. I.e. what i want is a possibility that when the test-method is executed, intercept this execution. This should allow me to instead upload the classfile to the server, load it via a custom classloader and execute the class/testmethod in the server. I can already do this via a custom junit-runner: WarpUnit/Warp.java at feature/integration-test-poc · 38leinaD/WarpUnit · GitHub

      What i would like to test now, is if i can somehow integrate this into Arquillian. Basically, for the test to be started like a @RunAsClient, but intercept like described above, so that i can load and start the class in the already running appserver and run it like an integration-test (as if there where no @RunAsClient; and allowing Injection to work).

      I hope it is somehow clear and make sense.

       

      I am now specifically wondering if there is a way for an arquillian extension to implement this behaviour or if this is something that could only be done by modifications in the core. I have never written an arquillian extension before but already found examples how i could enrich the test-deployment with some customer endoint at server-side, to upload a class-file but for anything further it would be helpful to get some hints on APIs to look into.

       

      Thanks in advance,

      Daniel

        • 1. Re: Writing an Arquillian Extension that runs an intergration-test as a system-test
          platzda

          Digging through the Arquillian code-base. It seems that the communication in Arquillian is mostly based on events. I see that there is an event of type Test and it is @Observed by ClientTestExecuter. I have seen that i can also register observers in my extension. Is there a way to prevent the execution of the ClientTestExecuter. I.e. to intercept the event and make sure that i can held the method execution instead of ClientTestExecuter?

           

          I am still trying to understand the basics of the Arquillian framework i guess.

           

          thanks in advance,
          daniel