Skip to content
Snippets Groups Projects
Commit 6c758384 authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-16192: Refactor links to support properly backlinks in a farm

* update test to take into account the fact that indexing links is slightly slower than it used to be
parent 91d707d2
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,7 @@
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.xwiki.platform</groupId>
......@@ -89,6 +90,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-search-solr-test-utils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-wiki-ui-wiki</artifactId>
......
......@@ -28,9 +28,13 @@
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.model.reference.SpaceReference;
import org.xwiki.model.reference.WikiReference;
import org.xwiki.repository.test.SolrTestUtils;
import org.xwiki.test.docker.junit5.ExtensionOverride;
import org.xwiki.test.docker.junit5.TestConfiguration;
import org.xwiki.test.docker.junit5.TestReference;
import org.xwiki.test.docker.junit5.UITest;
import org.xwiki.test.docker.junit5.servletengine.ServletEngine;
import org.xwiki.test.integration.XWikiExecutor;
import org.xwiki.test.ui.TestUtils;
import org.xwiki.test.ui.po.CopyOrRenameOrDeleteStatusPage;
import org.xwiki.test.ui.po.RenamePage;
......@@ -92,7 +96,8 @@ class SubWikiIT
@Test
@Order(1)
void movePageToSubwiki(TestUtils setup, TestReference testReference) throws Exception
void movePageToSubwiki(TestUtils setup, TestReference testReference, TestConfiguration testConfiguration)
throws Exception
{
createSubWiki(setup);
......@@ -118,6 +123,9 @@ void movePageToSubwiki(TestUtils setup, TestReference testReference) throws Exce
// For checking the link update.
setup.createPage(mainWikiLinkPage, String.format("[[%s.WebHome]]", space));
// Wait for the Solr indexing to be completed before moving the page
new SolrTestUtils(setup, computedHostURL(testConfiguration)).waitEmpyQueue();
// Move the page to subwiki.
ViewPage viewPage = setup.gotoPage(testReference);
RenamePage renamePage = viewPage.rename();
......@@ -143,6 +151,13 @@ void movePageToSubwiki(TestUtils setup, TestReference testReference) throws Exce
deleteSubWiki(setup);
}
private String computedHostURL(TestConfiguration testConfiguration)
{
ServletEngine servletEngine = testConfiguration.getServletEngine();
return String.format("http://%s:%d%s", servletEngine.getIP(), servletEngine.getPort(),
XWikiExecutor.DEFAULT_CONTEXT);
}
/**
* We create the subwiki as first action before running the test.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment