Merged HEAD-BUG-FIX (Cloud33/4.3) to HEAD (Cloud33/4.3)

62920: Merged PLATFORM1 (Cloud33) to HEAD-BUG-FIX (Cloud33/4.3)
      << This was a bad merge with conflicts to do with the impl/solr directory not existing >>
      62511: ACE-482: Hybrid search can be disabled/enabled and is disabled by default.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62975 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-20 14:37:41 +00:00
parent 4e6a415eb2
commit 1a7fd86ee2
10 changed files with 425 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import javax.transaction.UserTransaction;
import junit.framework.TestCase;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.search.impl.solr.DisabledFeatureException;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
@@ -32,6 +33,7 @@ import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.LimitBy;
import org.alfresco.service.cmr.search.PermissionEvaluationMode;
import org.alfresco.service.cmr.search.QueryConsistency;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService;
@@ -161,6 +163,27 @@ public class SearchServiceTest extends TestCase
super.tearDown();
}
public void testHybridDisabledByDefault()
{
try
{
authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
SearchParameters sp = new SearchParameters();
sp.setQueryConsistency(QueryConsistency.HYBRID);
sp.setLanguage(SearchService.LANGUAGE_CMIS_ALFRESCO);
sp.setQuery("select * from cmis:document where cmis:name like '%alfresco%'");
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
pubSearchService.query(sp);
fail("Hybrid search should be disabled.");
}
catch (DisabledFeatureException e)
{
// Got here, good.
}
}
public void testAdmim()
{
authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());