mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
127601 jkaabimofrad: Merged API-STRIKES-BACK (5.2.0) to HEAD (5.2) 127330 amukha: RA-941: V1 REST API Tests: rationalise the test startup - eg. only create test data when needed ;-) - Added checks to defer test data creation until it is required. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@127693 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -101,15 +101,22 @@ public abstract class AbstractTestFixture implements TestFixture
|
||||
|
||||
public void setup() throws Exception
|
||||
{
|
||||
setup(true);
|
||||
}
|
||||
|
||||
public void setup(boolean createTestData) throws Exception
|
||||
{
|
||||
this.jetty = makeJettyComponent();
|
||||
this.jetty.start();
|
||||
this.applicationContext = jetty.getApplicationContext();
|
||||
this.repoService = makeRepoService();
|
||||
this.transactionHelper = (RetryingTransactionHelper)repoService.getApplicationContext().getBean("retryingTransactionHelper");
|
||||
|
||||
populateTestData();
|
||||
|
||||
createTestData();
|
||||
if (createTestData)
|
||||
{
|
||||
populateTestData();
|
||||
createTestData();
|
||||
}
|
||||
}
|
||||
|
||||
public RepoService getRepoService()
|
||||
@@ -139,6 +146,11 @@ public abstract class AbstractTestFixture implements TestFixture
|
||||
|
||||
public TestNetwork getRandomNetwork()
|
||||
{
|
||||
if (networks.isEmpty())
|
||||
{
|
||||
populateTestData();
|
||||
createTestData();
|
||||
}
|
||||
int r = random.nextInt(networks.size());
|
||||
List<TestNetwork> a = new ArrayList<TestNetwork>();
|
||||
a.addAll(networks.values());
|
||||
|
Reference in New Issue
Block a user