modules/integration-tests/jndi-access/jndi-access-test/src/test/java/org/rhq/jndi/test/JndiAccessTest.java
| 12 ++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 35000db271b01396052737dbda03551802277c3b
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Sat Dec 15 00:44:26 2012 +0100
Ooops, forgot to implement the exception check in the JndiAccessTest.
diff --git
a/modules/integration-tests/jndi-access/jndi-access-test/src/test/java/org/rhq/jndi/test/JndiAccessTest.java
b/modules/integration-tests/jndi-access/jndi-access-test/src/test/java/org/rhq/jndi/test/JndiAccessTest.java
index d330ba1..2e088f8 100644
---
a/modules/integration-tests/jndi-access/jndi-access-test/src/test/java/org/rhq/jndi/test/JndiAccessTest.java
+++
b/modules/integration-tests/jndi-access/jndi-access-test/src/test/java/org/rhq/jndi/test/JndiAccessTest.java
@@ -35,6 +35,7 @@ import javax.script.ScriptException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.testng.Assert;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
@@ -253,7 +254,14 @@ public class JndiAccessTest extends Arquillian {
}
private void checkIsDesiredSecurityException(Throwable t) {
- //TODO implement
- System.out.println(t);
+ String message = t.getMessage();
+ String permissionTrace = "org.rhq.allow.server.internals.access";
+
+ if (!message.contains(permissionTrace)) {
+ Assert
+ .fail(
+ "The script exception doesn't seem to be caused by the
AllowRhqServerInternalsAccessPermission security exception. ",
+ t);
+ }
}
}
Show replies by date