@Override
 public void initialize(FeaturesRunner runner) throws Exception {
   WebXml anno =
       FeaturesRunner.getScanner().getFirstAnnotation(runner.getTargetTestClass(), WebXml.class);
   if (anno == null) {
     config = getResource("webengine/web/WEB-INF/web.xml");
   } else {
     config = runner.getTargetTestClass().getClassLoader().getResource(anno.value());
   }
   runner.getFeature(RuntimeFeature.class).getHarness().addWorkingDirectoryConfigurator(this);
 }
  public URL getRepositoryContrib(FeaturesRunner runner) {
    String msg;
    if (isVCS()) {
      msg = "Deploying a VCS repository";
    } else if (isDBS()) {
      msg = "Deploying a DBS repository using " + coreType;
    } else {
      throw new NuxeoException("Unkown test configuration (not vcs/dbs)");
    }
    // System.out used on purpose, don't remove
    System.out.println(getClass().getSimpleName() + ": " + msg);
    log.info(msg);

    String contribPath;
    String bundleName;
    if (isVCS()) {
      bundleName = "org.nuxeo.ecm.core.storage.sql.test";
      contribPath = databaseHelper.getDeploymentContrib();
    } else {
      bundleName = "org.nuxeo.ecm.core.test";
      if (isDBSMem()) {
        contribPath = "OSGI-INF/test-storage-repo-mem-contrib.xml";
      } else if (isDBSMongoDB()) {
        contribPath = "OSGI-INF/test-storage-repo-mongodb-contrib.xml";
      } else {
        throw new NuxeoException("Unkown DBS test configuration (not mem/mongodb)");
      }
    }
    RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness();
    Bundle bundle = harness.getOSGiAdapter().getRegistry().getBundle(bundleName);
    URL contribURL = bundle.getEntry(contribPath);
    assertNotNull("deployment contrib " + contribPath + " not found", contribURL);
    return contribURL;
  }
 public URL getBlobManagerContrib(FeaturesRunner runner) {
   String bundleName = "org.nuxeo.ecm.core.test";
   String contribPath = "OSGI-INF/test-storage-blob-contrib.xml";
   RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness();
   Bundle bundle = harness.getOSGiAdapter().getRegistry().getBundle(bundleName);
   URL contribURL = bundle.getEntry(contribPath);
   assertNotNull("deployment contrib " + contribPath + " not found", contribURL);
   return contribURL;
 }
 public void initialize(FeaturesRunner runner) {
   runner.getFeature(RuntimeFeature.class).getHarness().addWorkingDirectoryConfigurator(this);
 }
Beispiel #5
0
 @Override
 public void initialize(FeaturesRunner runner) {
   runner.getFeature(BaseFeature.class).enable();
 }