camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1233185 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/component/validator/ camel-core/src/main/java/org/apache/camel/processor/validation/ camel-core/src/test/java/org/apache/camel/component/validator/ came...
Date Thu, 19 Jan 2012 05:35:11 GMT
Author: davsclaus
Date: Thu Jan 19 05:35:11 2012
New Revision: 1233185

URL: http://svn.apache.org/viewvc?rev=1233185&view=rev
Log:
CAMEL-4877: Validator component now supports xs:import again.

Added:
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
      - copied unchanged from r1233183, camel/trunk/camel-core/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorIncludeRouteTest.java
      - copied unchanged from r1233183, camel/trunk/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorIncludeRouteTest.java
    camel/branches/camel-2.9.x/camel-core/src/test/resources/org/apache/camel/component/validator/health.xsd
      - copied unchanged from r1233183, camel/trunk/camel-core/src/test/resources/org/apache/camel/component/validator/health.xsd
    camel/branches/camel-2.9.x/camel-core/src/test/resources/org/apache/camel/component/validator/person.xsd
      - copied unchanged from r1233183, camel/trunk/camel-core/src/test/resources/org/apache/camel/component/validator/person.xsd
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorWithResourceResolverRouteTest.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 19 05:35:11 2012
@@ -1 +1 @@
-/camel/trunk:1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834
+/camel/trunk:1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834,1233183

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 19 05:35:11 2012
@@ -1 +1 @@
-/camel/trunk:1-1227196,1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834
+/camel/trunk:1-1227196,1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834,1233183

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java?rev=1233185&r1=1233184&r2=1233185&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java
Thu Jan 19 05:35:11 2012
@@ -50,8 +50,7 @@ public class ValidatorComponent extends 
         configureValidator(validator, uri, remaining, parameters);
 
         // force loading of schema at create time otherwise concurrent
-        // processing could
-        // cause thread safe issues for the javax.xml.validation.SchemaFactory
+        // processing could cause thread safe issues for the javax.xml.validation.SchemaFactory
         validator.loadSchema();
 
         return new ProcessorEndpoint(uri, this, validator);
@@ -61,6 +60,8 @@ public class ValidatorComponent extends 
         LSResourceResolver resourceResolver = resolveAndRemoveReferenceParameter(parameters,
"resourceResolver", LSResourceResolver.class);
         if (resourceResolver != null) {
             validator.setResourceResolver(resourceResolver);
+        } else {
+            validator.setResourceResolver(new DefaultLSResourceResolver(getCamelContext(),
remaining));
         }
 
         setProperties(validator, parameters);

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java?rev=1233185&r1=1233184&r2=1233185&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/validation/ValidatingProcessor.java
Thu Jan 19 05:35:11 2012
@@ -209,7 +209,9 @@ public class ValidatingProcessor impleme
 
     protected SchemaFactory createSchemaFactory() {
         SchemaFactory factory = SchemaFactory.newInstance(schemaLanguage);
-        factory.setResourceResolver(getResourceResolver());
+        if (getResourceResolver() != null) {
+            factory.setResourceResolver(getResourceResolver());
+        }
         return factory;
     }
 

Modified: camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorWithResourceResolverRouteTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorWithResourceResolverRouteTest.java?rev=1233185&r1=1233184&r2=1233185&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorWithResourceResolverRouteTest.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorWithResourceResolverRouteTest.java
Thu Jan 19 05:35:11 2012
@@ -87,7 +87,8 @@ public class ValidatorWithResourceResolv
                 from("direct:start")
                     .doTry()
                         .to("validator:org/apache/camel/component/validator/report.xsd?resourceResolver=#resourceResolver")
-                        .to("mock:valid").doCatch(ValidationException.class)
+                        .to("mock:valid")
+                    .doCatch(ValidationException.class)
                         .to("mock:invalid")
                     .doFinally()
                         .to("mock:finally")



Mime
View raw message