Fixing test

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

Branch: refs/heads/3.0.x-fixes
Commit: 4efea8c4aea95d28163b15093de0b09053fb8a3a
Parents: 71ad046
Author: Colm O hEigeartaigh <cohei...@apache.org>
Authored: Mon Aug 24 15:02:18 2015 +0100
Committer: Colm O hEigeartaigh <cohei...@apache.org>
Committed: Mon Aug 24 15:02:18 2015 +0100

----------------------------------------------------------------------
 .../jaxws/SchemaValidationClientServerTest.java | 61 ++++----------------
 1 file changed, 11 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4efea8c4/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SchemaValidationClientServerTest.java
----------------------------------------------------------------------
diff --git 
a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SchemaValidationClientServerTest.java
 
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SchemaValidationClientServerTest.java
index 44ba40a..917f437 100644
--- 
a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SchemaValidationClientServerTest.java
+++ 
b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SchemaValidationClientServerTest.java
@@ -115,7 +115,10 @@ public class SchemaValidationClientServerTest extends 
AbstractBusClientServerTes
             fail("should catch marshall exception as the invalid outgoing 
message per schema");
         } catch (Exception e) {
             assertTrue(e.getMessage().contains("Marshalling Error"));
-            assertTrue(e.getMessage().contains("is not facet-valid with 
respect to pattern"));
+            boolean english = 
"en".equals(java.util.Locale.getDefault().getLanguage());
+            if (english) {
+                assertTrue(e.getMessage().contains("is not facet-valid with 
respect to pattern"));
+            }
         }
 
         try {
@@ -123,13 +126,15 @@ public class SchemaValidationClientServerTest extends 
AbstractBusClientServerTes
             request.setRequest(requestId);
             header.setHeaderValue("AABBCCDDEEFFGGHHIIJJ");
             
-<<<<<<< HEAD
             //Check if incoming validation on server side works, turn off 
outgoing
             greeter.ckR(request, header);
             fail("should catch marshall exception as the invalid outgoing 
message per schema");
         } catch (Exception e) {
             assertTrue(e.getMessage().contains("Marshalling Error"));
-            assertTrue(e.getMessage().contains("is not facet-valid with 
respect to maxLength"));
+            boolean english = 
"en".equals(java.util.Locale.getDefault().getLanguage());
+            if (english) {
+                assertTrue(e.getMessage().contains("is not facet-valid with 
respect to maxLength"));
+            }
         }
         
         try {
@@ -143,54 +148,10 @@ public class SchemaValidationClientServerTest extends 
AbstractBusClientServerTes
             fail("should catch marshall exception as the invalid outgoing 
message per schema");
         } catch (Exception e) {
             assertTrue(e.getMessage().contains("Could not validate soapheader 
"));
-            assertTrue(e.getMessage().contains("is not facet-valid with 
respect to maxLength"));
-=======
-            try {
-                requestId.setId("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeeez");
-                request.setRequest(requestId);
-                greeter.ckR(request, header);
-                fail("should catch marshall exception as the invalid outgoing 
message per schema");
-            } catch (Exception e) {
-                assertTrue(e.getMessage().contains("Marshalling Error"));
-                boolean english = 
"en".equals(java.util.Locale.getDefault().getLanguage());
-                if (english) {
-                    assertTrue(e.getMessage().contains("is not facet-valid 
with respect to pattern"));
-                }
-            }
-    
-            try {
-                requestId.setId("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
-                request.setRequest(requestId);
-                header.setHeaderValue("AABBCCDDEEFFGGHHIIJJ");
-                
-                //Check if incoming validation on server side works, turn off 
outgoing
-                greeter.ckR(request, header);
-                fail("should catch marshall exception as the invalid outgoing 
message per schema");
-            } catch (Exception e) {
-                assertTrue(e.getMessage().contains("Marshalling Error"));
-                boolean english = 
"en".equals(java.util.Locale.getDefault().getLanguage());
-                if (english) {
-                    assertTrue(e.getMessage().contains("is not facet-valid 
with respect to maxLength"));
-                }
-            }
-            
-            try {
-                requestId.setId("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
-                request.setRequest(requestId);
-                header.setHeaderValue("AABBCCDDEEFFGGHHIIJJ");
-                
-                //Check if incoming validation on server side works, turn off 
outgoing
-                
greeter.getRequestContext().put(Message.SCHEMA_VALIDATION_ENABLED, 
Boolean.FALSE);
-                greeter.ckR(request, header);
-                fail("should catch marshall exception as the invalid outgoing 
message per schema");
-            } catch (Exception e) {
-                assertTrue(e.getMessage().contains("Could not validate 
soapheader "));
-                boolean english = 
"en".equals(java.util.Locale.getDefault().getLanguage());
-                if (english) {
-                    assertTrue(e.getMessage().contains("is not facet-valid 
with respect to maxLength"));
-                }
+            boolean english = 
"en".equals(java.util.Locale.getDefault().getLanguage());
+            if (english) {
+                assertTrue(e.getMessage().contains("is not facet-valid with 
respect to maxLength"));
             }
->>>>>>> 673ca40... Fixing some test assertions with a non-english locale
         }
         
     }

Reply via email to