Package org.crsh.plugin

Examples of org.crsh.plugin.PluginLifeCycle


    context.setServletContext(new MockServletContext());
    context.register(TestShellConfiguration.class);
    context.register(CrshAutoConfiguration.class);
    context.refresh();

    PluginLifeCycle lifeCycle = context.getBean(PluginLifeCycle.class);
    String uuid = lifeCycle.getConfig().getProperty("test.uuid");
    assertEquals(TestShellConfiguration.uuid, uuid);
    context.close();
  }
View Full Code Here


    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
    assertNotNull(lifeCycle);

    assertNull(lifeCycle.getContext().getPlugin(GroovyRepl.class));
    assertNull(lifeCycle.getContext().getPlugin(ProcessorIOHandler.class));
    assertNull(lifeCycle.getContext().getPlugin(JaasAuthenticationPlugin.class));
  }
View Full Code Here

  public void testAttributes() throws Exception {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

    Map<String, Object> attributes = lifeCycle.getContext().getAttributes();
    assertTrue(attributes.containsKey("spring.version"));
    assertTrue(attributes.containsKey("spring.beanfactory"));
    assertEquals(this.context.getBeanFactory(), attributes.get("spring.beanfactory"));
  }
View Full Code Here

    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

    assertEquals("3333", lifeCycle.getConfig().getProperty("crash.ssh.port"));
  }
View Full Code Here

    this.context = new AnnotationConfigWebApplicationContext();
    this.context.setEnvironment(env);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

    assertEquals("~/.ssh/id.pem",
        lifeCycle.getConfig().getProperty("crash.ssh.keypath"));
  }
View Full Code Here

  public void testCommandResolution() {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

    int count = 0;
    Iterator<Resource> resources = lifeCycle.getContext()
        .loadResources("login", ResourceKind.LIFECYCLE).iterator();
    while (resources.hasNext()) {
      count++;
      resources.next();
    }
    assertEquals(1, count);

    count = 0;
    resources = lifeCycle.getContext()
        .loadResources("sleep.groovy", ResourceKind.COMMAND).iterator();
    while (resources.hasNext()) {
      count++;
      resources.next();
    }
View Full Code Here

  public void testDisabledCommandResolution() {
    this.context = new AnnotationConfigWebApplicationContext();
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);

    int count = 0;
    Iterator<Resource> resources = lifeCycle.getContext()
        .loadResources("jdbc.groovy", ResourceKind.COMMAND).iterator();
    while (resources.hasNext()) {
      count++;
      resources.next();
    }
View Full Code Here

    this.context.setServletContext(new MockServletContext());
    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
    PluginContext pluginContext = lifeCycle.getContext();

    int count = 0;
    Iterator<AuthenticationPlugin> plugins = pluginContext.getPlugins(
        AuthenticationPlugin.class).iterator();
    while (plugins.hasNext()) {
View Full Code Here

    this.context.setEnvironment(env);
    this.context.setServletContext(new MockServletContext());
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
    assertEquals("simple", lifeCycle.getConfig().get("crash.auth"));
  }
View Full Code Here

    this.context.setServletContext(new MockServletContext());
    this.context.register(SecurityConfiguration.class);
    this.context.register(CrshAutoConfiguration.class);
    this.context.refresh();

    PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
    assertEquals("jaas", lifeCycle.getConfig().get("crash.auth"));
    assertEquals("my-test-domain", lifeCycle.getConfig()
        .get("crash.auth.jaas.domain"));
  }
View Full Code Here

TOP

Related Classes of org.crsh.plugin.PluginLifeCycle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.