Home » geronimo-2.2-source-release » org.apache.geronimo.tomcat.deployment » [javadoc | source]

    1   package org.apache.geronimo.tomcat.deployment;
    2   
    3   import java.io.File;
    4   import javax.management.ObjectName;
    5   
    6   import junit.framework.TestCase;
    7   import org.apache.geronimo.kernel.jmx.JMXUtil;
    8   import org.apache.geronimo.schema.SchemaConversionUtils;
    9   import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
   10   import org.apache.geronimo.xbeans.geronimo.tomcat.TomcatWebAppDocument;
   11   import org.apache.geronimo.xbeans.geronimo.tomcat.TomcatWebAppType;
   12   
   13   /**
   14    */
   15   public class PlanParsingTest extends TestCase {
   16       ObjectName tomcatContainerObjectName = JMXUtil.getObjectName("test:type=TomcatContainer");
   17       private TomcatModuleBuilder builder = new TomcatModuleBuilder(null, tomcatContainerObjectName, null, null);
   18       private File basedir = new File(System.getProperty("basedir", "."));
   19   
   20       public void testResourceRef() throws Exception {
   21           File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
   22           assertTrue(resourcePlan.exists());
   23           TomcatWebAppType jettyWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
   24           assertEquals(1, jettyWebApp.getResourceRefArray().length);
   25       }
   26   
   27       public void testConstructPlan() throws Exception {
   28           TomcatWebAppDocument tomcatWebAppDoc = TomcatWebAppDocument.Factory.newInstance();
   29           TomcatWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
   30           tomcatWebAppType.setConfigId("configId");
   31           tomcatWebAppType.setParentId("parentId");
   32           tomcatWebAppType.setContextPriorityClassloader(false);
   33           GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
   34           ref.setRefName("ref");
   35           ref.setTargetName("target");
   36   
   37           SchemaConversionUtils.validateDD(tomcatWebAppType);
   38           System.out.println(tomcatWebAppType.toString());
   39       }
   40   
   41       public void testParseSpecDD() {
   42   
   43       }
   44   }

Home » geronimo-2.2-source-release » org.apache.geronimo.tomcat.deployment » [javadoc | source]