Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-54258

Plugin's integration tests cannot use LiferayIntegrationTestRule

Details

    • 3

    Description

      Trying to use LiferayIntegrationTestRule on plugin integration tests results in failure and a stack trace. Without this rule, annotations such as @DeleteAfterTestRun are useless.

      Steps to reproduce

      You are expected to have both liferay-portal and liferay-plugins repositories on your machine for these tests.

      1. Set up a Liferay bundle with ant -f build-dist.xml setup-testable-tomcat called from liferay-portal
      2. Start up Liferay.
      3. In liferay-plugins, replace portlets/calendar-portlet/test/integration/com/liferay/calendar/service/CalendarLocalServiceTest.java with the attached version (or fetch the branch from https://github.com/brandizzi/liferay-plugins/commits/LPS-54258)
      4. Inside the calendar-portlet project, run ant test-integration

      Expected results

      • The test would pass

      Actual results

      • The test fails, the following stack trace is logged:
            [junit] Testcase: com.liferay.calendar.service.CalendarLocalServiceTest:    Caused an ERROR
            [junit] Could not create statement
            [junit] java.lang.RuntimeException: Could not create statement
            [junit]     at org.jboss.arquillian.junit.Arquillian.methodBlock(Arquillian.java:306)
            [junit]     at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:202)
            [junit]     at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:377)
            [junit]     at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:52)
            [junit]     at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:216)
            [junit]     at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:164)
            [junit] Caused by: java.lang.reflect.InvocationTargetException
            [junit]     at org.jboss.arquillian.junit.Arquillian.methodBlock(Arquillian.java:259)
            [junit] Caused by: java.lang.ExceptionInInitializerError
            [junit]     at com.liferay.portal.test.rule.LiferayIntegrationTestRule.apply(LiferayIntegrationTestRule.java:50)
            [junit] Caused by: java.lang.NullPointerException
            [junit]     at java.util.Hashtable.put(Hashtable.java:514)
            [junit]     at java.util.Properties.setProperty(Properties.java:161)
            [junit]     at java.lang.System.setProperty(System.java:787)
            [junit]     at com.liferay.portal.kernel.util.SystemProperties.set(SystemProperties.java:171)
            [junit]     at com.liferay.portal.util.PropsUtil.<init>(PropsUtil.java:183)
            [junit]     at com.liferay.portal.util.PropsUtil.<clinit>(PropsUtil.java:348)
        

      Attachments

        Issue Links

          Activity

            People

              cristina.gonzalez Cristina Gonzalez
              adam.brandizzi Adam Brandizzi
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                6 years, 47 weeks, 3 days ago

                Packages

                  Version Package