Service integration test using Arquillian fails on LR 7.1

thumbnail
Daniele Baggio, modified 6 Years ago. Expert Posts: 336 Join Date: 12/5/08 Recent Posts
Hi,


gradle buildService can generate integration test code using this directive:

buildService {
    apiDir = "../service-api/src/main/java"
    testDir = "../service-test/src/testIntegration/java"
}
build.gradle for integration test module:

dependencies {
    testIntegrationCompile group: "com.liferay", name: "com.liferay.arquillian.extension.junit.bridge", version: "1.0.17"
    testIntegrationCompile group: "com.liferay.portal", name: "release.portal.api", version: "7.1.1"    testIntegrationCompile project(":modules:xxxxxx.box-api")
    testIntegrationCompile project(":modules:xxxxxx.box-service")
}

The module compiles, the portal setup for testing is ok.

WHAT FAILS:

LiferayIntegrationTestRule can't instantiate due to this error:

java.lang.NoClassDefFoundError: javax/servlet/ServletException
    at com.liferay.portal.test.rule.LiferayIntegrationTestRule.<clinit>(LiferayIntegrationTestRule.java:94)
    at it.baxtheman.mgb.box.service.persistence.test.cbAllegatoPersistenceTest.<clinit>(cbAllegatoPersistenceTest.java:67)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.liferay.arquillian.extension.junit.bridge.junit.Arquillian.run(Arquillian.java:111)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
    at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)

Any help?
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Looks like you're missing a dependency on the servlet api jar.
thumbnail
Olaf Kock, modified 6 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Could it be LPS-97550?
thumbnail
Daniele Baggio, modified 6 Years ago. Expert Posts: 336 Join Date: 12/5/08 Recent Posts
No Olaf,  I seems different.
In my case the test classes are executed but the init method raise the exception due to some arquillian bridge dependecies missed..