Liferay has been catching up lately on the tests coverage. Many improvements have been made in the trunk located in liferay-portal / master branch on GitHub and since I've been fixing some things recently, I've included unit test for the changed class as well.
Quick start how-to:
- read Liferay testing documentation to get the basic picture,
- create your unit test in
portal-impl/test/unit/.../<your_class>Test.java,
- create test methods as usual with JUnit 4.x,
- run the test and see results:
cd portal-impl,
ant test-class -Dclass=CustomJspRegistryImplTest,
- note that only the name of the class is used, not the full name including package.
Testing just a single class at a time seems to be necessary, executing ant test-unit to run all existing unit tests seems to be time consuming (from minutes to tens of minutes).