Some initial documentation on JUnit Rules samples.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34317 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2012-03-01 16:09:28 +00:00
parent 8521b7d7bd
commit 19c9d617a3
4 changed files with 80 additions and 6 deletions

View File

@@ -33,6 +33,24 @@ import org.springframework.context.ApplicationContext;
/**
* This JUnit rule can be used to setup and teardown a set of Alfresco users for test purposes.
* <p/>
* Example usage:
* <pre>
* public class YourTestClass
* {
* // Normally we would initialise the spring application context in another rule.
* &#64;ClassRule public static final ApplicationContextInit APP_CONTEXT_RULE = new ApplicationContextInit();
*
* // This rule will give us 8 GUID-named users.
* &#64;Rule public final AlfrescoPeople testPeople = new AlfrescoPeople(APP_CONTEXT_RULE, 8);
*
* &#64;Test public void aTestMethod()
* {
* Set&#60;String&#62; userNames = testPeople.getUsernames();
* // etc
* }
* }
* </pre>
*
* @author Neil Mc Erlean
* @since Odin