You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by li...@apache.org on 2007/10/08 20:50:09 UTC
svn commit: r582931 [3/3] - in
/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources:
./ META-INF/ schema/ src/ src/org/ src/org/apache/ src/org/apache/geronimo/
src/org/apache/geronimo/devtools/ src/org/apache/geronimo/devtoo...
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/geronimo-secutiry-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/geronimo-secutiry-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/geronimo-secutiry-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/geronimo-secutiry-plan.xml Mon Oct 8 11:50:05 2007
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. -->
+ <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+ <environment>
+ <moduleId>
+ <groupId>console</groupId>
+ <artifactId>realm-SecurityRealm</artifactId>
+ <version>1.0</version>
+ <type>car</type>
+ </moduleId>
+ <dependencies>
+ <dependency>
+ <groupId>geronimo</groupId>
+ <artifactId>j2ee-security</artifactId>
+ <type>car</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ <gbean name="SecurityRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
+ <attribute name="realmName">SecurityRealm</attribute>
+ <reference name="ServerInfo">
+ <name>ServerInfo</name>
+ </reference>
+ <reference name="LoginService">
+ <name>JaasLoginService</name>
+ </reference>
+ <xml-reference name="LoginModuleConfiguration">
+ <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>SecurityRealm</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+ <log:option name="roleSearchMatching">test</log:option>
+ <log:option name="roleName">test</log:option>
+ <log:option name="userSearchSubtree">test</log:option>
+ <log:option name="roleBase">test</log:option>
+ <log:option name="userRoleName">test</log:option>
+ <log:option name="authentication">simple</log:option>
+ <log:option name="connectionUsername">testname</log:option>
+ <log:option name="connectionURL">ldap://localhost:1389</log:option>
+ <log:option name="userBase">test</log:option>
+ <log:option name="initialContextFactory">test</log:option>
+ <log:option name="roleSearchSubtree">test</log:option>
+ <log:option name="connectionPassword">testpwd</log:option>
+ <log:option name="userSearchMatching">test</log:option>
+ </log:login-module>
+ <log:login-module control-flag="OPTIONAL" server-side="true" wrap-principals="false">
+ <log:login-domain-name>SecurityRealm-Password</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.GeronimoPasswordCredentialLoginModule</log:login-module-class>
+ </log:login-module>
+ <log:login-module control-flag="OPTIONAL" server-side="true" wrap-principals="false">
+ <log:login-domain-name>SecurityRealm-Audit</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.FileAuditLoginModule</log:login-module-class>
+ <log:option name="file">~/tmp/test.log</log:option>
+ </log:login-module>
+ <log:login-module control-flag="REQUISITE" server-side="true" wrap-principals="false">
+ <log:login-domain-name>SecurityRealm-Lockout</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.RepeatedFailureLockoutLoginModule</log:login-module-class>
+ <log:option name="lockoutDurationSecs">80</log:option>
+ <log:option name="failurePeriodSecs">80</log:option>
+ <log:option name="failureCount">80</log:option>
+ </log:login-module>
+ <!-- test -->
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>geronimo-properties-realm</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+ <log:option name="usersURI">var/security/users.properties</log:option>
+ <log:option name="groupsURI">var/security/groups.properties</log:option>
+ </log:login-module>
+ <!-- database-->
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>TestDBSR</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.SQLLoginModule</log:login-module-class>
+ <log:option name="userSelect">user select sql</log:option>
+ <log:option name="jdbcDriver">com.mysql.jdbc.Driver</log:option>
+ <log:option name="jdbcUser">jdbc user name</log:option>
+ <log:option name="groupSelect">group select sql</log:option>
+ <log:option name="jdbcPassword">jdbc user name</log:option>
+ <log:option name="jdbcURL">jdbc url</log:option>
+ </log:login-module>
+ <!-- LDAP -->
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>NameLdapSR</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+ <log:option name="connectionProtocol">protocol</log:option>
+ <log:option name="roleSearchMatching">RoleUserSearchiString</log:option>
+ <log:option name="roleName">RoleName</log:option>
+ <log:option name="userSearchSubtree">uesrsSearchSubTree</log:option>
+ <log:option name="roleBase">RoleBase</log:option>
+ <log:option name="userRoleName">UserRoleSearch</log:option>
+ <log:option name="connectionUsername">usename</log:option>
+ <log:option name="connectionURL">ConnectionURL</log:option>
+ <log:option name="userBase">userbase</log:option>
+ <log:option name="initialContextFactory">InitialContextFactory</log:option>
+ <log:option name="roleSearchSubtree">RoleSearch</log:option>
+ <log:option name="connectionPassword">passeotd</log:option>
+ <log:option name="userSearchMatching">userSearchMatching</log:option>
+ </log:login-module>
+ <!-- Other -->
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>NameSR</log:login-domain-name>
+ <log:login-module-class>org.geronimo.test</log:login-module-class>
+ </log:login-module>
+
+ </log:login-config>
+ </xml-reference>
+ </gbean>
+</module>
Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/geronimo-secutiry-plan.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/login-config.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/login-config.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/login-config.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/login-config.xml Mon Oct 8 11:50:05 2007
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. -->
+<!-- DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd" -->
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+ <authentication>
+ <login-module code="login.module1.class.name" flag="control_flag">
+ <module-option name = "option1-name">option1-value</module-option>
+ <module-option name = "option2-name">option2-value</module-option>
+ ...
+ </login-module>
+
+ <login-module code="login.module2.class.name" flag="control_flag">
+ ...
+ </login-module>
+ ...
+ </authentication>
+</application-policy>
+
+$Revision: 561821 $
+-->
+
+<policy>
+ <!-- Used by clients within the application server VM such as
+ mbeans and servlets that access EJBs.
+ -->
+ <application-policy name = "client-login">
+ <authentication>
+ <login-module code = "org.jboss.security.ClientLoginModule"
+ flag = "required">
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- Security domain for JBossMQ -->
+ <application-policy name = "jbossmq">
+ <authentication>
+ <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
+ flag = "required">
+ <module-option name = "unauthenticatedIdentity">guest</module-option>
+ <module-option name = "dsJndiName">java:/DefaultDS/Test</module-option>
+ <module-option name = "principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
+ <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- Security domain for JBossMQ when using file-state-service.xml
+ <application-policy name = "jbossmq">
+ <authentication>
+ <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
+ flag = "required">
+ <module-option name = "unauthenticatedIdentity">guest</module-option>
+ <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+ -->
+
+ <!-- Security domains for testing new jca framework -->
+ <application-policy name = "HsqlDbRealm">
+ <authentication>
+ <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
+ flag = "required">
+ <module-option name = "principal">sa</module-option>
+ <module-option name = "userName">sa</module-option>
+ <module-option name = "password"></module-option>
+ <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name = "JmsXARealm">
+ <authentication>
+ <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
+ flag = "required">
+ <module-option name = "principal">guest</module-option>
+ <module-option name = "userName">guest</module-option>
+ <module-option name = "password">guest</module-option>
+ <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- A template configuration for the jmx-console web application. This
+ defaults to the UsersRolesLoginModule the same as other and should be
+ changed to a stronger authentication mechanism as required.
+ -->
+ <application-policy name = "jmx-console">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag = "required">
+ <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
+ <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- A template configuration for the web-console web application. This
+ defaults to the UsersRolesLoginModule the same as other and should be
+ changed to a stronger authentication mechanism as required.
+ -->
+ <application-policy name = "web-console">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag = "required">
+ <module-option name="usersProperties">web-console-users.properties</module-option>
+ <module-option name="rolesProperties">web-console-roles.properties</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- A template configuration for the JBossWS web application (and transport layer!).
+ This defaults to the UsersRolesLoginModule the same as other and should be
+ changed to a stronger authentication mechanism as required.
+ -->
+ <application-policy name="JBossWS">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required">
+ <module-option name="unauthenticatedIdentity">anonymous</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- The default login configuration used by any security domain that
+ does not have a application-policy entry with a matching name
+ -->
+ <application-policy name = "other">
+ <!-- A simple server login module, which can be used when the number
+ of users is relatively small. It uses two properties files:
+ users.properties, which holds users (key) and their password (value).
+ roles.properties, which holds users (key) and a comma-separated list of
+ their roles (value).
+ The unauthenticatedIdentity property defines the name of the principal
+ that will be used when a null username and password are presented as is
+ the case for an unuathenticated web client or MDB. If you want to
+ allow such users to be authenticated add the property, e.g.,
+ unauthenticatedIdentity="nobody"
+ -->
+ <authentication>
+ <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag = "required" />
+ </authentication>
+ </application-policy>
+
+ <!-- This is the test 1 LDAP JBoss Configuration -->
+ <application-policy name="testLDAP1">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
+ <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
+ <module-option name="java.naming.provider.url">ldap://ldaphost.jboss.org:1389/</module-option>
+ <module-option name="java.naming.security.protocol">ssl</module-option>
+ <module-option name="java.naming.security.authentication">simple</module-option>
+ <module-option name="principalDNPrefix">uid=</module-option>
+ <module-option name="principalDNSuffix">test=test,ou=People,dc=jboss,dc=org</module-option>
+ <module-option name="rolesCtxDN">ou=Roles,dc=jboss,dc=org</module-option>
+ <module-option name="uidAttributeID">member</module-option>
+ <module-option name="matchOnUserDN">true</module-option>
+ <module-option name="roleAttributeID">cn</module-option>
+ <module-option name="roleAttributeIsDN">false </module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <!-- This is the test 2 LDAP JBoss Configuration -->
+ <application-policy name="testLDAP2">
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
+ <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
+ <module-option name="java.naming.provider.url">ldap://ldaphost.jboss.org:1389/</module-option>
+ <module-option name="java.naming.security.protocol">tcp</module-option>
+ <module-option name="java.naming.security.authentication">simple</module-option>
+ <module-option name="principalDNPrefix">uid=</module-option>
+ <module-option name="principalDNSuffix">,ou=People,dc=jboss,dc=org</module-option>
+ <module-option name="rolesCtxDN">ou=Roles,dc=jboss,dc=org</module-option>
+ <module-option name="uidAttributeID">member</module-option>
+ <module-option name="matchOnUserDN">true</module-option>
+ <module-option name="roleAttributeID">cn</module-option>
+ <module-option name="roleAttributeIsDN">false </module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+</policy>
+
Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/login-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/security-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/security-geronimo-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/security-geronimo-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/security-geronimo-plan.xml Mon Oct 8 11:50:05 2007
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+ <environment>
+ <moduleId>
+ <groupId>j2g</groupId>
+ <artifactId>security</artifactId>
+ <version>1.0</version>
+ <type>rar</type>
+ </moduleId>
+ <dependencies>
+ <dependency>
+ <groupId>geronimo</groupId>
+ <artifactId>j2ee-security</artifactId>
+ <type>car</type>
+ </dependency>
+ </dependencies>
+ </environment>
+ <gbean name="SecurityRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
+ <reference name="ServerInfo">
+ <name>ServerInfo</name>
+ </reference>
+ <reference name="LoginService">
+ <name>JaasLoginService</name>
+ </reference>
+ <xml-reference name="LoginModuleConfiguration">
+ <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>jbossmq</log:login-domain-name>
+ <log:login-module-class>org.apache.geronimo.security.realm.providers.SQLLoginModule</log:login-module-class>
+ <log:option name="dataSourceName">java:/DefaultDS/Test</log:option>
+ <log:option name="userSelect">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</log:option>
+ <log:option name="groupSelect">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</log:option>
+ </log:login-module>
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>jmx-console</log:login-domain-name>
+ <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+ <log:option name="usersURI">var/security/user.properties</log:option>
+ <log:option name="groupsURI">var/security/user.properties</log:option>
+ </log:login-module>
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>web-console</log:login-domain-name>
+ <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+ <log:option name="usersURI">var/security/user.properties</log:option>
+ <log:option name="groupsURI">var/security/user.properties</log:option>
+ </log:login-module>
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>JBossWS</log:login-domain-name>
+ <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+ <log:option name="unauthenticatedIdentity">anonymous</log:option>
+ </log:login-module>
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>other</log:login-domain-name>
+ <log:login-module-class>org.apche.geronimo.security.realm.providers.PropertiesFileLoginModule</log:login-module-class>
+ </log:login-module>
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>testLDAP1</log:login-domain-name>
+ <log:login-module-class>org.apche.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+ <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
+ <log:option name="userBase"></log:option>
+ <log:option name="roleBase"></log:option>
+ <log:option name="userSearchSubtree">true</log:option>
+ <log:option name="roleSearchSubtree">true</log:option>
+ <log:option name="connectionURL">ldap://localhost:636</log:option>
+ <log:option name="connectionProtocol">ssl</log:option>
+ <log:option name="authentication">simple</log:option>
+ <log:option name="userSearchMatching">uid={0}test=test,ou=People,dc=jboss,dc=org</log:option>
+ <log:option name="roleSearchMatching">ou=Roles,dc=jboss,dc=org???(member={0})</log:option>
+ <log:option name="roleName">roles</log:option>
+ </log:login-module>
+ <log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
+ <log:login-domain-name>testLDAP2</log:login-domain-name>
+ <log:login-module-class>org.apche.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
+ <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
+ <log:option name="userBase"></log:option>
+ <log:option name="roleBase"></log:option>
+ <log:option name="userSearchSubtree">true</log:option>
+ <log:option name="roleSearchSubtree">true</log:option>
+ <log:option name="connectionURL">ldap://localhost:389</log:option>
+ <log:option name="connectionProtocol">tcp</log:option>
+ <log:option name="authentication">simple</log:option>
+ <log:option name="userSearchMatching">uid={0},ou=People,dc=jboss,dc=org</log:option>
+ <log:option name="roleSearchMatching">ou=Roles,dc=jboss,dc=org???(member={0})</log:option>
+ <log:option name="roleName">roles</log:option>
+ </log:login-module>
+ </log:login-config>
+ </xml-reference>
+ </gbean>
+</module>
Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/security-geronimo-plan.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/datasource/test/DSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/datasource/test/DSResouresToolTestCase.java?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/datasource/test/DSResouresToolTestCase.java (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/datasource/test/DSResouresToolTestCase.java Mon Oct 8 11:50:05 2007
@@ -0,0 +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.devtools.j2g.resources.datasource.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.devtools.j2g.resources.ResourcesTool;
+import org.apache.geronimo.devtools.j2g.resources.datasource.DSResourcesTool;
+import org.apache.geronimo.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/datasource/test/DSResouresToolTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/jms/test/JMSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/jms/test/JMSResouresToolTestCase.java?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/jms/test/JMSResouresToolTestCase.java (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/jms/test/JMSResouresToolTestCase.java Mon Oct 8 11:50:05 2007
@@ -0,0 +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.devtools.j2g.resources.jms.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.devtools.j2g.resources.ResourcesTool;
+import org.apache.geronimo.devtools.j2g.resources.jms.JMSResourcesTool;
+import org.apache.geronimo.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/jms/test/JMSResouresToolTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/mail/test/MailResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/mail/test/MailResouresToolTestCase.java?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/mail/test/MailResouresToolTestCase.java (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/mail/test/MailResouresToolTestCase.java Mon Oct 8 11:50:05 2007
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.devtools.j2g.resources.mail.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.devtools.j2g.resources.ResourcesTool;
+import org.apache.geronimo.devtools.j2g.resources.mail.MailResourcesTool;
+import org.apache.geronimo.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/mail/test/MailResouresToolTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/security/test/SecurityResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/security/test/SecurityResouresToolTestCase.java?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/security/test/SecurityResouresToolTestCase.java (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/security/test/SecurityResouresToolTestCase.java Mon Oct 8 11:50:05 2007
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.devtools.j2g.resources.security.test;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.devtools.j2g.resources.ResourcesTool;
+import org.apache.geronimo.devtools.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/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test/org/apache/geronimo/devtools/j2g/resources/security/test/SecurityResouresToolTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Re: svn commit: r582931 [3/3] - in /geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources:
./ META-INF/ schema/ src/ src/org/ src/org/apache/ src/org/apache/geronimo/
src/org/apache/geronimo/devtools/ src/org/apache/geronimo/devtoo...
Posted by Lin Sun <li...@gmail.com>.
Just corrected it... Thanks Kevan!
Kevan Miller wrote:
>
> On Oct 8, 2007, at 2:50 PM, linsun@apache.org wrote:
>
>> Added:
>> geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/security/geronimo-secutiry-plan.xml
>>
>
> Hi Lin,
> 'security' is misspelled in this new plan name...
>
> --kevan
>
Re: svn commit: r582931 [3/3] - in /geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources: ./ META-INF/ schema/ src/ src/org/ src/org/apache/ src/org/apache/geronimo/ src/org/apache/geronimo/devtools/ src/org/apache/geronimo/devtoo...
Posted by Kevan Miller <ke...@gmail.com>.
On Oct 8, 2007, at 2:50 PM, linsun@apache.org wrote:
> Added: geronimo/devtools/j2g/trunk/plugins/
> org.apache.geronimo.devtools.j2g.resources/test-apps/security/
> geronimo-secutiry-plan.xml
Hi Lin,
'security' is misspelled in this new plan name...
--kevan