mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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.
|
||||
* @ClassRule public static final ApplicationContextInit APP_CONTEXT_RULE = new ApplicationContextInit();
|
||||
*
|
||||
* // This rule will give us 8 GUID-named users.
|
||||
* @Rule public final AlfrescoPeople testPeople = new AlfrescoPeople(APP_CONTEXT_RULE, 8);
|
||||
*
|
||||
* @Test public void aTestMethod()
|
||||
* {
|
||||
* Set<String> userNames = testPeople.getUsernames();
|
||||
* // etc
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Neil Mc Erlean
|
||||
* @since Odin
|
||||
|
Reference in New Issue
Block a user