1 package org.apache.geronimo.jetty.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.jetty.JettyWebAppDocument; 10 import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType; 11 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType; 12 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder; 13 14 16 public class PlanParsingTest extends TestCase { 17 ObjectName jettyContainerObjectName = JMXUtil.getObjectName("test:type=JettyContainer"); 18 ObjectName pojoWebServiceTemplate = null; 19 WebServiceBuilder webServiceBuilder = null; 20 private JettyModuleBuilder builder = new JettyModuleBuilder(null, new Integer (1800), null, jettyContainerObjectName, null, null, null, pojoWebServiceTemplate, webServiceBuilder, null, null); 21 private File basedir = new File (System.getProperty("basedir", ".")); 22 23 public void testResourceRef() throws Exception { 24 File resourcePlan = new File (basedir, "src/test-resources/plans/plan1.xml"); 25 assertTrue(resourcePlan.exists()); 26 JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, true, null, null); 27 assertEquals(1, jettyWebApp.getResourceRefArray().length); 28 } 29 30 public void testConstructPlan() throws Exception { 31 JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance(); 32 JettyWebAppType jettyWebAppType = jettyWebAppDoc.addNewWebApp(); 33 jettyWebAppType.setConfigId("configId"); 34 jettyWebAppType.setParentId("parentId"); 35 jettyWebAppType.setContextPriorityClassloader(false); 36 GerResourceRefType ref = jettyWebAppType.addNewResourceRef(); 37 ref.setRefName("ref"); 38 ref.setTargetName("target"); 39 40 SchemaConversionUtils.validateDD(jettyWebAppType); 41 System.out.println(jettyWebAppType.toString()); 42 } 43 44 public void testParseSpecDD() { 45 46 } 47 } 48 | Popular Tags |