Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Service integration test using Arquillian fails on LR 7.1
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?
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?
Looks like you're missing a dependency on the servlet api jar.
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..
In my case the test classes are executed but the init method raise the exception due to some arquillian bridge dependecies missed..
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™