knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [22/25] knox git commit: KNOX-998 - Some more refactoring
Date Thu, 02 Nov 2017 18:48:26 GMT
http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java b/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java
index 25ad1c3..c9f262b 100644
--- a/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java
@@ -46,8 +46,8 @@ import org.apache.knox.gateway.topology.Provider;
 import org.apache.knox.gateway.topology.Service;
 import org.apache.knox.gateway.topology.Topology;
 import org.apache.knox.gateway.util.XmlUtils;
-import org.apache.hadoop.test.TestUtils;
-import org.apache.hadoop.test.log.NoOpAppender;
+import org.apache.knox.test.TestUtils;
+import org.apache.knox.test.log.NoOpAppender;
 import org.apache.log4j.Appender;
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.ArchivePath;
@@ -58,8 +58,8 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.xml.sax.SAXException;
 
-import static org.apache.hadoop.test.TestUtils.LOG_ENTER;
-import static org.apache.hadoop.test.TestUtils.LOG_EXIT;
+import static org.apache.knox.test.TestUtils.LOG_ENTER;
+import static org.apache.knox.test.TestUtils.LOG_EXIT;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.hamcrest.CoreMatchers.nullValue;

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditLayoutTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditLayoutTest.java b/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditLayoutTest.java
index 8ff183e..6400f1b 100644
--- a/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditLayoutTest.java
+++ b/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditLayoutTest.java
@@ -26,7 +26,7 @@ import org.apache.knox.gateway.audit.api.CorrelationService;
 import org.apache.knox.gateway.audit.api.CorrelationServiceFactory;
 import org.apache.knox.gateway.audit.log4j.audit.AuditConstants;
 import org.apache.knox.gateway.audit.log4j.layout.AuditLayout;
-import org.apache.hadoop.test.log.CollectAppender;
+import org.apache.knox.test.log.CollectAppender;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.PropertyConfigurator;
 import org.apache.log4j.spi.LoggingEvent;

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditServiceTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditServiceTest.java b/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditServiceTest.java
index 7c05a2a..7b08e83 100644
--- a/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditServiceTest.java
+++ b/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/AuditServiceTest.java
@@ -27,7 +27,7 @@ import org.apache.knox.gateway.audit.api.CorrelationServiceFactory;
 import org.apache.knox.gateway.audit.log4j.audit.AuditConstants;
 import org.apache.knox.gateway.audit.log4j.audit.Log4jAuditService;
 import org.apache.knox.gateway.audit.log4j.correlation.Log4jCorrelationService;
-import org.apache.hadoop.test.log.CollectAppender;
+import org.apache.knox.test.log.CollectAppender;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.PropertyConfigurator;
 import org.apache.log4j.spi.LoggingEvent;

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/StoreAndForwardAppenderTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/StoreAndForwardAppenderTest.java b/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/StoreAndForwardAppenderTest.java
index 808acb7..becad46 100644
--- a/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/StoreAndForwardAppenderTest.java
+++ b/gateway-util-common/src/test/java/org/apache/knox/gateway/audit/StoreAndForwardAppenderTest.java
@@ -17,7 +17,7 @@
  */
 package org.apache.knox.gateway.audit;
 
-import org.apache.hadoop.test.log.CollectAppender;
+import org.apache.knox.test.log.CollectAppender;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.log4j.PropertyConfigurator;

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-common/src/test/resources/audit-log4j.properties
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/test/resources/audit-log4j.properties b/gateway-util-common/src/test/resources/audit-log4j.properties
index ccc92f5..c4d4fd1 100644
--- a/gateway-util-common/src/test/resources/audit-log4j.properties
+++ b/gateway-util-common/src/test/resources/audit-log4j.properties
@@ -22,4 +22,4 @@ log4j.logger.audit.forward = INFO, audit-forward
 log4j.appender.audit-store = org.apache.knox.gateway.audit.log4j.appender.JdbmStoreAndForwardAppender
 log4j.appender.audit-store.file = target/audit
 
-log4j.appender.audit-forward = org.apache.hadoop.test.log.CollectAppender
\ No newline at end of file
+log4j.appender.audit-forward = org.apache.knox.test.log.CollectAppender
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
index acf7cf6..60f6bbd 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
@@ -17,8 +17,8 @@
  */
 package org.apache.knox.gateway.util.urltemplate;
 
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
+import org.apache.knox.test.category.FastTests;
+import org.apache.knox.test.category.UnitTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
index df31d3d..e75c89b 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
@@ -18,8 +18,8 @@
 package org.apache.knox.gateway.util.urltemplate;
 
 
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
+import org.apache.knox.test.category.FastTests;
+import org.apache.knox.test.category.UnitTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig
deleted file mode 100644
index 4e1a9c8..0000000
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java.orig
+++ /dev/null
@@ -1,839 +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.knox.gateway.util.urltemplate;
-
-
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.net.URISyntaxException;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.hamcrest.CoreMatchers.sameInstance;
-import static org.hamcrest.core.IsCollectionContaining.hasItem;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-
-//TODO: Test to make sure that extra unmatched query parameters prevent a match.
-@Category( { UnitTests.class, FastTests.class } )
-public class MatcherTest {
-
-  private void addTemplate( Matcher<String> matcher, String template ) throws URISyntaxException {
-    matcher.add( Parser.parse( template ), template );
-  }
-
-  private void assertValidMatch( Matcher<String> matcher, String uri, String template ) throws URISyntaxException {
-    if( template == null ) {
-      assertThat( matcher.match( Parser.parse( uri ) ), nullValue() );
-    } else {
-      Template uriTemplate = Parser.parse( uri );
-      Matcher<String>.Match match = matcher.match( uriTemplate );
-      assertThat( "Expected to find a match.", match, notNullValue() );
-      assertThat( match.getValue(), equalTo( template ) );
-    }
-  }
-
-  @Test
-  public void testWildcardCharacterInInputTemplate() throws URISyntaxException {
-    Matcher<String> matcher;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    // First verify that if .../test_table/test_row/family1... works.
-    matcher = new Matcher<String>();
-    inputTemplate = Parser.parse( "https://localhost:8443/gateway/sandbox/hbase/test_table/test_row/family1:row2_col1,family2/0,9223372036854775807?v=1" );
-    patternTemplate = Parser.parse( "*://*:*/**/webhdfs/{version}/{path=**}?{**}" );
-    matcher.add( patternTemplate, "webhdfs" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-
-    // Then reproduce the issue with .../test_table/*/family1..
-    matcher = new Matcher<String>();
-    inputTemplate = Parser.parse( "https://localhost:8443/gateway/sandbox/hbase/test_table/*/family1:row2_col1,family2/0,9223372036854775807?v=1" );
-    patternTemplate = Parser.parse( "*://*:*/**/webhdfs/{version}/{path=**}?{**}" );
-    matcher.add( patternTemplate, "webhdfs" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-
-    // Reproduce the issue where the wrong match was picked when there was a "*" in the input URL template.
-    matcher = new Matcher<String>();
-    inputTemplate = Parser.parse( "https://localhost:8443/gateway/sandbox/hbase/test_table/*/family1:row2_col1,family2/0,9223372036854775807?v=1" );
-    patternTemplate = Parser.parse( "*://*:*/**/webhdfs/{version}/{path=**}?{**}" );
-    matcher.add( patternTemplate, "webhdfs" );
-    patternTemplate = Parser.parse( "*://*:*/**/hbase/{path=**}?{**}" );
-    matcher.add( patternTemplate, "hbase" );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getValue(), is( "hbase" ) );
-  }
-  
-  @Test
-  public void testDefaultAppDeployment() throws Exception {
-    Matcher<String> matcher;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    matcher = new Matcher<String>();
-    inputTemplate = Parser.parse( "https://localhost:8443/webhdfs/v1/tmp?op=LISTSTATUS" );
-    patternTemplate = Parser.parse( "*://*:*/webhdfs/{version}/{path=**}?{**}" );
-    matcher.add( patternTemplate, "webhdfs" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-  }
-
-  @Test
-  public void testRootPathMatching() throws Exception {
-    Matcher<String> matcher;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    ///////
-    patternTemplate = Parser.parse( "*://*:*" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-match" );
-
-    inputTemplate = Parser.parse( "test-scheme://test-host:42" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/test-path" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-
-    ///////
-    patternTemplate = Parser.parse( "*://*:*/" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-match" );
-
-    inputTemplate = Parser.parse( "test-scheme://test-host:42" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/test-path" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-
-    ///////
-    patternTemplate = Parser.parse( "*://*:*/*" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-match" );
-
-    inputTemplate = Parser.parse( "test-scheme://test-host:42" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/test-path" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-
-    ///////
-    patternTemplate = Parser.parse( "*://*:*/**" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-match" );
-
-//KM: I'm not sure what the correct behavior is here.
-//    inputTemplate = Parser.parse( "test-scheme://test-host:42" );
-//    match = matcher.match( inputTemplate );
-//    assertThat( match, ? );
-//    inputTemplate = Parser.parse( "test-scheme://test-host:42/" );
-//    match = matcher.match( inputTemplate );
-//    assertThat( match, ? );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/test-path" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-
-    ///////
-    patternTemplate = Parser.parse( "*://*:*/{path=*}" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-match" );
-
-    inputTemplate = Parser.parse( "test-scheme://test-host:42" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/test-path" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-
-    ///////
-    patternTemplate = Parser.parse( "*://*:*/{path=**}" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-match" );
-
-//KM: I'm not sure what the correct behavior is here.
-//    inputTemplate = Parser.parse( "test-scheme://test-host:42" );
-//    match = matcher.match( inputTemplate );
-//    assertThat( match, ? );
-//    inputTemplate = Parser.parse( "test-scheme://test-host:42/" );
-//    match = matcher.match( inputTemplate );
-//    assertThat( match, ? );
-    inputTemplate = Parser.parse( "test-scheme://test-host:42/test-path" );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-  }
-
-  @Test
-  public void testTopLevelPathGlobMatch() throws Exception {
-    Matcher<String> matcher;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    patternTemplate = Parser.parse( "{*}://{host}:{*}/{**=**}?{**}" );
-    inputTemplate = Parser.parse( "test-scheme://test-input-host:42/test-path/test-file?test-name=test-value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-math" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because the path ** should include both test-path and test-file", match, notNullValue() );
-
-    patternTemplate = Parser.parse( "{*}://{host}:{*}/{**}?{**}" );
-    inputTemplate = Parser.parse( "test-scheme://test-input-host:42/test-path/test-file?test-name=test-value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "test-math" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because the path ** should include both test-path and test-file", match, notNullValue() );
-  }
-
-  @Test
-  public void testQueryHandling() throws Exception {
-    Matcher<String> matcher;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    patternTemplate = Parser.parse( "/path?{query}" );
-    inputTemplate = Parser.parse( "/path" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should not match because input does not contain the required query.", match, nullValue() );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/path?{query}" ), "T1" );
-    matcher.add( Parser.parse( "/path" ), "T2" );
-    inputTemplate = Parser.parse( "/path" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because there is an entry in the matcher without a query.", match, notNullValue() );
-    assertThat( match.getValue(), equalTo( "T2") );
-
-    patternTemplate = Parser.parse( "/path?{query}" );
-    inputTemplate = Parser.parse( "/path?query=value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because input does contain the required query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value" ) );
-    assertThat( match.getParams().resolve( "query" ).size(), equalTo( 1 ) );
-
-    patternTemplate = Parser.parse( "/path?{*}" );
-    inputTemplate = Parser.parse( "/path" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should not match because input does not contain the required query.", match, nullValue() );
-
-    patternTemplate = Parser.parse( "/path?*" );
-    inputTemplate = Parser.parse( "/path" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should not match because input does not contain the required query.", match, nullValue() );
-
-    patternTemplate = Parser.parse( "/path?*" );
-    inputTemplate = Parser.parse( "/path?query=value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat(
-        "Should match because the template has an extra query and the input has a query.",
-        match, notNullValue() );
-    assertThat(
-        "Should not have extracts any parameters since pattern template didn't contain {}",
-        match.getParams().resolve( "query" ), nullValue() );
-
-    patternTemplate = Parser.parse( "/path?{*}" );
-    inputTemplate = Parser.parse( "/path?query=value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because input does contain the required query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value" ) );
-
-    patternTemplate = Parser.parse( "/path?{**}" );
-    inputTemplate = Parser.parse( "/path" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because the template has an optional query.", match, notNullValue() );
-
-    patternTemplate = Parser.parse( "/path?**" );
-    inputTemplate = Parser.parse( "/path" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because the template has an optional extra query.", match, notNullValue() );
-
-    patternTemplate = Parser.parse( "/path?**" );
-    inputTemplate = Parser.parse( "/path?query=value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because the template has an optional extra query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), nullValue() );
-
-    patternTemplate = Parser.parse( "/path?{**}" );
-    inputTemplate = Parser.parse( "/path?query=value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because the template has an optional extra query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value" ) );
-    assertThat( match.getParams().resolve( "query" ).size(), equalTo( 1 ) );
-
-    patternTemplate = Parser.parse( "/path?{query}&{*}" );
-    inputTemplate = Parser.parse( "/path?query=value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should not match because input does not contain the required extra query.", match, nullValue() );
-
-    patternTemplate = Parser.parse( "/path?{query}&{*}" );
-    inputTemplate = Parser.parse( "/path?query=value&extra=extra-value" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because input does contain the required query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value" ) );
-    assertThat( match.getParams().resolve( "query" ).size(), equalTo( 1 ) );
-
-    patternTemplate = Parser.parse( "/path?{query=**}" );
-    inputTemplate = Parser.parse( "/path?query=value1&query=value2" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because input does contain the required query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value1" ) );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value2" ) );
-    assertThat( match.getParams().resolve( "query" ).size(), equalTo( 2 ) );
-
-    patternTemplate = Parser.parse( "/path?{query}" );
-    inputTemplate = Parser.parse( "/path?query=value1&query=value2" );
-    matcher = new Matcher<String>();
-    matcher.add( patternTemplate, "T" );
-    match = matcher.match( inputTemplate );
-    assertThat( "Should match because input does contain the required query.", match, notNullValue() );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value1" ) );
-    assertThat( match.getParams().resolve( "query" ), hasItem( "value2" ) );
-    assertThat( match.getParams().resolve( "query" ).size(), equalTo( 2 ) );
-  }
-
-  @Test
-  public void testMatchCompleteUrl() throws Exception {
-    Matcher<String> matcher;
-    String pattern, input;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    matcher = new Matcher<String>();
-    pattern = "foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-    matcher = new Matcher<String>();
-    pattern = "foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-
-    input = pattern;
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match, notNullValue() );
-
-    input = "not://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match, nullValue() );
-  }
-
-  @Test
-  public void testMatch() throws Exception {
-    Matcher<String> matcher;
-    String pattern, input;
-    Template patternTemplate, inputTemplate;
-    Matcher<String>.Match match;
-
-    matcher = new Matcher<String>();
-    pattern = "path";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    assertThat( matcher.get( patternTemplate ), is( pattern ) );
-    input = "path";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-
-    matcher = new Matcher<String>();
-    pattern = "/path";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "/path";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-    matcher = new Matcher<String>();
-    pattern = "path/path";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "path/path";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-    matcher = new Matcher<String>();
-    pattern = "*/path";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "pathA/path";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-    matcher = new Matcher<String>();
-    pattern = "**/path";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "pathA/pathB/path";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-    matcher = new Matcher<String>();
-    pattern = "path-1/{path=**}/path-4";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "path-1/path-2/path-3/path-4";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-    assertThat( match.getParams().resolve( "path" ).get( 0 ), equalTo( "path-2" ) );
-    assertThat( match.getParams().resolve( "path" ).get( 1 ), equalTo( "path-3" ) );
-
-    matcher = new Matcher<String>();
-    pattern = "/";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "/";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-
-    matcher = new Matcher<String>();
-    pattern = "";
-    patternTemplate = Parser.parse( pattern );
-    matcher.add( patternTemplate, pattern );
-    input = "";
-    inputTemplate = Parser.parse( input );
-    match = matcher.match( inputTemplate );
-    assertThat( match.getTemplate(), sameInstance( patternTemplate ) );
-    assertThat( match.getValue(), equalTo( pattern ) );
-  }
-
-  @Test
-  public void testVariousPatterns() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs" ), "/webhdfs" );
-    matcher.add( Parser.parse( "/webhdfs/dfshealth.jsp" ), "/webhdfs/dfshealth.jsp" );
-    matcher.add( Parser.parse( "/webhdfs/*.jsp" ), "/webhdfs/*.jsp" );
-    matcher.add( Parser.parse( "/webhdfs/other.jsp" ), "/webhdfs/other.jsp" );
-    matcher.add( Parser.parse( "/webhdfs/*" ), "/webhdfs/*" );
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    matcher.add( Parser.parse( "/webhdfs/v1/**" ), "/webhdfs/v1/**" );
-    matcher.add( Parser.parse( "/webhdfs/**/middle/*.xml" ), "/webhdfs/**/middle/*.xml" );
-
-    assertValidMatch( matcher, "/webhdfs", "/webhdfs" );
-    assertValidMatch( matcher, "/webhdfs/dfshealth.jsp", "/webhdfs/dfshealth.jsp" );
-    assertValidMatch( matcher, "/webhdfs/v1", "/webhdfs/*" ); // The star should be picked in preference to the glob.
-    assertValidMatch( matcher, "/webhdfs/some.jsp", "/webhdfs/*.jsp" );
-    assertValidMatch( matcher, "/webhdfs/other.jsp", "/webhdfs/other.jsp" );
-    assertValidMatch( matcher, "/webhdfs/path/some.jsp", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/path/middle/some.jsp", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/path/middle/some.xml", "/webhdfs/**/middle/*.xml" );
-    assertValidMatch( matcher, "/webhdfs/path/to/file", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/v1/path/to/file", "/webhdfs/v1/**" );
-  }
-
-  @Test
-  public void testStar() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/*" ), "/webhdfs/*" );
-    assertValidMatch( matcher, "/webhdfs/*", "/webhdfs/*" );
-    assertValidMatch( matcher, "/webhdfs/file", "/webhdfs/*" );
-    assertValidMatch( matcher, "/webhdfs/path/", "/webhdfs/*" );
-    assertValidMatch( matcher, "/webhdfs/path/file", null );
-    assertValidMatch( matcher, "/webhdfs/path/path/", null );
-  }
-
-  @Test
-  public void testGlob() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/file", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/path/", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/path/file", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/path/path/", "/webhdfs/**" );
-  }
-
-  @Test
-  public void testMatrixParam() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    matcher.add( Parser.parse( "/webhdfs/browseDirectory.jsp;dn=*" ), "/webhdfs/browseDirectory.jsp;dn=*" );
-    assertValidMatch( matcher, "/webhdfs/browseDirectory.jsp;dn=X", "/webhdfs/browseDirectory.jsp;dn=*" );
-  }
-
-  @Test
-  public void testTwoGlobsAtDifferentDepths() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    matcher.add( Parser.parse( "/webhdfs/v1/**" ), "/webhdfs/v1/**" );
-    assertValidMatch( matcher, "/webhdfs/file", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/v1/file", "/webhdfs/v1/**" );
-
-    // Reverse the put order.
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/v1/**" ), "/webhdfs/v1/**" );
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/file", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/v1/file", "/webhdfs/v1/**" );
-  }
-
-  @Test
-  public void testGlobsVsStarsAtSameDepth() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/*" ), "/webhdfs/*" );
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/file", "/webhdfs/*" ); // The star should be picked in preference to the glob.
-    assertValidMatch( matcher, "/webhdfs/path/file", "/webhdfs/**" );
-
-    // Reverse the put order.
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/webhdfs/**" ), "/webhdfs/**" );
-    matcher.add( Parser.parse( "/webhdfs/*" ), "/webhdfs/*" );
-    assertValidMatch( matcher, "/webhdfs/path/file", "/webhdfs/**" );
-    assertValidMatch( matcher, "/webhdfs/file", "/webhdfs/*" );
-  }
-
-  @Test
-  public void testMatchingPatternsWithinPathSegments() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/path/{file}" ), "default" );
-    assertValidMatch( matcher, "/path/file-name", "default" );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/path/{file=*}" ), "*" );
-    assertValidMatch( matcher, "/path/some-name", "*" );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/path/{more=**}" ), "**" );
-    assertValidMatch( matcher, "/path/some-path/some-name", "**" );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "/path/{regex=prefix*suffix}" ), "regex" );
-    assertValidMatch( matcher, "/path/prefix-middle-suffix", "regex" );
-    assertValidMatch( matcher, "/path/not-prefix-middle-suffix", null );
-  }
-
-  @Test
-  public void testMatchingPatternsWithinQuerySegments() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "?query={queryParam}" ), "default" );
-    assertValidMatch( matcher, "?query=value", "default" );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "?query={queryParam=*}" ), "*" );
-    assertValidMatch( matcher, "?query=some-value", "*" );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "?query={queryParam=**}" ), "**" );
-    assertValidMatch( matcher, "?query=some-value", "**" );
-
-    matcher = new Matcher<String>();
-    matcher.add( Parser.parse( "?query={queryParam=prefix*suffix}" ), "regex" );
-    assertValidMatch( matcher, "?query=prefix-middle-suffix", "regex" );
-    assertValidMatch( matcher, "?query=not-prefix-middle-suffix", null );
-  }
-
-  @Test
-  public void testMatchingForTemplatesThatVaryOnlyByQueryParams() throws URISyntaxException {
-    Matcher<String> matcher = new Matcher<String>();
-    addTemplate( matcher, "?one={queryParam}" );
-    addTemplate( matcher, "?two={queryParam}" );
-
-    assertValidMatch( matcher, "?one=value", "?one={queryParam}" );
-    assertValidMatch( matcher, "?two=value", "?two={queryParam}" );
-    assertValidMatch( matcher, "?three=value", null );
-    assertValidMatch( matcher, "?", null );
-  }
-
-  @Test
-  public void testFullUrlExtraction() throws URISyntaxException {
-    Template template;
-    Template input;
-    Matcher<?> matcher;
-    Matcher<?>.Match match;
-    Params params;
-
-    template = Parser.parse( "{scheme}://{username}:{password}@{host}:{port}/{root}/{path}/{file}?queryA={paramA}&queryB={paramB}#{fragment}" );
-    input = Parser.parse( "http://horton:hadoop@hortonworks.com:80/top/middle/end?queryA=valueA&queryB=valueB#section" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-
-    assertThat( params.getNames(), hasItem( "scheme" ) );
-    assertThat( params.resolve( "scheme" ), hasItem( "http" ) );
-    assertThat( params.getNames(), hasItem( "username" ) );
-    assertThat( params.resolve( "username" ), hasItem( "horton" ) );
-    assertThat( params.getNames(), hasItem( "password" ) );
-    assertThat( params.resolve( "password" ), hasItem( "hadoop" ) );
-    assertThat( params.getNames(), hasItem( "host" ) );
-    assertThat( params.resolve( "host" ), hasItem( "hortonworks.com" ) );
-    assertThat( params.getNames(), hasItem( "port" ) );
-    assertThat( params.resolve( "port" ), hasItem( "80" ) );
-    assertThat( params.getNames(), hasItem( "root" ) );
-    assertThat( params.resolve( "root" ), hasItem( "top" ) );
-    assertThat( params.getNames(), hasItem( "path" ) );
-    assertThat( params.resolve( "path" ), hasItem( "middle" ) );
-    assertThat( params.getNames(), hasItem( "file" ) );
-    assertThat( params.resolve( "file" ), hasItem( "end" ) );
-    assertThat( params.getNames(), hasItem( "paramA" ) );
-    assertThat( params.resolve( "paramA" ), hasItem( "valueA" ) );
-    assertThat( params.getNames(), hasItem( "paramB" ) );
-    assertThat( params.resolve( "paramB" ), hasItem( "valueB" ) );
-    assertThat( params.getNames(), hasItem( "fragment" ) );
-    assertThat( params.resolve( "fragment" ), hasItem( "section" ) );
-    assertThat( params.getNames().size(), equalTo( 11 ) );
-  }
-
-  @Test
-  public void testMultipleDoubleStarPathMatching() throws URISyntaxException {
-    Template template;
-    Template input;
-    Matcher<?> matcher;
-    Matcher<String> stringMatcher;
-    Matcher<?>.Match match;
-
-//    template = Parser.parse( "*://*:*/**/webhdfs/v1/**?**" );
-//    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
-//    matcher = new Matcher<String>( template, "test-value" );
-//    match = matcher.match( input );
-//    assertThat( (String)match.getValue(), is( "test-value" ) );
-//
-//    template = Parser.parse( "*://*:*/**/webhdfs/v1/{path=**}?{**=*}" );
-//    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
-//    matcher = new Matcher<String>( template, "test-value-2" );
-//    match = matcher.match( input );
-//    assertThat( (String)match.getValue(), is( "test-value-2" ) );
-//
-//    stringMatcher = new Matcher<String>();
-//    template = Parser.parse( "*://*:*/**/webhdfs/data/v1/{path=**}?host={host=*}&port={port=*}&{**=*}" );
-//    stringMatcher.add( template, "test-value-C" );
-//    template = Parser.parse( "*://*:*/**/webhdfs/v1/{path=**}?{**=*}" );
-//    stringMatcher.add( template, "test-value-B" );
-//    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
-//    match = stringMatcher.match( input );
-//    assertThat( match.getValue(), notNullValue() );
-//    assertThat( (String)match.getValue(), is( "test-value-B" ) );
-
-    // This is just a reverse of the above.  The order caused a bug.
-    stringMatcher = new Matcher<String>();
-    template = Parser.parse( "*://*:*/**/webhdfs/v1/{path=**}?{**=*}" );
-    stringMatcher.add( template, "test-value-B" );
-    template = Parser.parse( "*://*:*/**/webhdfs/data/v1/{path=**}?host={host=*}&port={port=*}&{**=*}" );
-    stringMatcher.add( template, "test-value-C" );
-    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
-    match = stringMatcher.match( input );
-    assertThat( match.getValue(), notNullValue() );
-    assertThat( (String)match.getValue(), is( "test-value-B" ) );
-
-  }
-
-  @Test
-  public void testPathExtraction() throws Exception {
-    Template template;
-    Template input;
-    Matcher<?> matcher;
-    Matcher<?>.Match match;
-    Params params;
-
-    template = Parser.parse( "{path-queryParam}" );
-    input = Parser.parse( "path-value" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "path-queryParam" ) );
-    assertThat( params.resolve( "path-queryParam" ).size(), equalTo( 1 ) );
-    assertThat( params.resolve( "path-queryParam" ), hasItem( "path-value" ) );
-
-    template = Parser.parse( "/some-path/{path-queryParam}" );
-    input = Parser.parse( "/some-path/path-value" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "path-queryParam" ) );
-    assertThat( params.resolve( "path-queryParam" ).size(), equalTo( 1 ) );
-    assertThat( params.resolve( "path-queryParam" ), hasItem( "path-value" ) );
-
-    template = Parser.parse( "/some-path/{path-queryParam}/some-other-path" );
-    input = Parser.parse( "/some-path/path-value/some-other-path" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "path-queryParam" ) );
-    assertThat( params.resolve( "path-queryParam" ).size(), equalTo( 1 ) );
-    assertThat( params.resolve( "path-queryParam" ), hasItem( "path-value" ) );
-
-    template = Parser.parse( "{path=**}" );
-    input = Parser.parse( "A/B" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "path" ) );
-    assertThat( params.resolve( "path" ).size(), equalTo( 2 ) );
-    assertThat( params.resolve( "path" ), hasItem( "A" ) );
-    assertThat( params.resolve( "path" ), hasItem( "B" ) );
-
-    template = Parser.parse( "/top/{mid=**}/end" );
-    input = Parser.parse( "/top/A/B/end" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "mid" ) );
-    assertThat( params.resolve( "mid" ).size(), equalTo( 2 ) );
-    assertThat( params.resolve( "mid" ), hasItem( "A" ) );
-    assertThat( params.resolve( "mid" ), hasItem( "B" ) );
-
-    template = Parser.parse( "*://*:*/{path=**}?{**}" );
-    input = Parser.parse( "http://host:port/pathA/pathB" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params.resolve( "path" ), hasItem( "pathA" ) );
-    assertThat( params.resolve( "path" ), hasItem( "pathB" ) );
-    assertThat( params.resolve( "path" ).size(), is( 2 ) );
-
-    template = Parser.parse( "*://*:*/{path=**}?{**}" );
-    input = Parser.parse( "http://host:port/pathA/pathB" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params.resolve( "path" ), hasItem( "pathA" ) );
-    assertThat( params.resolve( "path" ), hasItem( "pathB" ) );
-    assertThat( params.resolve( "path" ).size(), is( 2 ) );
-
-    template = Parser.parse( "*://*:*/{path=**}?{**}" );
-    input = Parser.parse( "http://host:port/pathA/pathB" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params.resolve( "path" ), hasItem( "pathA" ) );
-    assertThat( params.resolve( "path" ), hasItem( "pathB" ) );
-    assertThat( params.resolve( "path" ).size(), is( 2 ) );
-  }
-
-  @Test
-  public void testQueryExtraction() throws Exception {
-    Template template;
-    Template input;
-    Matcher<?> matcher;
-    Matcher<?>.Match match;
-    Params params;
-
-    template = Parser.parse( "?query-queryParam={queryParam-name}" );
-    input = Parser.parse( "?query-queryParam=queryParam-value" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "queryParam-name" ) );
-    assertThat( params.resolve( "queryParam-name" ).size(), equalTo( 1 ) );
-    assertThat( params.resolve( "queryParam-name" ), hasItem( "queryParam-value" ) );
-
-    template = Parser.parse( "?query-queryParam={queryParam-name}" );
-    input = Parser.parse( "?query-queryParam=queryParam-value" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 1 ) );
-    assertThat( params.getNames(), hasItem( "queryParam-name" ) );
-    assertThat( params.resolve( "queryParam-name" ).size(), equalTo( 1 ) );
-    assertThat( params.resolve( "queryParam-name" ), hasItem( "queryParam-value" ) );
-  }
-
-  @Test
-  public void testEdgeCaseExtraction() throws Exception {
-    Template template;
-    Template input;
-    Matcher<?> matcher;
-    Matcher<?>.Match match;
-    Params params;
-
-    template = Parser.parse( "" );
-    input = Parser.parse( "" );
-    matcher = new Matcher<Void>( template, null );
-    match = matcher.match( input );
-    params = match.getParams();
-    assertThat( params, notNullValue() );
-    assertThat( params.getNames().size(), equalTo( 0 ) );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
index 70085d4..90410ae 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
@@ -17,8 +17,8 @@
  */
 package org.apache.knox.gateway.util.urltemplate;
 
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
+import org.apache.knox.test.category.FastTests;
+import org.apache.knox.test.category.UnitTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
index 9d65b05..7bc3b85 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
@@ -17,8 +17,8 @@
  */
 package org.apache.knox.gateway.util.urltemplate;
 
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
+import org.apache.knox.test.category.FastTests;
+import org.apache.knox.test.category.UnitTests;
 import org.easymock.EasyMock;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
index 47ad08e..c88aacf 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
@@ -17,8 +17,8 @@
  */
 package org.apache.knox.gateway.util.urltemplate;
 
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
+import org.apache.knox.test.category.FastTests;
+import org.apache.knox.test.category.UnitTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
index d3f1c2a..5b3db90 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
@@ -17,8 +17,8 @@
  */
 package org.apache.knox.gateway.util.urltemplate;
 
-import org.apache.hadoop.test.category.FastTests;
-import org.apache.hadoop.test.category.UnitTests;
+import org.apache.knox.test.category.FastTests;
+import org.apache.knox.test.category.UnitTests;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 

http://git-wip-us.apache.org/repos/asf/knox/blob/1451428f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 315f25e..5549d93 100644
--- a/pom.xml
+++ b/pom.xml
@@ -192,13 +192,13 @@
                 </plugins>
             </build>
             <properties>
-                <failsafe.group>org.apache.hadoop.test.category.VerifyTest</failsafe.group>
+                <failsafe.group>org.apache.knox.test.category.VerifyTest</failsafe.group>
             </properties>
         </profile>
         <profile>
             <id>release</id>
             <properties>
-                <failsafe.group>org.apache.hadoop.test.category.VerifyTest,org.apache.hadoop.test.category.ReleaseTest</failsafe.group>
+                <failsafe.group>org.apache.knox.test.category.VerifyTest,org.apache.knox.test.category.ReleaseTest</failsafe.group>
             </properties>
         </profile>
         <profile>
@@ -207,7 +207,7 @@
                 <activeByDefault>true</activeByDefault>
             </activation>
             <properties>
-                <failsafe.group>org.apache.hadoop.test.category.VerifyTest</failsafe.group>
+                <failsafe.group>org.apache.knox.test.category.VerifyTest</failsafe.group>
             </properties>
         </profile>
     </profiles>
@@ -308,7 +308,7 @@
                 <version>${surefire-version}</version>
                 <configuration>
                     <excludedGroups>
-                        org.apache.hadoop.test.category.SlowTests,org.apache.hadoop.test.category.ManualTests,org.apache.hadoop.test.category.VerifyTest,org.apache.hadoop.test.category.ReleaseTest
+                        org.apache.knox.test.category.SlowTests,org.apache.knox.test.category.ManualTests,org.apache.knox.test.category.VerifyTest,org.apache.knox.test.category.ReleaseTest
                     </excludedGroups>
                     <systemPropertyVariables>
                         <gateway-version>${gateway-version}</gateway-version>


Mime
View raw message