camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [camel] branch master updated: Fixed CS for Camel-Any23
Date Wed, 21 Aug 2019 08:26:52 GMT
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 3971923  Fixed CS for Camel-Any23
3971923 is described below

commit 3971923ed5f5edd2f41096df11166bda6056ee9f
Author: Andrea Cosentino <ancosen@gmail.com>
AuthorDate: Wed Aug 21 10:26:19 2019 +0200

    Fixed CS for Camel-Any23
---
 .../camel/dataformat/any23/Any23DataFormat.java    | 306 ++++++++++-----------
 .../camel/dataformat/any23/Any23OutputFormat.java  |   2 +-
 .../camel/dataformat/any23/utils/Any23Utils.java   |  61 ++--
 .../dataformat/any23/writer/RDF4JModelWriter.java  |  60 ++--
 .../any23/Any23DataFormatConfigurationsTest.java   |  48 ++--
 .../any23/Any23DataFormatDefaultTest.java          |  40 +--
 .../any23/Any23DataFormatExtractorsTest.java       |  52 ++--
 .../dataformat/any23/Any23DataFormatHTTPTest.java  |  42 ++-
 .../any23/Any23DataFormatMarshalTest.java          |  46 ++--
 .../dataformat/any23/Any23DataFormatModelTest.java |  40 +--
 .../any23/Any23DataFormatOutputFormatTest.java     |  44 +--
 .../any23/Any23DataFormatSpringTest.java           |  35 ++-
 .../camel/dataformat/any23/Any23TestSupport.java   |  32 +--
 .../any23/spring/SpringAny23DataFormatTest.xml     |   5 +-
 14 files changed, 407 insertions(+), 406 deletions(-)

diff --git a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
index 5f2abdc..71590e9 100644
--- a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
+++ b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
@@ -50,159 +50,159 @@ import org.slf4j.LoggerFactory;
 @Dataformat("any23")
 public class Any23DataFormat extends ServiceSupport implements DataFormat, DataFormatName
{
 
-  /*
+    /*
      * Our Logger
-   */
-  private static final Logger LOG = LoggerFactory.getLogger(Any23DataFormat.class);
-
-  private Any23 any23;
-
-  private Map<String, String> configurations;
-  private List<String> extractors;
-  private Any23OutputFormat outputFormat;
-  private String baseURI;
-
-  public Any23DataFormat() {
-  }
-
-  public Any23DataFormat(String baseURI) {
-    this.baseURI = baseURI;
-  }
-
-  public Any23DataFormat(Any23OutputFormat outputFormat, String baseURI) {
-    this.outputFormat = outputFormat;
-    this.baseURI = baseURI;
-  }
-
-  public Any23DataFormat(Map<String, String> configurations, Any23OutputFormat outputFormat,
String baseURI) {
-    this.configurations = configurations;
-    this.outputFormat = outputFormat;
-    this.baseURI = baseURI;
-  }
-
-  public Any23DataFormat(Map<String, String> configurations, List<String> extractors,
Any23OutputFormat outputFormat, String baseURI) {
-    this.configurations = configurations;
-    this.extractors = extractors;
-    this.outputFormat = outputFormat;
-    this.baseURI = baseURI;
-  }
-
-  @Override
-  public String getDataFormatName() {
-    return "any23";
-  }
-
-  /**
-   * Marshal data. Generate RDF.
-   */
-  public void marshal(Exchange exchange, Object object, OutputStream outputStream) throws
Exception {
-    OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
-    outputStreamWriter.write("<html><script type=\"application/ld+json\">\n");
-    outputStreamWriter.flush();
-    Model mdl = (Model) object;
-    Rio.write(mdl, outputStream, RDFFormat.JSONLD);
-    outputStreamWriter.write("\n</script></html>");
-    outputStreamWriter.flush();
-    outputStreamWriter.close();
-    outputStream.close();
-  }
-
-  /**
-   * Unmarshal the data
-   */
-  public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception {
-    ByteArrayDocumentSource source = new ByteArrayDocumentSource(inputStream, this.baseURI,
null);
-    ByteArrayOutputStream out = new ByteArrayOutputStream();
-    TripleHandler handler = Any23Utils.obtainHandler(outputFormat, out);
-    any23.extract(source, handler);
-    handler.close();
-    Object respon;
-    if (outputFormat == Any23OutputFormat.RDF4JMODEL) {
-      respon = ((RDF4JModelWriter) handler).getModel();
-    } else {
-      respon = IOUtils.toString(out.toByteArray());
-    }
-    return respon;
-
-  }
-
-  @Override
-  protected void doStart() throws Exception {
-    ModifiableConfiguration conf = null;
-    String[] extrArray = null;
-    if (extractors != null && !extractors.isEmpty()) {
-      extrArray = new String[extractors.size()];
-      extrArray = extractors.toArray(extrArray);
-    }
-    if (configurations != null && !configurations.isEmpty()) {
-      conf = DefaultConfiguration.copy();
-      for (Entry<String, String> entry : configurations.entrySet()) {
-        conf.setProperty(entry.getKey(), entry.getValue());
-      }
-    }
-    if (outputFormat == null) {
-      //Default output format
-      outputFormat = Any23OutputFormat.RDF4JMODEL;
-    }
-    if (conf == null && extrArray == null) {
-      any23 = new Any23();
-    } else if (conf != null && extrArray == null) {
-      any23 = new Any23(conf);
-    } else if (conf == null && extrArray != null) {
-      any23 = new Any23(extrArray);
-    } else if (conf != null && extrArray != null) {
-      any23 = new Any23(conf, extrArray);
-    }
-  }
-
-  @Override
-  protected void doStop() throws Exception {
-    // noop
-  }
-
-  public Any23 getAny23() {
-    return any23;
-  }
-
-  public Any23DataFormat setAny23(Any23 any23) {
-    this.any23 = any23;
-    return this;
-  }
-
-  public Map<String, String> getConfigurations() {
-    return configurations;
-  }
-
-  public Any23DataFormat setConfigurations(Map<String, String> configurations) {
-    this.configurations = configurations;
-    return this;
-  }
-
-  public List<String> getExtractors() {
-    return extractors;
-  }
-
-  public Any23DataFormat setExtractors(List<String> extractors) {
-    this.extractors = extractors;
-    return this;
-  }
-
-  public Any23OutputFormat getOutputFormat() {
-    return outputFormat;
-  }
-
-  public Any23DataFormat setOutputFormat(Any23OutputFormat outputFormat) {
-    this.outputFormat = outputFormat;
-    return this;
-  }
-
-  public String getBaseURI() {
-    return baseURI;
-  }
-
-  public Any23DataFormat setBaseURI(String baseURI) {
-    this.baseURI = baseURI;
-    return this;
-  }
+     */
+    private static final Logger LOG = LoggerFactory.getLogger(Any23DataFormat.class);
+
+    private Any23 any23;
+
+    private Map<String, String> configurations;
+    private List<String> extractors;
+    private Any23OutputFormat outputFormat;
+    private String baseURI;
+
+    public Any23DataFormat() {
+    }
+
+    public Any23DataFormat(String baseURI) {
+        this.baseURI = baseURI;
+    }
+
+    public Any23DataFormat(Any23OutputFormat outputFormat, String baseURI) {
+        this.outputFormat = outputFormat;
+        this.baseURI = baseURI;
+    }
+
+    public Any23DataFormat(Map<String, String> configurations, Any23OutputFormat outputFormat,
String baseURI) {
+        this.configurations = configurations;
+        this.outputFormat = outputFormat;
+        this.baseURI = baseURI;
+    }
+
+    public Any23DataFormat(Map<String, String> configurations, List<String> extractors,
Any23OutputFormat outputFormat, String baseURI) {
+        this.configurations = configurations;
+        this.extractors = extractors;
+        this.outputFormat = outputFormat;
+        this.baseURI = baseURI;
+    }
+
+    @Override
+    public String getDataFormatName() {
+        return "any23";
+    }
+
+    /**
+     * Marshal data. Generate RDF.
+     */
+    public void marshal(Exchange exchange, Object object, OutputStream outputStream) throws
Exception {
+        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
+        outputStreamWriter.write("<html><script type=\"application/ld+json\">\n");
+        outputStreamWriter.flush();
+        Model mdl = (Model)object;
+        Rio.write(mdl, outputStream, RDFFormat.JSONLD);
+        outputStreamWriter.write("\n</script></html>");
+        outputStreamWriter.flush();
+        outputStreamWriter.close();
+        outputStream.close();
+    }
+
+    /**
+     * Unmarshal the data
+     */
+    public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception
{
+        ByteArrayDocumentSource source = new ByteArrayDocumentSource(inputStream, this.baseURI,
null);
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        TripleHandler handler = Any23Utils.obtainHandler(outputFormat, out);
+        any23.extract(source, handler);
+        handler.close();
+        Object respon;
+        if (outputFormat == Any23OutputFormat.RDF4JMODEL) {
+            respon = ((RDF4JModelWriter)handler).getModel();
+        } else {
+            respon = IOUtils.toString(out.toByteArray());
+        }
+        return respon;
+
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        ModifiableConfiguration conf = null;
+        String[] extrArray = null;
+        if (extractors != null && !extractors.isEmpty()) {
+            extrArray = new String[extractors.size()];
+            extrArray = extractors.toArray(extrArray);
+        }
+        if (configurations != null && !configurations.isEmpty()) {
+            conf = DefaultConfiguration.copy();
+            for (Entry<String, String> entry : configurations.entrySet()) {
+                conf.setProperty(entry.getKey(), entry.getValue());
+            }
+        }
+        if (outputFormat == null) {
+            // Default output format
+            outputFormat = Any23OutputFormat.RDF4JMODEL;
+        }
+        if (conf == null && extrArray == null) {
+            any23 = new Any23();
+        } else if (conf != null && extrArray == null) {
+            any23 = new Any23(conf);
+        } else if (conf == null && extrArray != null) {
+            any23 = new Any23(extrArray);
+        } else if (conf != null && extrArray != null) {
+            any23 = new Any23(conf, extrArray);
+        }
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        // noop
+    }
+
+    public Any23 getAny23() {
+        return any23;
+    }
+
+    public Any23DataFormat setAny23(Any23 any23) {
+        this.any23 = any23;
+        return this;
+    }
+
+    public Map<String, String> getConfigurations() {
+        return configurations;
+    }
+
+    public Any23DataFormat setConfigurations(Map<String, String> configurations) {
+        this.configurations = configurations;
+        return this;
+    }
+
+    public List<String> getExtractors() {
+        return extractors;
+    }
+
+    public Any23DataFormat setExtractors(List<String> extractors) {
+        this.extractors = extractors;
+        return this;
+    }
+
+    public Any23OutputFormat getOutputFormat() {
+        return outputFormat;
+    }
+
+    public Any23DataFormat setOutputFormat(Any23OutputFormat outputFormat) {
+        this.outputFormat = outputFormat;
+        return this;
+    }
+
+    public String getBaseURI() {
+        return baseURI;
+    }
+
+    public Any23DataFormat setBaseURI(String baseURI) {
+        this.baseURI = baseURI;
+        return this;
+    }
 
 }
diff --git a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23OutputFormat.java
b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23OutputFormat.java
index fa643ca..54f8af1 100644
--- a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23OutputFormat.java
+++ b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23OutputFormat.java
@@ -17,5 +17,5 @@
 package org.apache.camel.dataformat.any23;
 
 public enum Any23OutputFormat {
-  NTRIPLES, TURTLE, NQUADS, RDFXML, JSONLD, RDFJSON, RDF4JMODEL
+    NTRIPLES, TURTLE, NQUADS, RDFXML, JSONLD, RDFJSON, RDF4JMODEL
 }
diff --git a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/utils/Any23Utils.java
b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/utils/Any23Utils.java
index 09537d9..cd4e84c 100644
--- a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/utils/Any23Utils.java
+++ b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/utils/Any23Utils.java
@@ -28,36 +28,39 @@ import org.apache.camel.dataformat.any23.Any23OutputFormat;
 import org.apache.camel.dataformat.any23.writer.RDF4JModelWriter;
 import org.eclipse.rdf4j.model.impl.LinkedHashModel;
 
-public class Any23Utils {
+public final class Any23Utils {
+    
+    private Any23Utils() {
+    }
 
-  public static TripleHandler obtainHandler(Any23OutputFormat format, OutputStream outputStream)
{
-    TripleHandler handler;
-    switch (format) {
-      case NTRIPLES:
-        handler = new NTriplesWriter(outputStream);
-        break;
-      case TURTLE:
-        handler = new TurtleWriter(outputStream);
-        break;
-      case NQUADS:
-        handler = new NQuadsWriter(outputStream);
-        break;
-      case RDFXML:
-        handler = new RDFXMLWriter(outputStream);
-        break;
-      case JSONLD:
-        handler = new JSONLDWriter(outputStream);
-        break;
-      case RDFJSON:
-        handler = new JSONWriter(outputStream);
-        break;
-      case RDF4JMODEL:
-        handler = new RDF4JModelWriter(new LinkedHashModel());
-        break;
-      default:
-        throw new AssertionError(format.name());
+    public static TripleHandler obtainHandler(Any23OutputFormat format, OutputStream outputStream)
{
+        TripleHandler handler;
+        switch (format) {
+        case NTRIPLES:
+            handler = new NTriplesWriter(outputStream);
+            break;
+        case TURTLE:
+            handler = new TurtleWriter(outputStream);
+            break;
+        case NQUADS:
+            handler = new NQuadsWriter(outputStream);
+            break;
+        case RDFXML:
+            handler = new RDFXMLWriter(outputStream);
+            break;
+        case JSONLD:
+            handler = new JSONLDWriter(outputStream);
+            break;
+        case RDFJSON:
+            handler = new JSONWriter(outputStream);
+            break;
+        case RDF4JMODEL:
+            handler = new RDF4JModelWriter(new LinkedHashModel());
+            break;
+        default:
+            throw new AssertionError(format.name());
+        }
+        return handler;
     }
-    return handler;
-  }
 
 }
diff --git a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/writer/RDF4JModelWriter.java
b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/writer/RDF4JModelWriter.java
index 5e60f00..3ce5115 100644
--- a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/writer/RDF4JModelWriter.java
+++ b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/writer/RDF4JModelWriter.java
@@ -26,43 +26,43 @@ import org.eclipse.rdf4j.model.Value;
 
 public class RDF4JModelWriter extends TripleWriterHandler implements FormatWriter {
 
-  private Model model;
+    private Model model;
 
-  public RDF4JModelWriter(Model model) {
-    this.model = model;
-  }
+    public RDF4JModelWriter(Model model) {
+        this.model = model;
+    }
 
-  @Override
-  public void close() throws TripleHandlerException {
-    //noop
-  }
+    @Override
+    public void close() throws TripleHandlerException {
+        // noop
+    }
 
-  @Override
-  public void writeTriple(Resource s, IRI p, Value o, Resource g) throws TripleHandlerException
{
-    model.add(s, p, o, g);
-  }
+    @Override
+    public void writeTriple(Resource s, IRI p, Value o, Resource g) throws TripleHandlerException
{
+        model.add(s, p, o, g);
+    }
 
-  @Override
-  public void writeNamespace(String prefix, String uri) throws TripleHandlerException {
-    //noop
-  }
+    @Override
+    public void writeNamespace(String prefix, String uri) throws TripleHandlerException {
+        // noop
+    }
 
-  @Override
-  public boolean isAnnotated() {
-    return false;
-  }
+    @Override
+    public boolean isAnnotated() {
+        return false;
+    }
 
-  @Override
-  public void setAnnotated(boolean f) {
-    //noop
-  }
+    @Override
+    public void setAnnotated(boolean f) {
+        // noop
+    }
 
-  public Model getModel() {
-    return model;
-  }
+    public Model getModel() {
+        return model;
+    }
 
-  public void setModel(Model model) {
-    this.model = model;
-  }
+    public void setModel(Model model) {
+        this.model = model;
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatConfigurationsTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatConfigurationsTest.java
index c18eebc..c884579 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatConfigurationsTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatConfigurationsTest.java
@@ -35,32 +35,32 @@ import org.junit.Test;
 
 public class Any23DataFormatConfigurationsTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      String resultingRDF = in.getBody(String.class);
-      InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
-      Model parse = Rio.parse(toInputStream, BASEURI, RDFFormat.TURTLE);
-      assertEquals(parse.size(), 25);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+        template.sendBody("direct:start", contenhtml);
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            String resultingRDF = in.getBody(String.class);
+            InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
+            Model parse = Rio.parse(toInputStream, baseURI, RDFFormat.TURTLE);
+            assertEquals(parse.size(), 25);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        Map<String, String> conf = new HashMap();
-        conf.put("any23.extraction.metadata.nesting", "off");
-        from("direct:start").unmarshal().any23(BASEURI, Any23Type.TURTLE, conf).to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                Map<String, String> conf = new HashMap();
+                conf.put("any23.extraction.metadata.nesting", "off");
+                from("direct:start").unmarshal().any23(baseURI, Any23Type.TURTLE, conf).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
index 1bfd89b..7d032a7 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatDefaultTest.java
@@ -28,28 +28,28 @@ import org.junit.Test;
 
 public class Any23DataFormatDefaultTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      Model resultingRDF = in.getBody(Model.class);
-      assertEquals(resultingRDF.size(), 28);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+        template.sendBody("direct:start", contenhtml);
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            Model resultingRDF = in.getBody(Model.class);
+            assertEquals(resultingRDF.size(), 28);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        from("direct:start").unmarshal().any23(BASEURI).to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").unmarshal().any23(baseURI).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatExtractorsTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatExtractorsTest.java
index 533c7e1..757e94c 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatExtractorsTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatExtractorsTest.java
@@ -36,34 +36,34 @@ import org.junit.Test;
 
 public class Any23DataFormatExtractorsTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      String resultingRDF = in.getBody(String.class);
-      InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
-      Model parse = Rio.parse(toInputStream, BASEURI, RDFFormat.TURTLE);
-      assertEquals(parse.size(), 1);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+        template.sendBody("direct:start", contenhtml);
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            String resultingRDF = in.getBody(String.class);
+            InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
+            Model parse = Rio.parse(toInputStream, baseURI, RDFFormat.TURTLE);
+            assertEquals(parse.size(), 1);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        Map<String, String> conf = new HashMap();
-        conf.put("any23.extraction.metadata.nesting", "off");
-        List<String> extc = new ArrayList();
-        extc.add("html-head-title");
-        from("direct:start").unmarshal().any23(BASEURI, Any23Type.TURTLE, conf, extc).to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                Map<String, String> conf = new HashMap();
+                conf.put("any23.extraction.metadata.nesting", "off");
+                List<String> extc = new ArrayList();
+                extc.add("html-head-title");
+                from("direct:start").unmarshal().any23(baseURI, Any23Type.TURTLE, conf, extc).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
index 4a39606..dd4ab1f 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatHTTPTest.java
@@ -27,31 +27,27 @@ import org.junit.Test;
 
 public class Any23DataFormatHTTPTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    template.sendBody("direct:start", "bar");
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      Model resultingRDF = in.getBody(Model.class);
-      assertEquals(resultingRDF.size(), 1762);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        template.sendBody("direct:start", "bar");
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            Model resultingRDF = in.getBody(Model.class);
+            assertEquals(resultingRDF.size(), 1762);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        from("direct:start")
-            .to("http://dbpedia.org/page/Ecuador")
-            .unmarshal()
-            .any23(BASEURI)
-            .to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").to("http://dbpedia.org/page/Ecuador").unmarshal().any23(baseURI).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatMarshalTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatMarshalTest.java
index e5c55e1..356bd05 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatMarshalTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatMarshalTest.java
@@ -28,31 +28,31 @@ import org.junit.Test;
 
 public class Any23DataFormatMarshalTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      Model resultingRDF = in.getBody(Model.class);
-      assertEquals(resultingRDF.size(), 28);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+        template.sendBody("direct:start", contenhtml);
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            Model resultingRDF = in.getBody(Model.class);
+            assertEquals(resultingRDF.size(), 28);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        Any23DataFormat df = new Any23DataFormat().setBaseURI(BASEURI).setOutputFormat(Any23OutputFormat.RDF4JMODEL);
-        from("direct:start").unmarshal(df).to("direct:r1");
-        from("direct:r1").marshal(df).to("direct:r2");
-        from("direct:r2").unmarshal(df).to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                Any23DataFormat df = new Any23DataFormat().setBaseURI(baseURI).setOutputFormat(Any23OutputFormat.RDF4JMODEL);
+                from("direct:start").unmarshal(df).to("direct:r1");
+                from("direct:r1").marshal(df).to("direct:r2");
+                from("direct:r2").unmarshal(df).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatModelTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatModelTest.java
index 14ead31..29702c3 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatModelTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatModelTest.java
@@ -29,28 +29,28 @@ import org.junit.Test;
 
 public class Any23DataFormatModelTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      Model resultingRDF = in.getBody(Model.class);
-      assertEquals(resultingRDF.size(), 28);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+        template.sendBody("direct:start", contenhtml);
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            Model resultingRDF = in.getBody(Model.class);
+            assertEquals(resultingRDF.size(), 28);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        from("direct:start").unmarshal().any23(BASEURI, Any23Type.RDF4JMODEL).to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").unmarshal().any23(baseURI, Any23Type.RDF4JMODEL).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatOutputFormatTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatOutputFormatTest.java
index ecdd9b2..a0404e6 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatOutputFormatTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatOutputFormatTest.java
@@ -33,30 +33,30 @@ import org.junit.Test;
 
 public class Any23DataFormatOutputFormatTest extends CamelTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
-    template.sendBody("direct:start", contenhtml);
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      String resultingRDF = in.getBody(String.class);
-      InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
-      Model parse = Rio.parse(toInputStream, BASEURI, RDFFormat.TURTLE);
-      assertEquals(parse.size(), 28);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
+        template.sendBody("direct:start", contenhtml);
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            String resultingRDF = in.getBody(String.class);
+            InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
+            Model parse = Rio.parse(toInputStream, baseURI, RDFFormat.TURTLE);
+            assertEquals(parse.size(), 28);
+        }
     }
-  }
 
-  @Override
-  protected RouteBuilder createRouteBuilder() {
-    return new RouteBuilder() {
-      public void configure() {
-        from("direct:start").unmarshal().any23(BASEURI, Any23Type.TURTLE).to("mock:result");
-      }
-    };
-  }
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").unmarshal().any23(baseURI, Any23Type.TURTLE).to("mock:result");
+            }
+        };
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatSpringTest.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatSpringTest.java
index a164a82..dcd864b 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatSpringTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatSpringTest.java
@@ -26,32 +26,31 @@ import org.apache.commons.io.IOUtils;
 import org.eclipse.rdf4j.model.Model;
 import org.eclipse.rdf4j.rio.RDFFormat;
 import org.eclipse.rdf4j.rio.Rio;
-import static org.junit.Assert.assertEquals;
 import org.junit.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class Any23DataFormatSpringTest extends CamelSpringTestSupport {
 
-  private final String BASEURI = "http://mock.foo/bar";
+    private final String baseURI = "http://mock.foo/bar";
 
-  @Test
-  public void test() throws Exception {
-    MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
-    template.sendBody("direct:start", "bar");
-    List<Exchange> list = resultEndpoint.getReceivedExchanges();
-    for (Exchange exchange : list) {
-      Message in = exchange.getIn();
-      String resultingRDF = in.getBody(String.class);
-      InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
-      Model parse = Rio.parse(toInputStream, BASEURI, RDFFormat.TURTLE);
-      assertEquals(parse.size(), 1);
+    @Test
+    public void test() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        template.sendBody("direct:start", "bar");
+        List<Exchange> list = resultEndpoint.getReceivedExchanges();
+        for (Exchange exchange : list) {
+            Message in = exchange.getIn();
+            String resultingRDF = in.getBody(String.class);
+            InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
+            Model parse = Rio.parse(toInputStream, baseURI, RDFFormat.TURTLE);
+            assertEquals(parse.size(), 1);
+        }
     }
-  }
 
-  @Override
-  protected AbstractApplicationContext createApplicationContext() {
-    return new ClassPathXmlApplicationContext("org/apache/camel/dataformat/any23/spring/SpringAny23DataFormatTest.xml");
-  }
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/dataformat/any23/spring/SpringAny23DataFormatTest.xml");
+    }
 
 }
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java
b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java
index 9f34d74..448a88e 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java
@@ -23,22 +23,22 @@ import org.apache.camel.util.IOHelper;
 
 public final class Any23TestSupport {
 
-  private Any23TestSupport() {
-    // Utility class
-  }
+    private Any23TestSupport() {
+        // Utility class
+    }
 
-  public static String loadFileAsString(File file) throws Exception {
-    StringBuilder fileContent = new StringBuilder();
-    BufferedReader input = IOHelper.buffered(new FileReader(file));
-    try {
-      String line = null;
-      while ((line = input.readLine()) != null) {
-        fileContent.append(line);
-        fileContent.append(System.lineSeparator());
-      }
-    } finally {
-      input.close();
+    public static String loadFileAsString(File file) throws Exception {
+        StringBuilder fileContent = new StringBuilder();
+        BufferedReader input = IOHelper.buffered(new FileReader(file));
+        try {
+            String line = null;
+            while ((line = input.readLine()) != null) {
+                fileContent.append(line);
+                fileContent.append(System.lineSeparator());
+            }
+        } finally {
+            input.close();
+        }
+        return fileContent.toString();
     }
-    return fileContent.toString();
-  }
 }
diff --git a/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/spring/SpringAny23DataFormatTest.xml
b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/spring/SpringAny23DataFormatTest.xml
index 6ef43db..40f9b92 100644
--- a/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/spring/SpringAny23DataFormatTest.xml
+++ b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/spring/SpringAny23DataFormatTest.xml
@@ -1,19 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
+
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
     The ASF licenses this file to You under the Apache License, Version 2.0
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
+
          http://www.apache.org/licenses/LICENSE-2.0
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
--->
 
+-->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="


Mime
View raw message