0 Replies Latest reply on Oct 23, 2011 3:43 PM by Daniel Miklancic

    Deployment configuration causes invalid test result status

    Daniel Miklancic Newbie

      The  deployment shown below and the tests (not shown), work fine.  However, if a change such as removing the common-logging artifact is made, the tests do not run, yet the test results report is: Tests run: 3, Failures: 0, Errors: 0, Skipped: 0.  In fact, even if the tests fail, they are still reported as successful runs.


      Excluding a required dependency should rightfully generate an exception, and in fact, one is raised, but it neither seems to be visible in any of the test results nor causes the test(s) to fail.  When I remotely debug the code, I can see the exception that is raised (InvocationTargetException).  For some reason, the exception is swallowed, all subsequent tests are skipped, and the the test results are reported as mentioned above--Tests run: 3, Failures: 0, Errors: 0, Skipped: 0.


      It seems that the test(s) should fail on a deployment configuration error such as the one mentioned.  Is this a bug, or do I not understand something about how such errors are handled and reported? 


      It would be nice to be notified that an exception was thrown in the container so one could see it and realize that a required class, package, or jar is missing from the deployment.  Having to step through the debugger to see such exceptions is quite tedious and time consuming. 


      I am using the following configuration:






















          public static Archive<?> createTestArchive() {

              WebArchive war = ShrinkWrap

                      .create(WebArchive.class, "test.war")

                      .addClasses(QuantityDimension.class, QuantityDimensionDataService.class,

                              QuantityDimensionDataServiceBean.class, GenericDataService.class,

                              AbstractDataServiceBean.class, Resources.class, SQLStatementBuilder.class)









                      .addAsResource("log4j.xml", ArchivePaths.create("log4j.xml"))

                      .addAsResource(new File("target/test-classes/connection.properties"), "connection.properties")

                      .addAsResource(new File("src/test/resources/data/QuantityDimension_DataServiceTestData.xml"),


                      .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")

                      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");


              return war;