[
http://jira.jboss.com/jira/browse/JBSEAM-286?page=comments#action_12345996 ]
Bradley Smith commented on JBSEAM-286:
--------------------------------------
I've patched SeamTest from seam 1.1.0 beta 1 to support this request.
An example of how this is used:
public class MyBeanTest extends SeamTest {
private Log log = LogFactory.getLog(MyBeanTest.class);
@Test
public void test_someMethod() throws Exception {
SimpleGroup roles = new SimpleGroup("roles");
roles.addMember(new SimplePrincipal("admin"));
SimplePrincipal principal = new SimplePrincipal("joeuser");
new Script( (Principal)principal, (Group)roles) {
@Override
protected void setup() {
// set up any request parameters for the request
super.setup();
}
@Override
protected void updateModelValues() {
// set up any other objects required for @In-jection
}
@Override
protected void invokeApplication() {
// Test sendRequest() method
Principal userPrincipal =
(Principal)getInstance("userPrincipal");
assert userPrincipal != null;
assert "joeuser".equals(userPrincipal.getName());
log.info(userPrincipal);
}
}.run();
}
}
I am attaching the patched files to this issue.
Brad Smith
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
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