Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 39650 invoked from network); 28 Jun 2007 14:15:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 14:15:36 -0000 Received: (qmail 45983 invoked by uid 500); 28 Jun 2007 14:15:33 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 45930 invoked by uid 500); 28 Jun 2007 14:15:33 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 45763 invoked by uid 99); 28 Jun 2007 14:15:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 07:15:32 -0700 X-ASF-Spam-Status: No, hits=-98.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 07:15:22 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 8134F1A9825; Thu, 28 Jun 2007 07:15:02 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r551566 [5/7] - in /geronimo/sandbox/j2g: configurator/ plugins/ plugins/org.apache.geronimo.j2g.common/ plugins/org.apache.geronimo.j2g.descriptors.app/ plugins/org.apache.geronimo.j2g.descriptors.app/META-INF/ plugins/org.apache.geronimo.... Date: Thu, 28 Jun 2007 14:14:56 -0000 To: scm@geronimo.apache.org From: pmcmahan@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070628141502.8134F1A9825@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/err/mail-service.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/err/mail-service.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/err/mail-service.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/err/mail-service.xml Thu Jun 28 07:14:50 2007 @@ -52,3 +52,57 @@ + + + + + + + + + + + + java:/Mail + nobody + password + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/geronimo-mail-service.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/geronimo-mail-service.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/geronimo-mail-service.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/geronimo-mail-service.xml Thu Jun 28 07:14:50 2007 @@ -1,42 +0,0 @@ - - - - - - j2g - Mail - 1.0 - car - - - - geronimo - javamail - - - - - -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 - - - \ No newline at end of file Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-geronimo-plan.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-geronimo-plan.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-geronimo-plan.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-geronimo-plan.xml Thu Jun 28 07:14:50 2007 @@ -1,30 +0,0 @@ - - - - - - j2g - Mail - 1.0 - car - - - - geronimo - javamail - 1.1 - car - - - - - - - Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-service.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-service.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-service.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test-apps/mail/mail-service.xml Thu Jun 28 07:14:50 2007 @@ -54,3 +54,59 @@ + + + + + + + + + + + + + java:/Mail + nobody + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/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.mail/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.mail/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java Thu Jun 28 07:14:50 2007 @@ -1,70 +0,0 @@ -/** - * 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); - 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(); - } - } -} Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.classpath URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.classpath?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.classpath (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.classpath Thu Jun 28 07:14:50 2007 @@ -1,8 +0,0 @@ - - - - - - - - Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.project URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.project?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.project (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/.project Thu Jun 28 07:14:50 2007 @@ -1,28 +0,0 @@ - - - org.apache.geronimo.j2g.resources.security - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/META-INF/MANIFEST.MF URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/META-INF/MANIFEST.MF?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/META-INF/MANIFEST.MF (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/META-INF/MANIFEST.MF Thu Jun 28 07:14:50 2007 @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: J2G Security Plug-in -Bundle-SymbolicName: org.apache.geronimo.j2g.resources.security; singleton:=true -Bundle-Version: 1.0.0 -Bundle-Vendor: Apache.org -Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.runtime, - org.apache.geronimo.j2g.common, - org.apache.geronimo.j2g.resources, - org.apache.geronimo.j2g.util -Bundle-ClassPath: . -Export-Package: org.apache.geronimo.j2g.resources.security, - org.apache.geronimo.j2g.resources.security.test Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/build.properties URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/build.properties?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/build.properties (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/build.properties Thu Jun 28 07:14:50 2007 @@ -1,22 +0,0 @@ -/** - * 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/,\ - .,\ Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/plugin.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/plugin.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/plugin.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/plugin.xml Thu Jun 28 07:14:50 2007 @@ -1,23 +0,0 @@ - - - - - - - - Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/pom.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/pom.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/pom.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/pom.xml Thu Jun 28 07:14:50 2007 @@ -60,3 +60,65 @@ + + + + + 4.0.0 + org.apache.geronimo.tools + org.apache.geronimo.j2g.resources.security + jar + ${artifactId} + + org.apache.geronimo.tools + j2g-plugins + 1.0.0-SNAPSHOT + ../pom.xml + + + + + org.apache.geronimo.devtools + maven-eclipsepde-plugin + + + maven-jar-plugin + + + maven-dependency-plugin + + + + + + org.apache.geronimo.tools + org.apache.geronimo.j2g.resources + ${version} + + + org.apache.geronimo.tools + org.apache.geronimo.j2g.util + ${version} + + + org.apache.geronimo.tools + org.apache.geronimo.j2g.common + ${version} + + + Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/commons-logging.properties URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/commons-logging.properties?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/commons-logging.properties (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/commons-logging.properties Thu Jun 28 07:14:50 2007 @@ -1,30 +0,0 @@ -/** - * 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 Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java Thu Jun 28 07:14:50 2007 @@ -1,575 +0,0 @@ -/** - * 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; - -import java.io.File; -import java.io.IOException; -import java.util.Iterator; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.geronimo.j2g.common.IFileMigration; -import org.apache.geronimo.j2g.common.IOutput; -import org.apache.geronimo.j2g.common.Tool; -import org.apache.geronimo.j2g.util.resources.Constants; -import org.apache.geronimo.j2g.util.resources.xml.XMLConversionHelper; -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; - } - -} Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/geronimo-secutiry-plan.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/geronimo-secutiry-plan.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/geronimo-secutiry-plan.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/geronimo-secutiry-plan.xml Thu Jun 28 07:14:50 2007 @@ -1,120 +0,0 @@ - - - - - - console - realm-SecurityRealm - 1.0 - car - - - - geronimo - j2ee-security - car - - - - - SecurityRealm - - ServerInfo - - - JaasLoginService - - - - - SecurityRealm - org.apache.geronimo.security.realm.providers.LDAPLoginModule - test - test - test - test - test - simple - testname - ldap://localhost:1389 - test - test - test - testpwd - test - - - SecurityRealm-Password - org.apache.geronimo.security.realm.providers.GeronimoPasswordCredentialLoginModule - - - SecurityRealm-Audit - org.apache.geronimo.security.realm.providers.FileAuditLoginModule - ~/tmp/test.log - - - SecurityRealm-Lockout - org.apache.geronimo.security.realm.providers.RepeatedFailureLockoutLoginModule - 80 - 80 - 80 - - - - geronimo-properties-realm - org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule - var/security/users.properties - var/security/groups.properties - - - - TestDBSR - org.apache.geronimo.security.realm.providers.SQLLoginModule - user select sql - com.mysql.jdbc.Driver - jdbc user name - group select sql - jdbc user name - jdbc url - - - - NameLdapSR - org.apache.geronimo.security.realm.providers.LDAPLoginModule - protocol - RoleUserSearchiString - RoleName - uesrsSearchSubTree - RoleBase - UserRoleSearch - usename - ConnectionURL - userbase - InitialContextFactory - RoleSearch - passeotd - userSearchMatching - - - - NameSR - org.geronimo.test - - - - - - Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/login-config.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/login-config.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/login-config.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/login-config.xml Thu Jun 28 07:14:50 2007 @@ -204,3 +204,209 @@ + + + + + + + + + + + + + + + + + + + + guest + java:/DefaultDS/Test + SELECT PASSWD FROM JMS_USERS WHERE USERID=? + SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=? + + + + + + + + + + + sa + sa + + jboss.jca:service=LocalTxCM,name=DefaultDS + + + + + + + + guest + guest + guest + jboss.jca:service=TxCM,name=JmsXA + + + + + + + + + props/jmx-console-users.properties + props/jmx-console-roles.properties + + + + + + + + + web-console-users.properties + web-console-roles.properties + + + + + + + + + anonymous + + + + + + + + + + + + + + + + + com.sun.jndi.ldap.LdapCtxFactory + ldap://ldaphost.jboss.org:1389/ + ssl + simple + uid= + test=test,ou=People,dc=jboss,dc=org + ou=Roles,dc=jboss,dc=org + member + true + cn + false + + + + + + + + + com.sun.jndi.ldap.LdapCtxFactory + ldap://ldaphost.jboss.org:1389/ + tcp + simple + uid= + ,ou=People,dc=jboss,dc=org + ou=Roles,dc=jboss,dc=org + member + true + cn + false + + + + + + Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/security-geronimo-plan.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/security-geronimo-plan.xml?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/security-geronimo-plan.xml (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test-apps/security/security-geronimo-plan.xml Thu Jun 28 07:14:50 2007 @@ -1,89 +0,0 @@ - - - - - - j2g - security - 1.0 - rar - - - - geronimo - j2ee-security - car - - - - - - ServerInfo - - - JaasLoginService - - - - - jbossmq - org.apache.geronimo.security.realm.providers.SQLLoginModule - DefaultDS/Test - SELECT PASSWD FROM JMS_USERS WHERE USERID=? - SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=? - - - jmx-console - org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule - var/security/user.properties - var/security/user.properties - - - web-console - org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule - var/security/user.properties - var/security/user.properties - - - JBossWS - org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule - anonymous - - - other - org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule - - - testLDAP1 - org.apche.geronimo.security.realm.providers.LDAPLoginModule - com.sun.jndi.ldap.LdapCtxFactory - - - true - true - ldap://localhost:636 - ssl - simple - uid={0}test=test,ou=People,dc=jboss,dc=org - ou=Roles,dc=jboss,dc=org???(member={0}) - roles - - - testLDAP2 - org.apche.geronimo.security.realm.providers.LDAPLoginModule - com.sun.jndi.ldap.LdapCtxFactory - - - true - true - ldap://localhost:389 - tcp - simple - uid={0},ou=People,dc=jboss,dc=org - ou=Roles,dc=jboss,dc=org???(member={0}) - roles - - - - - Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/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.security/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources.security/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java Thu Jun 28 07:14:50 2007 @@ -1,45 +0,0 @@ -/** - * 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); - assertTrue(result); - } -} Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.classpath URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.classpath?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.classpath (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.classpath Thu Jun 28 07:14:50 2007 @@ -1,7 +1,8 @@ - - - - - - - + + + + + + + + Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.project URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.project?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.project (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/.project Thu Jun 28 07:14:50 2007 @@ -1,28 +1,22 @@ - - org.apache.geronimo.j2g.resources - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - + org.apache.geronimo.j2g.resources + JBoss to Geronimo Conversion Tool + + org.apache.geronimo.j2g.common + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.pde.ManifestBuilder + + + org.eclipse.pde.SchemaBuilder + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + \ No newline at end of file Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/META-INF/MANIFEST.MF URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/META-INF/MANIFEST.MF?view=diff&rev=551566&r1=551565&r2=551566 ============================================================================== --- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/META-INF/MANIFEST.MF (original) +++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/META-INF/MANIFEST.MF Thu Jun 28 07:14:50 2007 @@ -6,5 +6,6 @@ Bundle-Vendor: Apache.org Bundle-Localization: plugin Require-Bundle: org.apache.geronimo.j2g.common, + org.apache.geronimo.j2g.util, org.eclipse.core.runtime -Export-Package: org.apache.geronimo.j2g.resources +Bundle-ClassPath: .