Search in sources :

Example 1 with ExtensionTestUtils

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

the class AbstractExtensionAdminAuthenticatedIT method init.

@BeforeClass
public static void init() throws Exception {
    // Make sure repository and extension utils are initialized and set.
    RepositoryTestUtils repositoryTestUtils = getRepositoryTestUtils();
    ExtensionTestUtils extensionTestUtils = getExtensionTestUtils();
    // This will not be null if we are in the middle of allTests
    if (repositoryTestUtils == null || extensionTestUtils == null) {
        AllITs.initExtensions(context);
    }
}
Also used : ExtensionTestUtils(org.xwiki.extension.test.ExtensionTestUtils) RepositoryTestUtils(org.xwiki.repository.test.RepositoryTestUtils) BeforeClass(org.junit.BeforeClass)

Example 2 with ExtensionTestUtils

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

the class AllTests method initExtensionTestUtils.

public static ExtensionTestUtils initExtensionTestUtils(PersistentTestContext context) throws Exception {
    // Initialize extensions and repositories
    ExtensionTestUtils extensionTestUtil = new ExtensionTestUtils(context.getUtil());
    // Set integration extension utils.
    context.getProperties().put(ExtensionTestUtils.PROPERTY_KEY, extensionTestUtil);
    return extensionTestUtil;
}
Also used : ExtensionTestUtils(org.xwiki.extension.test.ExtensionTestUtils)

Example 3 with ExtensionTestUtils

use of org.xwiki.extension.test.ExtensionTestUtils 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)

Aggregations

ExtensionTestUtils (org.xwiki.extension.test.ExtensionTestUtils)3 RepositoryTestUtils (org.xwiki.repository.test.RepositoryTestUtils)2 File (java.io.File)1 BeforeClass (org.junit.BeforeClass)1 ExtensionId (org.xwiki.extension.ExtensionId)1 RepositoryUtils (org.xwiki.extension.test.RepositoryUtils)1 SolrTestUtils (org.xwiki.repository.test.SolrTestUtils)1