mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-10 14:11:25 +00:00
Merge pull request #1639 from Alfresco/fix/ACS-4463_FixPipelineIntermittentFailures
Check for non-empty results and move some tests out of pipeline suite
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Search Services E2E Test
|
* Alfresco Search Services E2E Test
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -26,10 +26,15 @@
|
|||||||
|
|
||||||
package org.alfresco.test.search.functional.searchServices.search;
|
package org.alfresco.test.search.functional.searchServices.search;
|
||||||
|
|
||||||
|
import org.alfresco.rest.exception.EmptyJsonResponseException;
|
||||||
|
import org.alfresco.rest.search.SearchResponse;
|
||||||
import org.alfresco.test.search.functional.AbstractE2EFunctionalTest;
|
import org.alfresco.test.search.functional.AbstractE2EFunctionalTest;
|
||||||
|
import org.alfresco.utility.Utility;
|
||||||
import org.alfresco.utility.model.FileModel;
|
import org.alfresco.utility.model.FileModel;
|
||||||
import org.alfresco.utility.model.FileType;
|
import org.alfresco.utility.model.FileType;
|
||||||
import org.alfresco.utility.model.FolderModel;
|
import org.alfresco.utility.model.FolderModel;
|
||||||
|
import org.alfresco.utility.model.UserModel;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
|
|
||||||
import static java.util.List.of;
|
import static java.util.List.of;
|
||||||
@@ -47,6 +52,10 @@ import static java.util.List.of;
|
|||||||
public abstract class AbstractSearchServicesE2ETest extends AbstractE2EFunctionalTest
|
public abstract class AbstractSearchServicesE2ETest extends AbstractE2EFunctionalTest
|
||||||
{
|
{
|
||||||
private static final String SEARCH_DATA_SAMPLE_FOLDER = "FolderSearch";
|
private static final String SEARCH_DATA_SAMPLE_FOLDER = "FolderSearch";
|
||||||
|
private static final int MAX_ATTEMPTS_TO_RETRY_QUERY = 10;
|
||||||
|
private static final int MAX_WAIT_IN_SECONDS_BEFORE_RETRY_QUERY = 5;
|
||||||
|
private static final int MAX_ATTEMPTS_TO_READ_RESPONSE = 10;
|
||||||
|
private static final int MAX_WAIT_IN_SECONDS_BEFORE_REREAD_RESPONSE = 2;
|
||||||
|
|
||||||
/** The maximum time to wait for content indexing to complete (in ms). */
|
/** The maximum time to wait for content indexing to complete (in ms). */
|
||||||
private static final int MAX_TIME = 120 * 1000;
|
private static final int MAX_TIME = 120 * 1000;
|
||||||
@@ -104,4 +113,46 @@ public abstract class AbstractSearchServicesE2ETest extends AbstractE2EFunctiona
|
|||||||
|
|
||||||
return uniqueFile;
|
return uniqueFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected SearchResponse queryUntilResponseEntriesListNotEmpty(UserModel user, String queryString)
|
||||||
|
{
|
||||||
|
SearchResponse response = queryUntilStatusIsOk(user, queryString);
|
||||||
|
if (restClient.getStatusCode().matches(HttpStatus.OK.toString()))
|
||||||
|
{
|
||||||
|
for (int readAttempts = 0; readAttempts < MAX_ATTEMPTS_TO_READ_RESPONSE; readAttempts++)
|
||||||
|
{
|
||||||
|
if (!response.isEmpty())
|
||||||
|
{
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
Utility.waitToLoopTime(MAX_WAIT_IN_SECONDS_BEFORE_REREAD_RESPONSE, "Re-reading empty response. Retry Attempt: " + (readAttempts + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SearchResponse queryUntilStatusIsOk(UserModel user, String queryString)
|
||||||
|
{
|
||||||
|
// Repeat query until status is OK or Query Retry limit is hit
|
||||||
|
for (int queryAttempts = 0; queryAttempts < MAX_ATTEMPTS_TO_RETRY_QUERY - 1; queryAttempts++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SearchResponse response = queryAsUser(user, queryString);
|
||||||
|
if (restClient.getStatusCode().matches(HttpStatus.OK.toString()))
|
||||||
|
{
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for pipeline to calm down
|
||||||
|
Utility.waitToLoopTime(MAX_WAIT_IN_SECONDS_BEFORE_RETRY_QUERY, "Re-trying query for valid status code. Retry Attempt: " + (queryAttempts + 1));
|
||||||
|
}
|
||||||
|
catch (EmptyJsonResponseException ignore)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Final attempt
|
||||||
|
return queryAsUser(user, queryString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Search Services E2E Test
|
* Alfresco Search Services E2E Test
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -51,6 +51,162 @@ public class SearchCasesTest extends AbstractSearchServicesE2ETest
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test(priority=1)
|
@Test(priority=1)
|
||||||
|
public void testSearchNameField()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:pangram");
|
||||||
|
queryReq.setUserQuery("pangram");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response = queryAsUser(testUser, "cm:name:pangram");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=2)
|
||||||
|
public void testSearchTitleField()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:title:cars");
|
||||||
|
queryReq.setUserQuery("cars");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response2 = queryAsUser(testUser, "cm:title:cars");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response2.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=3)
|
||||||
|
public void testSearchDescriptionField()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:description:alfresco");
|
||||||
|
queryReq.setUserQuery("alfresco");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response3 = queryAsUser(testUser, "cm:description:alfresco");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response3.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=4)
|
||||||
|
public void testSearchTextFile()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:pangram.txt");
|
||||||
|
queryReq.setUserQuery("pangram.txt");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "cm:name:pangram.txt");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=5)
|
||||||
|
public void testSearchPDFFile()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:cars.PDF");
|
||||||
|
queryReq.setUserQuery("cars.PDF");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "cm:name:cars.PDF");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=6)
|
||||||
|
public void testSearchDocxFile()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:alfresco.docx");
|
||||||
|
queryReq.setUserQuery("alfresco.docx");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "cm:name:alfresco.docx");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=7)
|
||||||
|
public void testSearchPhraseQueries()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:alfresco");
|
||||||
|
queryReq.setUserQuery("alfresco");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "The quick brown fox jumps over the lazy dog");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=8)
|
||||||
|
public void testSearchExactTermQueries()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:alfresco");
|
||||||
|
queryReq.setUserQuery("alfresco");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "=alfresco");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=9)
|
||||||
|
public void testSearchConjunctionQueries()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:unique");
|
||||||
|
queryReq.setUserQuery("unique");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "unique AND search");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=10)
|
||||||
|
public void testSearchDisjunctionQueries()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:cars");
|
||||||
|
queryReq.setUserQuery("cars");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "file OR discovery");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=11)
|
||||||
|
public void testSearchNegationQueries()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:pangram");
|
||||||
|
queryReq.setUserQuery("pangram");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "pangram NOT pan");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=12)
|
||||||
|
public void testSearchWildcardQueries()
|
||||||
|
{
|
||||||
|
SearchRequest searchReq = new SearchRequest();
|
||||||
|
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
||||||
|
queryReq.setQuery("cm:name:alfresco");
|
||||||
|
queryReq.setUserQuery("alfresco");
|
||||||
|
searchReq.setQuery(queryReq);
|
||||||
|
SearchResponse response6 = queryAsUser(testUser, "al?res*");
|
||||||
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(priority=13)
|
||||||
public void testSearchUpdateContent() throws InterruptedException
|
public void testSearchUpdateContent() throws InterruptedException
|
||||||
{
|
{
|
||||||
String originalText = String.valueOf(System.currentTimeMillis());
|
String originalText = String.valueOf(System.currentTimeMillis());
|
||||||
@@ -96,7 +252,7 @@ public class SearchCasesTest extends AbstractSearchServicesE2ETest
|
|||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
@Test(priority=2)
|
@Test(priority=14)
|
||||||
public void searchWithFacedFields() throws InterruptedException
|
public void searchWithFacedFields() throws InterruptedException
|
||||||
{
|
{
|
||||||
String uniqueText = String.valueOf(System.currentTimeMillis());
|
String uniqueText = String.valueOf(System.currentTimeMillis());
|
||||||
@@ -134,7 +290,7 @@ public class SearchCasesTest extends AbstractSearchServicesE2ETest
|
|||||||
bucket1.assertThat().field("count").is(1);
|
bucket1.assertThat().field("count").is(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(priority=3)
|
@Test(priority=15)
|
||||||
public void searchSpecialCharacters()
|
public void searchSpecialCharacters()
|
||||||
{
|
{
|
||||||
String specialCharfileName = "è¥äæ§ç§-åæ.pdf";
|
String specialCharfileName = "è¥äæ§ç§-åæ.pdf";
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Search Services E2E Test
|
* Alfresco Search Services E2E Test
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
* Copyright (C) 2005 - 2023 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -39,45 +39,6 @@ public class SearchSimpleCasesTest extends AbstractSearchServicesE2ETest
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test(priority=1)
|
@Test(priority=1)
|
||||||
public void testSearchNameField()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:pangram");
|
|
||||||
queryReq.setUserQuery("pangram");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response = queryAsUser(testUser, "cm:name:pangram");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=2)
|
|
||||||
public void testSearchTitleField()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:title:cars");
|
|
||||||
queryReq.setUserQuery("cars");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response2 = queryAsUser(testUser, "cm:title:cars");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response2.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=3)
|
|
||||||
public void testSearchDescriptionField()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:description:alfresco");
|
|
||||||
queryReq.setUserQuery("alfresco");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response3 = queryAsUser(testUser, "cm:description:alfresco");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response3.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=4)
|
|
||||||
public void testSearchContentField()
|
public void testSearchContentField()
|
||||||
{
|
{
|
||||||
SearchRequest searchReq = new SearchRequest();
|
SearchRequest searchReq = new SearchRequest();
|
||||||
@@ -85,51 +46,12 @@ public class SearchSimpleCasesTest extends AbstractSearchServicesE2ETest
|
|||||||
queryReq.setQuery("cm:content:unique");
|
queryReq.setQuery("cm:content:unique");
|
||||||
queryReq.setUserQuery("unique");
|
queryReq.setUserQuery("unique");
|
||||||
searchReq.setQuery(queryReq);
|
searchReq.setQuery(queryReq);
|
||||||
SearchResponse response4 = queryAsUser(testUser, "cm:content:unique");
|
SearchResponse response4 = queryUntilResponseEntriesListNotEmpty(testUser, "cm:content:unique");
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
response4.assertThat().entriesListIsNotEmpty();
|
response4.assertThat().entriesListIsNotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(priority=6)
|
@Test(priority=2)
|
||||||
public void testSearchTextFile()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:pangram.txt");
|
|
||||||
queryReq.setUserQuery("pangram.txt");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "cm:name:pangram.txt");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=7)
|
|
||||||
public void testSearchPDFFile()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:cars.PDF");
|
|
||||||
queryReq.setUserQuery("cars.PDF");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "cm:name:cars.PDF");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=8)
|
|
||||||
public void testSearchDocxFile()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:alfresco.docx");
|
|
||||||
queryReq.setUserQuery("alfresco.docx");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "cm:name:alfresco.docx");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=9)
|
|
||||||
public void testSearchODTFile()
|
public void testSearchODTFile()
|
||||||
{
|
{
|
||||||
SearchRequest searchReq = new SearchRequest();
|
SearchRequest searchReq = new SearchRequest();
|
||||||
@@ -137,85 +59,7 @@ public class SearchSimpleCasesTest extends AbstractSearchServicesE2ETest
|
|||||||
queryReq.setQuery("cm:name:unique.ODT");
|
queryReq.setQuery("cm:name:unique.ODT");
|
||||||
queryReq.setUserQuery("unique.ODT");
|
queryReq.setUserQuery("unique.ODT");
|
||||||
searchReq.setQuery(queryReq);
|
searchReq.setQuery(queryReq);
|
||||||
SearchResponse response6 = queryAsUser(testUser, "cm:name:unique.ODT");
|
SearchResponse response6 = queryUntilResponseEntriesListNotEmpty(testUser, "cm:name:unique.ODT");
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=12)
|
|
||||||
public void testSearchPhraseQueries()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:alfresco");
|
|
||||||
queryReq.setUserQuery("alfresco");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "The quick brown fox jumps over the lazy dog");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=13)
|
|
||||||
public void testSearchExactTermQueries()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:alfresco");
|
|
||||||
queryReq.setUserQuery("alfresco");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "=alfresco");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=14)
|
|
||||||
public void testSearchConjunctionQueries()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:unique");
|
|
||||||
queryReq.setUserQuery("unique");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "unique AND search");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=15)
|
|
||||||
public void testSearchDisjunctionQueries()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:cars");
|
|
||||||
queryReq.setUserQuery("cars");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "file OR discovery");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=16)
|
|
||||||
public void testSearchNegationQueries()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:pangram");
|
|
||||||
queryReq.setUserQuery("pangram");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "pangram NOT pan");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(priority=17)
|
|
||||||
public void testSearchWildcardQueries()
|
|
||||||
{
|
|
||||||
SearchRequest searchReq = new SearchRequest();
|
|
||||||
RestRequestQueryModel queryReq = new RestRequestQueryModel();
|
|
||||||
queryReq.setQuery("cm:name:alfresco");
|
|
||||||
queryReq.setUserQuery("alfresco");
|
|
||||||
searchReq.setQuery(queryReq);
|
|
||||||
SearchResponse response6 = queryAsUser(testUser, "al?res*");
|
|
||||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||||
response6.assertThat().entriesListIsNotEmpty();
|
response6.assertThat().entriesListIsNotEmpty();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user