cancel
Showing results for 
Search instead for 
Did you mean: 

How to test Alfresco AMP service beans in external JUnit?

subaruwrc
Champ in-the-making
Champ in-the-making
I have looked through the Alfresco documentation and even a lot of their source code, but it appears all the test examples I've seen use BaseSpringTest or BaseAlfrescoSpringTest.  Unfortunately, it appears that those tests also need to be bundled with the code that gets deployed to Tomcat/Alfresco in order to execute correctly.

I'm trying to write external Unit Tests to test AMP code I've written, specifically a service object I've written which interacts with the nodeService.  It looks like I would extend BaseAlfrescoSpringTest to run these tests, but that appears to try and load some mysterious properties files, dumps "alf_data" in my test project and never enters my test methods.  And the Alfresco testing documentation is completely missing…

The first hurdle I've been working to overcome is the "The Alfresco 'dir.root' property is set to a relative path './alf_data'.  'dir.root' should be overridden to point to a specific folder" configuration error I am getting from my external JUnit tests.  It seems wherever I place the 'custom-repository.properties' file the BaseAlfrescoSpringTest is not finding it.


So, how do I externally test Alfresco AMP code I've written?  Specifically, how do I test the Spring service beans I've created in the AMP project using the appropriate external test harness?
1 REPLY 1