cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1144919 - in /cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml: JAXRSSamlTest.java SamlOutInterceptor.java
Date Sun, 10 Jul 2011 17:56:42 GMT
Author: sergeyb
Date: Sun Jul 10 17:56:42 2011
New Revision: 1144919

URL: http://svn.apache.org/viewvc?rev=1144919&view=rev
Log:
[CXF-3588] Adding client-side reporting

Modified:
    cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/JAXRSSamlTest.java
    cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/SamlOutInterceptor.java

Modified: cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/JAXRSSamlTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/JAXRSSamlTest.java?rev=1144919&r1=1144918&r2=1144919&view=diff
==============================================================================
--- cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/JAXRSSamlTest.java
(original)
+++ cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/JAXRSSamlTest.java
Sun Jul 10 17:56:42 2011
@@ -25,6 +25,7 @@ import java.util.Map;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.jaxrs.client.ClientWebApplicationException;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
 import org.apache.cxf.jaxrs.client.WebClient;
@@ -70,7 +71,14 @@ public class JAXRSSamlTest extends Abstr
             assertEquals(123L, book.getId());
         } catch (ServerWebApplicationException ex) {
             fail(ex.getMessage());
+        } catch (ClientWebApplicationException ex) {
+            if (ex.getCause() != null && ex.getCause().getMessage() != null) {
+                fail(ex.getCause().getMessage());
+            } else {
+                fail(ex.getMessage());
+            }
         }
+        
     }
     
     

Modified: cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/SamlOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/SamlOutInterceptor.java?rev=1144919&r1=1144918&r2=1144919&view=diff
==============================================================================
--- cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/SamlOutInterceptor.java
(original)
+++ cxf/trunk/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/saml/SamlOutInterceptor.java
Sun Jul 10 17:56:42 2011
@@ -61,9 +61,9 @@ public class SamlOutInterceptor extends 
     } 
 
     public void handleMessage(Message message) throws Fault {
+        SAMLParms samlParms = new SAMLParms();
+        samlParms.setCallbackHandler(new SamlCallbackHandler());
         try {
-            SAMLParms samlParms = new SAMLParms();
-            samlParms.setCallbackHandler(new SamlCallbackHandler());
             AssertionWrapper assertion = new AssertionWrapper(samlParms);
             boolean selfSignAssertion = 
                 MessageUtils.getContextualBoolean(
@@ -120,8 +120,9 @@ public class SamlOutInterceptor extends 
                     CastUtils.cast(Collections.singletonList(builder.toString()), String.class));
             }
         } catch (Exception ex) {
-            // ignore
+            throw new Fault(ex);
         }
+        
     }
         
     private String getPassword(CallbackHandler handler, String userName, int type) {



Mime
View raw message