Removed index search ('xpath') from FileFolderPerformanceTester

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31123 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-10-11 11:12:16 +00:00
parent 87bee8092d
commit 9e7bb25cc6

View File

@@ -49,6 +49,7 @@ import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchService; import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.MutableAuthenticationService;
import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService; import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.ApplicationContextHelper;
@@ -82,6 +83,7 @@ public class FileFolderPerformanceTester extends TestCase
private AuthenticationComponent authenticationComponent; private AuthenticationComponent authenticationComponent;
private FileFolderService fileFolderService; private FileFolderService fileFolderService;
private SearchService searchService; private SearchService searchService;
private NamespaceService namespaceService;
private NodeRef rootFolderRef; private NodeRef rootFolderRef;
private File dataFile; private File dataFile;
@@ -103,6 +105,7 @@ public class FileFolderPerformanceTester extends TestCase
fileFolderService = serviceRegistry.getFileFolderService(); fileFolderService = serviceRegistry.getFileFolderService();
searchService = serviceRegistry.getSearchService(); searchService = serviceRegistry.getSearchService();
namespaceService = serviceRegistry.getNamespaceService();
nodeService = getNodeService(); nodeService = getNodeService();
authenticate(USERNAME); authenticate(USERNAME);
@@ -134,23 +137,23 @@ public class FileFolderPerformanceTester extends TestCase
{ {
// find the company home folder // find the company home folder
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"); StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH, "/app:company_home"); NodeRef storeRootNodeRef = nodeService.getRootNode(storeRef);
try List<NodeRef> results = searchService.selectNodes(
storeRootNodeRef,
"/app:company_home",
null,
namespaceService,
false,
SearchService.LANGUAGE_XPATH);
if (results.size() == 0)
{ {
if (rs.length() == 0) throw new AlfrescoRuntimeException("Didn't find Company Home");
{
throw new AlfrescoRuntimeException("Didn't find Company Home");
}
NodeRef companyHomeNodeRef = rs.getNodeRef(0);
return fileFolderService.create(
companyHomeNodeRef,
getName() + "_" + System.currentTimeMillis(),
ContentModel.TYPE_FOLDER).getNodeRef();
}
finally
{
rs.close();
} }
NodeRef companyHomeNodeRef = results.get(0);
return fileFolderService.create(
companyHomeNodeRef,
getName() + "_" + System.currentTimeMillis(),
ContentModel.TYPE_FOLDER).getNodeRef();
} }
/** /**