[jbossseam-issues] [JBoss JIRA] Reopened: (JBSEAM-286) SeamTest - Add support for authenticated user

Bradley Smith (JIRA) jira-events at jboss.com
Tue Nov 28 11:39:55 EST 2006


     [ http://jira.jboss.com/jira/browse/JBSEAM-286?page=all ]

Bradley Smith reopened JBSEAM-286:
----------------------------------

             
I really need the principal - not the name of a Principal,  also, I would prefer to be able to use a Principal class for the roles instead of a Set<String>.

The goal of this feature request was to have a Principal impl. available in the request so that the org.jboss.seam.core.userPrincipal component works.  Furthermore, I wanted to be able to produce an instance of Principal (my app's specific Principal impl.) and have that instance be used by the MockHttpServletRequest.  Is it too much too ask?  say it ain't so....

I tried using the 1.1.0 CR1 release of SeamTest - I overrode the getPrincipalName() method, the userPrincipal is not set on my EJB using @In Principal userPrincipal.

11:27:47,580 ERROR org.jboss.seam.interceptors.ExceptionInterceptor.(handle:367) - redirecting to debug page
javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: mailConfigurationEditor.userPrinc
ipal
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
        at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
        at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
        at $Proxy98.getMailConfiguration(Unknown Source)
        at com.evergreen.accesscontrol.MailConfigurationEditor$$FastClassByCGLIB$$b5b2a641.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
        at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
        at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
        at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
        at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
        at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
        at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78)
        at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
        at com.evergreen.accesscontrol.MailConfigurationEditor$$EnhancerByCGLIB$$19081219.getMailConfiguration(<generate
d>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
        at org.jboss.seam.Component.callComponentMethod(Component.java:1759)
        at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1647)
        at org.jboss.seam.Component.getInstance(Component.java:1590)
        at org.jboss.seam.Component.getInstance(Component.java:1567)
        at org.jboss.seam.Component.getInstance(Component.java:1561)
        at org.jboss.seam.mock.SeamTest.getInstance(SeamTest.java:112)
        at com.evergreen.accesscontrol.MailConfigurationEditorTest.access$000(MailConfigurationEditorTest.java:15)
        at com.evergreen.accesscontrol.MailConfigurationEditorTest$1.updateModelValues(MailConfigurationEditorTest.java:
31)
        at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:465)
        at com.evergreen.accesscontrol.MailConfigurationEditorTest.test_saveMailConfiguration(MailConfigurationEditorTes
t.java:22)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:407)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
        at org.testng.TestRunner.privateRun(TestRunner.java:682)
        at org.testng.TestRunner.run(TestRunner.java:566)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
        at org.testng.SuiteRunner.run(SuiteRunner.java:146)
        at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:713)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:676)
        at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64)
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: java.lang.IllegalArgumentException: could not set field value: mailConfigurationEditor.userPrincipal
        at org.jboss.seam.Component.setFieldValue(Component.java:1526)
        at org.jboss.seam.Component.injectFields(Component.java:1317)
        at org.jboss.seam.Component.inject(Component.java:1087)
        at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
        at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
        at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor
.java:51)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
        at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
        at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
        at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
        at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
        at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerIntercep
tor.java:54)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
        ... 73 more
Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: MailConfigurationEditorBean.user
Principal on: com.evergreen.accesscontrol.impl.MailConfigurationEditorBean with value: class org.jboss.seam.mock.MockHtt
pServletRequest$1
        at org.jboss.seam.util.Reflections.set(Reflections.java:75)
        at org.jboss.seam.Component.setFieldValue(Component.java:1522)
        ... 115 more
Caused by: java.lang.IllegalArgumentException
        at sun.reflect.UnsafeObjectFieldAccessorImpl.set(Unknown Source)
        at java.lang.reflect.Field.set(Unknown Source)
        at org.jboss.seam.util.Reflections.set(Reflections.java:61)
        ... 116 more
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 17.5 sec <<< FAILURE!

> SeamTest - Add support for authenticated user
> ---------------------------------------------
>
>                 Key: JBSEAM-286
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-286
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Core
>    Affects Versions: 1.0.1
>         Environment: All
>            Reporter: Bradley Smith
>         Assigned To: Gavin King
>             Fix For: 1.1.0.CR1
>
>         Attachments: MockExternalContext.java, MockExternalContext.java, MockHttpServletRequest.java, MockHttpServletRequest.java, SeamTest.java, SeamTest.java
>
>
> Add a property of type Principal and another property (maybe of type Group []?) to Script.  The Principal should be used by the MockHttpServletRequest to represent and authenticated user.  The Group [] property should be used by the MockHttpServletRequest to support the isUserInRole() implementation.
> These properties ideally should be settable by overriding the setup() method of Script.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list