Search in sources :

Example 1 with RepositoryUtils

use of org.xwiki.extension.test.RepositoryUtils in project xwiki-platform by xwiki.

the class AllITs method preStart.

@XWikiExecutorSuite.PreStart
public void preStart(List<XWikiExecutor> executors) throws Exception {
    XWikiExecutor executor = executors.get(0);
    repositoryUtil = new RepositoryUtils();
    LOGGER.info("Adding repository to xwiki.properties");
    PropertiesConfiguration properties = executor.loadXWikiPropertiesConfiguration();
    // Put self and Maven as extensions repository
    properties.setProperty("extension.repositories", Arrays.asList("self:xwiki:http://localhost:8080/xwiki/rest", "maven-test:maven:" + repositoryUtil.getMavenRepository().toURI()));
    // Disable core extension resolve because Jetty is not ready when it starts
    properties.setProperty("extension.core.resolve", false);
    executor.saveXWikiProperties();
}
Also used : RepositoryUtils(org.xwiki.extension.test.RepositoryUtils) XWikiExecutor(org.xwiki.test.integration.XWikiExecutor) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration)

Example 2 with RepositoryUtils

use of org.xwiki.extension.test.RepositoryUtils in project xwiki-platform by xwiki.

the class AllTests method preStart.

@PageObjectSuite.PreStart
public void preStart(List<XWikiExecutor> executors) throws Exception {
    setupChannel(executors.get(0), "tcp");
    setupChannel(executors.get(1), "tcp");
    repositoryUtil = new RepositoryUtils();
    repositoryUtil.setup();
    setupRepositories(executors.get(0));
    setupRepositories(executors.get(1));
}
Also used : RepositoryUtils(org.xwiki.extension.test.RepositoryUtils)

Example 3 with RepositoryUtils

use of org.xwiki.extension.test.RepositoryUtils in project xwiki-platform by xwiki.

the class AllITs method initExtensions.

public static void initExtensions(PersistentTestContext context) throws Exception {
    // This will not be null if we are in the middle of allTests
    if (repositoryUtil == null) {
        repositoryUtil = new RepositoryUtils();
    }
    // Initialize extensions and repositories
    RepositoryTestUtils repositoryTestUtil = new RepositoryTestUtils(context.getUtil(), repositoryUtil, new SolrTestUtils(context.getUtil()));
    repositoryTestUtil.init();
    ExtensionTestUtils extensionTestUtil = new ExtensionTestUtils(context.getUtil());
    // Set integration repository and extension utils.
    context.getProperties().put(RepositoryTestUtils.PROPERTY_KEY, repositoryTestUtil);
    context.getProperties().put(ExtensionTestUtils.PROPERTY_KEY, extensionTestUtil);
    // Populate maven repository
    File extensionFile = repositoryUtil.getExtensionPackager().getExtensionFile(new ExtensionId("emptyjar", "1.0"));
    FileUtils.copyFile(extensionFile, new File(repositoryUtil.getMavenRepository(), "maven/extension/1.0/extension-1.0.jar"));
    FileUtils.copyFile(extensionFile, new File(repositoryUtil.getMavenRepository(), "maven/extension/2.0/extension-2.0.jar"));
    FileUtils.copyFile(extensionFile, new File(repositoryUtil.getMavenRepository(), "maven/oldextension/0.9/oldextension-0.9.jar"));
    FileUtils.copyFile(extensionFile, new File(repositoryUtil.getMavenRepository(), "maven/dependency/version/dependency-version.jar"));
    // Used in the Extension Manager functional tests.
    FileUtils.copyFile(extensionFile, new File(repositoryUtil.getMavenRepository(), "org/xwiki/commons/xwiki-commons-diff-api/2.7/xwiki-commons-diff-api-2.7.jar"));
    FileUtils.copyFile(extensionFile, new File(repositoryUtil.getMavenRepository(), "org/xwiki/platform/xwiki-platform-display-api/100.1/xwiki-platform-display-api-100.1.jar"));
}
Also used : RepositoryUtils(org.xwiki.extension.test.RepositoryUtils) SolrTestUtils(org.xwiki.repository.test.SolrTestUtils) ExtensionTestUtils(org.xwiki.extension.test.ExtensionTestUtils) RepositoryTestUtils(org.xwiki.repository.test.RepositoryTestUtils) ExtensionId(org.xwiki.extension.ExtensionId) File(java.io.File)

Example 4 with RepositoryUtils

use of org.xwiki.extension.test.RepositoryUtils in project xwiki-platform by xwiki.

the class AllTests method preStart.

@XWikiExecutorSuite.PreStart
public void preStart(List<XWikiExecutor> executors) throws Exception {
    XWikiExecutor executor = executors.get(0);
    repositoryUtil = new RepositoryUtils();
    LOGGER.info("Adding maven repository to xwiki.properties");
    PropertiesConfiguration properties = executor.loadXWikiPropertiesConfiguration();
    // Put self as extensions repository
    properties.setProperty("extension.repositories", "maven-test:maven:" + repositoryUtil.getMavenRepository().toURI());
    // Disable core extension resolve because Jetty is not ready when it starts
    properties.setProperty("extension.core.resolve", false);
    executor.saveXWikiProperties();
}
Also used : RepositoryUtils(org.xwiki.extension.test.RepositoryUtils) XWikiExecutor(org.xwiki.test.integration.XWikiExecutor) PropertiesConfiguration(org.apache.commons.configuration2.PropertiesConfiguration)

Aggregations

RepositoryUtils (org.xwiki.extension.test.RepositoryUtils)4 PropertiesConfiguration (org.apache.commons.configuration2.PropertiesConfiguration)2 XWikiExecutor (org.xwiki.test.integration.XWikiExecutor)2 File (java.io.File)1 ExtensionId (org.xwiki.extension.ExtensionId)1 ExtensionTestUtils (org.xwiki.extension.test.ExtensionTestUtils)1 RepositoryTestUtils (org.xwiki.repository.test.RepositoryTestUtils)1 SolrTestUtils (org.xwiki.repository.test.SolrTestUtils)1