Turned WebScripts registry into an asynchronously-refreshed component

- The size of the object and the nature in which it is read means that it does not really
   fit into the clustered cache model.  We just notify the cluster if the cache entry it needs to be
   reloaded, serving stale data for a short while
 - ALF-19982: BM-0013: Reindex: WebScripts registry is repeatedly reset (DeclarativeRegistry)
 - ALF-19983 BM-0013: Reindex: Solr reindex works very slowly 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55415 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2013-09-17 14:39:25 +00:00
parent 17d6ce3730
commit 403fd26ace
6 changed files with 1242 additions and 1180 deletions

View File

@@ -86,24 +86,25 @@ public class RepositoryContainerTest extends BaseWebScriptTest
/**
* Person should be current user irrespective of runas user.
*/
public void testRunAsAdmin() throws Exception {
authenticationComponent.setCurrentUser(USER_ONE);
// No runas specified within our webscript descriptor
Response response = sendRequest(new GetRequest("/test/runas"), STATUS_OK);
assertEquals(USER_ONE, response.getContentAsString());
public void testRunAsAdmin() throws Exception
{
authenticationComponent.setCurrentUser(USER_ONE);
// No runas specified within our webscript descriptor
Response response = sendRequest(new GetRequest("/test/runas"), STATUS_OK);
assertEquals(USER_ONE, response.getContentAsString());
authenticationComponent.setCurrentUser(USER_TWO);
// runas "Admin" specified within our webscript descriptor
response = sendRequest(new GetRequest("/test/runasadmin"), STATUS_OK);
assertEquals(USER_TWO, response.getContentAsString());
authenticationComponent.setSystemUserAsCurrentUser();
}
authenticationComponent.setCurrentUser(USER_TWO);
// runas "Admin" specified within our webscript descriptor
response = sendRequest(new GetRequest("/test/runasadmin"), STATUS_OK);
assertEquals(USER_TWO, response.getContentAsString());
authenticationComponent.setSystemUserAsCurrentUser();
}
public void testReset() throws Exception
public void testReset() throws Exception
{
RepositoryContainer repoContainer = (RepositoryContainer) getServer().getApplicationContext().getBean("webscripts.container");
repoContainer.reset();