geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r552557 [2/6] - in /geronimo/sandbox/j2g/plugins: org.apache.geronimo.j2g.descriptors.app/ org.apache.geronimo.j2g.descriptors.cmp/ org.apache.geronimo.j2g.descriptors.ejb/ org.apache.geronimo.j2g.descriptors.web/ org.apache.geronimo.j2g.de...
Date Mon, 02 Jul 2007 18:30:40 GMT
Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/BeanMigrator.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,196 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.j2g.descriptors.ejb.bean;
+
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.j2g.common.ConsoleOutput;
+import org.apache.geronimo.j2g.common.IOutput;
+import org.apache.geronimo.j2g.common.Tool;
+import org.apache.geronimo.j2g.util.descriptors.Constants;
+import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
+import org.dom4j.Element;
+import org.dom4j.QName;
+
+public class BeanMigrator {
+
+    private IOutput out;
+
+    private Log logger = LogFactory.getLog(BeanMigrator.class);
+
+    protected EnvirionmentElementProcessor envirionmentElementProcessor;
+
+    protected NamingElementProcessor namingElementProcessor;
+
+    public BeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
+            NamingElementProcessor namingElementProcessor) {
+    	
+    	Tool currentTool = Tool.getCurrent();
+    	if (currentTool != null) {
+    		out = currentTool.getOutput();
+    	} else {
+    		out = new ConsoleOutput();
+    	}
+        this.envirionmentElementProcessor = envirionmentElementProcessor;
+        this.namingElementProcessor = namingElementProcessor;
+    }
+
+    /**
+     * migrates the common methods for all the methods
+     * 
+     * @param jbossBeanElment
+     * @param geronimoBeanElemnt
+     * @return migrated or not
+     */
+    public boolean migrateBean(Element jbossBeanElment, Element geronimoBeanElemnt) {
+        boolean migrated = true;
+        if (jbossBeanElment.getName().equals("ejb-name")) {
+            // add ejb name to geronimo bean
+            // we have to check the ejb name since ejb name can put by the
+            // jbosscmp-jar as well.
+            String xpath = "//ejb:ejb-name[text() ='" + jbossBeanElment.getText() + "']";
+            logger.debug("Find existing ejb names with xpath ==> " + xpath);
+            if (!XMLConversionHelper.isNodeAvailable(geronimoBeanElemnt, xpath)) {
+                logger.debug("adding ejb-name to bean with name ==> " + jbossBeanElment.getText());
+                QName qname = new QName("ejb-name", geronimoBeanElemnt.getNamespace());
+                Element geronimoEJBName = geronimoBeanElemnt.addElement(qname);
+                geronimoEJBName.setText(jbossBeanElment.getText());
+            } else {
+                logger.debug("ejb-name already exists");
+            }
+
+        } else if (jbossBeanElment.getName().equals("resource-ref")) {
+            QName qname = new QName("resource-ref", geronimoBeanElemnt
+                    .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+            Element geronimoResourceRef = geronimoBeanElemnt.addElement(qname);
+            namingElementProcessor.migrateResourceRef(jbossBeanElment, geronimoResourceRef);
+        } else if (jbossBeanElment.getName().equals("ejb-ref")) {
+            // get the jndi name
+            String jndiName = jbossBeanElment.elementText("jndi-name");
+            // find bean element matching jndiname
+            String xpath = "//enterprise-beans/session[jndi-name/text() ='" + jndiName
+                    + "']/ejb-name";
+            Element element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(),
+                    xpath);
+
+            // check reference for a entity bean
+            if (element == null) {
+                xpath = "//enterprise-beans/entity[jndi-name/text() ='" + jndiName + "']/ejb-name";
+                element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(), xpath);
+            }
+
+            if (element != null) {
+
+                QName qname = new QName("ejb-ref", geronimoBeanElemnt
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoEJBRef = geronimoBeanElemnt.addElement(qname);
+                migrateEJBRef(jbossBeanElment, geronimoEJBRef);
+                qname = new QName("ejb-link", geronimoEJBRef
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoEJBLink = geronimoEJBRef.addElement(qname);
+                geronimoEJBLink.setText(element.getText());
+
+            } else {
+                out.error(
+                        "The Element 'ejb-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually",
+                        XMLConversionHelper.getLineNumber(jbossBeanElment), XMLConversionHelper
+                                .getColumnNumber(jbossBeanElment));
+                logger
+                        .error("The Element 'ejb-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually");
+            }
+
+        } else if (jbossBeanElment.getName().equals("ejb-local-ref")) {
+
+            // get the jndi name
+            String jndiName = jbossBeanElment.elementText("local-jndi-name");
+            // find bean element matching jndiname
+            String xpath = "//enterprise-beans/session[local-jndi-name/text() ='" + jndiName
+                    + "']/ejb-name";
+            Element element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(),
+                    xpath);
+
+            // check reference for a entity bean
+            if (element == null) {
+                xpath = "//enterprise-beans/entity[local-jndi-name/text() ='" + jndiName
+                        + "']/ejb-name";
+                element = XMLConversionHelper.getJbossElement(jbossBeanElment.getDocument(), xpath);
+            }
+
+            if (element != null) {
+                logger.debug("EJB reference found");
+                QName qname = new QName("ejb-local-ref", geronimoBeanElemnt
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoEJBLocalRef = geronimoBeanElemnt.addElement(qname);
+                migrateEJBLocalRef(jbossBeanElment, geronimoEJBLocalRef);
+                qname = new QName("ejb-link", geronimoEJBLocalRef
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoEJBLink = geronimoEJBLocalRef.addElement(qname);
+                geronimoEJBLink.setText(element.getText());
+
+            } else {
+                out.error(
+                        "The Element 'ejb-local-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually",
+                        XMLConversionHelper.getLineNumber(jbossBeanElment), XMLConversionHelper
+                                .getColumnNumber(jbossBeanElment));
+                logger
+                        .error("The Element 'ejb-local-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually");
+            }
+
+        } else {
+            migrated = false;
+        }
+
+        return migrated;
+    }
+
+    private void migrateEJBRef(Element jbossEJBRef, Element geronimoEJBRef) {
+
+        Element jbossEJBChildRef;
+        for (Iterator iter = jbossEJBRef.elementIterator(); iter.hasNext();) {
+            jbossEJBChildRef = (Element) iter.next();
+            if (jbossEJBChildRef.getName().equals("ejb-ref-name")) {
+                QName qname = new QName("ref-name", geronimoEJBRef
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoRefName = geronimoEJBRef.addElement(qname);
+                geronimoRefName.setText(jbossEJBChildRef.getText());
+            }
+        }
+    }
+
+    private void migrateEJBLocalRef(Element jbossEJBRef, Element geronimoEJBRef) {
+
+        Element jbossEJBChildRef;
+        for (Iterator iter = jbossEJBRef.elementIterator(); iter.hasNext();) {
+            jbossEJBChildRef = (Element) iter.next();
+            if (jbossEJBChildRef.getName().equals("ejb-ref-name")) {
+                QName qname = new QName("ref-name", geronimoEJBRef
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoRefName = geronimoEJBRef.addElement(qname);
+                geronimoRefName.setText(jbossEJBChildRef.getText());
+            }
+        }
+    }
+
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/EntityBeanMigrator.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,61 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.descriptors.ejb.bean;
+
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.j2g.common.ConsoleOutput;
+import org.apache.geronimo.j2g.common.IOutput;
+import org.apache.geronimo.j2g.common.Tool;
+import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
+import org.dom4j.Element;
+
+public class EntityBeanMigrator extends JNDIBeanMigrator {
+
+    private IOutput out;
+    private Log logger = LogFactory.getLog(EntityBeanMigrator.class);
+
+    public EntityBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
+            NamingElementProcessor namingElementProcessor) {
+        super(envirionmentElementProcessor, namingElementProcessor);
+    	Tool currentTool = Tool.getCurrent();
+    	if (currentTool != null) {
+    		out = currentTool.getOutput();
+    	} else {
+    		out = new ConsoleOutput();
+    	}
+    }
+
+    public boolean migrateBean(Element jbossEntity, Element geronimoEntity) {
+        Element jbossEntityChildElement;
+        for (Iterator iter = jbossEntity.elements().iterator(); iter.hasNext();) {
+            jbossEntityChildElement = (Element) iter.next();
+
+            // do the migration only if super classes can not
+            if (!super.migrateBean(jbossEntityChildElement, geronimoEntity)) {
+                // TODO: entity bean secific migrations
+                out.warn("The Element '" + jbossEntityChildElement.getName()
+                        + "' is not supported");
+            }
+        }
+        return true;
+    }
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/JNDIBeanMigrator.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,53 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.descriptors.ejb.bean;
+
+
+import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
+import org.dom4j.Element;
+import org.dom4j.QName;
+
+public class JNDIBeanMigrator extends BeanMigrator {
+
+
+    public JNDIBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
+            NamingElementProcessor namingElementProcessor) {
+        super(envirionmentElementProcessor, namingElementProcessor);
+    }
+
+    public boolean migrateBean(Element jbossBeanElment, Element geronimoBeanElemnt) {
+        boolean migrated = true;
+        if (!super.migrateBean(jbossBeanElment, geronimoBeanElemnt)) {
+            if (jbossBeanElment.getName().equals("jndi-name")) {
+                // add ejb name to geronimo session
+                QName qname = new QName("jndi-name", geronimoBeanElemnt.getNamespace());
+                Element geronimoJndiName = geronimoBeanElemnt.addElement(qname);
+                geronimoJndiName.setText(jbossBeanElment.getText());
+            } else if (jbossBeanElment.getName().equals("local-jndi-name")) {
+                // add ejb name to geronimo session
+                QName qname = new QName("local-jndi-name", geronimoBeanElemnt.getNamespace());
+                Element geronimoLocalJndiName = geronimoBeanElemnt.addElement(qname);
+                geronimoLocalJndiName.setText(jbossBeanElment.getText());
+            } else {
+                migrated = false;
+            }
+        }
+        return migrated;
+    }
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/MessageDrivenBeanMigrator.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,29 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.j2g.descriptors.ejb.bean;
+
+import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
+
+
+public class MessageDrivenBeanMigrator extends BeanMigrator {
+
+    public MessageDrivenBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
+            NamingElementProcessor namingElementProcessor) {
+        super(envirionmentElementProcessor, namingElementProcessor);
+    }
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/bean/SessionBeanMigrator.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,60 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.j2g.descriptors.ejb.bean;
+
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.j2g.common.ConsoleOutput;
+import org.apache.geronimo.j2g.common.IOutput;
+import org.apache.geronimo.j2g.common.Tool;
+import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
+import org.dom4j.Element;
+
+
+public class SessionBeanMigrator extends JNDIBeanMigrator {
+
+    private static Log logger = LogFactory.getLog(SessionBeanMigrator.class);
+    private IOutput out;
+
+    public SessionBeanMigrator(EnvirionmentElementProcessor envirionmentElementProcessor,
+            NamingElementProcessor namingElementProcessor) {
+        super(envirionmentElementProcessor, namingElementProcessor);
+    	Tool currentTool = Tool.getCurrent();
+    	if (currentTool != null) {
+    		out = currentTool.getOutput();
+    	} else {
+    		out = new ConsoleOutput();
+    	}
+    }
+
+    public boolean migrateBean(Element jbossSession, Element geronimoSession) {
+        Element jbossSessionChildElement;
+        for (Iterator iter = jbossSession.elements().iterator(); iter.hasNext();) {
+            jbossSessionChildElement = (Element) iter.next();
+            // do the migration only if super classes can not
+            if (!super.migrateBean(jbossSessionChildElement, geronimoSession)) {
+                // TODO: session bean secific migrations
+                out.warn("The Element '" + jbossSessionChildElement.getName()
+                        + "' is not supported");
+            }
+        }
+        return true;
+    }
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,154 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.j2g.descriptors.web;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.j2g.common.ConsoleOutput;
+import org.apache.geronimo.j2g.common.IFileMigration;
+import org.apache.geronimo.j2g.common.IOutput;
+import org.apache.geronimo.j2g.common.Tool;
+import org.apache.geronimo.j2g.util.descriptors.Constants;
+import org.apache.geronimo.j2g.util.descriptors.env.EnvirionmentElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.naming.NamingElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.security.SecurityElementProcessor;
+import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.QName;
+
+public class WebDescriptorTool implements IFileMigration {
+
+    private IOutput out;
+
+    private static Log logger = LogFactory.getLog(WebDescriptorTool.class);
+
+    private EnvirionmentElementProcessor envirionmentElementProcessor;
+
+    private SecurityElementProcessor securityElementProcessor;
+
+    private NamingElementProcessor namingElementProcessor;
+
+    public WebDescriptorTool() {
+    	
+    	Tool currentTool = Tool.getCurrent();
+    	if (currentTool != null) {
+    		out = currentTool.getOutput();
+    	} else {
+    		out = new ConsoleOutput();
+    	}
+        envirionmentElementProcessor = new EnvirionmentElementProcessor();
+        securityElementProcessor = new SecurityElementProcessor();
+        namingElementProcessor = new NamingElementProcessor(envirionmentElementProcessor);
+    }
+
+    public boolean migrate(File file) {
+
+        boolean migrated = false;
+            String directoryName = file.getParent();
+            String jbossFileName = file.getName();
+            logger.debug("Directory Name ==> " + directoryName + " jboss file Name ==> "
+                    + jbossFileName);
+            if (jbossFileName.equals(Constants.JBOSS_WEB_XML_FILE)) {
+                out.info("Converting Jboss-web.xml file in " + directoryName);
+                try {
+                    Document jbossDocument = XMLConversionHelper.getDocument(file);
+                    Document geronimoDocument = XMLConversionHelper.createNewGeronimoDocument(
+                            Constants.WEB_NAME_SPACE, Constants.GERONIMO_WEB_XML_ROOT_NODE);
+                    migrate(jbossDocument.getRootElement(), geronimoDocument.getRootElement());
+                    String geronimoWebFileName = directoryName + File.separator
+                            + Constants.GERONIMO_WEB_XML_FILE;
+                    XMLConversionHelper.saveGeronimoDocument(geronimoWebFileName, geronimoDocument);
+                    migrated = true;
+                    out.info("Successfully migrated the jboss-web.xml file in "
+                            + directoryName + ", with the error and warning messages as shown");
+                } catch (DocumentException e) {
+                	out.error("Errors occurs while reading xml descriptor "
+    						+ file.getAbsolutePath()
+    						+ ". It is possible that the migrator cannot download an xml schema or xml file has a wrong syntax. Nested exception:"
+    						+ e.getMessage());
+                } catch (IOException e) {
+                    out.error("IO exception " + e.getMessage());
+                }
+            } else if (jbossFileName.equals(Constants.WEB_XML_FILE)){
+                out.info("Converting web.xml file in " + directoryName);
+                out.info("Nothing to convert. Keep the file as it is");
+            }
+        return migrated;
+    }
+
+    private void migrate(Element jbossRootElement, Element geronimoRootElement) {
+
+        // migrate the web descriptor componets here
+        Element jbossRootChildElement;
+        for (Iterator iter = jbossRootElement.elements().iterator(); iter.hasNext();) {
+            jbossRootChildElement = (Element) iter.next();
+            if (jbossRootChildElement.getName().equals("context-root")) {
+                QName qname = new QName("context-root", geronimoRootElement.getNamespace());
+                Element contextRootElement = geronimoRootElement.addElement(qname);
+                contextRootElement.setText(jbossRootChildElement.getText());
+            } else if (jbossRootChildElement.getName().equals("security-domain")) {
+                QName qname = new QName("security-realm-name", geronimoRootElement.getNamespace());
+                Element realmNameElement = geronimoRootElement.addElement(qname);
+                realmNameElement.setText(jbossRootChildElement.getText());
+                securityElementProcessor.setSecurityDomain(jbossRootChildElement.getText());
+            } else if (jbossRootChildElement.getName().equals("security-role")) {
+                Element geronimoRoleMapping = securityElementProcessor
+                        .getGeronimoSecurityRoleElement(geronimoRootElement);
+                securityElementProcessor.migrateSecurityRole(jbossRootChildElement,
+                        geronimoRoleMapping);
+            } else if (jbossRootChildElement.getName().equals("resource-ref")) {
+                QName qname = new QName("resource-ref", geronimoRootElement
+                        .getNamespaceForPrefix(Constants.NAMING_NAME_SPACE_PREFIX));
+                Element geronimoResourceRef = geronimoRootElement.addElement(qname);
+                namingElementProcessor.migrateResourceRef(jbossRootChildElement,
+                        geronimoResourceRef);
+            } else if (jbossRootChildElement.getName().equals("ejb-ref")) {
+                out.error(
+                        "The Element 'ejb-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger
+                        .debug("The Element 'ejb-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually");
+            } else if (jbossRootChildElement.getName().equals("ejb-local-ref")) {
+                out.error(
+                        "The Element 'ejb-local-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger
+                        .debug("The Element 'ejb-local-ref' is not supported. It is not possible to determine the EJB name "
+                                + "from the jndi name. Please migrate this element manually");
+            } else {
+                out.warn(
+                        "The Element '" + jbossRootChildElement.getName() + "' is not supported. ",
+                        XMLConversionHelper.getLineNumber(jbossRootChildElement),
+                        XMLConversionHelper.getColumnNumber(jbossRootChildElement));
+                logger.debug("The Element '" + jbossRootChildElement.getName()
+                        + "' is not supported. ");
+            }
+        }
+    }
+
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/ejb-jar.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/ejb-jar.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/ejb-jar.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+  
+<!--DOCTYPE ejb-jar PUBLIC
+      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
+
+<ejb-jar>
+   <display-name>CMP 2.0 Lab Jar</display-name>
+
+   <enterprise-beans>
+      <session>
+         <description>JUnit Session Bean Test Runner</description>
+         <ejb-name>EJBTestRunnerEJB</ejb-name>
+         <home>net.sourceforge.junitejb.EJBTestRunnerHome</home>
+         <remote>net.sourceforge.junitejb.EJBTestRunner</remote>
+         <ejb-class>net.sourceforge.junitejb.EJBTestRunnerBean</ejb-class>
+         <session-type>Stateless</session-type>
+         <transaction-type>Bean</transaction-type>
+      </session>
+
+      <entity>
+         <display-name>Organization Entity Bean</display-name>
+         <ejb-name>OrganizationEJB</ejb-name>
+
+         <local-home>org.jboss.docs.cmp2.crimeportal.OrganizationHome</local-home>
+         <local>org.jboss.docs.cmp2.crimeportal.Organization</local>
+         <ejb-class>org.jboss.docs.cmp2.crimeportal.OrganizationBean</ejb-class>
+
+         <persistence-type>Container</persistence-type>
+         <prim-key-class>java.lang.String</prim-key-class>
+         <reentrant>False</reentrant> 
+         <cmp-version>2.x</cmp-version>
+         <abstract-schema-name>organization</abstract-schema-name>
+
+         <cmp-field><field-name>name</field-name></cmp-field>
+         <cmp-field><field-name>description</field-name></cmp-field>
+
+         <primkey-field>name</primkey-field>
+      </entity>
+
+      <entity>
+         <display-name>Gangster Entity Bean</display-name>
+         <ejb-name>GangsterEJB</ejb-name>
+
+         <local-home>org.jboss.docs.cmp2.crimeportal.GangsterHome</local-home>
+         <local>org.jboss.docs.cmp2.crimeportal.Gangster</local>
+         <ejb-class>org.jboss.docs.cmp2.crimeportal.GangsterBean</ejb-class>
+
+         <persistence-type>Container</persistence-type>
+         <prim-key-class>java.lang.Integer</prim-key-class>
+         <reentrant>False</reentrant> 
+         <cmp-version>2.x</cmp-version>
+         <abstract-schema-name>gangster</abstract-schema-name>
+         
+         <cmp-field><field-name>gangsterId</field-name></cmp-field>
+         <cmp-field><field-name>name</field-name></cmp-field>
+         <cmp-field><field-name>nickName</field-name></cmp-field>
+         <cmp-field><field-name>badness</field-name></cmp-field>
+         
+         <primkey-field>gangsterId</primkey-field>
+
+         <query>
+            <query-method>
+               <method-name>findBadDudes</method-name>
+               <method-params><method-param>int</method-param></method-params>
+            </query-method>
+            <ejb-ql><![CDATA[
+               SELECT OBJECT(g)
+               FROM gangster g
+               WHERE g.badness > ?1
+            ]]></ejb-ql>
+         </query>
+
+         <query>
+            <query-method>
+               <method-name>ejbSelectBoss</method-name>
+               <method-params>
+                  <method-param>java.lang.String</method-param>
+               </method-params>
+            </query-method>
+            <ejb-ql><![CDATA[
+               SELECT DISTINCT underling.organization.theBoss
+               FROM gangster underling
+               WHERE underling.name = ?1 OR underling.nickName = ?1
+            ]]></ejb-ql>
+         </query>
+      </entity>
+
+      <entity>
+         <display-name>Job Entity Bean</display-name>
+         <ejb-name>JobEJB</ejb-name>
+
+         <local-home>org.jboss.docs.cmp2.crimeportal.JobHome</local-home>
+         <local>org.jboss.docs.cmp2.crimeportal.Job</local>
+         <ejb-class>org.jboss.docs.cmp2.crimeportal.JobBean</ejb-class>
+
+         <persistence-type>Container</persistence-type>
+         <prim-key-class>java.lang.String</prim-key-class>
+         <reentrant>False</reentrant> 
+         <cmp-version>2.x</cmp-version>
+         <abstract-schema-name>job</abstract-schema-name>
+         
+         <cmp-field><field-name>name</field-name></cmp-field>
+         <cmp-field><field-name>score</field-name></cmp-field>
+         <cmp-field><field-name>setupCost</field-name></cmp-field>
+         
+         <primkey-field>name</primkey-field>
+      </entity>
+   </enterprise-beans>
+
+   <relationships>
+      <ejb-relation>
+         <ejb-relation-name>Organization-Gangster</ejb-relation-name>
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>org-has-gangsters</ejb-relationship-role-name>
+
+            <multiplicity>One</multiplicity> 
+
+            <relationship-role-source> 
+               <ejb-name>OrganizationEJB</ejb-name> 
+            </relationship-role-source> 
+            
+            <cmr-field>
+               <cmr-field-name>memberGangsters</cmr-field-name> 
+               <cmr-field-type>java.util.Set</cmr-field-type> 
+            </cmr-field> 
+         </ejb-relationship-role> 
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>gangster-belongs-to-org</ejb-relationship-role-name>
+            
+            <multiplicity>Many</multiplicity> 
+            
+            <relationship-role-source>   
+               <ejb-name>GangsterEJB</ejb-name> 
+            </relationship-role-source> 
+          
+            <cmr-field> 
+               <cmr-field-name>organization</cmr-field-name>
+            </cmr-field> 
+         </ejb-relationship-role> 
+      </ejb-relation> 
+
+      <ejb-relation>
+         <ejb-relation-name>Gangster-Jobs</ejb-relation-name>
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>gangster-has-jobs</ejb-relationship-role-name>
+
+            <multiplicity>Many</multiplicity> 
+
+            <relationship-role-source> 
+               <ejb-name>GangsterEJB</ejb-name> 
+            </relationship-role-source> 
+            
+            <cmr-field>
+               <cmr-field-name>jobs</cmr-field-name> 
+               <cmr-field-type>java.util.Set</cmr-field-type> 
+            </cmr-field> 
+         </ejb-relationship-role> 
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>job-has-gangsters</ejb-relationship-role-name>
+            
+            <multiplicity>Many</multiplicity> 
+            
+            <relationship-role-source>   
+               <ejb-name>JobEJB</ejb-name> 
+            </relationship-role-source> 
+          
+            <cmr-field> 
+               <cmr-field-name>gangsters</cmr-field-name>
+               <cmr-field-type>java.util.Set</cmr-field-type> 
+            </cmr-field> 
+         </ejb-relationship-role> 
+      </ejb-relation> 
+
+      <ejb-relation>
+         <ejb-relation-name>Organization-Boss</ejb-relation-name>
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>organization-has-a-boss</ejb-relationship-role-name>
+
+            <multiplicity>One</multiplicity> 
+
+            <relationship-role-source> 
+               <ejb-name>OrganizationEJB</ejb-name> 
+            </relationship-role-source> 
+            
+            <cmr-field>
+               <cmr-field-name>theBoss</cmr-field-name> 
+            </cmr-field> 
+         </ejb-relationship-role> 
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>boss-runs-an-organization</ejb-relationship-role-name>
+            
+            <multiplicity>One</multiplicity> 
+            
+            <relationship-role-source>   
+               <ejb-name>GangsterEJB</ejb-name> 
+            </relationship-role-source> 
+
+         </ejb-relationship-role> 
+      </ejb-relation> 
+   </relationships>
+
+   <assembly-descriptor>
+
+      <container-transaction>
+         <method>
+            <ejb-name>OrganizationEJB</ejb-name>
+            <method-name>*</method-name>
+         </method>
+         <method>
+            <ejb-name>GangsterEJB</ejb-name>
+            <method-name>*</method-name>
+         </method>
+         <method>
+            <ejb-name>JobEJB</ejb-name>
+            <method-name>*</method-name>
+         </method>
+         <trans-attribute>Required</trans-attribute>
+      </container-transaction>
+
+   </assembly-descriptor>
+</ejb-jar>

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-application.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-application.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-application.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-application.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>j2g</sys:groupId>
+      <sys:artifactId>application</sys:artifactId>
+      <sys:version>1.0</sys:version>
+      <sys:type>ear</sys:type>
+    </sys:moduleId>
+    <sys:dependencies/>
+  </sys:environment>
+  <security:security>
+    <security:default-principal>
+      <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila" domain-name="securiyDomain" realm-name="securiyDomain"/>
+    </security:default-principal>
+    <security:role-mappings>
+      <security:role role-name="admin">
+        <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila" domain-name="securiyDomain" realm-name="securiyDomain"/>
+        <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="rasika" domain-name="securiyDomain" realm-name="securiyDomain"/>
+      </security:role>
+      <security:role role-name="manager">
+        <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="sandakith" domain-name="securiyDomain" realm-name="securiyDomain"/>
+        <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="sris" domain-name="securiyDomain" realm-name="securiyDomain"/>
+      </security:role>
+    </security:role-mappings>
+  </security:security>
+</application>

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>j2g</sys:groupId>
+      <sys:artifactId>web-module</sys:artifactId>
+      <sys:version>1.0</sys:version>
+      <sys:type>war</sys:type>
+    </sys:moduleId>
+    <sys:dependencies>
+      <sys:dependency>
+        <sys:groupId>j2g.jdbc</sys:groupId>
+        <sys:artifactId>TestDB</sys:artifactId>
+        <sys:version>1.0</sys:version>
+        <sys:type>rar</sys:type>
+      </sys:dependency>
+    </sys:dependencies>
+  </sys:environment>
+  <security-realm-name>securityDomation</security-realm-name>
+  <context-root>/myApp</context-root>
+  <naming:resource-ref>
+    <naming:ref-name>resource1</naming:ref-name>
+    <naming:resource-link>TestDB</naming:resource-link>
+  </naming:resource-ref>
+  <security:security>
+    <security:default-principal>
+      <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="anonymous" domain-name="securityDomation" realm-name="securityDomation"/>
+    </security:default-principal>
+    <security:role-mappings>
+      <security:role role-name="amila1">
+        <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila1" domain-name="securityDomation" realm-name="securityDomation"/>
+      </security:role>
+      <security:role role-name="amila2">
+        <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila2" domain-name="securityDomation" realm-name="securityDomation"/>
+      </security:role>
+    </security:role-mappings>
+  </security:security>
+</web-app>

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss-app.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss-app.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss-app.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss-app.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+  
+<!--DOCTYPE ejb-jar PUBLIC
+      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
+
+<jboss-app>
+    <security-domain>securiyDomain</security-domain>
+    <unauthenticated-principal>amila</unauthenticated-principal>
+    <jmx-name>messaging</jmx-name>
+    <module>
+        <service>mailservice.sar</service>
+    </module>
+    <module>
+        <har>hibanate.sar</har>
+    </module>
+    <security-role>
+        <role-name>admin</role-name>
+        <principal-name>amila</principal-name>
+        <principal-name>rasika</principal-name>
+    </security-role>
+    <security-role>
+        <role-name>manager</role-name>
+        <principal-name>sandakith</principal-name>
+        <principal-name>sris</principal-name>
+    </security-role>
+
+</jboss-app>
\ No newline at end of file

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jboss.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+  
+<!--DOCTYPE ejb-jar PUBLIC
+      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
+
+<jboss>
+   <enterprise-beans>
+      <session>
+         <ejb-name>EJBTestRunnerEJB</ejb-name>
+         <jndi-name>ejb/EJBTestRunner</jndi-name>
+      </session>
+      <entity>
+         <ejb-name>OrganizationEJB</ejb-name>
+         <local-jndi-name>crimeportal/Organization</local-jndi-name>
+      </entity>
+      <entity>
+         <ejb-name>GangsterEJB</ejb-name>
+         <local-jndi-name>crimeportal/Gangster</local-jndi-name>
+      </entity>
+      <entity>
+         <ejb-name>JobEJB</ejb-name>
+         <local-jndi-name>crimeportal/Job</local-jndi-name>
+      </entity>
+   </enterprise-beans>
+</jboss>

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jbosscmp-jdbc.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jbosscmp-jdbc.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jbosscmp-jdbc.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/jbosscmp-jdbc.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+  
+<!--DOCTYPE ejb-jar PUBLIC
+      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+      "http://java.sun.com/dtd/ejb-jar_2_0.dtd" -->
+
+
+<jbosscmp-jdbc>
+   <defaults>
+      <datasource>java:/DefaultDS</datasource>
+      <datasource-mapping>Hypersonic SQL</datasource-mapping>
+      <create-table>true</create-table>
+      <remove-table>true</remove-table>
+      <pk-constraint>true</pk-constraint>
+      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
+   </defaults>
+
+   <enterprise-beans>
+
+      <entity>
+         <ejb-name>OrganizationEJB</ejb-name>
+         <table-name>organization</table-name>
+
+         <cmp-field>
+            <field-name>name</field-name>
+            <column-name>name</column-name>
+         </cmp-field>
+         <cmp-field>
+            <field-name>description</field-name>
+            <column-name>desc</column-name>
+         </cmp-field>
+      </entity>
+
+      <entity>
+         <ejb-name>GangsterEJB</ejb-name>
+         <table-name>gangster</table-name>
+
+         <cmp-field>
+            <field-name>gangsterId</field-name>
+            <column-name>id</column-name>
+         </cmp-field>
+         <cmp-field>
+            <field-name>name</field-name>
+            <column-name>name</column-name>
+         </cmp-field>
+         <cmp-field>
+            <field-name>nickName</field-name>
+            <column-name>nick_name</column-name>
+            <jdbc-type>VARCHAR</jdbc-type>
+            <sql-type>VARCHAR(64)</sql-type>
+         </cmp-field>
+         <cmp-field>
+            <field-name>badness</field-name>
+            <column-name>badness</column-name>
+         </cmp-field>
+      </entity>
+
+      <entity>
+         <ejb-name>JobEJB</ejb-name>
+         <table-name>job</table-name>
+
+         <cmp-field>
+            <field-name>name</field-name>
+            <column-name>name</column-name>
+         </cmp-field>
+         <cmp-field>
+            <field-name>score</field-name>
+            <column-name>score</column-name>
+         </cmp-field>
+         <cmp-field>
+            <field-name>setupCost</field-name>
+            <column-name>setup_cost</column-name>
+         </cmp-field>
+      </entity>
+   </enterprise-beans>
+
+   <relationships>
+      <ejb-relation>
+         <ejb-relation-name>Organization-Gangster</ejb-relation-name>
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>org-has-gangsters</ejb-relationship-role-name>
+            <key-fields>
+               <key-field>
+                  <field-name>name</field-name>
+                  <column-name>organization</column-name>
+               </key-field>
+            </key-fields>
+         </ejb-relationship-role> 
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>gangster-belongs-to-org</ejb-relationship-role-name>
+         </ejb-relationship-role> 
+      </ejb-relation> 
+
+      <ejb-relation>
+         <ejb-relation-name>Gangster-Jobs</ejb-relation-name>
+         <relation-table-mapping>
+            <table-name>gangster_job</table-name>
+         </relation-table-mapping>
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>gangster-has-jobs</ejb-relationship-role-name>
+            <key-fields>
+               <key-field>
+                  <field-name>gangsterId</field-name>
+                  <column-name>gangster</column-name>
+               </key-field>
+            </key-fields>
+         </ejb-relationship-role> 
+
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>job-has-gangsters</ejb-relationship-role-name>
+            <key-fields>
+               <key-field>
+                  <field-name>name</field-name>
+                  <column-name>job</column-name>
+               </key-field>
+            </key-fields>
+         </ejb-relationship-role> 
+      </ejb-relation> 
+
+      <ejb-relation>
+         <ejb-relation-name>Organization-Boss</ejb-relation-name>
+		 
+         <ejb-relationship-role> 
+            <ejb-relationship-role-name>organization-has-a-boss</ejb-relationship-role-name>
+			<key-fields>
+			    <key-field>
+				  <field-name>name</field-name>
+				  <column-name>boss</column-name>
+				</key-field>
+			</key-fields>
+         </ejb-relationship-role>  
+      </ejb-relation> 
+   </relationships>
+</jbosscmp-jdbc>

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/openejb-jar.xml?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/openejb-jar.xml (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/openejb-jar.xml Mon Jul  2 11:30:34 2007
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>j2g</sys:groupId>
+      <sys:artifactId>ejb-module</sys:artifactId>
+      <sys:version>1.0</sys:version>
+      <sys:type>jar</sys:type>
+    </sys:moduleId>
+    <sys:dependencies>
+      <sys:dependency>
+        <sys:groupId>j2g.java:</sys:groupId>
+        <sys:artifactId>DefaultDS</sys:artifactId>
+        <sys:version>1.0</sys:version>
+        <sys:type>rar</sys:type>
+      </sys:dependency>
+    </sys:dependencies>
+  </sys:environment>
+  <naming:cmp-connection-factory>
+    <naming:resource-link>DefaultDS</naming:resource-link>
+  </naming:cmp-connection-factory>
+  <enterprise-beans>
+    <entity>
+      <ejb-name>OrganizationEJB</ejb-name>
+      <table-name>organization</table-name>
+      <cmp-field-mapping>
+        <cmp-field-name>name</cmp-field-name>
+        <table-column>name</table-column>
+      </cmp-field-mapping>
+      <cmp-field-mapping>
+        <cmp-field-name>description</cmp-field-name>
+        <table-column>desc</table-column>
+      </cmp-field-mapping>
+    </entity>
+    <entity>
+      <ejb-name>GangsterEJB</ejb-name>
+      <table-name>gangster</table-name>
+      <cmp-field-mapping>
+        <cmp-field-name>gangsterId</cmp-field-name>
+        <table-column>id</table-column>
+      </cmp-field-mapping>
+      <cmp-field-mapping>
+        <cmp-field-name>name</cmp-field-name>
+        <table-column>name</table-column>
+      </cmp-field-mapping>
+      <cmp-field-mapping>
+        <cmp-field-name>nickName</cmp-field-name>
+        <table-column>nick_name</table-column>
+      </cmp-field-mapping>
+      <cmp-field-mapping>
+        <cmp-field-name>badness</cmp-field-name>
+        <table-column>badness</table-column>
+      </cmp-field-mapping>
+    </entity>
+    <entity>
+      <ejb-name>JobEJB</ejb-name>
+      <table-name>job</table-name>
+      <cmp-field-mapping>
+        <cmp-field-name>name</cmp-field-name>
+        <table-column>name</table-column>
+      </cmp-field-mapping>
+      <cmp-field-mapping>
+        <cmp-field-name>score</cmp-field-name>
+        <table-column>score</table-column>
+      </cmp-field-mapping>
+      <cmp-field-mapping>
+        <cmp-field-name>setupCost</cmp-field-name>
+        <table-column>setup_cost</table-column>
+      </cmp-field-mapping>
+    </entity>
+  </enterprise-beans>
+  <relationships>
+    <ejb-relation>
+      <ejb-relation-name>Organization-Gangster</ejb-relation-name>
+      <ejb-relationship-role>
+        <ejb-relationship-role-name>org-has-gangsters</ejb-relationship-role-name>
+        <relationship-role-source>
+          <ejb-name>OrganizationEJB</ejb-name>
+        </relationship-role-source>
+        <cmr-field>
+          <cmr-field-name>memberGangsters</cmr-field-name>
+        </cmr-field>
+        <role-mapping>
+          <cmr-field-mapping>
+            <key-column>name</key-column>
+            <foreign-key-column>organization</foreign-key-column>
+          </cmr-field-mapping>
+        </role-mapping>
+      </ejb-relationship-role>
+    </ejb-relation>
+    <ejb-relation>
+      <ejb-relation-name>Gangster-Jobs</ejb-relation-name>
+      <many-to-many-table-name>gangster_job</many-to-many-table-name>
+      <ejb-relationship-role>
+        <ejb-relationship-role-name>gangster-has-jobs</ejb-relationship-role-name>
+        <relationship-role-source>
+          <ejb-name>GangsterEJB</ejb-name>
+        </relationship-role-source>
+        <cmr-field>
+          <cmr-field-name>jobs</cmr-field-name>
+        </cmr-field>
+        <role-mapping>
+          <cmr-field-mapping>
+            <key-column>id</key-column>
+            <foreign-key-column>gangster</foreign-key-column>
+          </cmr-field-mapping>
+        </role-mapping>
+      </ejb-relationship-role>
+      <ejb-relationship-role>
+        <ejb-relationship-role-name>job-has-gangsters</ejb-relationship-role-name>
+        <relationship-role-source>
+          <ejb-name>JobEJB</ejb-name>
+        </relationship-role-source>
+        <cmr-field>
+          <cmr-field-name>gangsters</cmr-field-name>
+        </cmr-field>
+        <role-mapping>
+          <cmr-field-mapping>
+            <key-column>name</key-column>
+            <foreign-key-column>job</foreign-key-column>
+          </cmr-field-mapping>
+        </role-mapping>
+      </ejb-relationship-role>
+    </ejb-relation>
+    <ejb-relation>
+      <ejb-relation-name>Organization-Boss</ejb-relation-name>
+      <ejb-relationship-role>
+        <ejb-relationship-role-name>organization-has-a-boss</ejb-relationship-role-name>
+        <relationship-role-source>
+          <ejb-name>OrganizationEJB</ejb-name>
+        </relationship-role-source>
+        <cmr-field>
+          <cmr-field-name>theBoss</cmr-field-name>
+        </cmr-field>
+        <role-mapping>
+          <cmr-field-mapping>
+            <key-column>name</key-column>
+            <foreign-key-column>boss</foreign-key-column>
+          </cmr-field-mapping>
+        </role-mapping>
+      </ejb-relationship-role>
+    </ejb-relation>
+  </relationships>
+</openejb-jar>

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,33 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ package org.apache.geronimo.j2g.descriptors.app.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.descriptors.app.ApplicationDescriptorTool;
+
+public class TestApplicationDescriptorTool extends TestCase {
+
+    public void testMigrate() {
+        String jbossApplicatinXmlFile = "test-resources/jboss-app.xml";
+        ApplicationDescriptorTool applicationDescriptorTool = new ApplicationDescriptorTool();
+        applicationDescriptorTool.migrate(new File(jbossApplicatinXmlFile));
+    }
+
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,34 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.descriptors.cmp.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.descriptors.comp.CMPDescriptorTool;
+
+public class TestCMPDescriptorsTool extends TestCase {
+
+    public void testMigrate() {
+        File file = new File("test-resources/jbosscmp-jdbc.xml");
+        CMPDescriptorTool cmpDescriptorTool = new CMPDescriptorTool();
+        cmpDescriptorTool.migrate(file);
+    }
+    
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestEJBjarXmlProcessor.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,35 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.j2g.descriptors.cmp.test;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.descriptors.comp.EJBJarXmlProcessor;
+import org.dom4j.DocumentException;
+
+public class TestEJBjarXmlProcessor extends TestCase {
+
+    public void testGetRelationships(){
+        EJBJarXmlProcessor ejbJarXmlProcessor = new EJBJarXmlProcessor("test-resources/ejb-jar.xml");
+        try {
+            ejbJarXmlProcessor.getRelationships();
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        }
+    }
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,33 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ package org.apache.geronimo.j2g.descriptors.ejb.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.descriptors.ejb.EJBDescriptorTool;
+
+public class TestEJBDescriptorTool extends TestCase {
+
+    public void testMigrate() {
+        File file = new File("test-resources/jboss.xml");
+        EJBDescriptorTool ejbDescriptorTool = new EJBDescriptorTool();
+        ejbDescriptorTool.migrate(file);
+    }
+    
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java Mon Jul  2 11:30:34 2007
@@ -0,0 +1,33 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ package org.apache.geronimo.j2g.descriptors.web.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.descriptors.web.WebDescriptorTool;
+
+public class TestWebDescriptorTool extends TestCase {
+
+    public void testMigration() {
+        File file = new File("test-resources/jboss-web.xml");
+        WebDescriptorTool webMigrationTool = new WebDescriptorTool();
+        webMigrationTool.migrate(file);
+    }
+
+}

Added: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/commons-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/commons-logging.properties?view=auto&rev=552557
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/commons-logging.properties (added)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/commons-logging.properties Mon Jul  2 11:30:34 2007
@@ -0,0 +1,30 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+ # Set root logger level to DEBUG and its only appender to console.
+log4j.rootLogger=INFO
+
+#define loggers
+#pluging logger
+log4j.logger.com.ibm.j2g=DEBUG,console
+
+# console is set to be a ConsoleAppender.
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern=[%t] %-5p %l - %m%n
+log4j.appender.console.layout.ConversionPattern=[%t] %-5p - %m%n
\ No newline at end of file



Mime
View raw message