I ran into difficulties writing new add-ons for testproject.
Example: We need a plugin that will connect to redis and take the key value from there. I need one dependency - some redis client (I took reddison) and a couple of lines of code.
Next, I write a test for the created action, which is launched through the runner. Everything seems to work and everything is fine!
Until I start loading this into testproject …
The first thing I encountered was a dependency conflict. (A large number of warning NoClassDefFoundError). The solution I eventually came up with was to build uber-jar using the maven-shade-plugin, moving the packages of your dependencies to another place. This more or less solved the problem, but it requires unnecessary actions (register specific packages in the shade plugin - relocation section). With the assembly you propose through gradle or maven-assembly-plugin it is almost impossible to connect libraries normally, which is very frustrating. Perhaps the pom-file with the dependencies used in the testproject runner (I’m not sure) would help, in order to somehow inherit from it cunningly.
The second problem is not clear error messages.
Example: I loaded my plugin to testproject to connect to redis, but I get an error when using:
java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied (“java.lang.RuntimePermission” “reflectionFactoryAccess”)
Caused by java.security.AccessControlException: access denied (“java.lang.RuntimePermission” “reflectionFactoryAccess”)
Or another example, this is in the plugin for performing actions in ldap:
Caused by java.lang.ExceptionInInitializerError
At the same time, everything works in the developer session in tests, so I don’t understand how I can catch these errors in advance and why they arise (in the first case, as I understand it, the plug-in does not have enough rights for some action), and most importantly - where they arise. There is nothing in runner logs either.
Sorry for the bad english. I really like your product, now all testers write autotests on their own, but writing plugins is frustrating. When writing code takes 20 minutes, and then another half day to get it to work correctly. I would be glad if there is an easier way to connect third-party libraries and fully check the addon for errors without loading it into testproject