Polished camel-undertow
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b5e94e21 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b5e94e21 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b5e94e21 Branch: refs/heads/master Commit: b5e94e218b68502b121a43166dd2e4fa9faad41b Parents: 100b2f4 Author: Claus Ibsen <[email protected]> Authored: Wed Jul 15 11:27:57 2015 +0200 Committer: Claus Ibsen <[email protected]> Committed: Wed Jul 15 11:27:57 2015 +0200 ---------------------------------------------------------------------- components/camel-undertow/pom.xml | 111 +++++++++---------- .../undertow/DefaultUndertowHttpBinding.java | 8 -- .../component/undertow/ExchangeHeaders.java | 2 - .../component/undertow/UndertowComponent.java | 16 +-- .../component/undertow/UndertowConsumer.java | 4 - .../component/undertow/UndertowEndpoint.java | 9 +- .../component/undertow/UndertowHttpBinding.java | 2 - .../component/undertow/UndertowProducer.java | 13 +-- .../component/undertow/UndertowRegistry.java | 9 +- .../camel/component/undertow/UndertowUtils.java | 2 - .../undertow/handlers/HttpCamelHandler.java | 3 - .../undertow/handlers/NotFoundHandler.java | 2 - .../org/apache/camel/component/undertow | 17 +++ .../undertow/UndertowComponentTest.java | 1 - .../undertow/UndertowError500Test.java | 3 - .../component/undertow/UndertowHeaderTest.java | 3 - .../undertow/UndertowHttpProducerTest.java | 3 - .../undertow/UndertowHttpsSpringTest.java | 6 - .../undertow/UndertowMethodRestricTest.java | 4 - .../undertow/UndertowPrefixMatchingTest.java | 5 - .../undertow/UndertowProducerTest.java | 4 - .../undertow/UndertowSharedPortTest.java | 3 - .../src/test/resources/SpringTest.xml | 31 +++--- parent/pom.xml | 1 + 24 files changed, 94 insertions(+), 168 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-undertow/pom.xml b/components/camel-undertow/pom.xml index bb4b69a..c752052 100644 --- a/components/camel-undertow/pom.xml +++ b/components/camel-undertow/pom.xml @@ -1,70 +1,67 @@ <?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. - --> +<!-- + 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. +--> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.apache.camel</groupId> - <artifactId>components</artifactId> - <version>2.16-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components</artifactId> + <version>2.16-SNAPSHOT</version> + </parent> - <artifactId>camel-undertow</artifactId> - <packaging>bundle</packaging> - <name>Camel :: Undertow</name> + <modelVersion>4.0.0</modelVersion> - <properties> - <camel.osgi.export.pkg>org.apache.camel.component.undertow.*</camel.osgi.export.pkg> - <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=undertow</camel.osgi.export.service> - <undertow-version>1.2.8.Final</undertow-version> - </properties> + <artifactId>camel-undertow</artifactId> + <packaging>bundle</packaging> + <name>Camel :: Undertow</name> - <dependencies> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-http</artifactId> - </dependency> - <dependency> - <groupId>io.undertow</groupId> - <artifactId>undertow-core</artifactId> - <version>${undertow-version}</version> - </dependency> + <properties> + <camel.osgi.export.pkg>org.apache.camel.component.undertow.*</camel.osgi.export.pkg> + <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=undertow</camel.osgi.export.service> + </properties> - <!-- testing --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-spring</artifactId> - <scope>test</scope> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-http</artifactId> + </dependency> + <dependency> + <groupId>io.undertow</groupId> + <artifactId>undertow-core</artifactId> + <version>${undertow-version}</version> + </dependency> + <!-- testing --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-test-spring</artifactId> + <scope>test</scope> + </dependency> + </dependencies> </project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHttpBinding.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHttpBinding.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHttpBinding.java index 6ef3ba0..1be1700 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHttpBinding.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHttpBinding.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.io.IOException; @@ -50,7 +49,6 @@ import org.xnio.Pooled; /** * DefaultUndertowHttpBinding represent binding used by default, if user doesn't provide any. * By default {@link HttpHeaderFilterStrategy} is also used. - * */ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { @@ -103,7 +101,6 @@ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { result.setBody(readResponseBody(clientExchange)); return result; - } @Override @@ -177,7 +174,6 @@ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { } } } - } @Override @@ -215,7 +211,6 @@ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { } } } - } @Override @@ -269,7 +264,6 @@ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { } return message.getBody(); - } @Override @@ -317,7 +311,6 @@ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { } } - return body; } @@ -355,5 +348,4 @@ public class DefaultUndertowHttpBinding implements UndertowHttpBinding { return bytes; } - } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/ExchangeHeaders.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/ExchangeHeaders.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/ExchangeHeaders.java index 54f9d96..bbe1590 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/ExchangeHeaders.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/ExchangeHeaders.java @@ -14,14 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import io.undertow.util.HttpString; /** * Copy of {@link org.apache.camel.Exchange} headers fields, to return them as {@link HttpString} for Undertow - * */ public final class ExchangeHeaders { http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java index 91bd8a8..a458835 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowComponent.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.net.URI; @@ -48,7 +47,6 @@ import org.slf4j.LoggerFactory; /** * Represents the component that manages {@link UndertowEndpoint}. - * */ public class UndertowComponent extends HttpComponent implements RestConsumerFactory { private static final Logger LOG = LoggerFactory.getLogger(UndertowEndpoint.class); @@ -68,10 +66,8 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class); Boolean throwExceptionOnFailure = getAndRemoveParameter(parameters, "throwExceptionOnFailure", Boolean.class); Boolean transferException = getAndRemoveParameter(parameters, "transferException", Boolean.class); - String httpMethodRestrict = getAndRemoveParameter(parameters, "httpMethodRestrict", String.class); - System.out.println("Remaining: " + remaining); String address = remaining; URI httpUri = new URI(UnsafeUriCharactersEncoder.encodeHttpURI(address)); URI endpointUri = URISupport.createRemainingURI(httpUri, parameters); @@ -158,9 +154,7 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact setProperties(endpoint, parameters); Consumer consumer = endpoint.createConsumer(processor); - return consumer; - } @Override @@ -192,7 +186,7 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact path.addExactPath(httpUri.getPath(), new HttpCamelHandler(consumer)); } - LOG.debug("::Rebuild for path: {}", httpUri.getPath()); + LOG.debug("Rebuild for path: {}", httpUri.getPath()); } result = result.setHandler(path); return result.build(); @@ -241,8 +235,6 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact /** * To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used. - * - * @param httpClientConfigurer */ @Override public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer) { @@ -251,8 +243,6 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact /** * To use a custom HttpConnectionManager to manage connections - * - * @param httpConnectionManager */ @Override public void setHttpConnectionManager(HttpConnectionManager httpConnectionManager) { @@ -261,8 +251,6 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact /** * To use a custom HttpBinding to control the mapping between Camel message and HttpClient. - * - * @param httpBinding */ @Override public void setHttpBinding(HttpBinding httpBinding) { @@ -271,8 +259,6 @@ public class UndertowComponent extends HttpComponent implements RestConsumerFact /** * To use the shared HttpConfiguration as base configuration. - * - * @param httpConfiguration */ @Override public void setHttpConfiguration(HttpConfiguration httpConfiguration) { http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java index 52c0cbf..9f3e4cc 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.Processor; @@ -24,7 +23,6 @@ import org.slf4j.LoggerFactory; /** * The Undertow consumer. - * */ public class UndertowConsumer extends DefaultConsumer { @@ -32,7 +30,6 @@ public class UndertowConsumer extends DefaultConsumer { public UndertowConsumer(UndertowEndpoint endpoint, Processor processor) { super(endpoint, processor); - } @Override @@ -54,5 +51,4 @@ public class UndertowConsumer extends DefaultConsumer { getEndpoint().getComponent().unregisterConsumer(this); } - } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java index 064f18c..6bca957 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowEndpoint.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.net.URI; @@ -39,7 +38,6 @@ import org.slf4j.LoggerFactory; /** * Represents an Undertow endpoint. - * */ @UriEndpoint(scheme = "undertow", title = "Undertow", syntax = "undertow:host:port/path", consumerClass = UndertowConsumer.class, label = "http") @@ -105,7 +103,6 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr /** * Set full HTTP URI - * @param httpURI */ public void setHttpURI(URI httpURI) { this.httpURI = httpURI; @@ -118,7 +115,6 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr /** * Configure set of allowed HTTP request method - * @param httpMethodRestrict */ public void setHttpMethodRestrict(String httpMethodRestrict) { this.httpMethodRestrict = httpMethodRestrict; @@ -130,7 +126,6 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr /** * Set if URI should be matched on prefix - * @param matchOnUriPrefix */ public void setMatchOnUriPrefix(Boolean matchOnUriPrefix) { this.matchOnUriPrefix = matchOnUriPrefix; @@ -159,7 +154,6 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr /** * Configure if exception should be thrown on failure - * @param throwExceptionOnFailure */ public void setThrowExceptionOnFailure(Boolean throwExceptionOnFailure) { this.throwExceptionOnFailure = throwExceptionOnFailure; @@ -170,8 +164,7 @@ public class UndertowEndpoint extends DefaultEndpoint implements HeaderFilterStr } /** - * Configure if expcetion should be transfered to client - * @param transferException + * Configure if exception should be transferred to client */ public void setTransferException(Boolean transferException) { this.transferException = transferException; http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHttpBinding.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHttpBinding.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHttpBinding.java index b9aad5b..736ea0b 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHttpBinding.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHttpBinding.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.util.Map; @@ -29,7 +28,6 @@ import org.apache.camel.spi.HeaderFilterStrategy; /** * Interface to define custom binding for the component - * */ public interface UndertowHttpBinding { http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java index 4136824..23e21a3 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.io.IOException; @@ -47,7 +46,6 @@ import org.xnio.XnioWorker; * The implementation of Producer is considered as experimental. The Undertow client classes are not thread safe, * their purpose is for the reverse proxy usage inside Undertow itself. This may change in the future versions and * general purpose HTTP client wrapper will be added. Therefore this Producer may be changed too. - * */ public class UndertowProducer extends DefaultProducer { private static final Logger LOG = LoggerFactory.getLogger(UndertowProducer.class); @@ -67,10 +65,10 @@ public class UndertowProducer extends DefaultProducer { this.endpoint = endpoint; } + // TODO: use async routing engine + @Override public void process(Exchange exchange) throws Exception { - LOG.info("Producer endpoint uri " + endpoint.getHttpURI()); - final UndertowClient client = UndertowClient.getInstance(); XnioWorker worker = Xnio.getInstance().createWorker(OptionMap.EMPTY); IoFuture<ClientConnection> connect = client.connect(endpoint.getHttpURI(), worker, new ByteBufferSlicePool(BufferAllocator.DIRECT_BYTE_BUFFER_ALLOCATOR, 8192, 8192 * 8192), OptionMap.EMPTY); @@ -80,7 +78,6 @@ public class UndertowProducer extends DefaultProducer { Object body = getRequestBody(request, exchange); - TypeConverter tc = endpoint.getCamelContext().getTypeConverter(); ByteBuffer bodyAsByte = tc.convertTo(ByteBuffer.class, body); @@ -89,7 +86,6 @@ public class UndertowProducer extends DefaultProducer { } connect.get().sendRequest(request, new UndertowProducerCallback(bodyAsByte, exchange)); - } private Object getRequestBody(ClientRequest request, Exchange camelExchange) { @@ -133,7 +129,6 @@ public class UndertowProducer extends DefaultProducer { @Override public void failed(IOException e) { camelExchange.setException(e); - } }); try { @@ -142,18 +137,14 @@ public class UndertowProducer extends DefaultProducer { clientExchange.getRequestChannel().write(body); } } catch (IOException e) { - LOG.error("Failed with: " + e.getMessage()); camelExchange.setException(e); } - } @Override public void failed(IOException e) { - LOG.error("Failed with: " + e.getMessage()); camelExchange.setException(e); } } - } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowRegistry.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowRegistry.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowRegistry.java index f05adc3..195946a 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowRegistry.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowRegistry.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.net.URI; @@ -23,14 +22,12 @@ import java.util.Map; import javax.net.ssl.SSLContext; import io.undertow.Undertow; -import org.apache.camel.RuntimeCamelException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * This class is used to hold Undertow instances during runtime. * One of the benefits is reuse of same TCP port for more endpoints. - * */ public class UndertowRegistry { @@ -61,14 +58,14 @@ public class UndertowRegistry { public void registerConsumer(UndertowConsumer consumer) { URI httpUri = consumer.getEndpoint().getHttpURI(); if (host != null && !host.equals(httpUri.getHost())) { - throw new RuntimeCamelException("Can't register UndertowConsumer on different host and same port: {}" + host + " " + httpUri.getHost()); + throw new IllegalArgumentException("Cannot register UndertowConsumer on different host and same port: {}" + host + " " + httpUri.getHost()); } else { host = httpUri.getHost(); } LOG.info("Adding consumer to consumerRegistry: {}", httpUri); consumersRegistry.put(httpUri, consumer); if (sslContext != null && consumer.getEndpoint().getSslContext() != null) { - throw new RuntimeCamelException("Can't register UndertowConsumer with different SSL config"); + throw new IllegalArgumentException("Cannot register UndertowConsumer with different SSL config"); } } @@ -78,7 +75,7 @@ public class UndertowRegistry { if (consumersRegistry.containsKey(httpUri)) { consumersRegistry.remove(httpUri); } else { - throw new RuntimeCamelException("This consumer is not registered"); + LOG.debug("Cannot unregister consumer {} as it was not registered", consumer); } } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowUtils.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowUtils.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowUtils.java index 188de3b..43f2631 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowUtils.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowUtils.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.util.ArrayList; @@ -23,7 +22,6 @@ import java.util.Map; /** * Util class for useful methods used all over the component - * */ public final class UndertowUtils { http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/HttpCamelHandler.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/HttpCamelHandler.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/HttpCamelHandler.java index 3900dd3..0229b78 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/HttpCamelHandler.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/HttpCamelHandler.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow.handlers; import java.nio.ByteBuffer; @@ -38,7 +37,6 @@ import org.slf4j.LoggerFactory; * to be used in the Camel route. * * This class can be considered part of UndertowConsumer implementation. - * */ public class HttpCamelHandler implements HttpHandler { private static final Logger LOG = LoggerFactory.getLogger(UndertowConsumer.class); @@ -128,5 +126,4 @@ public class HttpCamelHandler implements HttpHandler { return result; } - } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/NotFoundHandler.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/NotFoundHandler.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/NotFoundHandler.java index 932380c..d50c43e 100644 --- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/NotFoundHandler.java +++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/handlers/NotFoundHandler.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow.handlers; import io.undertow.server.HttpHandler; @@ -23,7 +22,6 @@ import io.undertow.util.Headers; /** * Custom handler to inform client that no matching path was found - * */ public class NotFoundHandler implements HttpHandler { http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/component/undertow ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/component/undertow b/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/component/undertow index 7aab4fd..6af2fbc 100644 --- a/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/component/undertow +++ b/components/camel-undertow/src/main/resources/META-INF/services/org/apache/camel/component/undertow @@ -1 +1,18 @@ +# +# 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. +# + class=org.apache.camel.component.undertow.UndertowComponent http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java index 5e31166..c2a7a5c 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowComponentTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.Exchange; http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java index 19c022e..93fc3ba 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowError500Test.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.CamelExecutionException; @@ -23,8 +22,6 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; -/** - */ public class UndertowError500Test extends CamelTestSupport { @Test http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java index be3a4ae..5ba092e 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHeaderTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.Exchange; @@ -22,8 +21,6 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; -/** - */ public class UndertowHeaderTest extends CamelTestSupport { @Test http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java index 8022a17..f9c4f3b 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpProducerTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.Exchange; @@ -22,8 +21,6 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; -/** - */ public class UndertowHttpProducerTest extends CamelTestSupport { @Test http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java index c6ee53a..f7375b6 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowHttpsSpringTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import java.net.URL; @@ -32,21 +31,16 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import static org.junit.Assert.assertEquals; -/** - */ - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"/SpringTest.xml"}) public class UndertowHttpsSpringTest { - @Produce private ProducerTemplate template; @EndpointInject(uri = "mock:input") private MockEndpoint mockEndpoint; - @BeforeClass public static void setUpJaas() throws Exception { URL trustStoreUrl = UndertowHttpsSpringTest.class.getClassLoader().getResource("ssl/keystore.jks"); http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java index e224a48..d2b9105 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowMethodRestricTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.Exchange; @@ -28,11 +27,8 @@ import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.StringRequestEntity; import org.junit.Test; -/** - */ public class UndertowMethodRestricTest extends CamelTestSupport { - private String url = "http://localhost:8888/methodRestrict"; @Test http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java index fcfe8f7..6c62967 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.CamelExecutionException; @@ -26,8 +25,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - */ public class UndertowPrefixMatchingTest extends CamelTestSupport { private static final Logger LOG = LoggerFactory.getLogger(UndertowComponentTest.class); @@ -67,8 +64,6 @@ public class UndertowPrefixMatchingTest extends CamelTestSupport { from("undertow:http://localhost:8888/bar") .transform(bodyAs(String.class).append(" Matching prefix")) .to("mock:bar"); - - } }; } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java index e717937..daf75ce 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowProducerTest.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; import org.apache.camel.Exchange; @@ -23,9 +22,6 @@ import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Ignore; import org.junit.Test; -/** - */ - public class UndertowProducerTest extends CamelTestSupport { @Ignore http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java index a68dd3f..24b4d7f 100644 --- a/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java +++ b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowSharedPortTest.java @@ -14,10 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.undertow; -/** - */ public class UndertowSharedPortTest { } http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/components/camel-undertow/src/test/resources/SpringTest.xml ---------------------------------------------------------------------- diff --git a/components/camel-undertow/src/test/resources/SpringTest.xml b/components/camel-undertow/src/test/resources/SpringTest.xml index 62e0ead..fa7459a 100644 --- a/components/camel-undertow/src/test/resources/SpringTest.xml +++ b/components/camel-undertow/src/test/resources/SpringTest.xml @@ -1,21 +1,20 @@ <?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 -<!--~ - ~ 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. - --> + 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xmlns="http://www.springframework.org/schema/beans" http://git-wip-us.apache.org/repos/asf/camel/blob/b5e94e21/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index 098e1c0..1b78bbcce 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -484,6 +484,7 @@ <testng-version>6.8.21</testng-version> <twitter4j-bundle-version>4.0.4_1</twitter4j-bundle-version> <twitter4j-version>4.0.4</twitter4j-version> + <undertow-version>1.2.8.Final</undertow-version> <univocity-parsers-version>1.2.1</univocity-parsers-version> <unix-socket-factory-version>2015-01-27T15-02-14</unix-socket-factory-version> <unix-socket-factory-bundle-version>1.0.0</unix-socket-factory-bundle-version>
