geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/jetty/src/test-resources/deployables/war1/WEB-INF web.xml
Date Sun, 25 Jan 2004 01:08:25 GMT
dain        2004/01/24 17:08:25

  Modified:    modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee
                        ENCHelper.java
               modules/jetty/src/test/org/apache/geronimo/jetty/deployment
                        WebAppDConfigTest.java
               modules/jetty/src/test-resources/deployables/war1/WEB-INF
                        web.xml
  Log:
  Added test for enc in a webapplication
  
  Revision  Changes    Path
  1.3       +5 -3      incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee/ENCHelper.java
  
  Index: ENCHelper.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee/ENCHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ENCHelper.java	23 Jan 2004 22:39:08 -0000	1.2
  +++ ENCHelper.java	25 Jan 2004 01:08:25 -0000	1.3
  @@ -68,6 +68,8 @@
   
   import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
   import org.apache.geronimo.deployment.util.XMLUtil;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   import org.w3c.dom.Element;
   import org.w3c.dom.Node;
  @@ -91,11 +93,11 @@
       public ENCHelper(DDBean ddBean) {
           this.ddBean = ddBean;
       }
  -
  +    private static final Log log = LogFactory.getLog(ENCHelper.class);
       public DConfigBean getDConfigBean(DDBean ddBean) throws ConfigurationException {
           String xpath = ddBean.getXpath();
           String name = ddBean.getText();
  -
  +        log.info("Gettig config bean for " + name + " at " + xpath);
           if (xpath.endsWith("ejb-ref/ejb-ref-name")) {
               DConfigBean dcBean = (DConfigBean) ejbRefs.get(name);
               if (dcBean == null) {
  
  
  
  1.2       +38 -1     incubator-geronimo/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/WebAppDConfigTest.java
  
  Index: WebAppDConfigTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/WebAppDConfigTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebAppDConfigTest.java	22 Jan 2004 04:44:44 -0000	1.1
  +++ WebAppDConfigTest.java	25 Jan 2004 01:08:25 -0000	1.2
  @@ -57,9 +57,12 @@
   
   import java.util.Arrays;
   import javax.enterprise.deploy.model.DDBeanRoot;
  +import javax.enterprise.deploy.model.DDBean;
   import javax.enterprise.deploy.spi.DeploymentConfiguration;
  +import javax.enterprise.deploy.spi.DConfigBean;
   
   import org.apache.geronimo.deployment.tools.loader.WebDeployable;
  +import org.apache.geronimo.deployment.plugin.j2ee.URIRefConfigBean;
   
   /**
    * 
  @@ -84,6 +87,40 @@
           WebAppDConfigRoot configRoot = (WebAppDConfigRoot) config.getDConfigBeanRoot(ddBeanRoot);
           WebAppDConfigBean webApp = (WebAppDConfigBean) configRoot.getDConfigBean(ddBeanRoot.getChildBean("web-app")[0]);
           assertNotNull(webApp);
  +    }
  +
  +    public void testEncRef() throws Exception {
  +        DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
  +        WebAppDConfigRoot configRoot = (WebAppDConfigRoot) config.getDConfigBeanRoot(ddBeanRoot);
  +
  +        DDBean[] ddBeans;
  +        DConfigBean dcBean;
  +
  +        ddBeans = ddBeanRoot.getChildBean("web-app/ejb-ref/ejb-ref-name");
  +        assertNotNull(ddBeans);
  +        assertEquals(1, ddBeans.length);
  +        assertEquals("fake-ejb-ref", ddBeans[0].getText());
  +        dcBean = configRoot.getDConfigBean(ddBeans[0]);
  +//        assertNotNull(dcBean);
  +//        assertTrue(dcBean instanceof URIRefConfigBean);
  +//        ((URIRefConfigBean)dcBean).setTargetURI("blah-ejb-ref");
  +//        dcBean = configRoot.getDConfigBean(ddBeans[0]);
  +//        assertNotNull(dcBean);
  +//        assertTrue(dcBean instanceof URIRefConfigBean);
  +//        assertEquals("blah-ejb-ref", ((URIRefConfigBean)dcBean).getTargetURI());
  +//
  +//        ddBeans = ddBeanRoot.getChildBean("web-app/ejb-local-ref/ejb-ref-name");
  +//        assertNotNull(ddBeans);
  +//        assertEquals(1, ddBeans.length);
  +//        assertEquals("fake-ejb-local-ref", ddBeans[0].getText());
  +//        dcBean = configRoot.getDConfigBean(ddBeans[0]);
  +//        assertNotNull(dcBean);
  +//        assertTrue(dcBean instanceof URIRefConfigBean);
  +//        ((URIRefConfigBean)dcBean).setTargetURI("blah-ejb-local-ref");
  +//        dcBean = configRoot.getDConfigBean(ddBeans[0]);
  +//        assertNotNull(dcBean);
  +//        assertTrue(dcBean instanceof URIRefConfigBean);
  +//        assertEquals("blah-ejb-local-ref", ((URIRefConfigBean)dcBean).getTargetURI());
       }
   
       protected void setUp() throws Exception {
  
  
  
  1.3       +26 -0     incubator-geronimo/modules/jetty/src/test-resources/deployables/war1/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/test-resources/deployables/war1/WEB-INF/web.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- web.xml	22 Jan 2004 04:44:44 -0000	1.2
  +++ web.xml	25 Jan 2004 01:08:25 -0000	1.3
  @@ -3,4 +3,30 @@
   
   <web-app>
       <description>Test Web Deployment</description>
  +    <resource-env-ref>
  +        <resource-env-ref-name>fake-resource-env-ref</resource-env-ref-name>
  +        <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
  +    </resource-env-ref>
  +    <resource-ref>
  +        <res-ref-name>fake-resource-ref</res-ref-name>
  +        <res-type>javax.sql.DataSource</res-type>
  +        <res-auth>Container</res-auth>
  +        <res-sharing-scope>Shareable</res-sharing-scope>
  +    </resource-ref>
  +    <ejb-ref>
  +        <ejb-ref-name>fake-ejb-ref</ejb-ref-name>
  +        <ejb-ref-type>Entity</ejb-ref-type>
  +        <home>some.package.FakeHome</home>
  +        <remote>some.package.Fake</remote>
  +    </ejb-ref>
  +    <ejb-local-ref>
  +        <ejb-ref-name>fake-ejb-local-ref</ejb-ref-name>
  +        <ejb-ref-type>Entity</ejb-ref-type>
  +        <local-home>some.package.FakeLocalHome</local-home>
  +        <local>some.package.FakeLocal</local>
  +    </ejb-local-ref>
  +<!--    <service-ref>-->
  +<!--        <service-ref-name>fake-service-ref</service-ref-name>-->
  +<!--        <service-interface>some.package.FakeService</service-interface>-->
  +<!--    </service-ref>-->
   </web-app>
  
  
  

Mime
View raw message