Example #1
0
  @Override
  protected void tearDown() throws Exception {
    // keep since PlexusTestCase is not JUnit4 annotated
    super.tearDown();

    cleanDir(plexusHomeDir);
  }
Example #2
0
  @Override
  protected void setUp() throws Exception {
    // keep since PlexusTestCase is not JUnit4 annotated
    super.setUp();

    // simply to make sure customizeContext is handled before anything else
    getContainer();

    plexusHomeDir.mkdirs();
    appsHomeDir.mkdirs();
    workHomeDir.mkdirs();
    confHomeDir.mkdirs();
    runtimeHomeDir.mkdirs();
    nexusappHomeDir.mkdirs();
  }
Example #3
0
  @Override
  protected void customizeContext(Context ctx) {
    super.customizeContext(ctx);

    plexusHomeDir =
        new File(
            getBasedir(),
            "target/plexus-home-" + new Random(System.currentTimeMillis()).nextLong());
    appsHomeDir = new File(plexusHomeDir, "apps");
    workHomeDir = new File(plexusHomeDir, "nexus-work");
    confHomeDir = new File(workHomeDir, "conf");
    runtimeHomeDir = new File(plexusHomeDir, "runtime");
    nexusappHomeDir = new File(plexusHomeDir, "nexus-app");

    ctx.put(WORK_CONFIGURATION_KEY, workHomeDir.getAbsolutePath());
    ctx.put(APPS_CONFIGURATION_KEY, appsHomeDir.getAbsolutePath());
    ctx.put(CONF_DIR_KEY, confHomeDir.getAbsolutePath());
    ctx.put(SECURITY_XML_FILE, getNexusSecurityConfiguration());
    ctx.put(RUNTIME_CONFIGURATION_KEY, runtimeHomeDir.getAbsolutePath());
    ctx.put(NEXUS_APP_CONFIGURATION_KEY, nexusappHomeDir.getAbsolutePath());
  }