mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
REST API Tests: minor pre-work (mark RepoService.createSite as deprecated, remove exists/delete)
- build attempt - REPO-1344, REPO-112 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@131113 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -209,7 +209,7 @@ public class RepoService
|
|||||||
protected Activities activities;
|
protected Activities activities;
|
||||||
|
|
||||||
protected PublicApiTestContext publicApiContext;
|
protected PublicApiTestContext publicApiContext;
|
||||||
|
|
||||||
protected Random random = new Random(System.currentTimeMillis());
|
protected Random random = new Random(System.currentTimeMillis());
|
||||||
|
|
||||||
protected static int numNetworks = 0;
|
protected static int numNetworks = 0;
|
||||||
@@ -511,33 +511,21 @@ public class RepoService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestSite createSite(TestNetwork network, final SiteInformation site)
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public TestSite createSite(TestNetwork network, final SiteInformation siteInfoIn)
|
||||||
{
|
{
|
||||||
SiteInfo siteInfo = null;
|
SiteInfo siteInfoOut = siteService.createSite(TEST_SITE_PRESET, siteInfoIn.getShortName(), siteInfoIn.getTitle(), siteInfoIn.getDescription(), siteInfoIn.getSiteVisibility());
|
||||||
|
siteService.createContainer(siteInfoIn.getShortName(), "documentLibrary", ContentModel.TYPE_FOLDER, null);
|
||||||
if(siteService.hasSite(site.getShortName()))
|
|
||||||
{
|
final TestSite testSite = new TestSite(network, siteInfoOut);
|
||||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public Void doWork() throws Exception
|
|
||||||
{
|
|
||||||
siteService.deleteSite(site.getShortName());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
siteInfo = siteService.createSite(TEST_SITE_PRESET, site.getShortName(), site.getTitle(), site.getDescription(), site.getSiteVisibility());
|
|
||||||
siteService.createContainer(site.getShortName(), "documentLibrary", ContentModel.TYPE_FOLDER, null);
|
|
||||||
|
|
||||||
final TestSite testSite = new TestSite(network, siteInfo);
|
|
||||||
|
|
||||||
log("Created site " + testSite + (network != null ? " in network " + network : ""));
|
log("Created site " + testSite + (network != null ? " in network " + network : ""));
|
||||||
|
|
||||||
return testSite;
|
return testSite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Invitation rejectSiteInvitation(String personId, String siteId)
|
public Invitation rejectSiteInvitation(String personId, String siteId)
|
||||||
{
|
{
|
||||||
Invitation ret = null;
|
Invitation ret = null;
|
||||||
@@ -1390,6 +1378,9 @@ public class RepoService
|
|||||||
return createSite(siteInfo);
|
return createSite(siteInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated replace with AbstractBaseApiTest.createSite (or PublicApiClient.sites.createSite)
|
||||||
|
*/
|
||||||
public TestSite createSite(final SiteInformation site)
|
public TestSite createSite(final SiteInformation site)
|
||||||
{
|
{
|
||||||
TestSite testSite = RepoService.this.createSite(this, site);
|
TestSite testSite = RepoService.this.createSite(this, site);
|
||||||
|
Reference in New Issue
Block a user