示例#1
0
  private void initializeCoreComponents()
      throws ComponentConfigurationException, ComponentRepositoryException, ContextException {
    BasicComponentConfigurator configurator = new BasicComponentConfigurator();

    PlexusConfiguration c = configuration.getChild("component-repository");

    processCoreComponentConfiguration("component-repository", configurator, c);

    componentRepository.configure(configuration);

    componentRepository.setClassRealm(plexusRealm);

    componentRepository.initialize();

    // Lifecycle handler manager

    c = configuration.getChild("lifecycle-handler-manager");

    processCoreComponentConfiguration("lifecycle-handler-manager", configurator, c);

    lifecycleHandlerManager.initialize();

    // Component manager manager

    c = configuration.getChild("component-manager-manager");

    processCoreComponentConfiguration("component-manager-manager", configurator, c);

    componentManagerManager.setLifecycleHandlerManager(lifecycleHandlerManager);

    // Component discoverer manager

    c = configuration.getChild("component-discoverer-manager");

    processCoreComponentConfiguration("component-discoverer-manager", configurator, c);

    componentDiscovererManager.initialize();

    // Component factory manager

    c = configuration.getChild("component-factory-manager");

    processCoreComponentConfiguration("component-factory-manager", configurator, c);

    if (componentFactoryManager instanceof Contextualizable) {
      Context context = getContext();

      context.put(PlexusConstants.PLEXUS_KEY, this);

      ((Contextualizable) componentFactoryManager).contextualize(getContext());
    }

    // Component factory manager

    c = configuration.getChild("component-composer-manager");

    processCoreComponentConfiguration("component-composer-manager", configurator, c);
  }
示例#2
0
  @Override
  protected void customizeContext(Context context) {
    super.customizeContext(context);

    String classname = this.getClass().getName();
    context.put("test-path", getBasedir() + "/target/test-classes/" + classname.replace('.', '/'));
  }
示例#3
0
  @Override
  protected void customizeContext(Context ctx) {
    super.customizeContext(ctx);

    try {
      System.setProperty(
          "plexus." + WORK_CONFIGURATION_KEY, (String) ctx.get(WORK_CONFIGURATION_KEY));
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
示例#4
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());
  }
示例#5
0
 public void contextualize(final Context context) throws ContextException {
   this.context = context;
   this.container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
 }
 private void configure() throws ContextException {
   configFileURL = (URL) context.get(Constants.CONFIG_FILE_CONTEXT);
   log = (Log) context.get(Constants.LOG_CONTEXT);
   mavenSession = (MavenSession) context.get(Constants.MAVEN_SESSION_CONTEXT);
 }
 public void contextualize(Context ctx) throws ContextException {
   plexus = (PlexusContainer) ctx.get(PlexusConstants.PLEXUS_KEY);
 }
 @Override
 protected void customizeContext(Context context) {
   context.put("application-conf", getBasedir() + "/target/test-classes/not-configured/");
 }
  /*
   * (non-Javadoc)
   *
   * @see com.sonatype.nexus.AbstractNexusTestCase#customizeContext(org.codehaus.plexus.context.Context)
   */
  @Override
  protected void customizeContext(Context ctx) {
    super.customizeContext(ctx);

    ctx.put(LDAP_CONFIGURATION_KEY, CONF_HOME.getAbsolutePath());
  }