geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1030836 - in /geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth: ./ src/ src/main/ src/main/java/ src/main/resources/ src/main/webapp/ src/main/webapp/WEB-INF/ src/main/webapp/auth/ src/main/webapp/forbidden/ src/...
Date Thu, 04 Nov 2010 05:29:12 GMT
Author: xiaming
Date: Thu Nov  4 05:29:11 2010
New Revision: 1030836

URL: http://svn.apache.org/viewvc?rev=1030836&view=rev
Log:
GERONIMO-5664 Add auto tests for new login modules: GenericHttpHeaderPropertiesFileLoginModule
and GenericHttpHeaderSqlLoginmodule

Added:
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml  
(with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/java/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
  (with props)
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
  (with props)

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml (added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml Thu
Nov  4 05:29:11 2010
@@ -0,0 +1,104 @@
+<?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.
+-->
+
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>security-testsuite</artifactId>
+        <version>2.1.7-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>test-generic-auth</artifactId>
+    <name>Geronimo TestSuite :: Security Testsuite :: Generic-Auth Test</name>
+    <packaging>war</packaging>
+
+    <description>
+		Test if server support GENERIC Authentication method, which is http header-based authentication.
+    </description>
+    
+    <build>
+		<plugins>
+			<plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-war-plugin</artifactId>
+                    <configuration>
+                        <archiveClasses>false</archiveClasses>
+                    </configuration>
+            </plugin>
+		</plugins>
+	  </build>
+
+	<profiles>
+		<profile>
+            <id>child</id>
+            <build>
+                <plugins>				
+				    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>      
                     
+                        <configuration>                                
+                            <suiteXmlFiles>
+                                <suiteXmlFile>${project.build.testOutputDirectory}/testng.xml</suiteXmlFile>
+                            </suiteXmlFiles>
+                            <systemProperties>
+                                <property>
+                                    <name>appContext</name>
+                                    <value>${project.artifactId}</value>
+                                </property>
+                            </systemProperties>						                            
+                        </configuration>                            
+                    </plugin>
+					
+                    <plugin>
+                        <groupId>org.apache.geronimo.buildsupport</groupId>
+                        <artifactId>geronimo-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>deploy-wars</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>deploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleArchive>${project.build.directory}/${project.artifactId}-${project.version}.war</moduleArchive>
+                                </configuration>
+                            </execution>
+                            <execution>
+                                <id>undeploy-war-as-moduleId</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>undeploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleId>${project.groupId}/${project.artifactId}/${project.version}/car</moduleId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+					
+                </plugins>
+            </build>
+        </profile>        
+    </profiles>
+</project>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,20 @@
+--  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.
+
+create table genericgroups(username varchar(10),groupname varchar(10));
+insert into genericgroups values('tom','manager');
+insert into genericgroups values('alan','it');

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/resources/SQLRealmData.sql
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed 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.
+-->
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" 
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" 
+         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" 
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+         
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>${project.groupId}</sys:groupId>
+      <sys:artifactId>${project.artifactId}</sys:artifactId>
+      <sys:version>${project.version}</sys:version>
+      <sys:type>car</sys:type>
+    </sys:moduleId>
+    <sys:dependencies>
+		<sys:dependency>
+			<sys:artifactId>system-database</sys:artifactId>
+		</sys:dependency>
+	</sys:dependencies>
+    <sys:hidden-classes/>
+    <sys:non-overridable-classes/>
+  </sys:environment>
+
+  <context-root>/${project.artifactId}</context-root>
+
+  <security-realm-name>GenericRealm</security-realm-name>
+  <sec:security>
+    <sec:role-mappings>
+      <sec:role role-name="content-administrator">
+		<sec:principal name="manager" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
/>
+      </sec:role>
+    </sec:role-mappings>
+  </sec:security>
+  
+  <gbean name="GenericSQLRealmData" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
 
+       <attribute name="path">SQLRealmData.sql</attribute>
+       <reference name="DataSource">
+           <name>SystemDatasource</name>
+       </reference>
+  </gbean>
+  
+  <gbean name="GenericRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"
xsi:type="dep:gbeanType" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <attribute name="realmName">GenericRealm</attribute>
+        <reference name="ServerInfo">
+            <name>ServerInfo</name>
+        </reference>
+        <xml-reference name="LoginModuleConfiguration">
+            <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
+                <log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>GenericFilePropRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderPropertiesFileLoginModule</log:login-module-class>
+                    <log:option name="groupsURI">var/security/demo_groups.properties</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>
+                </log:login-module>
+                <log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>GenericSQLRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderSqlLoginmodule</log:login-module-class>
+                    <log:option name="groupSelect">SELECT username, groupname FROM
genericgroups WHERE username=?</log:option>
+                    <log:option name="dataSourceApplication">null</log:option>
+                    <log:option name="dataSourceName">SystemDatasource</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>
+                </log:login-module>
+            </log:login-config>            
+        </xml-reference>
+    </gbean>	
+</web-app>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+	Licensed 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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <!-- Welcome File List -->
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+
+    <security-constraint>
+      <web-resource-collection>
+        <web-resource-name>Admin Role</web-resource-name>
+        <url-pattern>/protect/*</url-pattern>
+        <http-method>GET</http-method>
+        <http-method>POST</http-method>
+        <http-method>PUT</http-method>        
+      </web-resource-collection>
+      <auth-constraint>
+        <role-name>content-administrator</role-name>
+      </auth-constraint>
+    </security-constraint>
+    
+    <security-constraint>
+      <web-resource-collection>
+        <web-resource-name>No Access</web-resource-name>
+        <url-pattern>/forbidden/*</url-pattern>
+      </web-resource-collection>
+      <auth-constraint/>
+    </security-constraint>
+
+    <login-config>
+      <auth-method>GENERIC</auth-method>
+      <realm-name>GenericRealm</realm-name>
+    </login-config>
+
+  <security-role>
+      <role-name>content-administrator</role-name>
+  </security-role>  
+
+</web-app>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,38 @@
+<!--
+    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.
+-->
+<HTML>
+<H1>FORM Authentication demo</H1>
+<form method="POST" action="j_security_check">
+<table border="0" cellspacing="2" cellpadding="1">
+<tr>
+  <td>Username:</td>
+  <td><input size="12" value="" name="j_username" maxlength="25" type="text"></td>
+</tr>
+<tr>
+  <td>Password:</td>
+  <td><input size="12" value="" name="j_password" maxlength="25" type="password"></td>
+</tr>
+<tr>
+  <td colspan="2" align="center">
+    <input name="submit" type="submit" value="Login">
+  </td>
+</tr>
+</table>
+</form>
+</HTML>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logon.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,23 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<HTML>
+<H1>Authentication ERROR</H1>
+Username, password or role incorrect.
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
+</HTML>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/auth/logonError.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,21 @@
+<!--
+    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.
+-->
+<html>
+hello world.
+</html>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/forbidden/hello.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,33 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<html>
+    <body>
+        <h3>Testing The Properties File Security Realm</h3>
+        <p>The 2 properties files are located under <I>WASCE_HOME</I>/var/security:
<b>demo_groups.properties</b> & <b>demo_users.properties</b></p>
+        <p>
+        Once this sample has been installed, click on <a href='protect/hello.html'>Protect</a>
to validate against the properties file. You will be shown a login screen, use the following
usernames and passwords to login:
+        <p>username=<b>alan</b>    password=<b>starcraft</b></p>
+        <p>username=<b>metro</b>    password=<b>mouse</b></p>
+        <p>username=<b>george</b>    password=<b>bone</b></p>
+        
+        If everything works, you should see "hello world" in your browser.
+        </p>
+        <p>At this point you have an application that is validating username and passwords
against the properties file based on the security configuration you provided earlier. Now,
if you go back here and click on <a href='forbidden/'>Forbidden</a> you should
receive a 403 - Forbidden HTTP error.</p>
+    </body>
+</html>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,21 @@
+<!--
+    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.
+-->
+<html>
+hello world.
+</html>

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/main/webapp/protect/hello.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,91 @@
+/**
+ *  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.testsuite.security.test;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.methods.PostMethod;
+import java.net.HttpURLConnection;
+import java.io.IOException;
+import java.util.regex.*;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeTest;
+
+public class GenericRealmTest {
+
+    private static String url;
+	/**
+	 * Test 1  
+	 * Test valid user "izumi"(role "manager") in file realm can access protected resources
+	 */
+	@Test
+	public void GenericFileRealmSucessTest()throws Exception{					
+			Assert.assertEquals(getHTTPResponseStatus("izumi"), HttpURLConnection.HTTP_OK);			
+		}
+	
+	/**
+	 * Test 2  
+	 * Test valid user "tom"(role "manager") in SQL realm can access protected resources
+	 */
+	@Test
+	public void GenericSQLRealmSucessTest()throws Exception{			
+			Assert.assertEquals(getHTTPResponseStatus("tom"), HttpURLConnection.HTTP_OK);			
+		}
+	
+	/**
+	 * Test 3  
+	 * Test valid but forbidden user "alan"(role "it") cannot access the protected resources
+	 */
+	@Test
+	public void GenericFailureTest()throws Exception{		
+		Assert.assertEquals(getHTTPResponseStatus("alan"), HttpURLConnection.HTTP_FORBIDDEN);
+	}
+	
+	/**
+	 * Test 4  
+	 * Test invalid user "nobody" cannot access the protected resources
+	 */
+	@Test
+	public void GenericUnauthTest()throws Exception{		
+		Assert.assertEquals(getHTTPResponseStatus("nobody"), HttpURLConnection.HTTP_UNAUTHORIZED);
+	}
+	
+	@BeforeTest
+	public void setURL(){
+	    String contextRoot = System.getProperty("appContext");
+	    url = "http://localhost:8080/"+contextRoot+"/protect/hello.html";
+	}
+	
+	private int getHTTPResponseStatus(String username) throws Exception {		
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		httpMethod.setRequestHeader("SM_USER", username);
+		int status = 0;
+		
+		HttpClient nclient = new HttpClient();
+		status = nclient.executeMethod(httpMethod);
+		httpMethod.releaseConnection();		
+		return status;
+	}
+}
+

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/java/org/apache/geronimo/testsuite/security/test/GenericRealmTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml?rev=1030836&view=auto
==============================================================================
--- geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
(added)
+++ geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
Thu Nov  4 05:29:11 2010
@@ -0,0 +1,30 @@
+<?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 suite SYSTEM "http://testng.org/testng-1.0.dtd">
+
+<suite name="test-generic-auth" verbose="1">
+	<test name="security-testsuite-generic-auth-test">
+		<packages>
+			<package name="org.apache.geronimo.testsuite.security.test" />
+		</packages>
+	</test>
+</suite>
+

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/testsuite/security-testsuite/test-generic-auth/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message