deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject deltaspike git commit: DELTASPIKE-801 improved test
Date Wed, 17 Dec 2014 13:43:19 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 16ba76b8a -> a910828e9


DELTASPIKE-801 improved test


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/a910828e
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/a910828e
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/a910828e

Branch: refs/heads/master
Commit: a910828e9798ff469a65576f05cdb775fd5a6744
Parents: 16ba76b
Author: gpetracek <gpetracek@apache.org>
Authored: Wed Dec 17 14:42:23 2014 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Wed Dec 17 14:42:23 2014 +0100

----------------------------------------------------------------------
 ...ecurityParameterWithNonbindingMemberTest.java | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/a910828e/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/nonbinding/SecurityParameterWithNonbindingMemberTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/nonbinding/SecurityParameterWithNonbindingMemberTest.java
b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/nonbinding/SecurityParameterWithNonbindingMemberTest.java
index 24adfa1..684a492 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/nonbinding/SecurityParameterWithNonbindingMemberTest.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/nonbinding/SecurityParameterWithNonbindingMemberTest.java
@@ -47,11 +47,24 @@ public class SecurityParameterWithNonbindingMemberTest
                 .addAsWebInfResource(ArchiveUtils.getBeansXml(), "beans.xml");
     }
 
-    @Test(expected = AccessDeniedException.class)
+    @Test
+    //don't use expected = AccessDeniedException.class
+    //(reason: with some adapters it would lead to an ArquillianProxyException)
     public void securityParameterWithNonbindingMember()
     {
         SecuredBean testBean = BeanProvider.getContextualReference(SecuredBean.class, false);
-        testBean.getResult(new ParameterValue(false));
-        Assert.fail();
+        try
+        {
+            testBean.getResult(new ParameterValue(false));
+            Assert.fail("AccessDeniedException expect, but was not thrown");
+        }
+        catch (AccessDeniedException e)
+        {
+            //expected exception
+        }
+        catch (Exception e)
+        {
+            Assert.fail("Unexpected Exception: " + e);
+        }
     }
 }


Mime
View raw message