KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > jetty > deployment > PlanParsingTest


1 package org.apache.geronimo.jetty.deployment;
2
3 import java.io.File JavaDoc;
4 import javax.management.ObjectName JavaDoc;
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 /**
15  */

16 public class PlanParsingTest extends TestCase {
17     ObjectName JavaDoc jettyContainerObjectName = JMXUtil.getObjectName("test:type=JettyContainer");
18     ObjectName JavaDoc pojoWebServiceTemplate = null;
19     WebServiceBuilder webServiceBuilder = null;
20     private JettyModuleBuilder builder = new JettyModuleBuilder(null, new Integer JavaDoc(1800), null, jettyContainerObjectName, null, null, null, pojoWebServiceTemplate, webServiceBuilder, null, null);
21     private File JavaDoc basedir = new File JavaDoc(System.getProperty("basedir", "."));
22
23     public void testResourceRef() throws Exception JavaDoc {
24         File JavaDoc resourcePlan = new File JavaDoc(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 JavaDoc {
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