4 Replies Latest reply on May 20, 2014 6:44 PM by stardestroyer

    WAR Tests always run green in Liberty

    stardestroyer Newbie

      Hello, have a curious situation.  If I construct my deployment archive as a WAR, all tests always run green, even Assert.assertTrue(false).  Same test packaged as an EAR or a JAR works fine, but without clarity, I don't have confidence in any tests right now...  I am using the default TemperatureConverter as a testing ground. 

       

      Test method:

       

      @Test

      public void testConvertToCelsius() {

        assertTrue(false);

        assertEquals(converter.convertToCelsius(32d), 0d, 0.0001);

      }

       

      with this @Deployment method, the test always runs green in the Junit window:

       

      @Deployment

      public static Archive<WebArchive> createTestArchive() {

        WebArchive archive = ShrinkWrap

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

          .addClasses(TemperatureConverter.class)

          .addClasses(TemperatureConverterTest.class)

          .addAsManifestResource(EmptyAsset.INSTANCE,

            ArchivePaths.create("beans.xml"));

        return archive;

      }

       

      with this @Deployment method, the test fails, as expected, in the Junit window:

       

      @Deployment
      public static EnterpriseArchive createTestArchive() {
        EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class,
          "tc.ear");

        WebArchive war = ShrinkWrap
          .create(WebArchive.class, "tc.war")
          .addClasses(TemperatureConverter.class)
          .addClasses(TemperatureConverterTest.class)
          .addAsManifestResource(EmptyAsset.INSTANCE,
            ArchivePaths.create("beans.xml"));
        ear.addAsModule(war);
        return ear;
      }

       

      Running Arq 1.1.4.  Arquillian XML if needed:

       

      <container qualifier="wlp-managed" default="true">

        <configuration>

         <property name="appUndeployTimeout">30000</property>

         <property name="appDeployTimeout">60000</property>

         <property name="appDeployTimeout">120000</property>

         <property name="httpPort">18000</property>

         <property name="serverName">jab6</property>

         <property name="outputToConsole">true</property>

         <property name="wlpHome">c:/ibm/liberty/wlp</property>

        </configuration>

      </container>

       

      any ideas??  Am I doing anything wrong creating the deployment?