cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterjo...@apache.org
Subject svn commit: r814661 - in /cxf/trunk/rt: databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ transports/jms/src/test/java/org/apache/cxf/transport/jms/
Date Mon, 14 Sep 2009 14:29:10 GMT
Author: peterjones
Date: Mon Sep 14 14:29:10 2009
New Revision: 814661

URL: http://svn.apache.org/viewvc?rev=814661&view=rev
Log:
Some ibm jdk 5 fixes.
DataBindingProviderTest - string comparison of xml in test fails for ibm jdk.
JMSConduitTest - work-around for ibm jdk finalizing the conduit while it is
    still in scope in the test.
AegisDatabinding - Need to add a null check so that the simple frontend 
    dependency can be excluded with the ibm jdk.

Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java
    cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=814661&r1=814660&r2=814661&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
Mon Sep 14 14:29:10 2009
@@ -644,6 +644,14 @@
 
     private Method getMethod(Service s, OperationInfo op) {
         MethodDispatcher md = (MethodDispatcher)s.get(MethodDispatcher.class.getName());
+        // The ibm jdk requires the simple frontend dependency to be
+        // present for the SimpleMethodDispatcher cast below even if
+        // md is null (sun jdk does not).  So, for the jaxrs frontend,
+        // we can exclude the simple frontend from the aegis databinding
+        // dependency as long as this null check is here.
+        if (md == null) {
+            return null;
+        }
         SimpleMethodDispatcher smd = (SimpleMethodDispatcher)md;
         return smd != null ? smd.getPrimaryMethod(op) : null;
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java?rev=814661&r1=814660&r2=814661&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/DataBindingProviderTest.java
Mon Sep 14 14:29:10 2009
@@ -77,15 +77,19 @@
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         p.writeTo(b, Book.class, Book.class,
             new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(),
bos);
-        assertEquals(properties.getProperty("testAegisWriteXml"), bos.toString());
+        doTestAegisRead(bos.toString());
     }
     
-    @SuppressWarnings("unchecked")
     @Test
     public void testAegisRead() throws Exception {
         String data = "<ns1:Book xmlns:ns1=\"http://resources.jaxrs.cxf.apache.org\" "
             + "xmlns:ns2=\"http://www.w3.org/2001/XMLSchema-instance\" ns2:type=\"ns1:Book\">"
             + "<ns1:id>127</ns1:id><ns1:name>CXF</ns1:name><ns1:state></ns1:state></ns1:Book>";
+        doTestAegisRead(data);
+    }
+    
+    @SuppressWarnings("unchecked")
+    public void doTestAegisRead(String data) throws Exception { 
         Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
         s.put("readXsiType", true);
         AegisDatabinding binding = new AegisDatabinding();

Modified: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java?rev=814661&r1=814660&r2=814661&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
(original)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
Mon Sep 14 14:29:10 2009
@@ -168,6 +168,12 @@
                 return JMSUtils.createAndSetPayload(testBytes, session, JMSConstants.BYTE_MESSAGE_TYPE);
             }
         });
+        
+        // The ibm jdk finalizes conduit (during most runs of this test) and
+        // causes it to fail unless we reference the conduit here after the
+        // jmsTemplate.execute() call.
+        assertNotNull("Conduit is null", conduit);
+
         assertTrue("Message should have been of type BytesMessage ", message instanceof BytesMessage);
     }
 



Mime
View raw message