Author: dkulp
Date: Thu Apr 10 11:59:50 2008
New Revision: 646924

URL: http://svn.apache.org/viewvc?rev=646924&view=rev
Log:
Workaround an issue with older JDK's (example: 1.5.0_04 on HP-UX 11.00 which 
doesn't support the newer 1.5.0_11 jdk) where validation doesn't work.

Modified:
    
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java

Modified: 
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java?rev=646924&r1=646923&r2=646924&view=diff
==============================================================================
--- 
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
 (original)
+++ 
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
 Thu Apr 10 11:59:50 2008
@@ -70,7 +70,8 @@
             
             Endpoint ep = Endpoint.create(implementor);
             Map<String, Object> properties = new HashMap<String, Object>();
-            properties.put("schema-validation-enabled", Boolean.TRUE);
+            properties.put("schema-validation-enabled",
+                           shouldValidate());
             ep.setProperties(properties);
             ep.publish(address);
 
@@ -93,9 +94,20 @@
     
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", 
launchServer(Server.class));
+        assertTrue("server did not launch correctly", 
+                   launchServer(Server.class));
     }
             
+    public static Boolean shouldValidate() {
+        String ver = System.getProperty("java.version");
+        if (ver.startsWith("1.5.0_0")) {
+            //older versions of the JDK have a bug in the parser
+            //that prevent the validation from actually working
+            return Boolean.FALSE;
+        }
+        return Boolean.TRUE;
+    }
+    
     @Test
     public void testDecoupled() throws Exception {
         SpringBusFactory bf = new SpringBusFactory();
@@ -110,7 +122,8 @@
         
         GreeterService gs = new GreeterService();
         final Greeter greeter = gs.getGreeterPort();
-        
((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", 
Boolean.TRUE);
+        
((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", 
+                                                           shouldValidate());
         LOG.fine("Created greeter client.");
        
         ConnectionHelper.setKeepAliveConnection(greeter, true);


Reply via email to