Foros de discusión

Liferay integration testing

Mateusz Kruszyk, modificado hace 9 años.

Liferay integration testing

New Member Mensaje: 1 Fecha de incorporación: 11/07/14 Mensajes recientes
Hi guys

I am trying to set up integration testing with liferay and I find it suprisingly difficult. I've managed to set up ant to run it but when I do any DB operations (I copied a test from portal-impl tests) I get a lot of this kind of exceptions :

Caused by: java.sql.SQLException: user lacks privilege or object not found: COUNTER

I've read somewhere that it might be worth changing db from hypersonic to , let say, mysql.

So ... how do I do that?

This link suggests that I should put db conf into portal-test-ext.properties but I did that and they are still calling hypersonic.

I've put my portal-test-ext-properties into myPortlet/test directory if anybody wonders.

What is the good way to progress with that? Why there is no proper documentation on testing or did I missed it somehow?

thanks.
thumbnail
Manuel de la Peña, modificado hace 9 años.

RE: Liferay integration testing

Junior Member Mensajes: 62 Fecha de incorporación: 6/07/11 Mensajes recientes
Hi Mateusz

Reading your post, I guess that you are trying to setup a test environment for your plugins, aren't you? The wiki page you mentioned is about portal source code, that's why it doesn't work for you.

If you are dealing with plugins, then it would be better to setup the test environment as explained in this blog entry: https://www.liferay.com/es/web/manuel.delapenya/blog/-/blogs/-the-plugin-worked-on-my-computer-is-not-valid-anymore

You'll find there that we use Arquillian to throw the tests on a plugin to a running tomcat (previously configured as described on the blog entry), and Arquillian will be responsible of executing the tests on a live runtime (Liferay portal), and sending them back to the jUnit test runner (your IDE or ant console).

I've to say that this Arquillian integration has been done against our master branch, but it would be very easy to apply to 6.2.x or even 6.1.x, as it uses Plugins SDK ant tasks (i.e. direct-deploy). Which portal version are you coding against?

And of course, please comment what you think and if you make progress on it.

Thanks!