[jboss-svn-commits] JBL Code SVN: r24326 - in labs/jbossrules/trunk/drools-guvnor: src/test/java/org/drools/guvnor/server and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 9 13:57:17 EST 2008
Author: Rikkola
Date: 2008-12-09 13:57:15 -0500 (Tue, 09 Dec 2008)
New Revision: 24326
Modified:
labs/jbossrules/trunk/drools-guvnor/pom.xml
labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplSecurityTest.java
labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplementationTest.java
labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/security/MockIdentity.java
Log:
Updated Seam from 2.1.0.BETA1 to 2.1.0.GA
Modified: labs/jbossrules/trunk/drools-guvnor/pom.xml
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/pom.xml 2008-12-09 18:54:59 UTC (rev 24325)
+++ labs/jbossrules/trunk/drools-guvnor/pom.xml 2008-12-09 18:57:15 UTC (rev 24326)
@@ -141,12 +141,12 @@
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
- <version>2.1.0.BETA1</version>
+ <version>2.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
- <version>2.1.0.BETA1</version>
+ <version>2.1.0.GA</version>
</dependency>
<dependency>
Modified: labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplSecurityTest.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplSecurityTest.java 2008-12-09 18:54:59 UTC (rev 24325)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplSecurityTest.java 2008-12-09 18:57:15 UTC (rev 24326)
@@ -20,7 +20,6 @@
import org.drools.guvnor.server.security.RoleBasedPermissionManager;
import org.drools.guvnor.server.security.RoleTypes;
import org.drools.guvnor.server.util.TestEnvironmentSessionHelper;
-import org.drools.guvnor.server.util.ClassicDRLImporter.Asset;
import org.drools.repository.AssetItem;
import org.drools.repository.PackageItem;
import org.drools.repository.RulesRepository;
@@ -61,12 +60,15 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
-
+ midentity.create();
+
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
Contexts.getSessionContext().set(
"org.drools.guvnor.client.rpc.RepositoryService", impl);
+
+
List<RoleBasedPermission> pbps = new ArrayList<RoleBasedPermission>();
pbps.add(new RoleBasedPermission("jervis", RoleTypes.ANALYST, null,
"testLoadRuleAssetWithRoleBasedAuthrozationCat1"));
@@ -81,6 +83,7 @@
//now lets see if we can access this asset with the permissions
RuleAsset asset = impl.loadRuleAsset(uuid1);
try {
+
asset = impl.loadRuleAsset(uuid2);
fail("Did not catch expected exception");
} catch (AuthorizationException e) {
@@ -120,6 +123,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -179,6 +183,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(false);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -228,6 +233,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -279,6 +285,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -338,6 +345,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -401,6 +409,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -442,6 +451,7 @@
Lifecycle.beginCall();
MockIdentity mi = new MockIdentity();
mi.inject();
+ mi.create();
try {
impl.createNewRule("testCreateNewRuleName22",
@@ -500,6 +510,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -620,6 +631,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -672,6 +684,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
@@ -726,6 +739,7 @@
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(true);
midentity.addPermissionResolver(resolver);
+ midentity.create();
Contexts.getSessionContext().set(
"org.jboss.seam.security.identity", midentity);
Modified: labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplementationTest.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplementationTest.java 2008-12-09 18:54:59 UTC (rev 24325)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/ServiceImplementationTest.java 2008-12-09 18:57:15 UTC (rev 24326)
@@ -2251,6 +2251,7 @@
MockIdentity mi = new MockIdentity();
mi.inject();
+ mi.create();
//mi.addRole(RoleTypes.ADMIN);
RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
resolver.setEnableRoleBasedAuthorization(false);
Modified: labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/security/MockIdentity.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/security/MockIdentity.java 2008-12-09 18:54:59 UTC (rev 24325)
+++ labs/jbossrules/trunk/drools-guvnor/src/test/java/org/drools/guvnor/server/security/MockIdentity.java 2008-12-09 18:57:15 UTC (rev 24326)
@@ -48,10 +48,16 @@
this.hasRole = hasRole;
}
+ public boolean isLoggedIn() {
+ return true;
+ }
+
public boolean isLoggedIn(boolean attemptLogin) {
return true;
}
+
+
public boolean hasPermission(Object target, String action) {
for (PermissionResolver resolver : resolvers)
{
More information about the jboss-svn-commits
mailing list