Package org.megatome.frame2.jaxbgen

Examples of org.megatome.frame2.jaxbgen.ObjectFactory


  }

  private void loadPluginProxies() throws ConfigException {
    this.pluginProxies = new ArrayList<PluginProxy>();
    for (PluginDef pluginDef : this.plugins) {
      PluginInterface plugin = null;

      try {
        String type = pluginDef.getType();
        plugin = (PluginInterface) Class.forName(type).newInstance();
      } catch (Exception e) {
View Full Code Here


      assertTrue(params.get("param1").equals("value1")); //$NON-NLS-1$ //$NON-NLS-2$
   }

   @Test
   public void testGetPlugin() {
      PluginInterface plugin = this.proxy.getPlugin();
      assertNotNull(plugin);
      assertTrue(plugin instanceof MockPluginInterface);
   }
View Full Code Here

      TemplateConfigReader reader = new TemplateConfigReader(this.definitions);
      try {
         reader.execute(is);
      } catch (Exception e) {
         e.printStackTrace();
         throw new TemplateException(
            "Unable to load template definition file", //$NON-NLS-1$
            e);
      }
      for (TemplateDefI def : this.definitions.values()) {
        def.setConfigDir(this.configDir);
View Full Code Here

   }
   protected void validateDefinitionPath(ServletContext context,TemplateDefI def)
                                                         throws TemplateException {
      InputStream is = context.getResourceAsStream(this.configDir + def.getPath());
      if (is == null) {
         throw new TemplateException(TEMPLATE_PATH_EXCEPTION_MSG +
                                      this.configDir +
                                      def.getPath());
      }
   }
View Full Code Here

      Map<String, String> puts = def.getPutParams();
      Collection<String> paths = puts.values();
      for (String path : paths) {
         InputStream is = context.getResourceAsStream(this.configDir + path);
         if (is == null) {
            throw new TemplateException(TEMPLATE_PUT_PATH_EXCEPTION_MSG +
                                         this.configDir + path);
         }
      }
   }
View Full Code Here

                        "Error finding template definition file "); //$NON-NLS-1$
            }
            this.reader.parse(is);
        } catch (ParserException e) {
            e.printStackTrace();
            throw new TemplateException("Unable to load template definition: " //$NON-NLS-1$
                    + e.getMessage(), e);
        }
    }
View Full Code Here

public class TemplateConfigFactory {

   private static TemplateConfigurationInterface instance;

   public static void loadTemplateFile(ServletContext context, String fileName, String configDir) throws TemplateException{
      TemplateConfiguration config = new TemplateConfiguration();
      config.setConfigDir(configDir);
      InputStream is = context.getResourceAsStream(configDir + fileName);
      config.loadTemplateFile(is);
      config.validateTemplateFiles(context);
      instance = config;
   }
View Full Code Here

        this.plugin = new TemplatePlugin();
    }

    @Test
    public void testTemplatePluginSingleLoadDefaultDir() {
        TemplateConfigurationInterface config = testTemplatePlugin(null);

        TemplateDefI def = config.getDefinition("foo"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$
        assertTrue(def.getPutParams().isEmpty());

        def = config.getDefinition("bar"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$
        Map<String, String> params = def.getPutParams();
        assertTrue(params.size() == 1);
        assertNotNull(params.get("bar-put")); //$NON-NLS-1$
        assertTrue(params.get("bar-put").equals("yyy.jsp")); //$NON-NLS-1$ //$NON-NLS-2$

        def = config.getDefinition("baz"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$
        assertTrue(def.getPutParams().isEmpty());
    }
View Full Code Here

        assertTrue(def.getPutParams().isEmpty());
    }

    @Test
    public void testTemplatePluginSingleLoad() {
        TemplateConfigurationInterface config = testTemplatePlugin("/templates/good/single/"); //$NON-NLS-1$

        TemplateDefI def = config.getDefinition("foo"); //$NON-NLS-1$
        assertNotNull(def);
        assertTrue(def.getPath().equals("xxx.jsp")); //$NON-NLS-1$

        Map<String, String> params = def.getPutParams();
        assertTrue(params.size() == 1);
View Full Code Here

        } catch (PluginException e) {
            e.printStackTrace();
            fail();
        }

        TemplateConfigurationInterface config = null;
        try {
            config = TemplateConfigFactory.instance();
        } catch (TemplateException e1) {
            fail();
        }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.jaxbgen.ObjectFactory

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.