Examples of ModuleConfigImpl


Examples of net.laubenberger.tyr.model.ModuleConfigImpl

  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 net.laubenberger.tyr.model.ModuleConfigImpl

  final Collection<Dialog> dialogs = new HashSet<Dialog>();

  private boolean isExit = false;

  public static void main(final String[] args) {
    final ModuleConfig cm = new ModuleConfigImpl();
    cm.setName("Test"); //$NON-NLS-1$
    cm.setVersion(new BigDecimal("0.92")); //$NON-NLS-1$
    cm.setBuild(247);
    cm.setCreated(HelperTime.getDate(2012, 5, 31, 8, 37, 0));
    cm.setLanguage(Language.ENGLISH);
    cm.setUUID(UUID.fromString("febb21fe-52e6-4776-bfd4-dcc0fd2cc074")); //$NON-NLS-1$
    cm.addPerson(Constants.BOGATYR.getPersons().get(0)); //hopefully it's me :-)
    cm.setJars(HelperCollection.getList("tyr-module-test-0.92.jar", "lib/jbusycomponent-1.2.2.jar", "lib/jxlayer-3.0.4.jar" /*, "lib/commons-0.2.jar"*/))//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    cm.setModuleClass("net.laubenberger.tyr.module.test.TestImpl"); //$NON-NLS-1$
    cm.setLocalizerBase("net/laubenberger/tyr/module/test/test"); //$NON-NLS-1$
    cm.setLogo("net/laubenberger/tyr/module/test/icon/small/logo.png"); //$NON-NLS-1$
    cm.setLogoLarge("net/laubenberger/tyr/module/test/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/test_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.struts.config.impl.ModuleConfigImpl

     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        context = new MockActionContext();

        ModuleConfigImpl moduleConfig = new ModuleConfigImpl("/");

        context.setModuleConfig(moduleConfig);

        FormBeanConfig fooFBC = new FormBeanConfig();

        fooFBC.setName("foo");
        fooFBC.setType("org.apache.struts.mock.MockFormBean");
        moduleConfig.addFormBeanConfig(fooFBC);

        FormBeanConfig barFBC = new FormBeanConfig();

        barFBC.setName("bar");
        barFBC.setType("org.apache.struts.action.DynaActionForm"); // use a different type so we can verify lookups better

        FormPropertyConfig fpc = new FormPropertyConfig();

        fpc.setName("property");
        fpc.setType("java.lang.String");
        fpc.setInitial("test");
        barFBC.addFormPropertyConfig(fpc);
        moduleConfig.addFormBeanConfig(barFBC);

        ActionConfig testActionConfig = new ActionConfig();

        testActionConfig.setPath("/Test");
        testActionConfig.setName("foo");
        testActionConfig.setScope("request");
        moduleConfig.addActionConfig(testActionConfig);

        moduleConfig.freeze(); // otherwise, ActionConfigMatcher will be null and we'll get an NPE...
    }
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

     *
     * "/myapp", "/foo", null, null,
     */
    public void setUp() {
        // -- default Module
        this.moduleConfig = new ModuleConfigImpl("");
        this.moduleConfig.addForwardConfig(new ForwardConfig("foo", "/bar.jsp",
                false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("relative1",
                "relative.jsp", false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("relative2",
                "relative.jsp", false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("external",
                "http://struts.apache.org/", false));

        // -- module "/2"
        this.moduleConfig2 = new ModuleConfigImpl("/2");
        this.moduleConfig2.addForwardConfig(new ForwardConfig("foo",
                "/baz.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative1",
                "relative.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative2",
                "relative.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("external",
                "http://struts.apache.org/", false));

        // -- module "/3"
        this.moduleConfig3 = new ModuleConfigImpl("/3");

        // -- configure the ServletContext
        this.servletContext = new MockServletContext();
        this.servletContext.setAttribute(Globals.MODULE_KEY, moduleConfig);
        this.servletContext.setAttribute(Globals.MODULE_KEY + "/2",
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

    }

    // ----public ModuleConfig getModuleConfig(PageContext pageContext)
    public void testModuleConfig_getModuleConfig_PageContext() {
        MockServletConfig mockServletConfig = new MockServletConfig();
        ModuleConfig moduleConfig = new ModuleConfigImpl("");
        MockServletContext mockServletContext = new MockServletContext();
        MockHttpServletRequest mockHttpServletRequest =
            new MockHttpServletRequest();
        MockHttpServletResponse mockHttpServletResponse =
            new MockHttpServletResponse();
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

        pageContext.getResponseReturn = response;
        servletConfig = new ServletConfigSimulator();
        FieldAccessor.set(actionServlet, "config", servletConfig);
        pageContext.getServletConfigReturn = servletConfig;
        servletContext = new XServletContextSimulator();
        servletContext.setAttribute(Globals.MODULE_KEY, new ModuleConfigImpl(""));
        FieldAccessor.set(servletConfig, "context", servletContext);
        servletContext.setAttribute(Globals.MESSAGES_KEY, resources);
        pageContext.getServletContextReturn = servletContext;
        pageContext.getSessionReturn = request.getSession();
        jspWriter = new MockJspWriter();
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

    }

    public void setForward(String name, String path) {
        ModuleConfig config = mapping.getModuleConfig();
        if (config == null) {
            config = new ModuleConfigImpl("");
            mapping.setModuleConfig(config);
        }
        ForwardConfig forwardConfig = config.findForwardConfig(name);
        if (forwardConfig == null) {
            config.addForwardConfig(new ActionForward(name, path, false));
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

        for (int i = 0; i < dynaProperties.length; i++) {
            beanConfig.addFormPropertyConfig(dynaProperties[i]);
        }
       
        // Create a temporary ModuleConfig
        ModuleConfigImpl moduleConfig = new ModuleConfigImpl("");

        // Construct a corresponding DynaActionFormClass
        dynaClass = new DynaActionFormClass(beanConfig);

    }
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

        for (int i = 0; i < dynaProperties.length; i++) {
            beanConfig.addFormPropertyConfig(dynaProperties[i]);
        }
       
        // Create a temporary ModuleConfig
        ModuleConfigImpl moduleConfig = new ModuleConfigImpl("");

        // Construct a corresponding DynaActionFormClass
        dynaClass = new DynaActionFormClass(beanConfig);

    }
View Full Code Here

Examples of org.apache.struts.config.impl.ModuleConfigImpl

     *
     * "/myapp", "/foo", null, null,
     */
    public void setUp() {
        // -- default Module
        this.moduleConfig = new ModuleConfigImpl("");
        this.moduleConfig.addForwardConfig(new ForwardConfig("foo", "/bar.jsp",
                false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("relative1",
                "relative.jsp", false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("relative2",
                "relative.jsp", false));
        this.moduleConfig.addForwardConfig(new ForwardConfig("external",
                "http://struts.apache.org/", false));

        // -- module "/2"
        this.moduleConfig2 = new ModuleConfigImpl("/2");
        this.moduleConfig2.addForwardConfig(new ForwardConfig("foo",
                "/baz.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative1",
                "relative.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative2",
                "relative.jsp", false));
        this.moduleConfig2.addForwardConfig(new ForwardConfig("external",
                "http://struts.apache.org/", false));

        // -- module "/3"
        this.moduleConfig3 = new ModuleConfigImpl("/3");

        // -- configure the ServletContext
        this.servletContext = new MockServletContext();
        this.servletContext.setAttribute(Globals.MODULE_KEY, moduleConfig);
        this.servletContext.setAttribute(Globals.MODULE_KEY + "/2",
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.