[Jboss-cvs] JBossAS SVN: r55010 - in trunk/ejb3/src: resources/test resources/test/unauthenticatedprincipal resources/test/unauthenticatedprincipal/META-INF test/org/jboss/ejb3/test test/org/jboss/ejb3/test/unauthenticatedprincipal test/org/jboss/ejb3/test/unauthenticatedprincipal/unit

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 1 21:55:43 EDT 2006


Author: bdecoste
Date: 2006-08-01 21:55:41 -0400 (Tue, 01 Aug 2006)
New Revision: 55010

Added:
   trunk/ejb3/src/resources/test/unauthenticatedprincipal/
   trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/
   trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml
   trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml
   trunk/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties
   trunk/ejb3/src/resources/test/unauthenticatedprincipal/users.properties
   trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/
   trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java
Log:
test for <unauthenticated-principal>

Added: trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml
===================================================================
--- trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1,16 @@
+<ejb-jar
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+        version="3.0">
+  <enterprise-beans>
+    <session>
+      <ejb-name>StatelessBean</ejb-name>
+      <remote>org.jboss.ejb3.test.unauthenticatedprincipal.StatelessRemote</remote>
+      <ejb-class>org.jboss.ejb3.test.unauthenticatedprincipal.StatelessBean</ejb-class>
+      <session-type>Stateless</session-type>
+      <transaction-type>Container</transaction-type>
+    </session>
+  </enterprise-beans>
+</ejb-jar>

Added: trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml
===================================================================
--- trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+        version="3.0">
+   <security-domain>java:/jaas/other</security-domain>
+   <unauthenticated-principal>somebody</unauthenticated-principal>
+</jboss>

Added: trunk/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties
===================================================================
--- trunk/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1 @@
+somebody=allowed
\ No newline at end of file

Added: trunk/ejb3/src/resources/test/unauthenticatedprincipal/users.properties
===================================================================
--- trunk/ejb3/src/resources/test/unauthenticatedprincipal/users.properties	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/resources/test/unauthenticatedprincipal/users.properties	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1 @@
+somebody=password

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1,39 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.ejb3.test.unauthenticatedprincipal;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ */
+public class StatelessBean
+   implements StatelessRemote
+{
+   private static final Logger log = Logger.getLogger(StatelessBean.class);
+    
+   public void testAccess()
+   {
+     
+   }
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1,31 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.ejb3.test.unauthenticatedprincipal;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 1.0 $</tt>
+ */
+public interface StatelessRemote
+{
+   void testAccess();
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java	2006-08-02 00:55:07 UTC (rev 55009)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java	2006-08-02 01:55:41 UTC (rev 55010)
@@ -0,0 +1,54 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.ejb3.test.unauthenticatedprincipal.unit;
+
+import org.jboss.ejb3.test.unauthenticatedprincipal.StatelessRemote;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 1.0 $</tt>
+ */
+public class UnauthenticatedPrincipalTestCase extends JBossTestCase
+{
+  
+   public UnauthenticatedPrincipalTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnauthenticatedPrincipal() throws Exception
+   {
+      StatelessRemote test = (StatelessRemote)getInitialContext().lookup("StatelessBean/remote");
+      assertNotNull(test);
+      
+      test.testAccess();
+   }
+
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(UnauthenticatedPrincipalTestCase.class, "unauthenticatedprincipal.jar");
+   }
+
+}




More information about the jboss-cvs-commits mailing list