[jbosstools-dev] An excursion into integration testing plugins with Arquillian

phantomjinx p.g.richardson at phantomjinx.co.uk
Tue Jul 1 09:58:56 EDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/01/2014 01:53 PM, Max Rydahl Andersen wrote:
> On 28 Jun 2014, at 0:51, Paul G. Richardson wrote:
> 
>> On 06/27/2014 04:08 PM, Max Rydahl Andersen wrote:
>>> 
>>>>>> Might be of interest ...
>>>>>> 
>>>>>> https://community.jboss.org/en/teiiddesigner/dev/blog/2014/06/23/unit-testing-an-eclipse-plugin-with-arquillian
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>> 
thats cool - even though I was hoping it was actually using
>>>>> arquillian to test eclipse (i.e. as an alternative to eclipse test runner).
>>>>> 
>>>>> May I ask why the code we have in our server adapter testing base code was not
>>>>> sufficient for starting jboss servers and test against it ?
>>>>> 
>>>>> /max http://about.me/maxandersen
>>>> 
>>>> Cos... I didn't know it was there ;-)
>>> 
>>> there is this mailing list called jbosstools-dev where you can ask how we test our existing
>>> jboss server tooling :)
>>> 
>>>> I may have misunderstood mistria as well that the current JBT testing started servers
>>>> with WTP?
>>> 
>>> They are. We could probably remove that but for now not had that need since the plugins
>>> talking to the server have already had the dependency on the server adapter/wtp anyway.
>>> 
>>>> I didn't really want to introduce that element as well into the integration-testing. I
>>>> wanted to confine it to: - Start JBoss Server with Teiid installed - Connect to Teiid
>>>> using Teiid API from our Teiid client plugin - Deploy Teiid's own testing VDBs using our
>>>> Teiid client plugin ... ...
>>> 
>>> So that is reason enough for it. If you don't need/want to test your server adapter as part
>>> of this then yeah you don't have a need for it and its really cool to get arquillian to do
>>> it.
>>> 
>>> What worries me and what I couldn't immediately grok was why ant/eclipserunner had to be
>>> involved in this ?
>>> 
>>> This is because you need to actually invoke arquillian before the eclipse run ?
>>> 
>>> if it is then yeah - this is why I tease arquillian team to get an eclipse friendly version
>>> of it so all these hoops doesn't need to be jumped through.
>>> 
>>> I tried following a few of your links but they 404's (like 
>>> https://github.com/Teiid-Designer/komodo/blob/master/tests/org.komodo.eclipse.teiid-8.7.client.test/src/arquillian.xml)
>>>
>>>
>>>
>>> 
would love to show Aslak the complexity required for this (which seems
>>> unnecessary)
>>> 
>>> /max http://about.me/maxandersen
>> 
>> 
>> Ask for help when I can struggle on my own - are you mad!! ;-)
>> 
>> One of those "I'll just try this quickly situations that turn into a crusade' is the best 
>> explanation.
>> 
>> Anyway...
>> 
>> Answering points above in sequence:
>> 
>> Ant is responsible for downloading the maven dependencies and copying them to a libs folder
>> as library dependencies for the test plugin.
> 
> ..okey - any reasons why not just using the mvn copy goal for that which we use in other cases
> ?
> 
>> Executing tests within Eclipse AND through maven is part-and-parcel of our development
>> process. Run the tests in Eclipse once (or during) development and then run them through
>> maven prior to push to github and letting jenkins build.
> 
> Sure - just read the blog as if you were running eclipse in yet another different way via ant
> ?
> 
>> Otherwise, yes you are correct. Arquillian must be invoked prior to running the unit test so
>> that the JBoss container is there waiting.
> 
>> Links fixed but the komodo repository is a live firing range at the moment with lots of 
>> development going on so more than likely they might break again in the future. I'll try and
>> keep and eye-out.
>> 
>> Maybe I have got so used to using Eclipse auto-builders (using ant) to bring in extra
>> libraries from some other source that I don't really see it as complex. Then again seeing
>> wood for the trees is not necessarily my forte.
> 
> My main concern is that this is bringing in dependencies outside or our target platform thus
> less easy to contain/check for overlaps. Also - using mvn copy goal seems to me to be the
> better way rather than using ant auto builders?

The ant auto builder [1] does hands-off maven by calling 'mvn process-sources'. This always
executes the mvn copy-dependencies goal so bringing in the dependencies [2]. It has always been
essential that any process happening while developing in Eclipse must also occur when building on
the command line through maven. This is an example of that with the ant providing the plumbing
between Eclipse and maven.

The question of the dependencies not being in the target platform is worthy of further
consideration as the mvn-downloaded libraries are sometimes duplicated in the TP (even if
mvn-downloaded version is older than the one in the TP). At the moment, confining the mvn library
to only that plugin by not exporting its packages has worked so far. Of course, using these
libraries (as you know) is not without its classpath challenges but so far fragments have seemed
to mitigate these issues.

Of course, it would be lovely if maven-central could convert all libraries to plugins 'on-the-fly'
then they could just be dropped into the TP. However, due to the very classpath issues I have
encountered I know that is nigh on impossible.

[1]
https://github.com/Teiid-Designer/komodo/blob/master/integration-tests/org.komodo.eclipse.teiid-8.7.client.test/build.xml
[2]
https://github.com/Teiid-Designer/komodo/blob/master/integration-tests/org.komodo.eclipse.teiid-8.7.client.test/pom.xml

PGR



- -- 
Paul Richardson

  * p.g.richardson at phantomjinx.co.uk
  * p.g.richardson at redhat.com
  * pgrichardson at linux.com

"I know exactly who reads the papers ...

  * The Daily Mirror is read by people who think they run the country.
  * The Guardian is read by people who think they ought to run the country.
  * The Times is read by people who do actually run the country.
  * The Daily Mail is read by the wives of the people who run the country.
  * The Financial Times is read by the people who own the country.
  * The Morning Star is read by the people who think the country ought to be run by another country.
  * The Daily Telegraph is read by the people who think it is."

Jim Hacker, Yes Minister

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlOyvpUACgkQcthLMIwdEb3cQACgtQXYLh+AHX+tzLRFGw0ODM/0
JssAoImeXA4naGMajb/7ZKEBYzdNNF9a
=F/5A
-----END PGP SIGNATURE-----


More information about the jbosstools-dev mailing list