Java Doc for EJBSpecUnitTestCase.java in  » EJB-Server-JBoss-4.2.1 » testsuite » org » jboss » test » security » test » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server JBoss 4.2.1 » testsuite » org.jboss.test.security.test 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jboss.test.security.test.EJBSpecUnitTestCase

All known Subclasses:   org.jboss.test.security.test.CustomSecurityManagerTestCase,  org.jboss.test.jacc.test.EJBSpecUnitTestCase,
EJBSpecUnitTestCase
public class EJBSpecUnitTestCase extends JBossTestCase (Code)
Test of EJB spec conformace using the security-spec.jar deployment unit. These test the basic role based access model.
author:
   Scott.Stark@jboss.org
version:
   $Revision: 57211 $


Field Summary
static  StringQUEUE_FACTORY
    
 LoginContextlc
    
 booleanloggedIn
    
static  char[]password
    
static  Stringusername
    

Constructor Summary
public  EJBSpecUnitTestCase(String name)
    

Method Summary
public static  Testsuite()
     Setup the test suite.
public  voidtestDeepRunAs()
     This method tests the following call chain: Level1CallerBean.callEcho() -> Level2CallerBean.invokeEcho() -> Level3CalleeBean.echo() The Level1CallerBean uses a run-as of InternalRole and the Level2CallerBean and Level3CalleeBean are only accessible by InternalRole.
public  voidtestDomainInteraction()
    
public  voidtestDomainMethodAccess()
     Test that the echo method is accessible by an Echo role.
public  voidtestExcluded()
     Test that user scott who has the Echo role is not able to access the StatelessSession2.excluded method even though the Echo role has been granted access to all methods of StatelessSession2 to test that the excluded-list takes precendence over the method-permissions.
public  voidtestGetCallerPrincipal()
     Test that: 1.
public  voidtestHandle()
     Test the security behavior of handles.
public  voidtestJBAS1852()
    
public  voidtestLocalMethodAccess()
     Test a user with Echo and EchoLocal roles can access the CalleeBean through its local interface by calling the CallerBean and that a user with only a EchoLocal cannot call the CallerBean.
public  voidtestMDBDeepRunAs()
     Test that an MDB with a run-as identity is able to access secure EJBs that require the identity.
public  voidtestMDBRunAs()
     Test that an MDB with a run-as identity is able to access secure EJBs that require the identity.
public  voidtestMethodAccess()
     Test that the echo method is accessible by an Echo role.
public  voidtestMethodAccess2()
     Test that the permissions assigned to the stateless session bean: with ejb-name=org/jboss/test/security/ejb/StatelessSession_test are read correctly.
public  voidtestPrincipalPropagation()
     Test that the calling principal is propagated across bean calls.
public  voidtestRemoteUnchecked()
     Test access to a bean with a mix of remote interface permissions and unchecked permissions with the unchecked permissions declared last.
public  voidtestRunAs()
     This method tests the following call chains: 1.
public  voidtestRunAsSFSB()
    
public  voidtestRunAsWithRoles()
     This method tests that the RunAsWithRolesMDB is assigned multiple roles within its onMessage so that it can call into the ProjRepository session bean's methods that required ProjectAdmin, CreateFolder and DeleteFolder roles.
public  voidtestSecurityDomain()
     Validate that the users have the expected logins and roles.
public  voidtestStatefulCreateCaller()
    
public  voidtestStatefulHandle()
     Test the security behavior of stateful handles.
public  voidtestStress()
     Stress test declarative security.
public  voidtestStressNoJaasCache()
     Stress test declarative security with the JAAS cache disabled.
public  voidtestUnchecked()
     Test that a user with a role that has not been assigned any method permissions in the ejb-jar descriptor is able to access a method that has been marked as unchecked.
public  voidtestUncheckedRemote()
     Test access to a bean with a mix of remote interface permissions and unchecked permissions with the unchecked permissions declared first.
public  voidtestUncheckedWithLogin()
     Test that a user with a valid role is able to access a bean for which all methods have been marked as unchecked.

Field Detail
QUEUE_FACTORY
static String QUEUE_FACTORY(Code)



lc
LoginContext lc(Code)



loggedIn
boolean loggedIn(Code)



password
static char[] password(Code)



username
static String username(Code)




Constructor Detail
EJBSpecUnitTestCase
public EJBSpecUnitTestCase(String name)(Code)




Method Detail
suite
public static Test suite() throws Exception(Code)
Setup the test suite.



testDeepRunAs
public void testDeepRunAs() throws Exception(Code)
This method tests the following call chain: Level1CallerBean.callEcho() -> Level2CallerBean.invokeEcho() -> Level3CalleeBean.echo() The Level1CallerBean uses a run-as of InternalRole and the Level2CallerBean and Level3CalleeBean are only accessible by InternalRole.



testDomainInteraction
public void testDomainInteraction() throws Exception(Code)
Test that a call interacting with different security domains does not change the
throws:
  Exception -



testDomainMethodAccess
public void testDomainMethodAccess() throws Exception(Code)
Test that the echo method is accessible by an Echo role. Since the excluded() method of the StatelessSession bean has been placed into the excluded set it should not accessible by any user. This uses the security domain of the JaasSecurityDomain service to test its use as an authentication mgr.



testExcluded
public void testExcluded() throws Exception(Code)
Test that user scott who has the Echo role is not able to access the StatelessSession2.excluded method even though the Echo role has been granted access to all methods of StatelessSession2 to test that the excluded-list takes precendence over the method-permissions.



testGetCallerPrincipal
public void testGetCallerPrincipal() throws Exception(Code)
Test that: 1. SecureBean returns a non-null principal when getCallerPrincipal is called with a security context and that this is propagated to its Entity bean ref. 2. UnsecureBean throws an IllegalStateException when getCallerPrincipal is called without a security context.



testHandle
public void testHandle() throws Exception(Code)
Test the security behavior of handles. To obtain secured bean from a handle that the handle be



testJBAS1852
public void testJBAS1852() throws Exception(Code)
Test the run-as side-effects raised in http://jira.jboss.com/jira/browse/JBAS-1852
throws:
  Exception -



testLocalMethodAccess
public void testLocalMethodAccess() throws Exception(Code)
Test a user with Echo and EchoLocal roles can access the CalleeBean through its local interface by calling the CallerBean and that a user with only a EchoLocal cannot call the CallerBean.



testMDBDeepRunAs
public void testMDBDeepRunAs() throws Exception(Code)
Test that an MDB with a run-as identity is able to access secure EJBs that require the identity. DeepRunAsMDB -> Level1MDBCallerBean.callEcho() -> Level2CallerBean.invokeEcho() -> Level3CalleeBean.echo() The MDB uses a run-as of InternalRole and the Level2CallerBean and Level3CalleeBean are only accessible by InternalRole.



testMDBRunAs
public void testMDBRunAs() throws Exception(Code)
Test that an MDB with a run-as identity is able to access secure EJBs that require the identity.



testMethodAccess
public void testMethodAccess() throws Exception(Code)
Test that the echo method is accessible by an Echo role. Since the noop() method of the StatelessSession bean was not assigned any permissions it should be unchecked.



testMethodAccess2
public void testMethodAccess2() throws Exception(Code)
Test that the permissions assigned to the stateless session bean: with ejb-name=org/jboss/test/security/ejb/StatelessSession_test are read correctly.



testPrincipalPropagation
public void testPrincipalPropagation() throws Exception(Code)
Test that the calling principal is propagated across bean calls.



testRemoteUnchecked
public void testRemoteUnchecked() throws Exception(Code)
Test access to a bean with a mix of remote interface permissions and unchecked permissions with the unchecked permissions declared last.
throws:
  Exception -



testRunAs
public void testRunAs() throws Exception(Code)
This method tests the following call chains: 1. RunAsStatelessSession.echo() -> PrivateEntity.echo() 2. RunAsStatelessSession.noop() -> RunAsStatelessSession.excluded() 3. RunAsStatelessSession.forward() -> StatelessSession.echo() 1. Should succeed because the run-as identity of RunAsStatelessSession is valid for accessing PrivateEntity. 2. Should succeed because the run-as identity of RunAsStatelessSession is valid for accessing RunAsStatelessSession.excluded(). 3. Should fail because the run-as identity of RunAsStatelessSession is not Echo.



testRunAsSFSB
public void testRunAsSFSB() throws Exception(Code)



testRunAsWithRoles
public void testRunAsWithRoles() throws Exception(Code)
This method tests that the RunAsWithRolesMDB is assigned multiple roles within its onMessage so that it can call into the ProjRepository session bean's methods that required ProjectAdmin, CreateFolder and DeleteFolder roles.



testSecurityDomain
public void testSecurityDomain() throws Exception(Code)
Validate that the users have the expected logins and roles.
throws:
  Exception -



testStatefulCreateCaller
public void testStatefulCreateCaller() throws Exception(Code)
Test the use of getCallerPrincipal from within the ejbCreate in a stateful session bean



testStatefulHandle
public void testStatefulHandle() throws Exception(Code)
Test the security behavior of stateful handles. To obtain secured bean from a handle requires that there be a security context to obtain the ejb.



testStress
public void testStress() throws Exception(Code)
Stress test declarative security.



testStressNoJaasCache
public void testStressNoJaasCache() throws Exception(Code)
Stress test declarative security with the JAAS cache disabled.



testUnchecked
public void testUnchecked() throws Exception(Code)
Test that a user with a role that has not been assigned any method permissions in the ejb-jar descriptor is able to access a method that has been marked as unchecked.



testUncheckedRemote
public void testUncheckedRemote() throws Exception(Code)
Test access to a bean with a mix of remote interface permissions and unchecked permissions with the unchecked permissions declared first.
throws:
  Exception -



testUncheckedWithLogin
public void testUncheckedWithLogin() throws Exception(Code)
Test that a user with a valid role is able to access a bean for which all methods have been marked as unchecked.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.