juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject incubator-juneau git commit: Improved debugging support.
Date Sun, 26 Mar 2017 21:45:41 GMT
Repository: incubator-juneau
Updated Branches:
  refs/heads/master 9db2e03fa -> 9e095d85f


Improved debugging support.

Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/9e095d85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/9e095d85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/9e095d85

Branch: refs/heads/master
Commit: 9e095d85fe2115ef021d4b0f50726dc6648f34c7
Parents: 9db2e03
Author: JamesBognar <jamesbognar@apache.org>
Authored: Sun Mar 26 14:45:38 2017 -0700
Committer: JamesBognar <jamesbognar@apache.org>
Committed: Sun Mar 26 14:45:38 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/juneau/jena/RdfParser.java  |  5 ++
 .../java/org/apache/juneau/html/HtmlParser.java |  2 +-
 juneau-core/src/main/javadoc/overview.html      |  1 +
 .../org/apache/juneau/rest/client/RestCall.java | 16 ++---
 .../juneau/rest/client/RestCallLogger.java      | 12 +++-
 .../apache/juneau/rest/client/RestClient.java   | 13 +++-
 .../juneau/rest/client/RestClientBuilder.java   |  4 +-
 .../org/apache/juneau/rest/client/package.html  | 68 ++++++++++++++++++--
 .../apache/juneau/rest/test/InterfaceProxy.java |  6 ++
 .../rest/test/InterfaceProxyResource.java       | 19 ++++++
 .../juneau/rest/test/InterfaceProxyTest.java    | 34 ++++++++++
 .../org/apache/juneau/rest/RestRequest.java     | 12 ++--
 12 files changed, 168 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
----------------------------------------------------------------------
diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
index cdbb418..3534c7b 100644
--- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
+++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java
@@ -462,6 +462,11 @@ public class RdfParser extends ReaderParser {
 		return l;
 	}
 
+	@Override /* Parser */
+	protected Object[] doParseArgs(ParserSession session, ClassMeta<?>[] argTypes) throws
Exception {
+		throw new UnsupportedOperationException("Parser '"+getClass().getName()+"' does not support
this method.");
+	}
+
 	
 	//--------------------------------------------------------------------------------
 	// Entry point methods

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
index 75f2760..3c14825 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlParser.java
@@ -442,7 +442,7 @@ public class HtmlParser extends XmlParser {
 					}
 					String key = keys.get(i);
 					if (m != null) {
-						ClassMeta<?> et = elementType.getElementType();
+						ClassMeta<?> et = elementType.getValueType();
 						Object value = parseAnything(session, et, r, l, false, pMeta);
 						setName(et, value, key);
 						m.put(key, value);

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-core/src/main/javadoc/overview.html
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/javadoc/overview.html b/juneau-core/src/main/javadoc/overview.html
index 66952a8..b9af064 100644
--- a/juneau-core/src/main/javadoc/overview.html
+++ b/juneau-core/src/main/javadoc/overview.html
@@ -5812,6 +5812,7 @@
 					Useful for testing scenarios when you don't want the console to end up showing errors
done on purpose.
 				<li>{@link org.apache.juneau.rest.client.RestClientBuilder#debug(boolean)} now
adds a <code>Debug: true</code> header on all requests.
 			</ul>
+			<li>New doc: <a class='doclink' href='org/apache/juneau/rest/client/package-summary.html#Debugging'>1.5
- Debugging</a>
 		</ul>
 		
 		<h6 class='topic'>org.apache.juneau.microservice</h6>

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
index 161751a..88e892d 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
@@ -1263,16 +1263,16 @@ public final class RestCall {
 
 	<T> T getResponse(ClassMeta<T> type) throws IOException, ParseException {
 		try {
-		Parser p = getParser();
-		T o = null;
+			Parser p = getParser();
+			T o = null;
 			if (! p.isReaderParser()) {
-			InputStream is = getInputStream();
-			o = ((InputStreamParser)p).parse(is, type);
-		} else {
-			Reader r = getReader();
-			o = ((ReaderParser)p).parse(r, type);
+				InputStream is = getInputStream();
+				o = ((InputStreamParser)p).parse(is, type);
+			} else {
+				Reader r = getReader();
+				o = ((ReaderParser)p).parse(r, type);
 			}
-		return o;
+			return o;
 		} catch (ParseException e) {
 			isFailed = true;
 			throw e;

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
index 2eb8a55..03e8735 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
@@ -32,6 +32,12 @@ import org.apache.http.util.*;
  */
 public class RestCallLogger extends RestCallInterceptor {
 
+	/**
+	 * Default HTTP request logger.
+	 * Logs outgoing HTTP requests to the <code>org.apache.juneau.rest.client</code>
logger at <jsf>WARNING</jsf> level.
+	 */
+	public static final RestCallLogger DEFAULT = new RestCallLogger(Level.WARNING, Logger.getLogger("org.apache.juneau.rest.client"));
+
 	private Level level;
 	private Logger log;
 
@@ -76,12 +82,12 @@ public class RestCallLogger extends RestCallInterceptor {
 				HttpUriRequest req = restCall.getRequest();
 				HttpResponse res = restCall.getResponse();
 				if (req != null) {
-					sb.append("\n=== HTTP Call ==================================================================");
+					sb.append("\n=== HTTP Call (outgoing) =======================================================");
 
 					sb.append("\n=== REQUEST ===\n").append(req);
 					sb.append("\n---request headers---");
 					for (Header h : req.getAllHeaders())
-						sb.append("\n").append(h);
+						sb.append("\n\t").append(h);
 					if (req instanceof HttpEntityEnclosingRequestBase) {
 						sb.append("\n---request entity---");
 						HttpEntityEnclosingRequestBase req2 = (HttpEntityEnclosingRequestBase)req;
@@ -107,7 +113,7 @@ public class RestCallLogger extends RestCallInterceptor {
 					sb.append("\n=== RESPONSE ===\n").append(res.getStatusLine());
 					sb.append("\n---response headers---");
 					for (Header h : res.getAllHeaders())
-						sb.append("\n").append(h);
+						sb.append("\n\t").append(h);
 					sb.append("\n---response content---\n").append(output);
 					sb.append("\n=== END ========================================================================");
 				}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index 6594ced..37e8f33 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -66,6 +66,7 @@ public class RestClient extends CoreObject {
 	final RetryOn retryOn;
 	final int retries;
 	final long retryInterval;
+	final boolean debug;
 	final RestCallInterceptor[] interceptors;
 
 	/**
@@ -84,6 +85,7 @@ public class RestClient extends CoreObject {
 	 * @param retryOn
 	 * @param retries
 	 * @param retryInterval
+	 * @param debug
 	 */
 	public RestClient(
 			PropertyStore propertyStore,
@@ -99,7 +101,8 @@ public class RestClient extends CoreObject {
 			String rootUri,
 			RetryOn retryOn,
 			int retries,
-			long retryInterval) {
+			long retryInterval,
+			boolean debug) {
 		super(propertyStore);
 		this.httpClient = httpClient;
 		this.keepHttpClientOpen = keepHttpClientOpen;
@@ -110,12 +113,18 @@ public class RestClient extends CoreObject {
 		Map<String,String> h2 = new ConcurrentHashMap<String,String>(headers);
 
 		this.headers = Collections.unmodifiableMap(h2);
-		this.interceptors = interceptors.toArray(new RestCallInterceptor[interceptors.size()]);
 		this.remoteableServletUri = remoteableServletUri;
 		this.rootUrl = rootUri;
 		this.retryOn = retryOn;
 		this.retries = retries;
 		this.retryInterval = retryInterval;
+		this.debug = debug;
+
+		List<RestCallInterceptor> l = new ArrayList<RestCallInterceptor>(interceptors);
+		if (debug)
+			l.add(RestCallLogger.DEFAULT);
+
+		this.interceptors = l.toArray(new RestCallInterceptor[l.size()]);
 
 		if (Boolean.getBoolean("org.apache.juneau.rest.client.RestClient.trackLifecycle"))
 			creationStack = Thread.currentThread().getStackTrace();

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
index 39a2f88..a97c540 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClientBuilder.java
@@ -76,6 +76,7 @@ public class RestClientBuilder extends CoreObjectBuilder {
 	private int retries = 1;
 	private long retryInterval = -1;
 	private RetryOn retryOn = RetryOn.DEFAULT;
+	private boolean debug;
 
 	/**
 	 * Constructor, default settings.
@@ -139,7 +140,7 @@ public class RestClientBuilder extends CoreObjectBuilder {
 
 			UrlEncodingSerializer us = new SerializerBuilder(propertyStore).build(UrlEncodingSerializer.class);
 
-			return new RestClient(propertyStore, httpClient, keepHttpClientOpen, s, p, us, headers,
interceptors, remoteableServletUri, remoteableServiceUriMap, rootUrl, retryOn, retries, retryInterval);
+			return new RestClient(propertyStore, httpClient, keepHttpClientOpen, s, p, us, headers,
interceptors, remoteableServletUri, remoteableServiceUriMap, rootUrl, retryOn, retries, retryInterval,
debug);
 		} catch (Exception e) {
 			throw new RuntimeException(e);
 		}
@@ -1356,6 +1357,7 @@ public class RestClientBuilder extends CoreObjectBuilder {
 	@Override /* CoreObjectBuilder */
 	public RestClientBuilder debug(boolean value) {
 		super.debug(value);
+		this.debug = value;
 		header("Debug", value);
 		return this;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/package.html
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/package.html b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/package.html
index 8e30aaa..9476291 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/package.html
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/package.html
@@ -72,6 +72,7 @@
 		</ol>
 		<li><p><a class='doclink' href='#ResponsePatterns'>Using Response Patterns</a></p>
 		<li><p><a class='doclink' href='#PipingOutput'>Piping Response Output</a></p>
+		<li><p><a class='doclink' href='#Debugging'>Debugging</a></p>
 		<li><p><a class='doclink' href='#Logging'>Logging</a></p>
 		<li><p><a class='doclink' href='#Interceptors'>Interceptors</a></p>
 		<li><p><a class='doclink' href='#Remoteable'>Remoteable Proxies</a></p>
@@ -628,8 +629,65 @@
 	</div>	
 	
 	<!-- ========================================================================================================
-->
+	<a id="Debugging"></a>
+	<h3 class='topic' onclick='toggle(this)'>1.5 - Debugging</h3>
+	<div class='topic'>
+		<p>
+			Use the {@link org.apache.juneau.rest.client.RestClientBuilder#debug(boolean)} method
to enable logging for HTTP requests
+			made from the client.
+		</p>
+		<p>
+			Under-the-covers, this is simply a shortcut for adding the {@link org.apache.juneau.rest.client.RestCallLogger#DEFAULT}
interceptor
+			to the client.  This causes the following output to be generated by the Java <code>org.apache.juneau.rest.client</code>
logger at <jsf>WARNING</jsf>
+			level:
+		</p>
+		<p class='bcode'>
+	=== HTTP Call (outgoing) =======================================================
+	=== REQUEST ===
+	POST http://localhost:10000/testUrl HTTP/1.1
+	---request headers---
+		Debug: true
+		No-Trace: true
+		Accept: application/json
+	---request entity---
+		Content-Type: application/json
+	---request content---
+	{"foo":"bar","baz":123}
+	=== RESPONSE ===
+	HTTP/1.1 200 OK
+	---response headers---
+		Content-Type: application/json;charset=utf-8
+		Content-Length: 21
+		Server: Jetty(8.1.0.v20120127)
+	---response content---
+	{"message":"OK then"}
+	=== END ========================================================================
+		</p>
+		<p>
+			This setting also causes a <code>Debug: true</code> header value to trigger
logging of the request on the server side as well.
+		</p>
+		<p class='bcode'>
+	=== HTTP Request (incoming) ====================================================
+	HTTP POST /testUrl
+	---Headers---
+		Host: localhost:10000
+		Transfer-Encoding: chunked
+		Accept: application/json
+		Content-Type: application/json
+		User-Agent: Apache-HttpClient/4.5 (Java/1.6.0_65)
+		Connection: keep-alive
+		Debug: true
+		Accept-Encoding: gzip,deflate
+	---Default Servlet Headers---
+	---Body---
+	{"foo":"bar","baz":123}
+	=== END ========================================================================
+		</p>
+	</div>
+	
+	<!-- ========================================================================================================
-->
 	<a id="Logging"></a>
-	<h3 class='topic' onclick='toggle(this)'>1.5 - Logging</h3>
+	<h3 class='topic' onclick='toggle(this)'>1.6 - Logging</h3>
 	<div class='topic'>
 		<p>
 			Use the {@link org.apache.juneau.rest.client.RestClientBuilder#logTo(Level,Logger)} and
{@link org.apache.juneau.rest.client.RestCall#logTo(Level,Logger)} methods
@@ -652,7 +710,7 @@
 	
 	<!-- ========================================================================================================
-->
 	<a id="Interceptors"></a>
-	<h3 class='topic' onclick='toggle(this)'>1.6 - Interceptors</h3>
+	<h3 class='topic' onclick='toggle(this)'>1.7 - Interceptors</h3>
 	<div class='topic'>
 		<p>
 			The {@link org.apache.juneau.rest.client.RestClientBuilder#interceptor(RestCallInterceptor)}
and {@link org.apache.juneau.rest.client.RestCall#interceptor(RestCallInterceptor)} methods
@@ -708,7 +766,7 @@
 					HttpUriRequest req = restCall.getRequest();
 					HttpResponse res = restCall.getResponse();
 					<jk>if</jk> (req != <jk>null</jk>) {
-						sb.append(<js>"\n=== HTTP Call =================================================================="</js>);
+						sb.append(<js>"\n=== HTTP Call (outgoing) ========================================================="</js>);
 	
 						sb.append(<js>"\n=== REQUEST ===\n"</js>).append(req);
 						sb.append(<js>"\n---request headers---"</js>);
@@ -755,7 +813,7 @@
 
 	<!-- ========================================================================================================
-->
 	<a id="Remoteable"></a>
-	<h3 class='topic' onclick='toggle(this)'>1.7 - Remotable Proxies</h3>
+	<h3 class='topic' onclick='toggle(this)'>1.8 - Remotable Proxies</h3>
 	<div class='topic'>
 		<p>
 			Juneau provides the capability of calling methods on POJOs on a server through client-side
proxy interfaces.
@@ -817,7 +875,7 @@
 
 	<!-- ========================================================================================================
-->
 	<a id="Other"></a>
-	<h3 class='topic' onclick='toggle(this)'>1.8 - Other Useful Methods</h3>
+	<h3 class='topic' onclick='toggle(this)'>1.9 - Other Useful Methods</h3>
 	<div class='topic'>
 		<p>
 			The {@link org.apache.juneau.rest.client.RestClientBuilder#rootUrl(Object)} method can
be used to specify a root URL on 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxy.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxy.java
b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxy.java
index 6b96290..359f103 100644
--- a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxy.java
+++ b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxy.java
@@ -22,6 +22,7 @@ public interface InterfaceProxy {
 	void returnVoid();
 	int returnInt();
 	Integer returnInteger();
+	boolean returnBoolean();
 	float returnFloat();
 	Float returnFloatObject();
 	String returnString();
@@ -33,10 +34,13 @@ public interface InterfaceProxy {
 	Bean returnBean();
 	Bean[] returnBeanArray();
 	List<Bean> returnBeanList();
+	Map<String,Bean> returnBeanMap();
+	Map<String,List<Bean>> returnBeanListMap();
 
 	void setNothing();
 	void setInt(int x);
 	void setInteger(Integer x);
+	void setBoolean(boolean x);
 	void setFloat(float x);
 	void setFloatObject(Float x);
 	void setString(String x);
@@ -48,6 +52,8 @@ public interface InterfaceProxy {
 	void setBean(Bean x);
 	void setBeanArray(Bean[] x);
 	void setBeanList(List<Bean> x);
+	void setBeanMap(Map<String,Bean> x);
+	void setBeanListMap(Map<String,List<Bean>> x);
 
 	public static class Bean {
 		public int a;

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxyResource.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxyResource.java
b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxyResource.java
index 82de1c2..b8cdf03 100644
--- a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxyResource.java
+++ b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/InterfaceProxyResource.java
@@ -26,6 +26,7 @@ import org.junit.*;
  */
 @RestResource(
 	path="/testInterfaceProxyResource")
+@SuppressWarnings("serial")
 public class InterfaceProxyResource extends RestServletJenaDefault {
 	private static final long serialVersionUID = 1L;
 
@@ -42,6 +43,8 @@ public class InterfaceProxyResource extends RestServletJenaDefault {
 			@Override
 			public int returnInt() { return 1; }
 			@Override
+			public boolean returnBoolean() { return true; }
+			@Override
 			public float returnFloat() { return 1f; }
 			@Override
 			public Float returnFloatObject() { return 1f; }
@@ -63,6 +66,10 @@ public class InterfaceProxyResource extends RestServletJenaDefault {
 			public Bean[] returnBeanArray() { return new Bean[]{new Bean().init()}; }
 			@Override
 			public List<Bean> returnBeanList() { return Arrays.asList(new Bean().init()); }
+			@Override
+			public Map<String,Bean> returnBeanMap() { return new HashMap<String,Bean>(){{put("foo",new
Bean().init());}}; }
+			@Override
+			public Map<String,List<Bean>> returnBeanListMap() { return new HashMap<String,List<Bean>>(){{put("foo",Arrays.asList(new
Bean().init()));}}; }
 
 			@Override
 			public void setNothing() {
@@ -76,6 +83,10 @@ public class InterfaceProxyResource extends RestServletJenaDefault {
 				assertEquals((Integer)1, x);
 			}
 			@Override
+			public void setBoolean(boolean x) {
+				assertTrue(x);
+			}
+			@Override
 			public void setFloat(float x) {
 				assertTrue(1f == x);
 			}
@@ -119,6 +130,14 @@ public class InterfaceProxyResource extends RestServletJenaDefault {
 			public void setBeanList(List<Bean> x) {
 				assertObjectEquals("[{a:1,b:'foo'}]", x);
 			}
+			@Override
+			public void setBeanMap(Map<String,Bean> x) {
+				assertObjectEquals("{foo:{a:1,b:'foo'}}", x);
+			}
+			@Override
+			public void setBeanListMap(Map<String,List<Bean>> x) {
+				assertObjectEquals("{foo:[{a:1,b:'foo'}]}", x);
+			}
 		};
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/InterfaceProxyTest.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/InterfaceProxyTest.java
b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/InterfaceProxyTest.java
index 4ed272d..6ecfb0d 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/InterfaceProxyTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/InterfaceProxyTest.java
@@ -31,6 +31,7 @@ import org.junit.runner.*;
 import org.junit.runners.*;
 
 @RunWith(Parameterized.class)
+@SuppressWarnings("serial")
 public class InterfaceProxyTest extends RestTestcase {
 
 	@Parameterized.Parameters
@@ -43,6 +44,7 @@ public class InterfaceProxyTest extends RestTestcase {
 			{ /* 4 */ "MessagePack", MsgPackSerializer.DEFAULT, MsgPackParser.DEFAULT },
 			{ /* 5 */ "UrlEncoding", UrlEncodingSerializer.DEFAULT, UrlEncodingParser.DEFAULT },
 			{ /* 6 */ "Uon", UonSerializer.DEFAULT, UonParser.DEFAULT },
+			//{ /* 7 */ "RdfXml", RdfSerializer.DEFAULT_XMLABBREV, RdfParser.DEFAULT_XML },
 		});
 	}
 
@@ -74,6 +76,11 @@ public class InterfaceProxyTest extends RestTestcase {
 	}
 
 	@Test
+	public void returnBoolean() {
+		assertEquals(true, getProxy().returnBoolean());
+	}
+
+	@Test
 	public void returnFloat() {
 		assertTrue(1f == getProxy().returnFloat());
 	}
@@ -134,6 +141,18 @@ public class InterfaceProxyTest extends RestTestcase {
 	}
 
 	@Test
+	public void returnBeanMap() {
+		assertObjectEquals("{foo:{a:1,b:'foo'}}", getProxy().returnBeanMap());
+		assertClass(InterfaceProxy.Bean.class, getProxy().returnBeanMap().get("foo"));
+	}
+
+	@Test
+	public void returnBeanListMap() {
+		assertObjectEquals("{foo:[{a:1,b:'foo'}]}", getProxy().returnBeanListMap());
+		assertClass(InterfaceProxy.Bean.class, getProxy().returnBeanListMap().get("foo").get(0));
+	}
+
+	@Test
 	public void setNothing() {
 		getProxy().setNothing();
 	}
@@ -159,6 +178,11 @@ public class InterfaceProxyTest extends RestTestcase {
 	}
 
 	@Test
+	public void setBoolean() {
+		getProxy().setBoolean(true);
+	}
+
+	@Test
 	public void setFloat() {
 		getProxy().setFloat(1f);
 	}
@@ -222,4 +246,14 @@ public class InterfaceProxyTest extends RestTestcase {
 	public void setBeanList() {
 		getProxy().setBeanList(Arrays.asList(new Bean().init()));
 	}
+
+	@Test
+	public void setBeanMap() {
+		getProxy().setBeanMap(new HashMap<String,Bean>(){{put("foo",new Bean().init());}});
+	}
+
+	@Test
+	public void setBeanListMap() {
+		getProxy().setBeanListMap(new HashMap<String,List<Bean>>(){{put("foo",Arrays.asList(new
Bean().init()));}});
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/9e095d85/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
index cd5d42c..e9d5936 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
@@ -130,10 +130,6 @@ public final class RestRequest extends HttpServletRequestWrapper {
 
 			debug = "true".equals(getQueryParameter("debug", "false")) || "true".equals(getHeader("Debug",
"false"));
 
-			if (debug) {
-				context.getLogger().log(Level.INFO, toString());
-			}
-
 		} catch (RestException e) {
 			throw e;
 		} catch (Exception e) {
@@ -156,6 +152,14 @@ public final class RestRequest extends HttpServletRequestWrapper {
 		this.beanSession = urlEncodingParser.getBeanContext().createSession();
 		this.defaultCharset = defaultCharset;
 		this.encoders = encoders;
+
+		if (debug) {
+			String msg = ""
+				+ "\n=== HTTP Request (incoming) ===================================================="
+				+ toString()
+				+ "\n=== END ========================================================================";
+			context.getLogger().log(Level.WARNING, msg);
+		}
 	}
 
 	/**


Mime
View raw message