You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2015/08/24 16:02:26 UTC

[2/3] cxf git commit: Fixing some test assertions with a non-english locale

Fixing some test assertions with a non-english locale

Conflicts:
	systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/SchemaValidationClientServerTest.java


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

Branch: refs/heads/3.0.x-fixes
Commit: 9a4f57eba1ba34c6d2115acb358b17ed8616b8b1
Parents: 0d8d92c
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Mon Aug 24 14:26:25 2015 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Aug 24 14:28:58 2015 +0100

----------------------------------------------------------------------
 .../jaxrs/provider/JAXBElementProviderTest.java |  5 +-
 .../jaxws/SchemaValidationClientServerTest.java | 48 ++++++++++++++++++++
 .../cxf/tools/wsdlto/jaxws/CodeGenTest.java     |  5 +-
 3 files changed, 56 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9a4f57eb/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
index f69d8b9..1cc6502 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/JAXBElementProviderTest.java
@@ -1349,7 +1349,10 @@ public class JAXBElementProviderTest extends Assert {
             fail("Validation exception expected");
         } catch (Exception ex) {
             Throwable cause = ex.getCause();
-            assertTrue(cause.getMessage().contains("Cannot find the declaration of element"));
+            boolean english = "en".equals(java.util.Locale.getDefault().getLanguage());
+            if (english) {
+                assertTrue(cause.getMessage().contains("Cannot find the declaration of element"));
+            }
         }
         
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/9a4f57eb/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 fad4c22..44ba40a 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
@@ -123,6 +123,7 @@ 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");
@@ -143,6 +144,53 @@ public class SchemaValidationClientServerTest extends AbstractBusClientServerTes
         } 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"));
+                }
+            }
+>>>>>>> 673ca40... Fixing some test assertions with a non-english locale
         }
         
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/9a4f57eb/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
index f71a0fc..311de82 100644
--- a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
+++ b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
@@ -1263,9 +1263,12 @@ public class CodeGenTest extends AbstractCodeGenTest {
             processor.setContext(env);
             processor.execute();
         } catch (Exception e) {
-            assertTrue("Jaxb databinding can not find the schema error ",
+            boolean english = "en".equals(java.util.Locale.getDefault().getLanguage());
+            if (english) {
+                assertTrue("Jaxb databinding can not find the schema error ",
                        e.getLocalizedMessage().indexOf(" cos-st-restricts.1.1: "
                                                        + "The type 'TpAny' is atomic") > -1);
+            }
         }
     }