juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [21/33] incubator-juneau git commit: Microservice should be in it's own group.
Date Fri, 08 Sep 2017 23:28:14 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/750916a9/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PathsTest.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PathsTest.java b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PathsTest.java
new file mode 100644
index 0000000..e4623ed
--- /dev/null
+++ b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PathsTest.java
@@ -0,0 +1,817 @@
+// ***************************************************************************************************************************
+// * 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.juneau.rest.test;
+
+import static org.junit.Assert.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.rest.client.*;
+import org.junit.*;
+
+public class PathsTest extends RestTestcase {
+
+	private static String URL = "/testPaths";
+
+	//====================================================================================================
+	// Basic tests
+	//====================================================================================================
+	@Test
+	public void testBasic() throws Exception {
+		RestClient client = TestMicroservice.DEFAULT_CLIENT;
+		ObjectMap r;
+		String url;
+
+		// [/test/testPaths]
+		//	{
+		//		pathInfo:null,
+		//		pathInfoParts:[],
+		//		pathRemainder:null,
+		//		pathRemainderUndecoded:null,
+		//		requestURI:'/jazz/juneau/test/testPaths',
+		//		requestParentURI:'/jazz/juneau/test',
+		//		requestURL:'https://localhost:9443/jazz/juneau/test/testPaths',
+		//		servletPath:'/juneau/test/testPaths',
+		//	}
+		url = URL;
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertNull(r.getString("pathInfo"));
+		assertNull(r.getString("pathRemainder"));
+		assertNull(r.getString("pathRemainderUndecoded"));
+		assertNull(r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestParentURI").endsWith("/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+
+		// [/test/testPaths/]
+		//		{
+		//			pathInfo: '/',
+		//			pathRemainder: '',
+		//			pathRemainderUndecoded: '',
+		//			requestURI: '/jazz/juneau/test/testPaths/',
+		//			requestParentURI: '/jazz/juneau/test',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/',
+		//			servletPath: '/juneau/test/testPaths',
+		//		}
+		url = URL + '/';
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/", r.getString("pathInfo"));
+		assertEquals("", r.getString("pathRemainder"));
+		assertEquals("", r.getString("pathRemainderUndecoded"));
+		assertEquals("", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		// [/test/testPaths//]
+		//		{
+		//			pathInfo: '//',
+		//			pathRemainder: '/',
+		//			requestURI: '/jazz/juneau/test/testPaths//',
+		//			requestParentURI: '/jazz/juneau/test',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths//',
+		//			servletPath: '/juneau/test/testPaths',
+		//		}
+		url = URL + "//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("//", r.getString("pathInfo"));
+		assertEquals("/", r.getString("pathRemainder"));
+		assertEquals("/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		// [/test/testPaths///]
+		//		{
+		//			pathInfo: '///',
+		//			pathRemainder: '//',
+		//			requestURI: '/jazz/juneau/test/testPaths///',
+		//			requestParentURI: '/jazz/juneau/test',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths///',
+		//			servletPath: '/juneau/test/testPaths',
+		//		}
+		url = URL + "///";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("///", r.getString("pathInfo"));
+		assertEquals("//", r.getString("pathRemainder"));
+		assertEquals("//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths///"));
+		assertTrue(r.getString("requestParentURI").endsWith("/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths///"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		// [/test/testPaths/foo/bar]
+		//		{
+		//			pathInfo: '/foo/bar',
+		//			pathRemainder: 'foo/bar',
+		//			requestURI: '/jazz/juneau/test/testPaths/foo/bar',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/foo/bar',
+		//			servletPath: '/juneau/test/testPaths',
+		//		}
+		url = URL + "/foo/bar";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/foo/bar", r.getString("pathInfo"));
+		assertEquals("foo/bar", r.getString("pathRemainder"));
+		assertEquals("foo/bar", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/foo/bar"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/foo/bar"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		// [/test/testPaths/foo/bar/]
+		//		{
+		//			pathInfo: '/foo/bar/',
+		//			pathRemainder: 'foo/bar/',
+		//			requestURI: '/jazz/juneau/test/testPaths/foo/bar/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/foo/bar/',
+		//			servletPath: '/juneau/test/testPaths',
+		//		}
+		url = URL + "/foo/bar/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/foo/bar/", r.getString("pathInfo"));
+		assertEquals("foo/bar/", r.getString("pathRemainder"));
+		assertEquals("foo/bar/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/foo/bar/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/foo/bar/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		// [/test/testPaths//foo//bar//]
+		//		{
+		//			pathInfo: '//foo//bar//',
+		//			pathRemainder: '/foo//bar//',
+		//			requestURI: '/jazz/juneau/test/testPaths//foo//bar//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths//foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths//foo//bar//',
+		//			servletPath: '/juneau/test/testPaths',
+		//		}
+		url = URL + "//foo//bar//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("//foo//bar//", r.getString("pathInfo"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths//foo//bar//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/foo/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths//foo//bar//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		// [/test/testPaths/test2]
+		//		{
+		//			pathInfo: '/test2',
+		//			pathRemainder: null,
+		//			requestURI: '/jazz/juneau/test/testPaths/test2',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2", r.getString("pathInfo"));
+		assertNull(r.getString("pathRemainder"));
+		assertNull(r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+
+		// [/test/testPaths/test2/]
+		//		{
+		//			pathInfo: '/test2/',
+		//			pathRemainder: '',
+		//			requestURI: '/jazz/juneau/test/testPaths/test2/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2/',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/", r.getString("pathInfo"));
+		assertEquals("", r.getString("pathRemainder"));
+		assertEquals("", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		// [/test/testPaths/test2//]
+		//		{
+		//			pathInfo: '/test2//',
+		//			pathRemainder: '/',
+		//			requestURI: '/jazz/juneau/test/testPaths/test2//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2//',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2//", r.getString("pathInfo"));
+		assertEquals("/", r.getString("pathRemainder"));
+		assertEquals("/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		// [/test/testPaths/test2///]
+		//		{
+		//			pathInfo: '/test2///',
+		//			pathRemainder: '//',
+		//			requestURI: '/jazz/juneau/test/testPaths/test2///',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2///',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2///";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2///", r.getString("pathInfo"));
+		assertEquals("//", r.getString("pathRemainder"));
+		assertEquals("//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2///"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2///"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		// [/test/testPaths/test2/foo/bar]
+		//		{
+		//			pathInfo: '/test2/foo/bar',
+		//			pathRemainder: 'foo/bar',
+		//			requestURI: '/jazz/juneau/test/testPaths/test2/foo/bar',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/test2/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2/foo/bar',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2/foo/bar";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/foo/bar", r.getString("pathInfo"));
+		assertEquals("foo/bar", r.getString("pathRemainder"));
+		assertEquals("foo/bar", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2/foo/bar"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/test2/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2/foo/bar"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		// [/test/testPaths/test2/foo/bar/]
+		//		{
+		//			pathInfo: '/test2/foo/bar/',
+		//			pathRemainder: 'foo/bar/',
+		//			requestURI: '/jazz/juneau/test/testPaths/test2/foo/bar/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/test2/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2/foo/bar/',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2/foo/bar/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/foo/bar/", r.getString("pathInfo"));
+		assertEquals("foo/bar/", r.getString("pathRemainder"));
+		assertEquals("foo/bar/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2/foo/bar/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/test2/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2/foo/bar/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		// [/test/testPaths/test2//foo//bar//]
+		//		{
+		//			pathInfo: '/test2//foo//bar//',
+		//			pathRemainder: '/foo//bar//',
+		//			requestURI: '/jazz/juneau/test/testPaths/test2//foo//bar//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/test2//foo/',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/test2//foo//bar//',
+		//			servletPath: '/juneau/test/testPaths',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test',
+		//			method: 2
+		//		}
+		url = URL + "/test2//foo//bar//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2//foo//bar//", r.getString("pathInfo"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2//foo//bar//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/test2//foo/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2//foo//bar//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		// [/test/testPaths/a]
+		//		{
+		//			pathInfo: null,
+		//			pathRemainder: null,
+		//			requestURI: '/jazz/juneau/test/testPaths/a',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertNull(r.getString("pathInfo"));
+		assertNull(r.getString("pathRemainder"));
+		assertNull(r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/]
+		//		{
+		//			pathInfo: '/',
+		//			pathRemainder: '',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/", r.getString("pathInfo"));
+		assertEquals("", r.getString("pathRemainder"));
+		assertEquals("", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a//]
+		//		{
+		//			pathInfo: '//',
+		//			pathRemainder: '/',
+		//			requestURI: '/jazz/juneau/test/testPaths/a//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a//',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("//", r.getString("pathInfo"));
+		assertEquals("/", r.getString("pathRemainder"));
+		assertEquals("/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a///]
+		//		{
+		//			pathInfo: '///',
+		//			pathRemainder: '//',
+		//			requestURI: '/jazz/juneau/test/testPaths/a///',
+		//			requestParentURI: '/jazz/juneau/test/testPaths',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a///',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a///";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("///", r.getString("pathInfo"));
+		assertEquals("//", r.getString("pathRemainder"));
+		assertEquals("//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a///"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a///"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/foo/bar]
+		//		{
+		//			pathInfo: '/foo/bar',
+		//			pathRemainder: 'foo/bar',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/foo/bar',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/foo/bar',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a/foo/bar";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/foo/bar", r.getString("pathInfo"));
+		assertEquals("foo/bar", r.getString("pathRemainder"));
+		assertEquals("foo/bar", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/foo/bar"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/foo/bar"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/foo/bar/]
+		//		{
+		//			pathInfo: '/foo/bar/',
+		//			pathRemainder: 'foo/bar/',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/foo/bar/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/foo/bar/',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a/foo/bar/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/foo/bar/", r.getString("pathInfo"));
+		assertEquals("foo/bar/", r.getString("pathRemainder"));
+		assertEquals("foo/bar/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/foo/bar/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/foo/bar/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a//foo//bar//]
+		//		{
+		//			pathInfo: '//foo//bar//',
+		//			pathRemainder: '/foo//bar//',
+		//			requestURI: '/jazz/juneau/test/testPaths/a//foo//bar//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a//foo/',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a//foo//bar//',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 3
+		//		}
+		url = URL + "/a//foo//bar//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("//foo//bar//", r.getString("pathInfo"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a//foo//bar//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/foo/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a//foo//bar//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2]
+		//		{
+		//			pathInfo: '/test2',
+		//			pathRemainder: null,
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2", r.getString("pathInfo"));
+		assertNull(r.getString("pathRemainder"));
+		assertNull(r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2/]
+		//		{
+		//			pathInfo: '/test2/',
+		//			pathRemainder: '',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2/',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/", r.getString("pathInfo"));
+		assertEquals("", r.getString("pathRemainder"));
+		assertEquals("", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2//]
+		//		{
+		//			pathInfo: '/test2//',
+		//			pathRemainder: '/',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2//',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2//", r.getString("pathInfo"));
+		assertEquals("/", r.getString("pathRemainder"));
+		assertEquals("/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2///]
+		//		{
+		//			pathInfo: '/test2///',
+		//			pathRemainder: '//',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2///',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2///',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2///";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2///", r.getString("pathInfo"));
+		assertEquals("//", r.getString("pathRemainder"));
+		assertEquals("//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2///"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2///"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2/foo/bar]
+		//		{
+		//			pathInfo: '/test2/foo/bar',
+		//			pathRemainder: 'foo/bar',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2/foo/bar',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a/test2/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2/foo/bar',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2/foo/bar";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/foo/bar", r.getString("pathInfo"));
+		assertEquals("foo/bar", r.getString("pathRemainder"));
+		assertEquals("foo/bar", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2/foo/bar"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/test2/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2/foo/bar"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2/foo/bar/]
+		//		{
+		//			pathInfo: '/test2/foo/bar/',
+		//			pathRemainder: 'foo/bar/',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2/foo/bar/',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a/test2/foo',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2/foo/bar/',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2/foo/bar/";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/foo/bar/", r.getString("pathInfo"));
+		assertEquals("foo/bar/", r.getString("pathRemainder"));
+		assertEquals("foo/bar/", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2/foo/bar/"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/test2/foo"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2/foo/bar/"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		// [/test/testPaths/a/test2//foo//bar//]
+		//		{
+		//			pathInfo: '/test2//foo//bar//',
+		//			pathRemainder: '/foo//bar//',
+		//			requestURI: '/jazz/juneau/test/testPaths/a/test2//foo//bar//',
+		//			requestParentURI: '/jazz/juneau/test/testPaths/a/test2//foo/',
+		//			requestURL: 'https://localhost:9443/jazz/juneau/test/testPaths/a/test2//foo//bar//',
+		//			servletPath: '/juneau/test/testPaths/a',
+		//			servletURI: 'https://localhost:9443/jazz/juneau/test/testPaths/a',
+		//			servletParentURI: 'https://localhost:9443/jazz/juneau/test/testPaths',
+		//			method: 4
+		//		}
+		url = URL + "/a/test2//foo//bar//";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2//foo//bar//", r.getString("pathInfo"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder"));
+		assertEquals("/foo//bar//", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2//foo//bar//"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/test2//foo/"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2//foo//bar//"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		//--------------------------------------------------------------------------------
+		// Spaces
+		//--------------------------------------------------------------------------------
+		url = URL + "/%20";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("%20", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/%20"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/%20"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		url = URL + "/test2/%20";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("%20", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2/%20"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/test2"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2/%20"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		url = URL + "/a/%20";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("%20", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/%20"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/%20"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		url = URL + "/a/test2/%20";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("%20", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2/%20"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/test2"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2/%20"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+
+		url = URL + "/+";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("+", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/+"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/+"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(1, (int)r.getInt("method"));
+
+		url = URL + "/test2/+";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("+", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/test2/+"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/test2"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/test2/+"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths"));
+		assertEquals(2, (int)r.getInt("method"));
+
+		url = URL + "/a/+";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("+", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/+"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/+"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(3, (int)r.getInt("method"));
+
+		url = URL + "/a/test2/+";
+		r = client.doGet(url).getResponse(ObjectMap.class);
+		assertEquals("/test2/ ", r.getString("pathInfo"));
+		assertEquals(" ", r.getString("pathRemainder"));
+		assertEquals("+", r.getString("pathRemainderUndecoded"));
+		assertEquals(" ", r.getString("pathRemainder2"));
+		assertTrue(r.getString("requestURI").endsWith("/testPaths/a/test2/+"));
+		assertTrue(r.getString("requestParentURI").endsWith("/testPaths/a/test2"));
+		assertTrue(r.getString("requestURL").endsWith("/testPaths/a/test2/+"));
+		assertTrue(r.getString("servletPath").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletURI").endsWith("/testPaths/a"));
+		assertTrue(r.getString("servletParentURI").endsWith("/testPaths"));
+		assertEquals(4, (int)r.getInt("method"));
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/750916a9/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PropertiesTest.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PropertiesTest.java b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PropertiesTest.java
new file mode 100644
index 0000000..f52a564
--- /dev/null
+++ b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/PropertiesTest.java
@@ -0,0 +1,43 @@
+// ***************************************************************************************************************************
+// * 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.juneau.rest.test;
+
+import static org.junit.Assert.*;
+
+import org.apache.juneau.rest.client.*;
+import org.junit.*;
+
+public class PropertiesTest extends RestTestcase {
+
+	private static String URL = "/testProperties";
+
+	//====================================================================================================
+	// Properties defined on method.
+	//====================================================================================================
+	@Test
+	public void testPropertiesDefinedOnMethod() throws Exception {
+		RestClient client = TestMicroservice.DEFAULT_CLIENT;
+		String r = client.doGet(URL + "/testPropertiesDefinedOnMethod").getResponseAsString();
+		assertTrue(r.matches("A1=a1,A2=c,B1=b1,B2=c,C=c,R1a=.*/testProperties/testPropertiesDefinedOnMethod,R1b=.*/testProperties,R2=bar,R3=baz,R4=a1,R5=c,R6=c"));
+	}
+
+	//====================================================================================================
+	// Make sure attributes/parameters/headers are available through ctx.getProperties().
+	//====================================================================================================
+	@Test
+	public void testProperties() throws Exception {
+		RestClient client = TestMicroservice.DEFAULT_CLIENT;
+		String r = client.doGet(URL + "/testProperties/a1?P=p1").header("H", "h1").getResponseAsString();
+		assertEquals("A=a1,P=p1,H=h1", r);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/750916a9/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/QueryTest.java
----------------------------------------------------------------------
diff --git a/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/QueryTest.java b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/QueryTest.java
new file mode 100644
index 0000000..c211ca8
--- /dev/null
+++ b/juneau-microservice/juneau-microservice-test/src/test/java/org/apache/juneau/rest/test/QueryTest.java
@@ -0,0 +1,60 @@
+// ***************************************************************************************************************************
+// * 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.juneau.rest.test;
+
+import static org.apache.juneau.rest.test.TestUtils.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.rest.client.*;
+import org.junit.*;
+
+/**
+ * Tests client-side form posts.
+ */
+public class QueryTest extends RestTestcase {
+
+	private static String URL = "/testQuery";
+	RestClient client = TestMicroservice.DEFAULT_CLIENT;
+
+	//====================================================================================================
+	// Default values.
+	//====================================================================================================
+
+	@Test
+	public void defaultQuery() throws Exception {
+		assertObjectEquals("{f1:'1',f2:'2',f3:'3'}", client.doGet(URL + "/defaultQuery").getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/defaultQuery").query("f1",4).query("f2",5).query("f3",6).getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/defaultQuery").query("f1",4).query("f2",5).query("f3",6).getResponse(ObjectMap.class));
+	}
+
+	@Test
+	public void annotatedQuery() throws Exception {
+		assertObjectEquals("{f1:null,f2:null,f3:null}", client.doGet(URL + "/annotatedQuery").getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/annotatedQuery").query("f1",4).query("f2",5).query("f3",6).getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/annotatedQuery").query("f1",4).query("f2",5).query("f3",6).getResponse(ObjectMap.class));
+	}
+
+	@Test
+	public void annotatedQueryDefault() throws Exception {
+		assertObjectEquals("{f1:'1',f2:'2',f3:'3'}", client.doGet(URL + "/annotatedQueryDefault").getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/annotatedQueryDefault").query("f1",4).query("f2",5).query("f3",6).getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/annotatedQueryDefault").query("f1",4).query("f2",5).query("f3",6).getResponse(ObjectMap.class));
+	}
+
+	@Test
+	public void annotatedAndDefaultQuery() throws Exception {
+		assertObjectEquals("{f1:'4',f2:'5',f3:'6'}", client.doGet(URL + "/annotatedAndDefaultQuery").getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'7',f2:'8',f3:'9'}", client.doGet(URL + "/annotatedAndDefaultQuery").query("f1",7).query("f2",8).query("f3",9).getResponse(ObjectMap.class));
+		assertObjectEquals("{f1:'7',f2:'8',f3:'9'}", client.doGet(URL + "/annotatedAndDefaultQuery").query("f1",7).query("f2",8).query("f3",9).getResponse(ObjectMap.class));
+	}
+}


Mime
View raw message