For a general overview of testing within the SPCP7 look at the documentation on the SPCP7 main site.

You can find the tests of the image gallery maven typical below src/test/java . Within the image gallery there are junit 4.0 tests for the spcp7-imagegallery-abstraction-impl and the spcp7-imagegallery-cp-impl-alfresco projects. You can execute them like every other maven test. For details on how to do this view the maven documentation. Most of the time it is as easy as:

mvn test

spcp7-imagegallery-abstraction-impl tests

spcp7.imagegallery.abstractionlayer.test.TestContentProviderRegistry.java needs a configured and running database to work. Details on how to set up the database can be found in the appropriate Java Doc. With this test adding, getting and updating of content folders and getting a content provider instance can be tested.


If you want to run these tests a configured and running database and a configured and running Alfresco instance are needed. For instructions on how to configure the database and alfresco visit the installation instructions of this Image Gallery.


This test needs specific test data to work. It will be inserted when the test starts. spcp7.imagegallery.alfresco.test.util.AlfrescoTestBase.java provides all functionality for inserting the test data. If you need test data for other purposes you can call/run AlfrescoTestBase.java separately. Due to technical reasons it is not possible to submit working preview images for the content folders. This does not affect the tests. You can add preview images yourself via the image gallery admin page. For further reading refer to the API documentation.


This is a quite simple class to test methods of the Alfresco Utils like encodeAlfrescoAbbreviatedPathISO9075(String) .