掲示板

Liferay DXP Integration Tests

7年前 に Martin Kruse によって更新されました。

Liferay DXP Integration Tests

New Member 投稿: 2 参加年月日: 14/04/15 最新の投稿
Hi Devs,

I need help to get integration tests in Liferay DXP with an OSGi module built with gradle up and running. I tried several posts on the internet including:
https://web.liferay.com/web/neeraj.gautam/blog/-/blogs/unit-testing-and-integration-testing-for-service-builder-with-liferay-dxp-7-0-ce
https://web.liferay.com/de/community/wiki/-/wiki/Main/Liferay+Testing+Infrastructure
...

and of course the official documentation
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/arquillian-extension-for-liferay-example

Sadly none of these seem to work. The official documentation does not even refer to a bundle created in a liferay workspace with gradle, which seems to be the preferred way to work with DXP, isn't it?

Attached you can find a simple example module that has an api, service and test module. The service just invokes the userlocalservice to count the users and the test should be successful, when there is at least one user (so it should be always successful). You can copy the module in the modules-folder in the liferay workspace and just refresh gradle projects in Liferay Developer Studio to get the service up and running.
At the current state, this test fails because the service injection does not work. This is because the test module is kept pretty dumb at the moment.

Can please anyone make this test running?

I also tried using pax exam to get this working. So using another framework to get simple integration tests running would be acceptable too.

May goals for using integration tests are:
- testing custom services that use liferay services
- not having to create mocks for liferay services
- test correct initialization of all relevant modules
- test correct versions and services of all relevant modules

Thank you very much in advance.
Martin

添付ファイル:

7年前 に Martin Kruse によって更新されました。

RE: Liferay DXP Integration Tests

New Member 投稿: 2 参加年月日: 14/04/15 最新の投稿
Hi Devs,

I still have Problems getting integration tests to work. I have attached a new example-bundle with api and service, that need to be deployed before running the test. Sadly the Inject in the test does not work - the injected service is still always null.

In the official documentation the Inject class is imported from org.arquillian.container.liferay.remote.enricher.Inject instead of com.liferay.arquillian.containter.remote.enricher.Inject. This will result in a missing import of spring-test packages and others, but maybe this will work if anyone could tell me what bundles need to be installed (I tried spring-osgi-test and others, but I think this approach results in conflicts with the system bundle).

Does anyone have a tip on how I should proceed?

Best regards
Martin

添付ファイル:

thumbnail
7年前 に Manish Kumar Jaiswal によって更新されました。

RE: Liferay DXP Integration Tests

Regular Member 投稿: 153 参加年月日: 08/11/25 最新の投稿
Hi Matin ,
Did you get any breakthrough . I too am facing similar problem . If yes can you please share the working example .

Thanks in advance
Manish
6年前 に Anji E によって更新されました。

RE: Liferay DXP Integration Tests

Junior Member 投稿: 49 参加年月日: 14/11/18 最新の投稿
Hi Martin ,

Did you find solution ? We are also implementing arquilian test .
Please share your finds , it will be helpful for us
6年前 に deveshree zawar によって更新されました。

RE: Liferay DXP Integration Tests

Junior Member 投稿: 61 参加年月日: 16/02/09 最新の投稿
Hi,

Any solution with the Functional Tests using Arquillian.
Facing issues related to Selenium drivers.
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055
Any help is appreciated.

Thanks,
Deveshree