use of org.xwiki.repository.test.RepositoryTestUtils in project xwiki-platform by xwiki.
the class AllTests method initExtensions.
public static void initExtensions(PersistentTestContext context) throws Exception {
// Initialize extensions and repositories
RepositoryTestUtils repositoryTestUtil = new RepositoryTestUtils(context.getUtil(), repositoryUtil, new SolrTestUtils(context.getUtil()));
repositoryTestUtil.init();
// Set integration repository and extension utils.
context.getProperties().put(RepositoryTestUtils.PROPERTY_KEY, repositoryTestUtil);
// Populate maven repository
File extensionFile = repositoryTestUtil.getTestExtension(new ExtensionId("emptyjar", "1.0"), "jar").getFile().getFile();
FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(), "maven/extension/1.0/extension-1.0.jar"));
FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(), "maven/extension/2.0/extension-2.0.jar"));
FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(), "maven/oldextension/0.9/oldextension-0.9.jar"));
FileUtils.copyFile(extensionFile, new File(repositoryTestUtil.getRepositoryUtil().getMavenRepository(), "maven/dependency/version/dependency-version.jar"));
}
use of org.xwiki.repository.test.RepositoryTestUtils in project xwiki-platform by xwiki.
the class AbstractExtensionAdminAuthenticatedTest method init.
@BeforeClass
public static void init() throws Exception {
// Require some AbstractTest initialization
AbstractTest.init();
// Make sure repository and extension utils are initialized and set.
RepositoryTestUtils repositoryTestUtils = getRepositoryTestUtils();
// This will not be null if we are in the middle of allTests
if (repositoryTestUtils == null) {
AllTests.initExtensions(context);
}
}
use of org.xwiki.repository.test.RepositoryTestUtils 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);
}
}
use of org.xwiki.repository.test.RepositoryTestUtils 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"));
}
Aggregations