From ced709b7bcc83a123f75d8ef2fe93468d5db03ac Mon Sep 17 00:00:00 2001 From: Sara Aspery Date: Thu, 19 Jan 2023 11:36:25 +0000 Subject: [PATCH] Move problematic test out of pipeline tests --- .../search/SearchCasesTest.java | 30 ++++++++++++++++++ .../search/SearchSimpleCasesTest.java | 31 ------------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchCasesTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchCasesTest.java index 9caae205a..2b8dd154f 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchCasesTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchCasesTest.java @@ -29,7 +29,10 @@ import org.alfresco.rest.search.RestRequestQueryModel; import org.alfresco.rest.search.RestResultBucketsModel; import org.alfresco.rest.search.SearchRequest; import org.alfresco.rest.search.SearchResponse; +import org.alfresco.utility.Utility; import org.alfresco.utility.model.FileModel; +import org.alfresco.utility.model.FileType; +import org.hamcrest.Matchers; import org.springframework.http.HttpStatus; import org.testng.Assert; import org.testng.annotations.BeforeClass; @@ -130,4 +133,31 @@ public class SearchCasesTest extends AbstractSearchServicesE2ETest bucket1.assertThat().field("filterQuery").is("modifier:\"" + testUser.getUsername() + "\""); bucket1.assertThat().field("count").is(1); } + + @Test(priority=18) + public void searchSpecialCharacters() + { + String specialCharfileName = "è¥äæ§ç§-åæ.pdf"; + FileModel file = new FileModel(specialCharfileName, "è¥äæ§ç§-忬¯¸" + "è¥äæ§ç§-忬¯¸", "è¥äæ§ç§-忬¯¸", FileType.TEXT_PLAIN, + "Text file with Special Characters: " + specialCharfileName); + dataContent.usingUser(testUser).usingSite(testSite).createContent(file); + + waitForIndexing(file.getName(), true); + + SearchRequest searchReq = createQuery("name:'" + specialCharfileName + "'"); + SearchResponse nodes = query(searchReq); + restClient.assertStatusCodeIs(HttpStatus.OK); + + int searchCount = 0; + while (nodes.isEmpty() && searchCount < SEARCH_MAX_ATTEMPTS) + { + // Wait for the solr indexing (eventual consistency). + Utility.waitToLoopTime(properties.getSolrWaitTimeInSeconds(), "Wait For Results After Indexing. Retry Attempt: " + (searchCount + 1)); + nodes = query(searchReq); + restClient.assertStatusCodeIs(HttpStatus.OK); + } + + nodes.assertThat().entriesListIsNotEmpty(); + restClient.onResponse().assertThat().body("list.entries.entry[0].name", Matchers.equalToIgnoringCase(specialCharfileName)); + } } diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchSimpleCasesTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchSimpleCasesTest.java index a854a0488..72b34811c 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchSimpleCasesTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchSimpleCasesTest.java @@ -25,10 +25,6 @@ package org.alfresco.test.search.functional.searchServices.search; import org.alfresco.rest.search.RestRequestQueryModel; import org.alfresco.rest.search.SearchRequest; import org.alfresco.rest.search.SearchResponse; -import org.alfresco.utility.Utility; -import org.alfresco.utility.model.FileModel; -import org.alfresco.utility.model.FileType; -import org.hamcrest.Matchers; import org.springframework.http.HttpStatus; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -223,31 +219,4 @@ public class SearchSimpleCasesTest extends AbstractSearchServicesE2ETest restClient.assertStatusCodeIs(HttpStatus.OK); response6.assertThat().entriesListIsNotEmpty(); } - - @Test(priority=18) - public void searchSpecialCharacters() - { - String specialCharfileName = "è¥äæ§ç§-åæ.pdf"; - FileModel file = new FileModel(specialCharfileName, "è¥äæ§ç§-忬¯¸" + "è¥äæ§ç§-忬¯¸", "è¥äæ§ç§-忬¯¸", FileType.TEXT_PLAIN, - "Text file with Special Characters: " + specialCharfileName); - dataContent.usingUser(testUser).usingSite(testSite).createContent(file); - - waitForIndexing(file.getName(), true); - - SearchRequest searchReq = createQuery("name:'" + specialCharfileName + "'"); - SearchResponse nodes = query(searchReq); - restClient.assertStatusCodeIs(HttpStatus.OK); - - int searchCount = 0; - while (nodes.isEmpty() && searchCount < SEARCH_MAX_ATTEMPTS) - { - // Wait for the solr indexing (eventual consistency). - Utility.waitToLoopTime(properties.getSolrWaitTimeInSeconds(), "Wait For Results After Indexing. Retry Attempt: " + (searchCount + 1)); - nodes = query(searchReq); - restClient.assertStatusCodeIs(HttpStatus.OK); - } - - nodes.assertThat().entriesListIsNotEmpty(); - restClient.onResponse().assertThat().body("list.entries.entry[0].name", Matchers.equalToIgnoringCase(specialCharfileName)); - } }