Examples of ModuleConfig


Examples of net.kuujo.vertigo.component.ModuleConfig

  }

  @Test
  public void testConfiguredFeederModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    ModuleConfig verticle = network.addModule("feeder", "com.test~test-module~1.0");
    verticle.setModule("com.test~test-module~1.0");
    verticle.setConfig(new JsonObject().putString("foo", "bar"));
    verticle.setInstances(2);
    verticle.setGroup("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("feeder");
    assertEquals("feeder", moduleContext.name());
    assertEquals("vertigo.test.feeder", moduleContext.address());
View Full Code Here

Examples of net.kuujo.vertigo.component.ModuleConfig

  }

  @Test
  public void testConfiguredWorkerModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    ModuleConfig module = network.addModule("worker", "com.test~test-module~1.0");
    module.setModule("com.test~test-module~1.0");
    module.setConfig(new JsonObject().putString("foo", "bar"));
    module.setInstances(2);
    module.setGroup("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("worker");
    assertEquals("worker", moduleContext.name());
    assertEquals("vertigo.test.worker", moduleContext.address());
View Full Code Here

Examples of net.kuujo.vertigo.component.ModuleConfig

    return addModule(name, moduleName, null, instances, doneHandler);
  }

  @Override
  public ModuleConfig addModule(String name, String moduleName, JsonObject config, int instances, Handler<AsyncResult<ActiveNetwork>> doneHandler) {
    ModuleConfig module = network.addModule(name, moduleName, config, instances);
    cluster.deployNetwork(network, doneHandler);
    return module;
  }
View Full Code Here

Examples of net.kuujo.vertigo.component.ModuleConfig

  @Override
  public ModuleConfig removeModule(String name, final Handler<AsyncResult<ActiveNetwork>> doneHandler) {
    // Undeploy a single module by creating a copy of the network with the
    // module as its only element. When then network is undeployed, the module
    // will be removed from the network.
    ModuleConfig module = network.removeModule(name);
    NetworkConfig undeploy = new DefaultNetworkConfig(network.getName());
    undeploy.addModule(module);
    cluster.undeployNetwork(undeploy, new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> result) {
View Full Code Here

Examples of net.laubenberger.tyr.model.ModuleConfig

  static AdvancedPlayer player;

  private boolean isExit = false;

  public static void main(final String[] args) {
    final ModuleConfig cm = new ModuleConfigImpl();
    cm.setName("MusicPlayer"); //$NON-NLS-1$
    cm.setVersion(new BigDecimal("0.87")); //$NON-NLS-1$
    cm.setBuild(247);
    cm.setCreated(HelperTime.getDate(2012, 5, 31, 8, 13, 0));
    cm.setLanguage(Language.ENGLISH);
    cm.setUUID(UUID.fromString("aa9d8103-a786-4a68-8f7c-ff1fdcebe06e")); //$NON-NLS-1$
    cm.addPerson(Constants.BOGATYR.getPersons().get(0)); //hopefully it's me :-)
    cm.setJars(HelperCollection.getList("tyr-module-musicplayer-0.87.jar", "lib/jlayer.jar"))//$NON-NLS-1$//$NON-NLS-2$
    cm.setModuleClass("net.laubenberger.tyr.module.musicplayer.MusicPlayerImpl"); //$NON-NLS-1$
    cm.setLocalizerBase("net/laubenberger/tyr/module/musicplayer/musicplayer"); //$NON-NLS-1$
    cm.setLogo("net/laubenberger/tyr/module/musicplayer/icon/small/logo.png"); //$NON-NLS-1$
    cm.setLogoLarge("net/laubenberger/tyr/module/musicplayer/icon/large/logo.png"); //$NON-NLS-1$
   
    try {
      cm.setUrl(new URL("http://dev.laubenberger.net/")); //$NON-NLS-1$
      // cm.setUpdateLocation(new
      // URL("file://User/slaubenberger/Desktop/musicplayer_update.xml"));
    } catch (MalformedURLException ex) {
      // should never happen!
      log.error("URL invalid", ex); //$NON-NLS-1$
    }

    try {
      HelperXml.serialize(new File(cm.getName() + FileType.CONFIGURATION.getExtension()), cm);
    } catch (JAXBException ex) {
      log.error("Could not write the configration file", ex); //$NON-NLS-1$
    }
  }
View Full Code Here

Examples of org.apache.geronimo.mavenplugins.geronimo.ModuleConfig

            // Add the single module to the list
            //
            // FIXME Should be able to handle multiple moduleIds
            //
            ModuleConfig moduleConfig = createModuleConfigFromId(moduleId);
            if (modules == null) {
                modules = new ModuleConfig[] {
                    moduleConfig
                };
            }
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

  @Test
  public void testProcessRegularAction() throws Exception
  {

    Action action = createMock(Action.class);
    ModuleConfig config = createMock(ModuleConfig.class);
    ServletContext context = createMock(ServletContext.class);
    ActionServlet servlet = createMock(ActionServlet.class);

    expect(servlet.getServletContext()).andReturn(context);
    expect(config.getPrefix()).andReturn("");
    expect(action.execute(null, null, (HttpServletRequest) null, (HttpServletResponse) null)).andReturn(null)
        .times(1);

    replay(action);
    replay(config);
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

   */
  @Test
  public void testProcessControllerAction() throws Exception
  {

    ModuleConfig config = createMock(ModuleConfig.class);
    ServletContext context = createMock(ServletContext.class);
    ActionServlet servlet = createMock(ActionServlet.class);
    ReadOnlyControllerAction action = createMock(ReadOnlyControllerAction.class);
    ControllerProcessorDelegate delegate = createMock(ControllerProcessorDelegate.class);

    expect(servlet.getServletContext()).andReturn(context);   
    expect(config.getPrefix()).andReturn("prefix");
    expect(delegate.handleActionPerform(action, new TestContextImpl())).andReturn(null).times(1);

    replay(action);
    replay(config);
    replay(context);
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

  {
    ActionCreator actionCreator = newMock(ActionCreator.class);
    CreateAction createAction = getCreateAction(actionCreator);
    ServletActionContext actionContext = getActionContext();
    ActionConfig actionConfig = newMock(ActionConfig.class);
    ModuleConfig moduleConfig = newMock(ModuleConfig.class);
    ActionServlet servlet = newMock(ActionServlet.class);
    Map applicationScope = newMock(Map.class);
    Map actions = new HashMap();
    Action action = new Action();
   
    expect(actionConfig.getModuleConfig()).andReturn(moduleConfig);
    expect(moduleConfig.getPrefix()).andReturn("prefix");
    expect(actionContext.getApplicationScope()).andReturn(applicationScope);
    expect(applicationScope.get("actionsprefix")).andReturn(actions);
    expect(actionCreator.createAction(String.class)).andReturn(action);
    expect(actionContext.getActionServlet()).andReturn(servlet);
View Full Code Here

Examples of org.apache.struts.config.ModuleConfig

    SimpleLookupDispatchAction actionBean = createMock(SimpleLookupDispatchAction.class);

    ActionMapping mapping = createMock(ActionMapping.class);
    HttpServletRequest request = createMock(HttpServletRequest.class);
    HttpSession session = createMock(HttpSession.class);
    ModuleConfig moduleConfig = createMock(ModuleConfig.class);
    ActionServlet servlet = createMock(ActionServlet.class);
    ServletContext context = createMock(ServletContext.class);
    MessageResources messageResources = createMock(MessageResources.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);
   
    action.setServlet(servlet);

    actionBean.preBind();
    form.bindInwards(actionBean);
    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(null);
    expect(mapping.getParameter()).andReturn("method");
    expect(request.getParameter("method")).andReturn("Insert Stuff Here");
    expect(request.getSession(false)).andReturn(session);
    expect(session.getAttribute(Globals.LOCALE_KEY)).andReturn(Locale.getDefault());
    expect(request.getAttribute(Globals.MODULE_KEY)).andReturn(moduleConfig);
    expect(moduleConfig.findMessageResourcesConfigs()).andReturn(new MessageResourcesConfig[]
    {
      new MessageResourcesConfig()
    });
    expect(servlet.getServletContext()).andReturn(context);
    expect(request.getAttribute(Globals.MODULE_KEY)).andReturn(moduleConfig);
    expect(moduleConfig.getPrefix()).andReturn("");
    expect(context.getAttribute(Globals.MESSAGES_KEY)).andReturn(messageResources);
    expect(messageResources.getMessage(Locale.getDefault(), "insert.key")).andReturn("Insert Stuff Here");
    expect(actionBean.insert()).andReturn("inserted");
    expect(mapping.findForward("inserted")).andReturn(actionForward);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.