cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r806406 - in /cxf/trunk: rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ systests/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 21 Aug 2009 01:04:48 GMT
Author: bimargulies
Date: Fri Aug 21 01:04:47 2009
New Revision: 806406

URL: http://svn.apache.org/viewvc?rev=806406&view=rev
Log:
Change Aegis schema validation to be non-Soap-specific.

Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisSchemaValidationInInterceptor.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/Messages.properties
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisSchemaValidationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisSchemaValidationInInterceptor.java?rev=806406&r1=806405&r2=806406&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisSchemaValidationInInterceptor.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisSchemaValidationInInterceptor.java
Fri Aug 21 01:04:47 2009
@@ -25,19 +25,17 @@
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.binding.soap.SoapFault;
-import org.apache.cxf.binding.soap.SoapMessage;
-import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
 import org.apache.cxf.binding.soap.interceptor.StartBodyInterceptor;
-import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.io.StaxValidationManager;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.ServiceInfo;
 
-public class AegisSchemaValidationInInterceptor extends AbstractSoapInterceptor {
+public class AegisSchemaValidationInInterceptor extends AbstractPhaseInterceptor<Message>
{
     private static final Logger LOG = LogUtils.getL7dLogger(AegisSchemaValidationInInterceptor.class);
     
     private ServiceInfo service;
@@ -52,17 +50,17 @@
     }
 
 
-    public void handleMessage(SoapMessage message) throws Fault {
+    public void handleMessage(Message message) throws Fault {
         XMLStreamReader xmlReader = message.getContent(XMLStreamReader.class);
         try {
             setSchemaInMessage(message, xmlReader);
         } catch (XMLStreamException e) {
-            throw new SoapFault(new Message("XML_STREAM_EXC", LOG), 
-                                e, message.getVersion().getSender());
+            throw new Fault(new org.apache.cxf.common.i18n.Message("SCHEMA_ERROR", LOG),

+                            e);
         }
     }
     
-    private void setSchemaInMessage(SoapMessage message, XMLStreamReader reader) throws XMLStreamException
 {
+    private void setSchemaInMessage(Message message, XMLStreamReader reader) throws XMLStreamException
 {
         Object en = message.getContextualProperty(org.apache.cxf.message.Message.SCHEMA_VALIDATION_ENABLED);
         if (Boolean.TRUE.equals(en) || "true".equals(en)) {
             StaxValidationManager mgr = bus.getExtension(StaxValidationManager.class);
@@ -71,5 +69,4 @@
             }
         }
     }
-
 }

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/Messages.properties?rev=806406&r1=806405&r2=806406&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/Messages.properties
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/Messages.properties
Fri Aug 21 01:04:47 2009
@@ -22,4 +22,5 @@
 STREAM_READ_ERROR=Error reading XML input stream.
 MAPPED_CLASS_NOT_FOUND=Class {0} from service property {1} not found.
 NO_MESSAGE_FOR_PART=No message found for part {0}.
+SCHEMA_ERROR=Error installing schema for schema validation.
 

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java?rev=806406&r1=806405&r2=806406&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSDataBindingTest.java
Fri Aug 21 01:04:47 2009
@@ -36,7 +36,6 @@
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSDataBindingTest extends AbstractBusClientServerTestBase {
@@ -57,7 +56,6 @@
     }
     
     @Test
-    @Ignore("Aegis Schema Validation gets in the way")
     public void testGetBookAegis() throws Exception {
         WebClient client = WebClient.create("http://localhost:9080/databinding/aegis/bookstore/books/123",
                                             Collections.singletonList(new AegisElementProvider()));



Mime
View raw message