geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r520023 [8/10] - in /geronimo/sandbox/j2g: ./ bin/ doc/ src/ src/common/ src/common/META-INF/ src/common/src/ src/common/src/org/ src/common/src/org/apache/ src/common/src/org/apache/apps/ src/common/src/org/apache/apps/j2gmigrator/ src/con...
Date Mon, 19 Mar 2007 17:43:49 GMT
Propchange: geronimo/sandbox/j2g/src2/mail-plugin/src/org/apache/apps/j2gmigrator/resources/mail/MailResourcesTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/src/org/apache/apps/j2gmigrator/resources/mail/MailResourcesTool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/src/org/apache/apps/j2gmigrator/resources/mail/MailResourcesTool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml (added)
+++ geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,57 @@
+/**
+ *  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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE server>
+<!-- $Id$ -->
+
+<server>
+
+  <!-- ==================================================================== -->
+  <!-- Mail Connection Factory                                              -->
+  <!-- ==================================================================== -->
+
+  <mbean code="org.jboss.mail.MailService"
+         name="jboss:service=Mail">
+    <attribute name="JNDIName">java:/Mail</attribute>
+    <attribute name="User">nobody</attribute>
+    <attribute name="Password">password</attribute>
+    <attribute name="Configuration">
+       <!-- Test -->
+       <configuration>
+          <!-- Change to your mail server prototocol -->
+          <property name="mail.store.protocol" value="pop3"/>
+          <property name="mail.transport.protocol" value="smtp"/>
+
+          <!-- Change to the user who will receive mail  -->
+          <property name="mail.user" value="nobody"/>
+
+          <!-- Change to the mail server  -->
+          <property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the SMTP gateway server -->
+          <property name="mail.smtp.host" value="smtp.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the address mail will be from  -->
+          <property name="mail.from" value="nobody@nosuchhost.nosuchdomain.com"/>
+
+          <!-- Enable debugging output from the javamail classes -->
+          <property name="mail.debug" value="false"/>
+       </configuration>
+    </attribute>
+  </mbean>
+
+</server>

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/err/mail-service.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml (added)
+++ geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,43 @@
+/**
+ *  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.
+ */
+ <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <environment>
+    <moduleId>
+      <groupId>j2g</groupId>
+      <artifactId>Mail</artifactId>
+      <version>1.0</version>
+      <type>car</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>geronimo</groupId>
+        <artifactId>javamail</artifactId>
+      </dependency>
+    </dependencies>
+  </environment>
+  <gbean name="mailSession" class="org.apache.geronimo.mail.MailGBean">
+    <attribute name="properties">
+mail.store.protocol=pop3
+mail.transport.protocol=smtp
+mail.user=nobody
+mail.pop3.host=pop3.nosuchhost.nosuchdomain.com
+mail.smtp.host=smtp.nosuchhost.nosuchdomain.com
+mail.from=nobody@nosuchhost.nosuchdomain.com
+mail.debug=false
+    </attribute>   
+  </gbean>
+</module>
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/geronimo-mail-service.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-geronimo-plan.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-geronimo-plan.xml (added)
+++ geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-geronimo-plan.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,46 @@
+/**
+ *  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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <environment>
+    <moduleId>
+      <groupId>j2g</groupId>
+      <artifactId>Mail</artifactId>
+      <version>1.0</version>
+      <type>car</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>j2g.java:</groupId>
+        <artifactId>Mail</artifactId>
+        <version>1.0</version>
+        <type>car</type>
+      </dependency>
+    </dependencies>
+  </environment>
+  <gbean name="mailSession" class="org.apache.geronimo.mail.MailGBean">
+    <attribute name="properties"><![CDATA[
+mail.store.protocol=pop3
+mail.transport.protocol=smtp
+mail.user=nobody
+mail.pop3.host=pop3.nosuchhost.nosuchdomain.com
+mail.smtp.host=smtp.nosuchhost.nosuchdomain.com
+mail.from=nobody@nosuchhost.nosuchdomain.com
+mail.debug=false]]></attribute>
+  </gbean>
+</module>

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml (added)
+++ geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,58 @@
+/**
+ *  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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE server
+    PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
+<!-- $Id$ -->
+
+<server>
+
+  <!-- ==================================================================== -->
+  <!-- Mail Connection Factory                                              -->
+  <!-- ==================================================================== -->
+
+  <mbean code="org.jboss.mail.MailService"
+         name="jboss:service=Mail">
+    <attribute name="JNDIName">java:/Mail</attribute>
+    <attribute name="User">nobody</attribute>
+    <attribute name="Configuration">
+       <!-- Test -->
+       <configuration>
+          <!-- Change to your mail server prototocol -->
+          <property name="mail.store.protocol" value="pop3"/>
+          <property name="mail.transport.protocol" value="smtp"/>
+
+          <!-- Change to the user who will receive mail  -->
+          <property name="mail.user" value="nobody"/>
+
+          <!-- Change to the mail server  -->
+          <property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the SMTP gateway server -->
+          <property name="mail.smtp.host" value="smtp.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the address mail will be from  -->
+          <property name="mail.from" value="nobody@nosuchhost.nosuchdomain.com"/>
+
+          <!-- Enable debugging output from the javamail classes -->
+          <property name="mail.debug" value="false"/>
+       </configuration>
+    </attribute>
+  </mbean>
+
+</server>

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test-apps/mail/mail-service.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java (added)
+++ geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,70 @@
+/**
+ *  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.apps.j2gmigrator.resources.mail.test;
+
+import java.io.File;
+
+import org.apache.apps.j2gmigrator.resources.ResourcesTool;
+import org.apache.apps.j2gmigrator.resources.mail.MailResourcesTool;
+import org.apache.apps.j2gmigrator.resources.xmlutil.XMLConversionHelper;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+
+import junit.framework.TestCase;
+
+/**
+ * Test Case for the MailResouresTool
+ */
+public class MailResouresToolTestCase extends TestCase {
+
+     
+    protected void setUp() throws Exception {
+        // To set the IOutput intialize the DescripterTool
+        ResourcesTool resTool = new ResourcesTool();
+        super.setUp();
+    }
+    
+    // Test for mail service migration
+    public void testMailResourcesFileMigration() {
+        File file = new File("test-apps/mail/mail-service.xml");
+        MailResourcesTool mailResourcesTool = new MailResourcesTool();
+        boolean result = mailResourcesTool.migrate(file);
+        assertTrue(result);
+    }
+
+    // Test for mail service migration (with plain text password authentication)
+    public void testMailResourcesFileMigration_withPassword() {
+        File file = new File("test-apps/mail/err/mail-service.xml");
+        MailResourcesTool mailResourcesTool = new MailResourcesTool();
+        boolean result = mailResourcesTool.migrate(file);
+        assertTrue(!result);
+    }
+    
+    // Test for mail service migration (with plain text password authentication)
+    public void testCDATA_Section() {
+        File file = new File("test-apps/mail/mail-geronimo-plan.xml");
+        try {
+            Document document = XMLConversionHelper.getJbossDocument(file);
+            Element element =XMLConversionHelper.obtainSubElementWithAttribute( document.getRootElement(), "gbean", "name", "mailSession");
+            Element element1 =XMLConversionHelper.obtainSubElementWithAttribute(element, "attribute", "name", "properties");
+            System.out.println(element1.getText());
+        } catch (DocumentException e) {
+            e.printStackTrace();
+        }
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/mail-plugin/test/org/apache/apps/j2gmigrator/resources/mail/test/MailResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/security-plugin/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/META-INF/MANIFEST.MF?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/META-INF/MANIFEST.MF (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/META-INF/MANIFEST.MF Mon Mar 19 10:43:27 2007
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Security_plugin Plug-in
+Bundle-SymbolicName: security_plugin; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Vendor: ibm
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ com.ibm.j2g,
+ com.ibm.j2g.resources,
+ com.ibm.j2g.util
+Eclipse-LazyStart: true
+Bundle-ClassPath: .

Added: geronimo/sandbox/j2g/src2/security-plugin/build.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/build.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/build.properties (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/build.properties Mon Mar 19 10:43:27 2007
@@ -0,0 +1,22 @@
+/**
+ *  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.
+ */
+ source.. = src/,\
+           test/
+output.. = classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\

Propchange: geronimo/sandbox/j2g/src2/security-plugin/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/security-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/plugin.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/plugin.xml (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/plugin.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,23 @@
+/**
+ *  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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+    <extension point="com.ibm.j2g.resources.migrations">
+      	<migration class="com.ibm.j2g.resources.security.SecurityResourcesTool"/>
+   </extension>
+</plugin>

Propchange: geronimo/sandbox/j2g/src2/security-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties Mon Mar 19 10:43:27 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.
+commons-logging.rootLogger=INFO
+
+#define loggers
+#pluging logger
+lcommons-logging.logger.com.ibm.j2g= DEBUG,console
+
+# console is set to be a ConsoleAppender.
+commons-logging.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+commons-logging.appender.console.layout=org.apache.log4j.PatternLayout
+#commons-logging.appender.console.layout.ConversionPattern=[%t] %-5p %l - %m%n
+commons-logging.appender.console.layout.ConversionPattern=[%t] %-5p - %m%n
\ No newline at end of file

Propchange: geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/src/commons-logging.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,575 @@
+/**
+ *  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.apps.j2gmigrator.resources.security;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.apache.apps.j2gmigrator.IFileMigration;
+import org.apache.apps.j2gmigrator.IOutput;
+import org.apache.apps.j2gmigrator.Tool;
+import org.apache.apps.j2gmigrator.resources.utils.Constants;
+import org.apache.apps.j2gmigrator.resources.xmlutil.XMLConversionHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.QName;
+
+/**
+ * Class which implement the Security Resource File Migration 
+ */
+public class SecurityResourcesTool implements IFileMigration {
+
+    // Initialization of the IOutput for SecurityResourcesTool class
+    IOutput out = Tool.getCurrent().getOutput();
+    // Initialization of the logger for SecurityResourcesTool class
+    Log logger = LogFactory.getLog(SecurityResourcesTool.class);
+
+    /**
+     * mgration method from data source jboss discripters to geronimo
+     * discriptors
+     * 
+     * @param sourceFile :data source jboss discriptor file
+     * @return status of the migration
+     */
+    public boolean migrate(File sourceFile) {
+        // read the login-config.xml file and then make the changes to the
+        // geronimo side
+        boolean migrated = false;
+            String fileName = sourceFile.getPath();
+            String directoryName = fileName.substring(0, fileName.lastIndexOf(File.separator));
+            String jbossSecirityFileName = sourceFile.getName();
+            logger.debug("Directory Name ==> " + directoryName);
+            logger.debug("jboss security file Name ==> " + jbossSecirityFileName);
+            // Checking wether file is a valid login-config.xml file
+            if (jbossSecirityFileName.equals(Constants.JBOSS_VALID_SECURITY_XML_FILE)) {
+                out.info("Converting Jboss login-config.xml file in " + directoryName);
+                try {
+                    Document jbossDocument = XMLConversionHelper.getJbossDocument(sourceFile);
+                    Document geronimoDocument = migrationFromJboss2Geronimo(jbossDocument
+                            .getRootElement());
+                    String geronimoSecurityFileName = directoryName + File.separator
+                            + Constants.GERONIMO_SECURITY_PLAN_FILE;
+                    // Check whether the file already exists if so back up
+                    // that and save that or check the req
+                    // This was done at upper level of the tool
+                    XMLConversionHelper.saveGeronimoDocument(geronimoSecurityFileName,
+                            geronimoDocument);
+                    migrated = true;
+                    out.info("The Security Resource File Migration Complete !!!\n");
+                } catch (DocumentException e) {
+                	out.error("Errors occurs while reading xml descriptor "
+    						+ sourceFile.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());
+                }
+            }
+
+        return migrated;
+    }
+
+    /**
+     * Accepts the jboss side Elements that holdes the discripter infomation and
+     * return the geronimo discripter
+     * 
+     * @param jbossRootElement
+     * @return geronimo plan
+     */
+    private Document migrationFromJboss2Geronimo(Element jbossRootElement) {
+        Document geronimoDocument = XMLConversionHelper.createNewGeronimoDocument(
+                Constants.NAMESPACE_ENV, "module", Constants.SECURITY_RESOURCE_TOOL, "", "");
+        Document geronimoNewDocument = createGBeanElement(jbossRootElement, geronimoDocument);
+        return geronimoNewDocument;
+    }
+
+    /**
+     * Create the GBeanElement by refering the jboss side elamanets
+     * 
+     * @param jbossRootElement
+     * @param geronimoDocument
+     * @return geronimo security plan which contains the GBean Element
+     */
+    private Document createGBeanElement(Element jbossRootElement, Document geronimoDocument) {
+        Namespace rootNamespace = geronimoDocument.getRootElement().getNamespace();
+        Element gbeanElement = DocumentHelper.createElement(new QName("gbean", rootNamespace));
+        gbeanElement.add(DocumentHelper.createAttribute(gbeanElement, "name", "SecurityRealm"));
+        gbeanElement.add(DocumentHelper.createAttribute(gbeanElement, "class",
+                "org.apache.geronimo.security.realm.GenericSecurityRealm"));
+        Element attributeElement = DocumentHelper.createElement(new QName("attribute",
+                rootNamespace));
+        attributeElement.add(DocumentHelper.createAttribute(gbeanElement, "name", "realmName"));
+        attributeElement.addText("SecurityRealm");
+        gbeanElement.add(createReferenceElement("ServerInfo", "ServerInfo", rootNamespace));
+        gbeanElement.add(createReferenceElement("LoginService", "JaasLoginService", rootNamespace));
+        Element xml_referenceElement = DocumentHelper.createElement(new QName("xml-reference",
+                rootNamespace));
+        xml_referenceElement.add(DocumentHelper.createAttribute(xml_referenceElement, "name",
+                "LoginModuleConfiguration"));
+        Element loginConfigElement = createLoginConfigElement();
+        Element newLoginConfigElement = createLoginModulesByReferingJbossDocument(
+                loginConfigElement, jbossRootElement);
+        xml_referenceElement.add(newLoginConfigElement);
+        gbeanElement.add(xml_referenceElement);
+        geronimoDocument.getRootElement().add(gbeanElement);
+        return geronimoDocument;
+    }
+
+    /**
+     * create the reference element
+     * 
+     * @param name
+     * @param contain
+     * @param rootNamespace
+     * @return return the reference element
+     */
+    private Element createReferenceElement(String name, String contain, Namespace rootNamespace) {
+        Element referenceElement = DocumentHelper.createElement(new QName("reference",
+                rootNamespace));
+        referenceElement.add(DocumentHelper.createAttribute(referenceElement, "name", name));
+        Element nameElement = DocumentHelper.createElement(new QName("name", rootNamespace));
+        nameElement.addText(contain);
+        referenceElement.add(nameElement);
+        return referenceElement;
+
+    }
+
+    /**
+     * create the login config elament
+     * 
+     * @return login config element
+     */
+    private Element createLoginConfigElement() {
+        Namespace loginNamespace = new Namespace("log", Constants.NAMESPACE_GERONIMO_LOGGIN);
+        Element login_configElement = DocumentHelper.createElement(new QName("login-config",
+                loginNamespace));
+        return login_configElement;
+    }
+
+    /**
+     * create the login module by referencing the jboss document
+     * 
+     * @param loginConfigElement
+     * @param jbossRootElement
+     * @return the login module
+     */
+    private Element createLoginModulesByReferingJbossDocument(Element loginConfigElement,
+            Element jbossRootElement) {
+        String login_domain_name = null;
+        String control_flag = null;
+        String login_module_class = null;
+        Element login_moduleElement = null;
+        Iterator elementIterator = jbossRootElement.elementIterator();
+        while (elementIterator.hasNext()) {
+            Element itElement = (Element) elementIterator.next();
+            if (itElement.getName().equals("application-policy")) {
+                out.info("Starting Module Migration");
+                if (validateSecurityPolicy(itElement)) {
+                    login_domain_name = obtainLoginDomainName(itElement);
+                    if (XMLConversionHelper.containSubElement(itElement, "authentication")) {
+                        Element authenticationElement = XMLConversionHelper.obtainSubElement(
+                                itElement, "authentication");
+                        if (XMLConversionHelper.containSubElement(authenticationElement,
+                                "login-module")) {
+                            login_moduleElement = XMLConversionHelper.obtainSubElement(
+                                    authenticationElement, "login-module");
+                            control_flag = obtainControlFlagFromLoginModuleElement(login_moduleElement);
+                            login_module_class = obtainLoginModuleClassFromLoginModuleElement(login_moduleElement);
+                        }
+                    }
+                    Element geronimo_login_moduleElement = createLoginModuleElementbyReferingJbossApplicationPolicyElement(
+                            login_moduleElement, loginConfigElement, control_flag,
+                            login_domain_name, login_module_class);
+                    loginConfigElement.add(geronimo_login_moduleElement);
+                    out.info("Finishing Module Migration");
+                } else {
+                    out.error("The security resource conversion tool does not support module functionality");
+                    out.info("Finishing Module Migration");
+                }
+            }
+        }
+        return loginConfigElement;
+    }
+
+    /**
+     * return the login module class from the login module element
+     * 
+     * @param login_moduleElement
+     * @return String version of the login module class
+     */
+    private String obtainLoginModuleClassFromLoginModuleElement(Element login_moduleElement) {
+        String login_module_class = null;
+        Iterator attribIterator = login_moduleElement.attributeIterator();
+        while (attribIterator.hasNext()) {
+            Attribute itAttribute = (Attribute) attribIterator.next();
+            if (itAttribute.getName().equals("code")) {
+                login_module_class = itAttribute.getText();
+                if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_IDELTITY)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_IDELTITY;
+                } else if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_LDAP)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_LDAP;
+                } else if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_DATABASE_SERVER)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_DATABASE_SERVER;
+                } else if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_USERS_ROLES)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_USERS_ROLES;
+                }
+            }
+        }
+        return login_module_class;
+    }
+
+    /**
+     * obtain the login domain name from the element
+     * 
+     * @param application_policyElement
+     * @return String version of the login domain name
+     */
+    private String obtainLoginDomainName(Element application_policyElement) {
+        String login_domain_name = null;
+        Iterator attribIterator = application_policyElement.attributeIterator();
+        while (attribIterator.hasNext()) {
+            Attribute itAttribute = (Attribute) attribIterator.next();
+            if (itAttribute.getName().equals("name")) {
+                login_domain_name = itAttribute.getText();
+            }
+        }
+        return login_domain_name;
+    }
+
+    /**
+     * creates the mudule elements by referencing the jboss side apllication
+     * policy elamentsS
+     * 
+     * @param jbossLoginModuleElement
+     * @param geronimoLoginConfigElement
+     * @param control_flag
+     * @param login_domain_name
+     * @param login_module_class
+     * @return login module element
+     */
+    private Element createLoginModuleElementbyReferingJbossApplicationPolicyElement(
+            Element jbossLoginModuleElement, Element geronimoLoginConfigElement,
+            String control_flag, String login_domain_name, String login_module_class) {
+        Element login_moduleElement = DocumentHelper.createElement(new QName("login-module",
+                geronimoLoginConfigElement.getNamespace()));
+        login_moduleElement.add(DocumentHelper.createAttribute(login_moduleElement, "control-flag",
+                control_flag.toUpperCase()));
+        // Adding this defaults
+        login_moduleElement.add(DocumentHelper.createAttribute(login_moduleElement, "server-side",
+                "true"));
+        login_moduleElement.add(DocumentHelper.createAttribute(login_moduleElement,
+                "wrap-principals", "false"));
+        login_moduleElement.add(XMLConversionHelper.createSibling("login-domain-name",
+                login_domain_name, geronimoLoginConfigElement.getNamespace()));
+        login_moduleElement.add(XMLConversionHelper.createSibling("login-module-class",
+                login_module_class, geronimoLoginConfigElement.getNamespace()));
+        if (XMLConversionHelper.containSubElement(jbossLoginModuleElement, "module-option")) {
+            login_moduleElement = addAppropriateOptionToAppropriateLoginModule(
+                    jbossLoginModuleElement, login_moduleElement, login_module_class);
+        }
+        return login_moduleElement;
+    }
+
+    /**
+     * adding the appropriate options for the appropriate login modules
+     * 
+     * @param jbossLoginModuleElement
+     * @param geronimoLoginmoduleElement
+     * @param login_module_class
+     * @return returns the login module
+     */
+    private Element addAppropriateOptionToAppropriateLoginModule(Element jbossLoginModuleElement,
+            Element geronimoLoginmoduleElement, String login_module_class) {
+        String option_value = null;
+        String option_attrib_name_value = null;
+        Element[] extraOptionsElement = new Element[4];
+        int countIterations = 0;
+        Iterator elementIterator = jbossLoginModuleElement.elementIterator();
+        while (elementIterator.hasNext()) {
+            Element itElement = (Element) elementIterator.next();
+            if (itElement.getName().equals("module-option")) {
+                option_value = itElement.getText();
+                Iterator attribIterator = itElement.attributeIterator();
+                while (attribIterator.hasNext()) {
+                    Attribute itAttribute = (Attribute) attribIterator.next();
+                    if (itAttribute.getName().equals("name")) {
+                        option_attrib_name_value = itAttribute.getText();
+                    }
+                }
+                Element optionElement = null;
+                if (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_DATABASE_SERVER)) {
+                    if (option_attrib_name_value.equals("principalsQuery")) {
+                        option_attrib_name_value = "userSelect";
+                    }
+                    if (option_attrib_name_value.equals("rolesQuery")) {
+                        option_attrib_name_value = "groupSelect";
+                    }
+                    if (option_attrib_name_value.equals("dsJndiName")) {
+                        option_attrib_name_value = "dataSourceName";
+                        // This is to be modified to the algorithm that
+                        // cuts only the last tocken
+                        option_value = option_value.substring(option_value.indexOf(File.separator) + 1,
+                                option_value.length());
+                    }
+                    if (!(option_attrib_name_value.equals("unauthenticatedIdentity"))) {
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                }
+                // No Need , because of no Geronimo side support
+                // else if
+                // (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_IDELTITY)){
+                // optionElement =
+                // XMLConversionHelper.createSiblingWithAttrib("option",
+                // option_value, "name", option_attrib_name_value,
+                // geronimoLoginmoduleElement.getNamespace());
+                // }
+                else if (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_LDAP)) {
+
+                    if (option_attrib_name_value.equals("java.naming.factory.initial")) {
+                        option_attrib_name_value = "initialContextFactory";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.provider.url")) {
+                        String connectionURLString = "ldap://localhost:";
+                        if (XMLConversionHelper.containSubElementWithAttribute(
+                                jbossLoginModuleElement, "module-option", "name",
+                                "java.naming.security.protocol")) {
+                            Element securityProtocolElement = XMLConversionHelper
+                                    .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                            "module-option", "name",
+                                            "java.naming.security.protocol");
+                            String securityProtocolElementString = securityProtocolElement
+                                    .getText();
+                            if (securityProtocolElementString.equals("ssl")) {
+                                connectionURLString += "636";
+                            } else {
+                                connectionURLString += "389";
+                            }
+                        }
+                        option_attrib_name_value = "connectionURL";
+                        option_value = connectionURLString;
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.security.protocol")) {
+                        option_attrib_name_value = "connectionProtocol";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.security.authentication")) {
+                        option_attrib_name_value = "authentication";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("roleAttributeID")) {
+                        option_attrib_name_value = "roleName";
+                        option_value = "roles";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.security.protocol")) {
+                        option_attrib_name_value = "connectionProtocol";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("principalDNPrefix")) {
+                        if (XMLConversionHelper.containSubElementWithAttribute(
+                                jbossLoginModuleElement, "module-option", "name",
+                                "principalDNSuffix")) {
+                            Element principalDNSuffixElement = XMLConversionHelper
+                                    .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                            "module-option", "name", "principalDNSuffix");
+                            String principalDNSuffixElementString = principalDNSuffixElement
+                                    .getText();
+                            if (principalDNSuffixElementString != null) {
+                                // option_value+=principalDNSuffixElementString.substring(0,
+                                // principalDNSuffixElementString.indexOf(","));
+                                option_value += "{0}" + principalDNSuffixElementString;
+                            } else {
+                                option_value += "{0}";
+                            }
+                        }
+                        option_attrib_name_value = "userSearchMatching";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("rolesCtxDN")) {
+                        option_attrib_name_value = "roleSearchMatching";
+                        if (XMLConversionHelper.containSubElementWithAttribute(
+                                jbossLoginModuleElement, "module-option", "name", "matchOnUserDN")) {
+                            Element matchOnUserDNElement = XMLConversionHelper
+                                    .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                            "module-option", "name", "matchOnUserDN");
+                            String matchOnUserDNString = matchOnUserDNElement.getText();
+                            if (XMLConversionHelper.containSubElementWithAttribute(
+                                    jbossLoginModuleElement, "module-option", "name",
+                                    "matchOnUserDN")) {
+                                Element uidAttributeIDElement = XMLConversionHelper
+                                        .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                                "module-option", "name", "uidAttributeID");
+                                String uidAttributeIDString = uidAttributeIDElement.getText();
+                                // String first_part_of_option_value =
+                                // option_value.substring(0,
+                                // option_value.indexOf(","));
+                                // String secoend_part_of_option_value =
+                                // first_part_of_option_value.substring(0,
+                                // option_value.indexOf(","));
+                                String first_part_of_option_value = "{0}";
+                                String secoend_part_of_option_value = "{1}";
+                                option_value = option_value
+                                        + "???("
+                                        + uidAttributeIDString
+                                        + "="
+                                        + (matchOnUserDNString.equals("true") ? first_part_of_option_value
+                                                : secoend_part_of_option_value) + ")";
+                            }
+                        }
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    extraOptionsElement[0] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "", "name", "userBase", geronimoLoginmoduleElement.getNamespace());
+                    extraOptionsElement[1] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "", "name", "roleBase", geronimoLoginmoduleElement.getNamespace());
+                    extraOptionsElement[2] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "true", "name", "userSearchSubtree", geronimoLoginmoduleElement
+                                    .getNamespace());
+                    extraOptionsElement[3] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "true", "name", "roleSearchSubtree", geronimoLoginmoduleElement
+                                    .getNamespace());
+                } else if (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_USERS_ROLES)) {
+                    if (option_attrib_name_value.equals("usersProperties")) {
+                        option_attrib_name_value = "usersURI";
+                        option_value = Constants.USER_PROPERTIES_FILE_PATH;
+                        out
+                           .info("Sesurity Resources Tool Assumes user properties are in location =>"
+                                    + Constants.USER_PROPERTIES_FILE_PATH);
+                    }
+                    if (option_attrib_name_value.equals("rolesProperties")) {
+                        option_attrib_name_value = "groupsURI";
+                        option_value = Constants.GROUP_PROPERTIES_FILE_PATH;
+                        out
+                           .info("Sesurity Resources Tool Assumes groups properties are in location =>"
+                                    + Constants.GROUP_PROPERTIES_FILE_PATH);
+                    }
+                    optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                            option_value, "name", option_attrib_name_value,
+                            geronimoLoginmoduleElement.getNamespace());
+                }
+                if (optionElement != null)
+                    geronimoLoginmoduleElement.add(optionElement);
+                if (countIterations == 0) {
+                    for (int i = 0; i < extraOptionsElement.length; i++) {
+                        if (extraOptionsElement[i] != null)
+                            geronimoLoginmoduleElement.add(extraOptionsElement[i]);
+                    }
+                }
+                countIterations += 1;
+            }
+        }
+        return geronimoLoginmoduleElement;
+    }
+
+    /**
+     * validate the wether the jeronimo side policy is a valid policy
+     * 
+     * @param application_policyElement
+     * @return boolean status of the check
+     */
+    private boolean validateSecurityPolicy(Element application_policyElement) {
+        String jbossLoginModule = null;
+        if (XMLConversionHelper.containSubElement(application_policyElement, "authentication")) {
+            Element authenticationElement = XMLConversionHelper.obtainSubElement(
+                    application_policyElement, "authentication");
+            if (XMLConversionHelper.containSubElement(authenticationElement, "login-module")) {
+                Element login_moduleElement = XMLConversionHelper.obtainSubElement(
+                        authenticationElement, "login-module");
+                Iterator attribIterator = login_moduleElement.attributeIterator();
+                while (attribIterator.hasNext()) {
+                    Attribute itAttribute = (Attribute) attribIterator.next();
+                    if (itAttribute.getName().equals("code")) {
+                        jbossLoginModule = itAttribute.getText();
+                        boolean return_value = validateJbossLoginModule(jbossLoginModule);
+                        return return_value;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * obtain the control flag from the login module element
+     * 
+     * @param login_moduleElement
+     * @return String version of the control flag
+     */
+    private String obtainControlFlagFromLoginModuleElement(Element login_moduleElement) {
+        String control_flag = null;
+        Iterator attribIterator = login_moduleElement.attributeIterator();
+        while (attribIterator.hasNext()) {
+            Attribute itAttribute = (Attribute) attribIterator.next();
+            if (itAttribute.getName().equals("flag")) {
+                control_flag = itAttribute.getText();
+                return control_flag;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * validate the jboss security modules wethere these are acceptable for the
+     * geronimo side
+     * 
+     * @param jbossLoginModule
+     * @return boolean status of the validation
+     */
+    private boolean validateJbossLoginModule(String jbossLoginModule) {
+        boolean status = false;
+        logger.debug("Jboss login module class name => " + jbossLoginModule);
+        if (jbossLoginModule.equals(Constants.JBOSS_LOGIN_MODULE_DATABASE_SERVER)) {
+            status = true;
+        } else if (jbossLoginModule.equals(Constants.JBOSS_LOGIN_MODULE_LDAP)) {
+            status =  true;
+        } else if (jbossLoginModule.equals(Constants.JBOSS_LOGIN_MODULE_USERS_ROLES)) {
+            status =  true;
+        }else {
+            out.error("The security resource conversion tool does not support "+
+                       jbossLoginModule+" module functionality");
+        }
+        return status;
+    }
+
+}

Propchange: geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/src/org/apache/apps/j2gmigrator/resources/security/SecurityResourcesTool.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,121 @@
+/**
+ *  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.
+ */
+ <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <environment>
+        <moduleId>
+            <groupId>console</groupId>
+            <artifactId>realm-SecurityRealm</artifactId>
+            <version>1.0</version>
+            <type>car</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>j2ee-security</artifactId>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+    <gbean name="SecurityRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
+        <attribute name="realmName">SecurityRealm</attribute>
+        <reference name="ServerInfo">
+            <name>ServerInfo</name>
+        </reference>
+        <reference name="LoginService">
+            <name>JaasLoginService</name>
+        </reference>
+        <xml-reference name="LoginModuleConfiguration">
+            <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
+                <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>SecurityRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+                    <log:option name="roleSearchMatching">test</log:option>
+                    <log:option name="roleName">test</log:option>
+                    <log:option name="userSearchSubtree">test</log:option>
+                    <log:option name="roleBase">test</log:option>
+                    <log:option name="userRoleName">test</log:option>
+                    <log:option name="authentication">simple</log:option>
+                    <log:option name="connectionUsername">testname</log:option>
+                    <log:option name="connectionURL">ldap://localhost:1389</log:option>
+                    <log:option name="userBase">test</log:option>
+                    <log:option name="initialContextFactory">test</log:option>
+                    <log:option name="roleSearchSubtree">test</log:option>
+                    <log:option name="connectionPassword">testpwd</log:option>
+                    <log:option name="userSearchMatching">test</log:option>
+                </log:login-module>
+                <log:login-module control-flag="OPTIONAL" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>SecurityRealm-Password</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GeronimoPasswordCredentialLoginModule</log:login-module-class>
+                </log:login-module>
+                <log:login-module control-flag="OPTIONAL" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>SecurityRealm-Audit</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.FileAuditLoginModule</log:login-module-class>
+                    <log:option name="file">~/tmp/test.log</log:option>
+                </log:login-module>
+                <log:login-module control-flag="REQUISITE" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>SecurityRealm-Lockout</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.RepeatedFailureLockoutLoginModule</log:login-module-class>
+                    <log:option name="lockoutDurationSecs">80</log:option>
+                    <log:option name="failurePeriodSecs">80</log:option>
+                    <log:option name="failureCount">80</log:option>
+                </log:login-module>
+				<!-- test -->
+				   <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>geronimo-properties-realm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+                    <log:option name="usersURI">var/security/users.properties</log:option>
+                    <log:option name="groupsURI">var/security/groups.properties</log:option>
+                </log:login-module>
+				<!-- database-->
+				 <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>TestDBSR</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.SQLLoginModule</log:login-module-class>
+                    <log:option name="userSelect">user select sql</log:option>
+                    <log:option name="jdbcDriver">com.mysql.jdbc.Driver</log:option>
+                    <log:option name="jdbcUser">jdbc user name</log:option>
+                    <log:option name="groupSelect">group select sql</log:option>
+                    <log:option name="jdbcPassword">jdbc user name</log:option>
+                    <log:option name="jdbcURL">jdbc url</log:option>
+				</log:login-module>
+				<!-- LDAP -->
+					<log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>NameLdapSR</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+                    <log:option name="connectionProtocol">protocol</log:option>
+                    <log:option name="roleSearchMatching">RoleUserSearchiString</log:option>
+                    <log:option name="roleName">RoleName</log:option>
+                    <log:option name="userSearchSubtree">uesrsSearchSubTree</log:option>
+                    <log:option name="roleBase">RoleBase</log:option>
+                    <log:option name="userRoleName">UserRoleSearch</log:option>
+                    <log:option name="connectionUsername">usename</log:option>
+                    <log:option name="connectionURL">ConnectionURL</log:option>
+                    <log:option name="userBase">userbase</log:option>
+                    <log:option name="initialContextFactory">InitialContextFactory</log:option>
+                    <log:option name="roleSearchSubtree">RoleSearch</log:option>
+                    <log:option name="connectionPassword">passeotd</log:option>
+                    <log:option name="userSearchMatching">userSearchMatching</log:option>
+                </log:login-module>
+				<!-- Other -->
+				<log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+                    <log:login-domain-name>NameSR</log:login-domain-name>
+                    <log:login-module-class>org.geronimo.test</log:login-module-class>
+                </log:login-module>
+					 
+            </log:login-config>
+        </xml-reference>
+    </gbean>
+</module>

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/geronimo-secutiry-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,208 @@
+/**
+ *  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.
+ */
+ <?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+      "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+      "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+  <authentication>
+    <login-module code="login.module1.class.name" flag="control_flag">
+      <module-option name = "option1-name">option1-value</module-option>
+      <module-option name = "option2-name">option2-value</module-option>
+      ...
+    </login-module>
+
+    <login-module code="login.module2.class.name" flag="control_flag">
+      ...
+    </login-module>
+    ...
+  </authentication>
+</application-policy>
+
+$Revision$
+-->
+
+<policy>
+    <!-- Used by clients within the application server VM such as
+    mbeans and servlets that access EJBs.
+    -->
+    <application-policy name = "client-login">
+       <authentication>
+          <login-module code = "org.jboss.security.ClientLoginModule"
+             flag = "required">
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <!-- Security domain for JBossMQ -->
+    <application-policy name = "jbossmq">
+       <authentication>
+          <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
+             flag = "required">
+             <module-option name = "unauthenticatedIdentity">guest</module-option>
+             <module-option name = "dsJndiName">java:/DefaultDS/Test</module-option>
+             <module-option name = "principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
+             <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <!-- Security domain for JBossMQ when using file-state-service.xml
+    <application-policy name = "jbossmq">
+       <authentication>
+          <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
+             flag = "required">
+             <module-option name = "unauthenticatedIdentity">guest</module-option>
+             <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+    -->
+
+    <!-- Security domains for testing new jca framework -->
+    <application-policy name = "HsqlDbRealm">
+       <authentication>
+          <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
+             flag = "required">
+             <module-option name = "principal">sa</module-option>
+             <module-option name = "userName">sa</module-option>
+             <module-option name = "password"></module-option>
+             <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <application-policy name = "JmsXARealm">
+       <authentication>
+          <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
+             flag = "required">
+             <module-option name = "principal">guest</module-option>
+             <module-option name = "userName">guest</module-option>
+             <module-option name = "password">guest</module-option>
+             <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <!-- A template configuration for the jmx-console web application. This
+      defaults to the UsersRolesLoginModule the same as other and should be
+      changed to a stronger authentication mechanism as required.
+    -->
+    <application-policy name = "jmx-console">
+       <authentication>
+          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+             flag = "required">
+           <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
+           <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <!-- A template configuration for the web-console web application. This
+      defaults to the UsersRolesLoginModule the same as other and should be
+      changed to a stronger authentication mechanism as required.
+    -->
+    <application-policy name = "web-console">
+       <authentication>
+          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+             flag = "required">
+             <module-option name="usersProperties">web-console-users.properties</module-option>
+             <module-option name="rolesProperties">web-console-roles.properties</module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+    <!-- A template configuration for the JBossWS web application (and transport layer!).
+      This defaults to the UsersRolesLoginModule the same as other and should be
+      changed to a stronger authentication mechanism as required.
+    -->
+    <application-policy name="JBossWS">
+      <authentication>
+        <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+          flag="required">
+          <module-option name="unauthenticatedIdentity">anonymous</module-option>
+        </login-module>
+      </authentication>
+    </application-policy>
+
+    <!-- The default login configuration used by any security domain that
+    does not have a application-policy entry with a matching name
+    -->
+    <application-policy name = "other">
+       <!-- A simple server login module, which can be used when the number 
+       of users is relatively small. It uses two properties files:
+       users.properties, which holds users (key) and their password (value).
+       roles.properties, which holds users (key) and a comma-separated list of
+       their roles (value).
+       The unauthenticatedIdentity property defines the name of the principal
+       that will be used when a null username and password are presented as is
+       the case for an unuathenticated web client or MDB. If you want to
+       allow such users to be authenticated add the property, e.g.,
+       unauthenticatedIdentity="nobody"
+       -->
+       <authentication>
+          <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
+             flag = "required" />
+       </authentication>
+    </application-policy>
+	
+	    <!-- This is the test 1 LDAP JBoss Configuration    -->
+	    <application-policy name="testLDAP1"> 
+        <authentication>
+         <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
+                <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
+                <module-option name="java.naming.provider.url">ldap://ldaphost.jboss.org:1389/</module-option>
+                <module-option name="java.naming.security.protocol">ssl</module-option>
+                <module-option name="java.naming.security.authentication">simple</module-option>
+                <module-option name="principalDNPrefix">uid=</module-option>                    
+                <module-option name="principalDNSuffix">test=test,ou=People,dc=jboss,dc=org</module-option>
+                <module-option name="rolesCtxDN">ou=Roles,dc=jboss,dc=org</module-option>
+                <module-option name="uidAttributeID">member</module-option>
+                <module-option name="matchOnUserDN">true</module-option>
+                <module-option name="roleAttributeID">cn</module-option>
+                <module-option name="roleAttributeIsDN">false </module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+	
+		    <!-- This is the test 2 LDAP JBoss Configuration    -->
+	    <application-policy name="testLDAP2"> 
+        <authentication>
+         <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
+                <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
+                <module-option name="java.naming.provider.url">ldap://ldaphost.jboss.org:1389/</module-option>
+                <module-option name="java.naming.security.protocol">tcp</module-option>
+                <module-option name="java.naming.security.authentication">simple</module-option>
+                <module-option name="principalDNPrefix">uid=</module-option>                    
+                <module-option name="principalDNSuffix">,ou=People,dc=jboss,dc=org</module-option>
+                <module-option name="rolesCtxDN">ou=Roles,dc=jboss,dc=org</module-option>
+                <module-option name="uidAttributeID">member</module-option>
+                <module-option name="matchOnUserDN">true</module-option>
+                <module-option name="roleAttributeID">cn</module-option>
+                <module-option name="roleAttributeIsDN">false </module-option>
+          </login-module>
+       </authentication>
+    </application-policy>
+
+</policy>
+

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/login-config.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml Mon Mar 19 10:43:27 2007
@@ -0,0 +1,106 @@
+/**
+ *  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.
+ */
+ <?xml version="1.0" encoding="UTF-8"?>
+
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <environment>
+    <moduleId>
+      <groupId>j2g</groupId>
+      <artifactId>security</artifactId>
+      <version>1.0</version>
+      <type>rar</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>j2g</groupId>
+        <artifactId>security</artifactId>
+        <version>1.0</version>
+        <type>rar</type>
+      </dependency>
+    </dependencies>
+  </environment>
+  <gbean name="SecurityRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
+    <reference name="ServerInfo">
+      <name>ServerInfo</name>
+    </reference>
+    <reference name="LoginService">
+      <name>JaasLoginService</name>
+    </reference>
+    <xml-reference name="LoginModuleConfiguration">
+      <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>jbossmq</log:login-domain-name>
+          <log:login-module-class>org.apache.geronimo.security.realm.providers.SQLLoginModule</log:login-module-class>
+          <log:option name="dataSourceName">DefaultDS/Test</log:option>
+          <log:option name="userSelect">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</log:option>
+          <log:option name="groupSelect">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</log:option>
+        </log:login-module>
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>jmx-console</log:login-domain-name>
+          <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+          <log:option name="usersURI">var/security/user.properties</log:option>
+          <log:option name="groupsURI">var/security/user.properties</log:option>
+        </log:login-module>
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>web-console</log:login-domain-name>
+          <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+          <log:option name="usersURI">var/security/user.properties</log:option>
+          <log:option name="groupsURI">var/security/user.properties</log:option>
+        </log:login-module>
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>JBossWS</log:login-domain-name>
+          <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+          <log:option name="unauthenticatedIdentity">anonymous</log:option>
+        </log:login-module>
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>other</log:login-domain-name>
+          <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+        </log:login-module>
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>testLDAP1</log:login-domain-name>
+          <log:login-module-class>org.apche.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+          <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
+          <log:option name="userBase"></log:option>
+          <log:option name="roleBase"></log:option>
+          <log:option name="userSearchSubtree">true</log:option>
+          <log:option name="roleSearchSubtree">true</log:option>
+          <log:option name="connectionURL">ldap://localhost:636</log:option>
+          <log:option name="connectionProtocol">ssl</log:option>
+          <log:option name="authentication">simple</log:option>
+          <log:option name="userSearchMatching">uid={0}test=test,ou=People,dc=jboss,dc=org</log:option>
+          <log:option name="roleSearchMatching">ou=Roles,dc=jboss,dc=org???(member={0})</log:option>
+          <log:option name="roleName">roles</log:option>
+        </log:login-module>
+        <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+          <log:login-domain-name>testLDAP2</log:login-domain-name>
+          <log:login-module-class>org.apche.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+          <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
+          <log:option name="userBase"></log:option>
+          <log:option name="roleBase"></log:option>
+          <log:option name="userSearchSubtree">true</log:option>
+          <log:option name="roleSearchSubtree">true</log:option>
+          <log:option name="connectionURL">ldap://localhost:389</log:option>
+          <log:option name="connectionProtocol">tcp</log:option>
+          <log:option name="authentication">simple</log:option>
+          <log:option name="userSearchMatching">uid={0},ou=People,dc=jboss,dc=org</log:option>
+          <log:option name="roleSearchMatching">ou=Roles,dc=jboss,dc=org???(member={0})</log:option>
+          <log:option name="roleName">roles</log:option>
+        </log:login-module>
+      </log:login-config>
+    </xml-reference>
+  </gbean>
+</module>

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test-apps/security/security-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java (added)
+++ geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java Mon Mar 19 10:43:27 2007
@@ -0,0 +1,45 @@
+/**
+ *  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.apps.j2gmigrator.resources.security.test;
+
+import java.io.File;
+
+import org.apache.apps.j2gmigrator.resources.ResourcesTool;
+import org.apache.apps.j2gmigrator.resources.security.SecurityResourcesTool;
+
+import junit.framework.TestCase;
+
+/**
+ * Test Case for the SecurityResouresTool
+ */
+public class SecurityResouresToolTestCase extends TestCase {
+
+    @Override //the setup method 
+    protected void setUp() throws Exception {
+        // To set the IOutput intialize the ResourcesTool
+        ResourcesTool  resTool = new ResourcesTool();
+        super.setUp();
+    }
+    
+    // Test for login-config.xml file loading
+    public void testSecurityResourcesFileMigration_file() {
+        File file = new File("test-apps/security/login-config.xml");
+        SecurityResourcesTool securityResourcesTool = new SecurityResourcesTool();
+        boolean result = securityResourcesTool.migrate(file);
+        assertTrue(result);
+    }
+}

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/src2/security-plugin/test/org/apache/apps/j2gmigrator/resources/security/test/SecurityResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/j2g/src2/web-migration-plugin/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/src2/web-migration-plugin/META-INF/MANIFEST.MF?view=auto&rev=520023
==============================================================================
--- geronimo/sandbox/j2g/src2/web-migration-plugin/META-INF/MANIFEST.MF (added)
+++ geronimo/sandbox/j2g/src2/web-migration-plugin/META-INF/MANIFEST.MF Mon Mar 19 10:43:27 2007
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Web_migration_plugin Plug-in
+Bundle-SymbolicName: com.ibm.j2g.descriptors.web; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Vendor: ibm
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ com.ibm.j2g,
+ com.ibm.j2g.descriptors,
+ com.ibm.j2g.util
+Eclipse-LazyStart: true
+Bundle-ClassPath: .



Mime
View raw message