0 Replies Latest reply on Apr 1, 2012 4:20 PM by Craig Schwarzwald

    Default Deployment types and AddClasses from Forge$ arquillian create-test

    Craig Schwarzwald Newbie

      In using the Forge-Arquillian plugin on my own sample project, I noticed a few things that I feel could, and probably should, be cleaned up by the plugin itself.  The current behavior caused me a bit of grief in trying to re-configure the arquillian test that was created by the plugin in order to make it work for my project, and I think updating the plugin for these few cases should be "relatively" easy and more importantly extremely useful to users.


      1 - The default for Forge$ arquillian create-test seems to create a JavaArchive Deployment.  I feel the plugin should look at the pom file, and if it sees a <packaging>war</packaging> tag, it should then create a WebArchive Deployent in the test by default instead.

           1b - This would also mean updating the included resources with the propper methods (ie: updating [.addAsManifestResource("META-INF/persistence.xml")] for jar to [.addAsResource("META-INF/persistence.xml")] for war).


      2 - Less of an issue, but still a nice to have - By default, the plugin creates the test and adds a .addClass(ClassUnderTest.class) line to the deployment.  Ideally, the plugin could scan the class under test to find other classes that are called/used within it, and continue doing so all the way down, gathering all Classes that would need to be added to the deployment in order to test the original class.  The plugin could then add the .addClass(ClassName.Class) line for each of those classes it found.  It would obviously be left to the user to add any additional classes they may want to include, but at mimimum it should be known and apparent to the plugin any/all classes that will NEED to be added to the deployment in order to test the original class, and the plugin should take care of adding all of those obviously necessary clasess to the deployment for the user by default.