4 Replies Latest reply on Jun 11, 2015 2:17 AM by Robert Hoeppner

    Arquillian/JUnit Fails to Run in JBoss Tools Generated Project in Eclipse

    Al Koch Newbie

      Hello,

       

      I am using Eclipse Kepler with JBoss 7.1.1 and I use JBoss Tools Central to generate the "Java EE Web Project" template project.  The project generates successfully and runs fine.  However, after starting the server, when I click on the project and select Run as JUnit Test I have a couple of problems/issues:

       

      1) The console shows 'deployed "test.war" '.  But neither the console nor the Kepler JUnit View show any test information at all.  As a test, I altered the following line in the auto-generated code for MemberRegistrationTest.java:

      assertNotNull(newMember.getId());

      to be

      assertNull(newMember.getId());

       

      to force an assert.  However, I get no output in the console nor in the JUnit view showing this assert.  As far as I can tell, the Run as JUnit Test is either not running at all or it is failing to display any results.

       

      2) Each time I Run as Junit Test I get one or more folders added to <JBOSS_HOME>\standalone\data\content, each of which is named with a two digit hex character (e.g., "87") and that folder contains another folder with a 38 hex character name (e.g. "ed8525e1a637334f002e6c4ebec047445b0ec3").  In that folder is a file named "content" that is about 750k in size.  Every time I run a test I get more of these folders and they are never cleaned up.  Further, in The JBoss config file standalone.xml I discovered that the following has been added:

      <deployments>

          <deployment name="test.war" runtime-name="test.war">

              <content sha1="87ed8525e1a637334f002e6c4ebec047445b0ec3"/>

          </deployment>

      </deployments>

      where the "87ed8525e1a637334f002e6c4ebec047445b0ec3" corresponds to the folder "87" and the subfolder "ed8525e1a637334f002e6c4ebec047445b0ec3" (for example).  (It appears that the 40 char SHA1 hash is used to name these two folders.)  If I delete the project and ask for it to be removed from disk I get an error stating that "An exception has been caught while processing the refactoring 'Delete Resource' and Details shows that it could not delete the Project folder.  Then, when I restart Kepler and try to recreate the Project with the same name I get the error that it already exists.  If I then shutdown Kelper I get an error that "the project cannot be updated."  Also, the <deployment> block stays in standalone.xml.

       

      Can someone explain why this unaltered project "right out of the box" is "failing" to test and is messing up Kepler's Project management when I try to delete it?

       

      Thank you.

      Al