geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r561821 [9/12] - in /geronimo/sandbox/j2g: ./ configurator/ doc/ plugins/ plugins/org.apache.geronimo.j2g.common/ plugins/org.apache.geronimo.j2g.descriptors/ plugins/org.apache.geronimo.j2g.descriptors/src/ plugins/org.apache.geronimo.j2g....
Date Wed, 01 Aug 2007 15:05:17 GMT
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java Wed Aug  1 08:05:12 2007
@@ -1,72 +1,72 @@
-/**
- *  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.resources.datasource.test;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.resources.ResourcesTool;
-import org.apache.geronimo.j2g.resources.datasource.DSResourcesTool;
-import org.apache.geronimo.j2g.util.resources.Constants;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-
-/**
- * Test Case for the DSResouresTool
- */
-public class DSResouresToolTestCase extends TestCase {
-    
-    
-    protected void setUp() throws Exception {
-        // To set the IOutput intialize the DescripterTool
-        ResourcesTool desTool = new ResourcesTool();
-        super.setUp();
-    }
-
-    // Test for the mysql
-    public void testDSResourcesFileMigration_mysql() {
-        File file = new File("test-apps/ds/mysql-ds.xml");
-        DSResourcesTool dsResourcesTool = new DSResourcesTool();
-        boolean result = dsResourcesTool.migrate(file, null);
-        assertTrue(result);
-    }
-
-    // Test for the oracle
-    public void testDSResourcesFileMigration_oracle() {
-        File file = new File("test-apps/ds/oracle-ds.xml");
-        DSResourcesTool dsResourcesTool = new DSResourcesTool();
-        boolean result = dsResourcesTool.migrate(file, null);
-        assertTrue(result);
-    }
-
-    // Test for the hsqldb
-    public void testDSResourcesFileMigration_hsqldb() {
-        File file = new File("test-apps/ds/hsqldb-ds.xml");
-        DSResourcesTool dsResourcesTool = new DSResourcesTool();
-        boolean result = dsResourcesTool.migrate(file, null);
-        assertTrue(result);
-    }
-
-    public void testMethod_createDefaultConnectionManagerElement() {
-        Namespace connectorNamespace = new Namespace("", Constants.NAMESPACE_CONNECTOR);
-        DSResourcesTool dsResourcesTool = new DSResourcesTool();
-        Element result = dsResourcesTool.createDefaultConnectionManagerElement(connectorNamespace);
-        assertNotNull(result);
-    }
-
-}
+/**
+ *  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.resources.datasource.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.resources.ResourcesTool;
+import org.apache.geronimo.j2g.resources.datasource.DSResourcesTool;
+import org.apache.geronimo.j2g.util.resources.Constants;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+
+/**
+ * Test Case for the DSResouresTool
+ */
+public class DSResouresToolTestCase extends TestCase {
+    
+    
+    protected void setUp() throws Exception {
+        // To set the IOutput intialize the DescripterTool
+        ResourcesTool desTool = new ResourcesTool();
+        super.setUp();
+    }
+
+    // Test for the mysql
+    public void testDSResourcesFileMigration_mysql() {
+        File file = new File("test-apps/ds/mysql-ds.xml");
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        boolean result = dsResourcesTool.migrate(file, null);
+        assertTrue(result);
+    }
+
+    // Test for the oracle
+    public void testDSResourcesFileMigration_oracle() {
+        File file = new File("test-apps/ds/oracle-ds.xml");
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        boolean result = dsResourcesTool.migrate(file, null);
+        assertTrue(result);
+    }
+
+    // Test for the hsqldb
+    public void testDSResourcesFileMigration_hsqldb() {
+        File file = new File("test-apps/ds/hsqldb-ds.xml");
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        boolean result = dsResourcesTool.migrate(file, null);
+        assertTrue(result);
+    }
+
+    public void testMethod_createDefaultConnectionManagerElement() {
+        Namespace connectorNamespace = new Namespace("", Constants.NAMESPACE_CONNECTOR);
+        DSResourcesTool dsResourcesTool = new DSResourcesTool();
+        Element result = dsResourcesTool.createDefaultConnectionManagerElement(connectorNamespace);
+        assertNotNull(result);
+    }
+
+}

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java Wed Aug  1 08:05:12 2007
@@ -1,48 +1,48 @@
-/**
- *  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.resources.jms.test;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.resources.ResourcesTool;
-import org.apache.geronimo.j2g.resources.jms.JMSResourcesTool;
-import org.apache.geronimo.j2g.util.resources.Constants;
-
-/**
- * Test Case for the JMSResouresTool
- */
-public class JMSResouresToolTestCase extends TestCase {
-    
-    @Override //the setup method 
-    protected void setUp() throws Exception {
-        // To set the IOutput intialize the DescripterTool
-        ResourcesTool desTool = new ResourcesTool();
-        super.setUp();
-    }
-    
-    // Test for JMS Resources Migration
-    public void testJMSResourcesFileMigration() {
-        String fileLocation = Constants.TEST_RESOURCES_DIRECTORY + "jms/"
-                + Constants.JBOSS_VALID_JMS_DESTINATIONS_SERVICES_XML_FILE;
-        File file = new File(fileLocation);
-        JMSResourcesTool jmsResourcesTool = new JMSResourcesTool();
-        boolean result = jmsResourcesTool.migrate(file, null);
-        assertTrue(result);
-    }
-}
+/**
+ *  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.resources.jms.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.resources.ResourcesTool;
+import org.apache.geronimo.j2g.resources.jms.JMSResourcesTool;
+import org.apache.geronimo.j2g.util.resources.Constants;
+
+/**
+ * Test Case for the JMSResouresTool
+ */
+public class JMSResouresToolTestCase extends TestCase {
+    
+    @Override //the setup method 
+    protected void setUp() throws Exception {
+        // To set the IOutput intialize the DescripterTool
+        ResourcesTool desTool = new ResourcesTool();
+        super.setUp();
+    }
+    
+    // Test for JMS Resources Migration
+    public void testJMSResourcesFileMigration() {
+        String fileLocation = Constants.TEST_RESOURCES_DIRECTORY + "jms/"
+                + Constants.JBOSS_VALID_JMS_DESTINATIONS_SERVICES_XML_FILE;
+        File file = new File(fileLocation);
+        JMSResourcesTool jmsResourcesTool = new JMSResourcesTool();
+        boolean result = jmsResourcesTool.migrate(file, null);
+        assertTrue(result);
+    }
+}

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java Wed Aug  1 08:05:12 2007
@@ -1,70 +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.geronimo.j2g.resources.mail.test;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.resources.ResourcesTool;
-import org.apache.geronimo.j2g.resources.mail.MailResourcesTool;
-import org.apache.geronimo.j2g.util.resources.xml.XMLConversionHelper;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-
-/**
- * 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, null);
-        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, null);
-        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();
-        }
-    }
-}
+/**
+ *  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.resources.mail.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.resources.ResourcesTool;
+import org.apache.geronimo.j2g.resources.mail.MailResourcesTool;
+import org.apache.geronimo.j2g.util.resources.xml.XMLConversionHelper;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+
+/**
+ * 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, null);
+        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, null);
+        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/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java Wed Aug  1 08:05:12 2007
@@ -1,45 +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.geronimo.j2g.resources.security.test;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.geronimo.j2g.resources.ResourcesTool;
-import org.apache.geronimo.j2g.resources.security.SecurityResourcesTool;
-
-/**
- * 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, null);
-        assertTrue(result);
-    }
-}
+/**
+ *  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.resources.security.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.j2g.resources.ResourcesTool;
+import org.apache.geronimo.j2g.resources.security.SecurityResourcesTool;
+
+/**
+ * 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, null);
+        assertTrue(result);
+    }
+}

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

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

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

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/plugin.xml?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/plugin.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/plugin.xml Wed Aug  1 08:05:12 2007
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
-  ~ 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.
-  -->
-<plugin>
-   <extension-point id="migrations" name="Java Sources Migration Extension Point" schema="schema/migrations.exsd"/>
-   <extension
-         id="tool"
-         name="Source Identification Tool"
-         point="org.eclipse.core.runtime.applications">
-      <application>
-         <run class="org.apache.geronimo.j2g.sources.SourceIdentificationTool"/>
-      </application>
-   </extension>
-   <extension
-         point="org.apache.geronimo.j2g.sources.migrations">
-      <migration
-            class="org.apache.geronimo.j2g.sources.dependence.DependenceJavaMigration">
-      </migration>
-   </extension>
-   <extension
-         point="org.apache.geronimo.j2g.sources.migrations">
-      <migration
-            class="org.apache.geronimo.j2g.sources.environment.EjbEnvJavaMigration">
-      </migration>
-   </extension>
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<!--
+  ~ 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.
+  -->
+<plugin>
+   <extension-point id="migrations" name="Java Sources Migration Extension Point" schema="schema/migrations.exsd"/>
+   <extension
+         id="tool"
+         name="Source Identification Tool"
+         point="org.eclipse.core.runtime.applications">
+      <application>
+         <run class="org.apache.geronimo.j2g.sources.SourceIdentificationTool"/>
+      </application>
+   </extension>
+   <extension
+         point="org.apache.geronimo.j2g.sources.migrations">
+      <migration
+            class="org.apache.geronimo.j2g.sources.dependence.DependenceJavaMigration">
+      </migration>
+   </extension>
+   <extension
+         point="org.apache.geronimo.j2g.sources.migrations">
+      <migration
+            class="org.apache.geronimo.j2g.sources.environment.EjbEnvJavaMigration">
+      </migration>
+   </extension>
+</plugin>

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/pom.xml
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Wed Aug  1 08:05:12 2007
@@ -1 +1 @@
-Date Rev
+Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/FileFilterImpl.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Wed Aug  1 08:05:12 2007
@@ -1 +1 @@
-Date Rev
+Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/JavaParser.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Wed Aug  1 08:05:12 2007
@@ -1 +1 @@
-Date Rev
+Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/JavaSourceFilter.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Wed Aug  1 08:05:12 2007
@@ -1 +1 @@
-Date Rev
+Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/ParsedSource.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Wed Aug  1 08:05:12 2007
@@ -1 +1 @@
-Date Rev
+Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/SourceIdentificationTool.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Wed Aug  1 08:05:12 2007
@@ -1 +1 @@
-Date Rev
+Date Author Id Revision HeadURL

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java Wed Aug  1 08:05:12 2007
@@ -1,151 +1,151 @@
-/**
- *  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.sources.dependence;
-
-import java.util.List;
-
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.Tool;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTMatcher;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
-
-
-/**
- * Finds specified names and replaces its by new one.
- */
-public class APIReplaceVisitor extends ASTVisitor {
-
-	/** Name to replace */
-	private QualifiedName targetName;
-
-	/** New name */
-	private QualifiedName newName;
-
-	/** Compilation unit */
-	private CompilationUnit unit;
-
-	/** Nodes matcher */
-	private ASTMatcher matcher;
-
-	/** Output */
-	private IOutput out;
-
-	/** Import changing flag */
-	private boolean isImportAffected;
-
-	/** Changes counter */
-	private int changes = 0; 
-	
-	/**
-	 * Constructor. Creates new instance of APIReplaceVisitor.
-	 * @param unit compilation unit.
-	 * @param targetName target name.
-	 * @param newName new name.
-	 */
-	public APIReplaceVisitor(CompilationUnit unit, QualifiedName targetName, QualifiedName newName) {
-		super(false);
-		this.targetName = targetName;
-		this.newName = newName;
-		this.unit = unit;
-		matcher = new ASTMatcher(false);
-		out = Tool.getCurrent().getOutput();
-		isImportAffected = false;
-	}
-
-	/**
-	 * Replaces qualified names in imports.
-	 */
-	public boolean visit(ImportDeclaration importDeclaration) {
-		QualifiedName name = (QualifiedName) importDeclaration.getName();
-		if (!importDeclaration.isOnDemand()) {
-			int position = name.getStartPosition();
-			if (matcher.match(name, targetName)) {
-				isImportAffected = true;
-				AST ast = importDeclaration.getAST();
-				Name replacer = ast.newName(newName.getFullyQualifiedName());
-				printChanges(name, newName, unit.getLineNumber(position), unit.getColumnNumber(position));
-				importDeclaration.setName(replacer);
-			}
-		}
-		else {
-			if (matcher.match(name, targetName.getQualifier())) {
-				List imports = unit.imports();
-				AST ast = unit.getAST();
-				ImportDeclaration newImport = ast.newImportDeclaration();
-				newImport.setName(newName);
-				imports.add(newImport);
-				isImportAffected = true;
-				out.info(APIReplaceVisitor.class.getSimpleName(), "New import was added: '" + newName.getFullyQualifiedName()+"'.");
-				changes++;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Replaces qualified name.
-	 */
-	public boolean visit(QualifiedName name) {
-		int position = name.getStartPosition();
-		if (matcher.match(name, targetName)) {
-			AST ast = name.getAST();
-			Name replacer = ast.newName(newName.getFullyQualifiedName());
-			StructuralPropertyDescriptor desc = name.getLocationInParent();
-			printChanges(name, newName, unit.getLineNumber(position), unit.getColumnNumber(position));
-			name.getParent().setStructuralProperty(desc, replacer);
-		}
-		return false;
-	}
-
-	/**
-	 * Replaces simple name.
-	 */
-	public boolean visit(SimpleName name) {
-		int position = name.getStartPosition();
-		if (matcher.match(name, targetName.getName()) && isImportAffected) {
-			printChanges(name, newName.getName(), unit.getLineNumber(position), unit.getColumnNumber(position));
-			name.setIdentifier(newName.getName().getIdentifier());
-		}
-		return false;
-	}
-
-	/**
-	 * Prints out about changes in compilation unit.
-	 * @param name replaced name.
-	 * @param newName new name.
-	 * @param row row in source unit.
-	 * @param col column in source unit.
-	 */
-	private void printChanges(Name name, Name newName, int row, int col) {
-		changes++;
-		out.info(APIReplaceVisitor.class.getSimpleName(), "Name '" + name.getFullyQualifiedName() + "' was replaced by '" + newName.getFullyQualifiedName() + "'.", row, col);
-	}
-
-	/**
-	 * @return the changes count
-	 */
-	public int getChanges() {
-		return changes;
-	}
-}
+/**
+ *  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.sources.dependence;
+
+import java.util.List;
+
+import org.apache.geronimo.j2g.common.IOutput;
+import org.apache.geronimo.j2g.common.Tool;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTMatcher;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
+
+
+/**
+ * Finds specified names and replaces its by new one.
+ */
+public class APIReplaceVisitor extends ASTVisitor {
+
+	/** Name to replace */
+	private QualifiedName targetName;
+
+	/** New name */
+	private QualifiedName newName;
+
+	/** Compilation unit */
+	private CompilationUnit unit;
+
+	/** Nodes matcher */
+	private ASTMatcher matcher;
+
+	/** Output */
+	private IOutput out;
+
+	/** Import changing flag */
+	private boolean isImportAffected;
+
+	/** Changes counter */
+	private int changes = 0; 
+	
+	/**
+	 * Constructor. Creates new instance of APIReplaceVisitor.
+	 * @param unit compilation unit.
+	 * @param targetName target name.
+	 * @param newName new name.
+	 */
+	public APIReplaceVisitor(CompilationUnit unit, QualifiedName targetName, QualifiedName newName) {
+		super(false);
+		this.targetName = targetName;
+		this.newName = newName;
+		this.unit = unit;
+		matcher = new ASTMatcher(false);
+		out = Tool.getCurrent().getOutput();
+		isImportAffected = false;
+	}
+
+	/**
+	 * Replaces qualified names in imports.
+	 */
+	public boolean visit(ImportDeclaration importDeclaration) {
+		QualifiedName name = (QualifiedName) importDeclaration.getName();
+		if (!importDeclaration.isOnDemand()) {
+			int position = name.getStartPosition();
+			if (matcher.match(name, targetName)) {
+				isImportAffected = true;
+				AST ast = importDeclaration.getAST();
+				Name replacer = ast.newName(newName.getFullyQualifiedName());
+				printChanges(name, newName, unit.getLineNumber(position), unit.getColumnNumber(position));
+				importDeclaration.setName(replacer);
+			}
+		}
+		else {
+			if (matcher.match(name, targetName.getQualifier())) {
+				List imports = unit.imports();
+				AST ast = unit.getAST();
+				ImportDeclaration newImport = ast.newImportDeclaration();
+				newImport.setName(newName);
+				imports.add(newImport);
+				isImportAffected = true;
+				out.info(APIReplaceVisitor.class.getSimpleName(), "New import was added: '" + newName.getFullyQualifiedName()+"'.");
+				changes++;
+			}
+		}
+		return false;
+	}
+
+	/**
+	 * Replaces qualified name.
+	 */
+	public boolean visit(QualifiedName name) {
+		int position = name.getStartPosition();
+		if (matcher.match(name, targetName)) {
+			AST ast = name.getAST();
+			Name replacer = ast.newName(newName.getFullyQualifiedName());
+			StructuralPropertyDescriptor desc = name.getLocationInParent();
+			printChanges(name, newName, unit.getLineNumber(position), unit.getColumnNumber(position));
+			name.getParent().setStructuralProperty(desc, replacer);
+		}
+		return false;
+	}
+
+	/**
+	 * Replaces simple name.
+	 */
+	public boolean visit(SimpleName name) {
+		int position = name.getStartPosition();
+		if (matcher.match(name, targetName.getName()) && isImportAffected) {
+			printChanges(name, newName.getName(), unit.getLineNumber(position), unit.getColumnNumber(position));
+			name.setIdentifier(newName.getName().getIdentifier());
+		}
+		return false;
+	}
+
+	/**
+	 * Prints out about changes in compilation unit.
+	 * @param name replaced name.
+	 * @param newName new name.
+	 * @param row row in source unit.
+	 * @param col column in source unit.
+	 */
+	private void printChanges(Name name, Name newName, int row, int col) {
+		changes++;
+		out.info(APIReplaceVisitor.class.getSimpleName(), "Name '" + name.getFullyQualifiedName() + "' was replaced by '" + newName.getFullyQualifiedName() + "'.", row, col);
+	}
+
+	/**
+	 * @return the changes count
+	 */
+	public int getChanges() {
+		return changes;
+	}
+}

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/APIReplaceVisitor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java?view=diff&rev=561821&r1=561820&r2=561821
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java Wed Aug  1 08:05:12 2007
@@ -1,271 +1,271 @@
-/**
- *  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.sources.dependence;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.geronimo.j2g.common.FatalToolException;
-import org.apache.geronimo.j2g.common.IJavaMigration;
-import org.apache.geronimo.j2g.common.IOutput;
-import org.apache.geronimo.j2g.common.RollbackManager;
-import org.apache.geronimo.j2g.common.Tool;
-import org.apache.geronimo.j2g.common.ToolConstants;
-import org.apache.geronimo.j2g.sources.dependence.compatibility.Anybody;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jface.text.Document;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * Determines all references of the source compilation unit to classes which are incompatible with
- * Geronimo.
- */
-public class DependenceJavaMigration implements IJavaMigration {
-	/**
-	 * Plug-in name.
-	 */
-	private final static String PLUGIN_NAME = "Dependence plug-in";
-
-	/**
-	 * Tool output
-	 */
-	private IOutput out;
-	
-	/**
-	 * Property file with default Geronimo libraries names.
-	 */
-	private final String DEFAULT_LIBS_FILENAME = "default_jars.properties";
-	private final String DEFAULT_LIBS_DIRECTORY = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence/";
-
-	/**
-	 * Set of default Geronimo libraries names.
-	 */
-	private static Set defaultLibs;
-
-	/**
-	 * Compatibility sources names.
-	 */
-	private final String COMPATIBILITY_SOURCES_FILENAME = "compatible_sources.properties";
-	private final String COMPATIBILITY_SOURCES_DIRECTORY = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence/";
-
-	/**
-	 * Set of default Geronimo libraries names.
-	 */
-	private static Properties compatibilitySources;
-
-	/**
-	 * Property file with class analogies.
-	 */
-	private final String CLASS_ANALOGIES_FILENAME = "class_analogies.properties";
-	private final String CLASS_ANALOGIES_DIRECTORY = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence/";
-
-	/**
-	 * Properties with class analogies.
-	 */
-	private static Properties classAnalogies;
-
-	/**
-	 * Compatibles package qualified name.
-	 */
-	private static final String COMPATIBLES_PACKAGE = "org/apache/geronimo/j2g/sources/dependence/compatibility";
-
-	/**
-	 * Location of Compatibles Files.
-	 */
-	private static final String COMPATIBLES_LOCATION = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence.compatibility";
-	/**
-	 * Java resources extension.
-	 */
-	private static final String JAVA_EXT = ".java";
-
-	/**
-	 * Byte buffer size.
-	 */
-	private static final int BUFFER_SIZE = 1024;
-
-	/**
-	 * Constructor. Loads default libs names and class analogies names.
-	 * @throws FatalToolException if cannot load properties file with default jars names.
-	 */
-	public DependenceJavaMigration() throws FatalToolException {
-		super();
-		if (defaultLibs == null) {
-			try {
-				File propertyFile = new File(DEFAULT_LIBS_DIRECTORY + DEFAULT_LIBS_FILENAME);
-				Properties prop = new Properties();
-				prop.load(new FileInputStream(propertyFile));
-				defaultLibs = prop.keySet();
-			} catch (IOException e) {
-				throw new FatalToolException("Cannot load properties file with default jars names.");
-			}
-		}
-
-		if (classAnalogies == null) {
-			try {
-				File propertyFile = new File(CLASS_ANALOGIES_DIRECTORY + CLASS_ANALOGIES_FILENAME);
-				classAnalogies = new Properties();
-				classAnalogies.load(new FileInputStream(propertyFile));
-			} catch (IOException e) {
-				throw new FatalToolException("Cannot load properties file with class analogies.");
-			}
-		}
-		if (compatibilitySources == null) {
-			try {
-				File propertyFile = new File(COMPATIBILITY_SOURCES_DIRECTORY + COMPATIBILITY_SOURCES_FILENAME);
-				compatibilitySources = new Properties();
-				compatibilitySources.load(new FileInputStream(propertyFile));
-			} catch (IOException e) {
-				throw new FatalToolException("Cannot load properties file with compatibility classnames.");
-			}
-		}
-	}
-
-	/**
-	 * Determines all references of the source compilation unit to classes which are incompatible
-	 * with Geronimo.
-	 * @param source compilation unit for migration.
-	 */
-	public boolean migrate(ASTNode source) {
-		out = Tool.getCurrent().getOutput();
-		if (source instanceof CompilationUnit) {
-			CompilationUnit compilationUnit = (CompilationUnit) source;
-			String unitName = compilationUnit.getJavaElement().getElementName();
-			boolean isSourceChanged = false;
-			out.info(DependenceJavaMigration.class.getSimpleName(), "[" + PLUGIN_NAME + "] " + "Migration started: " + unitName);
-			Set replacedClasses = classAnalogies.keySet();
-			AST ast = compilationUnit.getAST();
-			Iterator classesIterator = replacedClasses.iterator();
-			while (classesIterator.hasNext()) {
-				String targetStr = (String) classesIterator.next();
-				String newStr = classAnalogies.getProperty(targetStr);
-				Name replaced = ast.newName(targetStr);
-				Name replacer = ast.newName(newStr);
-
-				if (replaced.isQualifiedName() && replacer.isQualifiedName()) {
-					QualifiedName targetName = (QualifiedName) replaced;
-					QualifiedName newName = (QualifiedName) replacer;
-					APIReplaceVisitor apiReplacer = new APIReplaceVisitor(compilationUnit, targetName, newName);
-					compilationUnit.accept(apiReplacer);
-					apiReplacer.visit(compilationUnit);
-					isSourceChanged = isSourceChanged || (apiReplacer.getChanges() > 0);
-				}
-				else {
-					out.error(DependenceJavaMigration.class.getSimpleName(), "Wrong class names for JBoss classes and it's Geronimo analogies in property file");
-					break;
-				}
-
-			}
-			try {
-				if (isSourceChanged) {
-					String path = compilationUnit.getJavaElement().getUnderlyingResource().getLocation().toPortableString();
-					String package_path = compilationUnit.getPackage().getName().getFullyQualifiedName().replace('.', IPath.SEPARATOR);
-					String src_path = path.substring(0, path.indexOf(package_path));
-					String compatible_dir = src_path + COMPATIBLES_PACKAGE;
-					File pack = new File(compatible_dir);
-					File sourceDir = new File(COMPATIBLES_LOCATION);
-					if (!pack.exists()) {
-						pack.mkdirs();
-						Set compatibleSources = compatibilitySources.keySet();
-						Iterator keys = compatibleSources.iterator();
-						while (keys.hasNext()) {
-							String classname = (String)keys.next();
-							String sourceName = classname.substring(classname.lastIndexOf('.') + 1) + JAVA_EXT;
-							File addedSource = new File(pack, sourceName);
-							addedSource.createNewFile();
-							PrintWriter writer = new PrintWriter(new FileOutputStream(addedSource));
-							InputStream inStream = null;
-							inStream = new FileInputStream(new File(sourceDir,sourceName));
-							byte[] buffer = new byte[BUFFER_SIZE];
-							int len = 0;
-							while ((len = inStream.read(buffer)) > 0) {
-								String outpt = new String(buffer, 0, len);
-								writer.print(outpt);
-							}
-							inStream.close();
-							writer.close();
-						}
-						IWorkspace workspace = ResourcesPlugin.getWorkspace();
-						IProject project = workspace.getRoot().getProject(ToolConstants.TEMPORARY_PROJECT_NAME);
-						project.refreshLocal(IResource.DEPTH_INFINITE, null);
-					}
-					ICompilationUnit isource = (ICompilationUnit) compilationUnit.getJavaElement();
-					String contents = isource.getBuffer().getContents();
-					File file = new File(isource.getUnderlyingResource().getLocation().toOSString() + RollbackManager.BACKUP_SUFFIX);
-					file.createNewFile();
-					FileOutputStream fout = new FileOutputStream(file);
-					fout.write(contents.getBytes());
-					fout.close();
-					Document document = new Document(contents);
-					TextEdit edits = compilationUnit.rewrite(document, isource.getJavaProject().getOptions(true));
-					edits.apply(document);
-					String newSource = document.get();
-					isource.getBuffer().setContents(newSource);
-					isource.save(null, true);
-
-					ASTParser parser = ASTParser.newParser(AST.JLS3);
-					parser.setResolveBindings(true);
-					parser.setSource(isource);
-					compilationUnit = (CompilationUnit) parser.createAST(null);
-				}
-			} catch (IOException ex) {
-				out.fatal(DependenceJavaMigration.class.getSimpleName(), "The plug-in cannot add compatible package or save backup because an I/O error occured. Make sure that the source directories are not under write protection.");
-			} catch (Exception e) {
-				out.fatal(DependenceJavaMigration.class.getSimpleName(), "The plug-in cannot get access to the resources. Make sure that the source files are not under write protection or have not been deleted by another process.");
-			}
-			NodesVisitor visitor = new NodesVisitor(compilationUnit);
-			compilationUnit.accept(visitor);
-			visitor.visit(compilationUnit);
-			boolean isSourceValid = visitor.isSourceValid();
-			if (isSourceChanged && !isSourceValid) {
-				out.warn(DependenceJavaMigration.class.getSimpleName(), "Errors were found in the source file! Changes were saved. The original file was saved with name " + unitName + RollbackManager.BACKUP_SUFFIX);
-			}
-			out.info(DependenceJavaMigration.class.getSimpleName(), "[" + PLUGIN_NAME + "] " + "Migration finished: " + unitName);
-			return false;
-		}
-		else {
-			out.error(DependenceJavaMigration.class.getSimpleName(), "[" + PLUGIN_NAME + "] " + "Wrong type of source node.");
-		}
-		return false;
-	}
-
-	/**
-	 * @return set of default lib names.
-	 */
-	public static Set getDefaultLibs() {
-		return defaultLibs;
-	}
-}
+/**
+ *  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.sources.dependence;
+
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.geronimo.j2g.common.FatalToolException;
+import org.apache.geronimo.j2g.common.IJavaMigration;
+import org.apache.geronimo.j2g.common.IOutput;
+import org.apache.geronimo.j2g.common.RollbackManager;
+import org.apache.geronimo.j2g.common.Tool;
+import org.apache.geronimo.j2g.common.ToolConstants;
+import org.apache.geronimo.j2g.sources.dependence.compatibility.Anybody;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Name;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jface.text.Document;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Determines all references of the source compilation unit to classes which are incompatible with
+ * Geronimo.
+ */
+public class DependenceJavaMigration implements IJavaMigration {
+	/**
+	 * Plug-in name.
+	 */
+	private final static String PLUGIN_NAME = "Dependence plug-in";
+
+	/**
+	 * Tool output
+	 */
+	private IOutput out;
+	
+	/**
+	 * Property file with default Geronimo libraries names.
+	 */
+	private final String DEFAULT_LIBS_FILENAME = "default_jars.properties";
+	private final String DEFAULT_LIBS_DIRECTORY = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence/";
+
+	/**
+	 * Set of default Geronimo libraries names.
+	 */
+	private static Set defaultLibs;
+
+	/**
+	 * Compatibility sources names.
+	 */
+	private final String COMPATIBILITY_SOURCES_FILENAME = "compatible_sources.properties";
+	private final String COMPATIBILITY_SOURCES_DIRECTORY = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence/";
+
+	/**
+	 * Set of default Geronimo libraries names.
+	 */
+	private static Properties compatibilitySources;
+
+	/**
+	 * Property file with class analogies.
+	 */
+	private final String CLASS_ANALOGIES_FILENAME = "class_analogies.properties";
+	private final String CLASS_ANALOGIES_DIRECTORY = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence/";
+
+	/**
+	 * Properties with class analogies.
+	 */
+	private static Properties classAnalogies;
+
+	/**
+	 * Compatibles package qualified name.
+	 */
+	private static final String COMPATIBLES_PACKAGE = "org/apache/geronimo/j2g/sources/dependence/compatibility";
+
+	/**
+	 * Location of Compatibles Files.
+	 */
+	private static final String COMPATIBLES_LOCATION = System.getenv("ECLIPSE_HOME")+"/plugins/org.apache.geronimo.j2g.sources.dependence.compatibility";
+	/**
+	 * Java resources extension.
+	 */
+	private static final String JAVA_EXT = ".java";
+
+	/**
+	 * Byte buffer size.
+	 */
+	private static final int BUFFER_SIZE = 1024;
+
+	/**
+	 * Constructor. Loads default libs names and class analogies names.
+	 * @throws FatalToolException if cannot load properties file with default jars names.
+	 */
+	public DependenceJavaMigration() throws FatalToolException {
+		super();
+		if (defaultLibs == null) {
+			try {
+				File propertyFile = new File(DEFAULT_LIBS_DIRECTORY + DEFAULT_LIBS_FILENAME);
+				Properties prop = new Properties();
+				prop.load(new FileInputStream(propertyFile));
+				defaultLibs = prop.keySet();
+			} catch (IOException e) {
+				throw new FatalToolException("Cannot load properties file with default jars names.");
+			}
+		}
+
+		if (classAnalogies == null) {
+			try {
+				File propertyFile = new File(CLASS_ANALOGIES_DIRECTORY + CLASS_ANALOGIES_FILENAME);
+				classAnalogies = new Properties();
+				classAnalogies.load(new FileInputStream(propertyFile));
+			} catch (IOException e) {
+				throw new FatalToolException("Cannot load properties file with class analogies.");
+			}
+		}
+		if (compatibilitySources == null) {
+			try {
+				File propertyFile = new File(COMPATIBILITY_SOURCES_DIRECTORY + COMPATIBILITY_SOURCES_FILENAME);
+				compatibilitySources = new Properties();
+				compatibilitySources.load(new FileInputStream(propertyFile));
+			} catch (IOException e) {
+				throw new FatalToolException("Cannot load properties file with compatibility classnames.");
+			}
+		}
+	}
+
+	/**
+	 * Determines all references of the source compilation unit to classes which are incompatible
+	 * with Geronimo.
+	 * @param source compilation unit for migration.
+	 */
+	public boolean migrate(ASTNode source) {
+		out = Tool.getCurrent().getOutput();
+		if (source instanceof CompilationUnit) {
+			CompilationUnit compilationUnit = (CompilationUnit) source;
+			String unitName = compilationUnit.getJavaElement().getElementName();
+			boolean isSourceChanged = false;
+			out.info(DependenceJavaMigration.class.getSimpleName(), "[" + PLUGIN_NAME + "] " + "Migration started: " + unitName);
+			Set replacedClasses = classAnalogies.keySet();
+			AST ast = compilationUnit.getAST();
+			Iterator classesIterator = replacedClasses.iterator();
+			while (classesIterator.hasNext()) {
+				String targetStr = (String) classesIterator.next();
+				String newStr = classAnalogies.getProperty(targetStr);
+				Name replaced = ast.newName(targetStr);
+				Name replacer = ast.newName(newStr);
+
+				if (replaced.isQualifiedName() && replacer.isQualifiedName()) {
+					QualifiedName targetName = (QualifiedName) replaced;
+					QualifiedName newName = (QualifiedName) replacer;
+					APIReplaceVisitor apiReplacer = new APIReplaceVisitor(compilationUnit, targetName, newName);
+					compilationUnit.accept(apiReplacer);
+					apiReplacer.visit(compilationUnit);
+					isSourceChanged = isSourceChanged || (apiReplacer.getChanges() > 0);
+				}
+				else {
+					out.error(DependenceJavaMigration.class.getSimpleName(), "Wrong class names for JBoss classes and it's Geronimo analogies in property file");
+					break;
+				}
+
+			}
+			try {
+				if (isSourceChanged) {
+					String path = compilationUnit.getJavaElement().getUnderlyingResource().getLocation().toPortableString();
+					String package_path = compilationUnit.getPackage().getName().getFullyQualifiedName().replace('.', IPath.SEPARATOR);
+					String src_path = path.substring(0, path.indexOf(package_path));
+					String compatible_dir = src_path + COMPATIBLES_PACKAGE;
+					File pack = new File(compatible_dir);
+					File sourceDir = new File(COMPATIBLES_LOCATION);
+					if (!pack.exists()) {
+						pack.mkdirs();
+						Set compatibleSources = compatibilitySources.keySet();
+						Iterator keys = compatibleSources.iterator();
+						while (keys.hasNext()) {
+							String classname = (String)keys.next();
+							String sourceName = classname.substring(classname.lastIndexOf('.') + 1) + JAVA_EXT;
+							File addedSource = new File(pack, sourceName);
+							addedSource.createNewFile();
+							PrintWriter writer = new PrintWriter(new FileOutputStream(addedSource));
+							InputStream inStream = null;
+							inStream = new FileInputStream(new File(sourceDir,sourceName));
+							byte[] buffer = new byte[BUFFER_SIZE];
+							int len = 0;
+							while ((len = inStream.read(buffer)) > 0) {
+								String outpt = new String(buffer, 0, len);
+								writer.print(outpt);
+							}
+							inStream.close();
+							writer.close();
+						}
+						IWorkspace workspace = ResourcesPlugin.getWorkspace();
+						IProject project = workspace.getRoot().getProject(ToolConstants.TEMPORARY_PROJECT_NAME);
+						project.refreshLocal(IResource.DEPTH_INFINITE, null);
+					}
+					ICompilationUnit isource = (ICompilationUnit) compilationUnit.getJavaElement();
+					String contents = isource.getBuffer().getContents();
+					File file = new File(isource.getUnderlyingResource().getLocation().toOSString() + RollbackManager.BACKUP_SUFFIX);
+					file.createNewFile();
+					FileOutputStream fout = new FileOutputStream(file);
+					fout.write(contents.getBytes());
+					fout.close();
+					Document document = new Document(contents);
+					TextEdit edits = compilationUnit.rewrite(document, isource.getJavaProject().getOptions(true));
+					edits.apply(document);
+					String newSource = document.get();
+					isource.getBuffer().setContents(newSource);
+					isource.save(null, true);
+
+					ASTParser parser = ASTParser.newParser(AST.JLS3);
+					parser.setResolveBindings(true);
+					parser.setSource(isource);
+					compilationUnit = (CompilationUnit) parser.createAST(null);
+				}
+			} catch (IOException ex) {
+				out.fatal(DependenceJavaMigration.class.getSimpleName(), "The plug-in cannot add compatible package or save backup because an I/O error occured. Make sure that the source directories are not under write protection.");
+			} catch (Exception e) {
+				out.fatal(DependenceJavaMigration.class.getSimpleName(), "The plug-in cannot get access to the resources. Make sure that the source files are not under write protection or have not been deleted by another process.");
+			}
+			NodesVisitor visitor = new NodesVisitor(compilationUnit);
+			compilationUnit.accept(visitor);
+			visitor.visit(compilationUnit);
+			boolean isSourceValid = visitor.isSourceValid();
+			if (isSourceChanged && !isSourceValid) {
+				out.warn(DependenceJavaMigration.class.getSimpleName(), "Errors were found in the source file! Changes were saved. The original file was saved with name " + unitName + RollbackManager.BACKUP_SUFFIX);
+			}
+			out.info(DependenceJavaMigration.class.getSimpleName(), "[" + PLUGIN_NAME + "] " + "Migration finished: " + unitName);
+			return false;
+		}
+		else {
+			out.error(DependenceJavaMigration.class.getSimpleName(), "[" + PLUGIN_NAME + "] " + "Wrong type of source node.");
+		}
+		return false;
+	}
+
+	/**
+	 * @return set of default lib names.
+	 */
+	public static Set getDefaultLibs() {
+		return defaultLibs;
+	}
+}

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.sources/src/org/apache/geronimo/j2g/sources/dependence/DependenceJavaMigration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message