Ejemplo n.º 1
0
 @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);
 }
Ejemplo n.º 2
0
  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;
  }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public void initialize(FeaturesRunner runner) {
   runner.getFeature(RuntimeFeature.class).getHarness().addWorkingDirectoryConfigurator(this);
 }
Ejemplo n.º 5
0
 @Override
 public void initialize(FeaturesRunner runner) {
   runner.getFeature(BaseFeature.class).enable();
 }