use of org.xwiki.repository.test.SolrTestUtils 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.SolrTestUtils in project xwiki-platform by xwiki.
the class AbstractHttpTest method setUp.
@Before
public void setUp() throws Exception {
random = new Random();
JAXBContext context = JAXBContext.newInstance("org.xwiki.rest.model.jaxb");
marshaller = context.createMarshaller();
unmarshaller = context.createUnmarshaller();
objectFactory = new ObjectFactory();
// Make sure guest does not have edit right
Page page = this.testUtils.rest().page(new DocumentReference("xwiki", "XWiki", "XWikiPreferences"));
org.xwiki.rest.model.jaxb.Object rightObject = this.testUtils.rest().object("XWiki.XWikiGlobalRights");
rightObject.withProperties(this.testUtils.rest().property("users", "XWiki.XWikiGuest"), this.testUtils.rest().property("levels", "edit"), this.testUtils.rest().property("allow", "0"));
Objects objects = new Objects();
objects.withObjectSummaries(rightObject);
page.setObjects(objects);
this.testUtils.rest().save(page);
// Init solr utils
this.solrUtils = new SolrTestUtils(this.testUtils);
}
use of org.xwiki.repository.test.SolrTestUtils 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