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 15:26:44 UTC

cxf git commit: Fixing some test assertions with a non-english locale

Repository: cxf
Updated Branches:
  refs/heads/master c9129aff7 -> 673ca406c


Fixing some test assertions with a non-english locale


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

Branch: refs/heads/master
Commit: 673ca406cd9725a0e5e4891ab9d54df0c4881600
Parents: c9129af
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:26:25 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/673ca406/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 0249fd0..d4a1753 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
@@ -1353,7 +1353,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/673ca406/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 d261d96..c3359c2 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
@@ -113,7 +113,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 {
@@ -126,7 +129,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 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 {
@@ -140,7 +146,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"));
+                boolean english = "en".equals(java.util.Locale.getDefault().getLanguage());
+                if (english) {
+                    assertTrue(e.getMessage().contains("is not facet-valid with respect to maxLength"));
+                }
             }
         }
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/673ca406/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 84af561..1c57554 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
@@ -1262,9 +1262,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);
+            }
         }
     }