You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/10/14 10:05:21 UTC

[camel] branch master updated: CAMEL-14032: Move test to where the others are

This is an automated email from the ASF dual-hosted git repository.

davsclaus 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 025ad35  CAMEL-14032: Move test to where the others are
025ad35 is described below

commit 025ad35922d71d453cedbe42610532105a3e2660
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Oct 14 12:04:26 2019 +0200

    CAMEL-14032: Move test to where the others are
---
 .../org/apache/camel/util/EndpointHelperTest.java  | 38 +++++++++++++
 core/camel-support/pom.xml                         |  5 --
 .../apache/camel/support/EndpointHelperTest.java   | 62 ----------------------
 3 files changed, 38 insertions(+), 67 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java b/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
index 0b09df6..1738026 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
@@ -28,6 +28,8 @@ import org.apache.camel.Processor;
 import org.apache.camel.support.EndpointHelper;
 import org.junit.Test;
 
+import static org.hamcrest.CoreMatchers.is;
+
 public class EndpointHelperTest extends ContextTestSupport {
 
     private Endpoint foo;
@@ -140,4 +142,40 @@ public class EndpointHelperTest extends ContextTestSupport {
         assertEquals(123, num.intValue());
     }
 
+    @Test
+    public void matchEndpointsShouldIgnoreQueryParamOrder() {
+        String endpointUri = "sjms:queue:my-queue?transacted=true&consumerCount=1";
+        String endpointUriShuffled = "sjms:queue:my-queue?consumerCount=1&transacted=true";
+        String notMatchingEndpointUri = "sjms:queue:my-queue?consumerCount=1";
+
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, endpointUri), is(true));
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, endpointUriShuffled), is(true));
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUriShuffled, endpointUri), is(true));
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUriShuffled, endpointUriShuffled), is(true));
+        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, endpointUriShuffled), is(false));
+        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, endpointUri), is(false));
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, notMatchingEndpointUri), is(false));
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUriShuffled, notMatchingEndpointUri), is(false));
+    }
+
+    @Test
+    public void matchEndpointsShouldMatchWildcards() {
+        String endpointUri = "sjms:queue:my-queue?transacted=true&consumerCount=1";
+        String notMatchingEndpointUri = "sjms:queue:my-queue";
+        String pattern = "sjms:queue:my-queue?*";
+
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, pattern), is(true));
+        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, pattern), is(false));
+    }
+
+    @Test
+    public void matchEndpointsShouldMatchRegex() {
+        String endpointUri = "sjms:queue:my-queue?transacted=true&consumerCount=1";
+        String notMatchingEndpointUri = "sjms:queue:my-queue?transacted=false&consumerCount=1";
+        String pattern = "sjms://.*transacted=true.*";
+
+        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, pattern), is(true));
+        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, pattern), is(false));
+    }
+
 }
diff --git a/core/camel-support/pom.xml b/core/camel-support/pom.xml
index f15b040..320ab13 100644
--- a/core/camel-support/pom.xml
+++ b/core/camel-support/pom.xml
@@ -69,11 +69,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <profiles>
diff --git a/core/camel-support/src/test/java/org/apache/camel/support/EndpointHelperTest.java b/core/camel-support/src/test/java/org/apache/camel/support/EndpointHelperTest.java
deleted file mode 100644
index 063cd4d..0000000
--- a/core/camel-support/src/test/java/org/apache/camel/support/EndpointHelperTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-package org.apache.camel.support;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class EndpointHelperTest {
-
-    @Test
-    public void matchEndpointsShouldIgnoreQueryParamOrder() {
-        String endpointUri = "sjms:queue:my-queue?transacted=true&consumerCount=1";
-        String endpointUriShuffled = "sjms:queue:my-queue?consumerCount=1&transacted=true";
-        String notMatchingEndpointUri = "sjms:queue:my-queue?consumerCount=1";
-
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, endpointUri), is(true));
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, endpointUriShuffled), is(true));
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUriShuffled, endpointUri), is(true));
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUriShuffled, endpointUriShuffled), is(true));
-        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, endpointUriShuffled), is(false));
-        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, endpointUri), is(false));
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, notMatchingEndpointUri), is(false));
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUriShuffled, notMatchingEndpointUri), is(false));
-    }
-
-    @Test
-    public void matchEndpointsShouldMatchWildcards() {
-        String endpointUri = "sjms:queue:my-queue?transacted=true&consumerCount=1";
-        String notMatchingEndpointUri = "sjms:queue:my-queue";
-        String pattern = "sjms:queue:my-queue?*";
-
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, pattern), is(true));
-        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, pattern), is(false));
-    }
-
-    @Test
-    public void matchEndpointsShouldMatchRegex() {
-        String endpointUri = "sjms:queue:my-queue?transacted=true&consumerCount=1";
-        String notMatchingEndpointUri = "sjms:queue:my-queue?transacted=false&consumerCount=1";
-        String pattern = "sjms://.*transacted=true.*";
-
-        assertThat(EndpointHelper.matchEndpoint(null, endpointUri, pattern), is(true));
-        assertThat(EndpointHelper.matchEndpoint(null, notMatchingEndpointUri, pattern), is(false));
-    }
-
-}