tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndegraev <nick.degra...@telenet.be>
Subject Re: JUnit: Sessioncontext.isCallerInRole allways returns false
Date Fri, 04 Feb 2011 15:37:56 GMT

That was really helpful! Thanks. But wait, I'm not there yet...

I decided to use PropertiesLoginModule and now I can login. 

I defined the roles I want to use in my unit tests in ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<j2ee:ejb-jar 
		version="3.0" 
		xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" 
		xmlns:xml="http://www.w3.org/XML/1998/namespace" 
		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/ejb-jar_3_0.xsd ">

	<j2ee:assembly-descriptor>
		<j2ee:security-role>
			<j2ee:role-name>role1</j2ee:role-name>
		</j2ee:security-role>
		<j2ee:security-role>
			<j2ee:role-name>role2</j2ee:role-name>
		</j2ee:security-role>
	</j2ee:assembly-descriptor>
		
</j2ee:ejb-jar>

Where do I put this? In src/main/resources/META-INF,
src/test/resources/META-INF or both?

And where do I map my JAAS groups to J2EE roles? Probably in the
openejb-jar.xml? 

Not a lot of documentation on how to do it, though, so any help is welcome.

-- 
View this message in context: http://openejb.979440.n4.nabble.com/JUnit-Sessioncontext-isCallerInRole-allways-returns-false-tp3257408p3260388.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message