juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [33/51] [partial] incubator-juneau git commit: Add project hierarchies, part 1
Date Sat, 02 Sep 2017 14:10:55 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
new file mode 100755
index 0000000..62b17dc
--- /dev/null
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/parser/ParserGroupTest.java
@@ -0,0 +1,116 @@
+// ***************************************************************************************************************************
+// * 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.parser;
+
+import static org.apache.juneau.TestUtils.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.json.*;
+import org.junit.*;
+
+@SuppressWarnings({"javadoc"})
+public class ParserGroupTest {
+
+	//====================================================================================================
+	// Test parser group matching
+	//====================================================================================================
+	@Test
+	public void testParserGroupMatching() throws Exception {
+
+		ParserGroup g = new ParserGroupBuilder().append(Parser1.class, Parser2.class, Parser3.class).build();
+		assertType(Parser1.class, g.getParser("text/foo"));
+		assertType(Parser1.class, g.getParser("text/foo_a"));
+		assertType(Parser1.class, g.getParser("text/foo_a+xxx"));
+		assertType(Parser1.class, g.getParser("text/xxx+foo_a"));
+		assertType(Parser2.class, g.getParser("text/foo+bar"));
+		assertType(Parser2.class, g.getParser("text/foo+bar_a"));
+		assertType(Parser2.class, g.getParser("text/bar+foo"));
+		assertType(Parser2.class, g.getParser("text/bar+foo+xxx"));
+		assertType(Parser3.class, g.getParser("text/baz"));
+		assertType(Parser3.class, g.getParser("text/baz_a"));
+		assertType(Parser3.class, g.getParser("text/baz+yyy"));
+		assertType(Parser3.class, g.getParser("text/baz_a+yyy"));
+		assertType(Parser3.class, g.getParser("text/yyy+baz"));
+		assertType(Parser3.class, g.getParser("text/yyy+baz_a"));
+	}
+
+
+	public static class Parser1 extends JsonParser {
+		public Parser1(PropertyStore propertyStore) {
+			super(propertyStore, "text/foo", "text/foo_a");
+		}
+	}
+
+	public static class Parser2 extends JsonParser {
+		public Parser2(PropertyStore propertyStore) {
+			super(propertyStore, "text/foo+bar", "text/foo+bar_a");
+		}
+	}
+
+	public static class Parser3 extends JsonParser {
+		public Parser3(PropertyStore propertyStore) {
+			super(propertyStore, "text/baz", "text/baz_a");
+		}
+	}
+
+	//====================================================================================================
+	// Test inheritence
+	//====================================================================================================
+	@Test
+	public void testInheritence() throws Exception {
+		ParserGroupBuilder gb = null;
+		ParserGroup g = null;
+
+		gb = new ParserGroupBuilder().append(P1.class, P2.class);
+		g = gb.build();
+		assertObjectEquals("['text/1','text/2','text/2a']", g.getSupportedMediaTypes());
+
+		gb = new ParserGroupBuilder(g).append(P3.class, P4.class);
+		g = gb.build();
+		assertObjectEquals("['text/3','text/4','text/4a','text/1','text/2','text/2a']", g.getSupportedMediaTypes());
+
+		gb = new ParserGroupBuilder(g).append(P5.class);
+		g = gb.build();
+		assertObjectEquals("['text/5','text/3','text/4','text/4a','text/1','text/2','text/2a']", g.getSupportedMediaTypes());
+	}
+
+	public static class P1 extends JsonParser {
+		public P1(PropertyStore propertyStore) {
+			super(propertyStore, "text/1");
+		}
+	}
+
+	public static class P2 extends JsonParser {
+		public P2(PropertyStore propertyStore) {
+			super(propertyStore, "text/2", "text/2a");
+		}
+	}
+
+	public static class P3 extends JsonParser {
+		public P3(PropertyStore propertyStore) {
+			super(propertyStore, "text/3");
+		}
+	}
+
+	public static class P4 extends JsonParser {
+		public P4(PropertyStore propertyStore) {
+			super(propertyStore, "text/4", "text/4a");
+		}
+	}
+
+	public static class P5 extends JsonParser {
+		public P5(PropertyStore propertyStore) {
+			super(propertyStore, "text/5");
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java
new file mode 100644
index 0000000..b439593
--- /dev/null
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java
@@ -0,0 +1,439 @@
+// ***************************************************************************************************************************
+// * 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.serializer;
+
+import java.io.*;
+import java.util.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.internal.*;
+import org.apache.juneau.utils.*;
+import org.junit.runner.*;
+import org.junit.runners.*;
+
+/**
+ * Verifies that Reader and InputStream objects are serialized correctly.
+ * Note that these are one-way serializations and you're not guaranteed to produce parsable output.
+ */
+@RunWith(Parameterized.class)
+@SuppressWarnings({"javadoc"})
+public class ReaderObjectComboTest extends ComboSerializeTest {
+
+	@Parameterized.Parameters
+	public static Collection<Object[]> getParameters() {
+		return Arrays.asList(new Object[][] {
+			{ 	/* 0 */
+				new ComboInput<Reader>(
+					"SimpleReader",
+					Reader.class,
+					null,
+					/* Json */		"foobar",
+					/* JsonT */		"foobar",
+					/* JsonR */		"foobar",
+					/* Xml */		"foobar",
+					/* XmlT */		"foobar",
+					/* XmlR */		"foobar\n",
+					/* XmlNs */		"foobar",
+					/* Html */		"foobar",
+					/* HtmlT */		"foobar",
+					/* HtmlR */		"foobar",
+					/* Uon */		"foobar",
+					/* UonT */		"foobar",
+					/* UonR */		"foobar",
+					/* UrlEnc */	"foobar",
+					/* UrlEncT */	"foobar",
+					/* UrlEncR */	"foobar",
+					/* MsgPack */	"666F6F626172",
+					/* MsgPackT */	"666F6F626172",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<j:value>foobar</j:value>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<j:value>foobar</j:value>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <j:value>foobar</j:value>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public Reader getInput() {
+						return new StringReader("foobar");
+					}
+				}
+			},
+			{ 	/* 1 */
+				new ComboInput<InputStream>(
+					"SimpleInputStream",
+					InputStream.class,
+					null,
+					/* Json */		"foobar",
+					/* JsonT */		"foobar",
+					/* JsonR */		"foobar",
+					/* Xml */		"foobar",
+					/* XmlT */		"foobar",
+					/* XmlR */		"foobar\n",
+					/* XmlNs */		"foobar",
+					/* Html */		"foobar",
+					/* HtmlT */		"foobar",
+					/* HtmlR */		"foobar",
+					/* Uon */		"foobar",
+					/* UonT */		"foobar",
+					/* UonR */		"foobar",
+					/* UrlEnc */	"foobar",
+					/* UrlEncT */	"foobar",
+					/* UrlEncR */	"foobar",
+					/* MsgPack */	"666F6F626172",
+					/* MsgPackT */	"666F6F626172",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<j:value>foobar</j:value>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<j:value>foobar</j:value>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <j:value>foobar</j:value>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public InputStream getInput() throws Exception {
+						return IOUtils.toInputStream("foobar");
+					}
+				}
+			},
+			{ 	/* 2 */
+				new ComboInput<BeanWithReaderField>(
+					"BeanWithReaderField",
+					BeanWithReaderField.class,
+					null,
+					/* Json */		"{f:fv}",
+					/* JsonT */		"{f:fv}",
+					/* JsonR */		"{\n\tf: fv\n}",
+					/* Xml */		"<object><f>fv</f></object>",
+					/* XmlT */		"<object><f>fv</f></object>",
+					/* XmlR */		"<object>\n\t<f>fv</f>\n</object>\n",
+					/* XmlNs */		"<object><f>fv</f></object>",
+					/* Html */		"<table><tr><td>f</td><td>fv</td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td>fv</td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td>fv</td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=fv)",
+					/* UonT */		"(f=fv)",
+					/* UonR */		"(\n\tf=fv\n)",
+					/* UrlEnc */	"f=fv",
+					/* UrlEncT */	"f=fv",
+					/* UrlEncR */	"f=fv",
+					/* MsgPack */	"81A1666676",
+					/* MsgPackT */	"81A1666676",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>fv</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>fv</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f>fv</jp:f>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReaderField getInput() throws Exception {
+						return new BeanWithReaderField().init();
+					}
+				}
+			},
+			{ 	/* 3 */
+				new ComboInput<BeanWithReader1dField>(
+					"BeanWithReader1dField",
+					BeanWithReader1dField.class,
+					null,
+					/* Json */		"{f:[fv1,fv2,null]}",
+					/* JsonT */		"{f:[fv1,fv2,null]}",
+					/* JsonR */		"{\n\tf: [\n\t\tfv1,\n\t\tfv2,\n\t\tnull\n\t]\n}",
+					/* Xml */		"<object><f>fv1fv2<null/></f></object>",
+					/* XmlT */		"<object><f>fv1fv2<null/></f></object>",
+					/* XmlR */		"<object>\n\t<f>\n\t\tfv1\n\t\tfv2\n\t\t<null/>\n\t</f>\n</object>\n",
+					/* XmlNs */		"<object><f>fv1fv2<null/></f></object>",
+					/* Html */		"<table><tr><td>f</td><td><ul><li>fv1</li><li>fv2</li><li><null/></li></ul></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><ul><li>fv1</li><li>fv2</li><li><null/></li></ul></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td>\n\t\t\t<ul>\n\t\t\t\t<li>fv1</li>\n\t\t\t\t<li>fv2</li>\n\t\t\t\t<li><null/></li>\n\t\t\t</ul>\n\t\t</td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=@(fv1,fv2,null))",
+					/* UonT */		"(f=@(fv1,fv2,null))",
+					/* UonR */		"(\n\tf=@(\n\t\tfv1,\n\t\tfv2,\n\t\tnull\n\t)\n)",
+					/* UrlEnc */	"f=@(fv1,fv2,null)",
+					/* UrlEncT */	"f=@(fv1,fv2,null)",
+					/* UrlEncR */	"f=@(\n\tfv1,\n\tfv2,\n\tnull\n)",
+					/* MsgPack */	"81A16693667631667632C0",
+					/* MsgPackT */	"81A16693667631667632C0",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>\n<rdf:Seq>\n<rdf:li>fv1</rdf:li>\n<rdf:li>fv2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>\n<rdf:Seq>\n<rdf:li>fv1</rdf:li>\n<rdf:li>fv2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f>\n      <rdf:Seq>\n        <rdf:li>fv1</rdf:li>\n        <rdf:li>fv2</rdf:li>\n        <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n      </rdf:Seq>\n    </jp:f>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReader1dField getInput() throws Exception {
+						return new BeanWithReader1dField().init();
+					}
+				}
+			},
+			{ 	/* 4 */
+				new ComboInput<BeanWithReaderNullField>(
+					"BeanWithReaderNullField",
+					BeanWithReaderNullField.class,
+					null,
+					/* Json */		"{f:null}",
+					/* JsonT */		"{f:null}",
+					/* JsonR */		"{\n\tf: null\n}",
+					/* Xml */		"<object><f _type='null'/></object>",
+					/* XmlT */		"<object><f t='null'/></object>",
+					/* XmlR */		"<object>\n\t<f _type='null'/>\n</object>\n",
+					/* XmlNs */		"<object><f _type='null'/></object>",
+					/* Html */		"<table><tr><td>f</td><td><null/></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><null/></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td><null/></td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=null)",
+					/* UonT */		"(f=null)",
+					/* UonR */		"(\n\tf=null\n)",
+					/* UrlEnc */	"f=null",
+					/* UrlEncT */	"f=null",
+					/* UrlEncR */	"f=null",
+					/* MsgPack */	"81A166C0",
+					/* MsgPackT */	"81A166C0",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReaderNullField getInput() throws Exception {
+						return new BeanWithReaderNullField().init();
+					}
+				}
+			},
+			{ 	/* 5 */
+				new ComboInput<BeanWithReaderListField>(
+					"BeanWithReaderListField",
+					BeanWithReaderListField.class,
+					null,
+					/* Json */		"{f:[fv1,fv2,null]}",
+					/* JsonT */		"{f:[fv1,fv2,null]}",
+					/* JsonR */		"{\n\tf: [\n\t\tfv1,\n\t\tfv2,\n\t\tnull\n\t]\n}",
+					/* Xml */		"<object><f>fv1fv2<null/></f></object>",
+					/* XmlT */		"<object><f>fv1fv2<null/></f></object>",
+					/* XmlR */		"<object>\n\t<f>\n\t\tfv1\n\t\tfv2\n\t\t<null/>\n\t</f>\n</object>\n",
+					/* XmlNs */		"<object><f>fv1fv2<null/></f></object>",
+					/* Html */		"<table><tr><td>f</td><td><ul><li>fv1</li><li>fv2</li><li><null/></li></ul></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><ul><li>fv1</li><li>fv2</li><li><null/></li></ul></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td>\n\t\t\t<ul>\n\t\t\t\t<li>fv1</li>\n\t\t\t\t<li>fv2</li>\n\t\t\t\t<li><null/></li>\n\t\t\t</ul>\n\t\t</td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=@(fv1,fv2,null))",
+					/* UonT */		"(f=@(fv1,fv2,null))",
+					/* UonR */		"(\n\tf=@(\n\t\tfv1,\n\t\tfv2,\n\t\tnull\n\t)\n)",
+					/* UrlEnc */	"f=@(fv1,fv2,null)",
+					/* UrlEncT */	"f=@(fv1,fv2,null)",
+					/* UrlEncR */	"f=@(\n\tfv1,\n\tfv2,\n\tnull\n)",
+					/* MsgPack */	"81A16693667631667632C0",
+					/* MsgPackT */	"81A16693667631667632C0",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>\n<rdf:Seq>\n<rdf:li>fv1</rdf:li>\n<rdf:li>fv2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>\n<rdf:Seq>\n<rdf:li>fv1</rdf:li>\n<rdf:li>fv2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f>\n      <rdf:Seq>\n        <rdf:li>fv1</rdf:li>\n        <rdf:li>fv2</rdf:li>\n        <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n      </rdf:Seq>\n    </jp:f>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReaderListField getInput() throws Exception {
+						return new BeanWithReaderListField().init();
+					}
+				}
+			},
+			{ 	/* 6 */
+				new ComboInput<BeanWithReaderMapField>(
+					"BeanWithReaderMapField",
+					BeanWithReaderMapField.class,
+					null,
+					/* Json */		"{f:{foo:fv1,bar:null,null:fv2}}",
+					/* JsonT */		"{f:{foo:fv1,bar:null,null:fv2}}",
+					/* JsonR */		"{\n\tf: {\n\t\tfoo: fv1,\n\t\tbar: null,\n\t\tnull: fv2\n\t}\n}",
+					/* Xml */		"<object><f><foo>fv1</foo><bar _type='null'/><_x0000_>fv2</_x0000_></f></object>",
+					/* XmlT */		"<object><f><foo>fv1</foo><bar t='null'/><_x0000_>fv2</_x0000_></f></object>",
+					/* XmlR */		"<object>\n\t<f>\n\t\t<foo>fv1</foo>\n\t\t<bar _type='null'/>\n\t\t<_x0000_>fv2</_x0000_>\n\t</f>\n</object>\n",
+					/* XmlNs */		"<object><f><foo>fv1</foo><bar _type='null'/><_x0000_>fv2</_x0000_></f></object>",
+					/* Html */		"<table><tr><td>f</td><td><table><tr><td>foo</td><td>fv1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>fv2</td></tr></table></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><table><tr><td>foo</td><td>fv1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>fv2</td></tr></table></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td>\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>foo</td>\n\t\t\t\t\t<td>fv1</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>bar</td>\n\t\t\t\t\t<td><null/></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t<td>fv2</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=(foo=fv1,bar=null,null=fv2))",
+					/* UonT */		"(f=(foo=fv1,bar=null,null=fv2))",
+					/* UonR */		"(\n\tf=(\n\t\tfoo=fv1,\n\t\tbar=null,\n\t\tnull=fv2\n\t)\n)",
+					/* UrlEnc */	"f=(foo=fv1,bar=null,null=fv2)",
+					/* UrlEncT */	"f=(foo=fv1,bar=null,null=fv2)",
+					/* UrlEncR */	"f=(\n\tfoo=fv1,\n\tbar=null,\n\tnull=fv2\n)",
+					/* MsgPack */	"81A16683A3666F6F667631A3626172C0C0667632",
+					/* MsgPackT */	"81A16683A3666F6F667631A3626172C0C0667632",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:parseType='Resource'>\n<jp:foo>fv1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>fv2</jp:_x0000_>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:parseType='Resource'>\n<jp:foo>fv1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>fv2</jp:_x0000_>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f rdf:parseType='Resource'>\n      <jp:foo>fv1</jp:foo>\n      <jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n      <jp:_x0000_>fv2</jp:_x0000_>\n    </jp:f>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReaderMapField getInput() throws Exception {
+						return new BeanWithReaderMapField().init();
+					}
+				}
+			},
+			{ 	/* 7 */
+				new ComboInput<BeanWithReaderBeanListField>(
+					"BeanWithReaderBeanListField",
+					BeanWithReaderBeanListField.class,
+					null,
+					/* Json */		"{f:[{f1:f1v,f2:[f2v1,f2v2,null],f3:null,f4:[f4v1,f4v2,null],f5:{foo:f5v1,bar:null,null:f5v2}},null]}",
+					/* JsonT */		"{f:[{f1:f1v,f2:[f2v1,f2v2,null],f3:null,f4:[f4v1,f4v2,null],f5:{foo:f5v1,bar:null,null:f5v2}},null]}",
+					/* JsonR */		"{\n\tf: [\n\t\t{\n\t\t\tf1: f1v,\n\t\t\tf2: [\n\t\t\t\tf2v1,\n\t\t\t\tf2v2,\n\t\t\t\tnull\n\t\t\t],\n\t\t\tf3: null,\n\t\t\tf4: [\n\t\t\t\tf4v1,\n\t\t\t\tf4v2,\n\t\t\t\tnull\n\t\t\t],\n\t\t\tf5: {\n\t\t\t\tfoo: f5v1,\n\t\t\t\tbar: null,\n\t\t\t\tnull: f5v2\n\t\t\t}\n\t\t},\n\t\tnull\n\t]\n}",
+					/* Xml */		"<object><f><object><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 _type='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar _type='null'/><_x0000_>f5v2</_x0000_></f5></object><null/></f></object>",
+					/* XmlT */		"<object><f><object><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 t='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar t='null'/><_x0000_>f5v2</_x0000_></f5></object><null/></f></object>",
+					/* XmlR */		"<object>\n\t<f>\n\t\t<object>\n\t\t\t<f1>f1v</f1>\n\t\t\t<f2>\n\t\t\t\tf2v1\n\t\t\t\tf2v2\n\t\t\t\t<null/>\n\t\t\t</f2>\n\t\t\t<f3 _type='null'/>\n\t\t\t<f4>\n\t\t\t\tf4v1\n\t\t\t\tf4v2\n\t\t\t\t<null/>\n\t\t\t</f4>\n\t\t\t<f5>\n\t\t\t\t<foo>f5v1</foo>\n\t\t\t\t<bar _type='null'/>\n\t\t\t\t<_x0000_>f5v2</_x0000_>\n\t\t\t</f5>\n\t\t</object>\n\t\t<null/>\n\t</f>\n</object>\n",
+					/* XmlNs */		"<object><f><object><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 _type='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar _type='null'/><_x0000_>f5v2</_x0000_></f5></object><null/></f></object>",
+					/* Html */		"<table><tr><td>f</td><td><ul><li><table><tr><td>f1</td><td>f1v</td></tr><tr><td>f2</td><td><ul><li>f2v1</li><li>f2v2</li><li><null/></li></ul></td></tr><tr><td>f3</td><td><null/></td></tr><tr><td>f4</td><td><ul><li>f4v1</li><li>f4v2</li><li><null/></li></ul></td></tr><tr><td>f5</td><td><table><tr><td>foo</td><td>f5v1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>f5v2</td></tr></table></td></tr></table></li><li><null/></li></ul></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><ul><li><table><tr><td>f1</td><td>f1v</td></tr><tr><td>f2</td><td><ul><li>f2v1</li><li>f2v2</li><li><null/></li></ul></td></tr><tr><td>f3</td><td><null/></td></tr><tr><td>f4</td><td><ul><li>f4v1</li><li>f4v2</li><li><null/></li></ul></td></tr><tr><td>f5</td><td><table><tr><td>foo</td><td>f5v1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>f5v2</td></tr></table></td></tr></table></li><li><null/></li></ul></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td>\n\t\t\t<ul>\n\t\t\t\t<li>\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>f1</td>\n\t\t\t\t\t\t\t<td>f1v</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>f2</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li>f2v1</li>\n\t\t\t\t\t\t\t\t\t<li>f2v2</li>\n\t\t\t\t\t\t\t\t\t<li><null/></li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>f3</td>\n\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>f4</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li>f4v1</li>\n\t\t\t\t\t\t\t\t\t<li>f4v2</li>\n\t\t\t\t\t\t\t\t\t<li><null/></li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>f5</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>foo</td>\n\t\t\t\t\t\t\t\t\t\t<td>f5v1</td>\n\t\t\t\t\t\t\t\
 t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>bar</td>\n\t\t\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t\t\t\t<td>f5v2</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</li>\n\t\t\t\t<li><null/></li>\n\t\t\t</ul>\n\t\t</td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=@((f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),null))",
+					/* UonT */		"(f=@((f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),null))",
+					/* UonR */		"(\n\tf=@(\n\t\t(\n\t\t\tf1=f1v,\n\t\t\tf2=@(\n\t\t\t\tf2v1,\n\t\t\t\tf2v2,\n\t\t\t\tnull\n\t\t\t),\n\t\t\tf3=null,\n\t\t\tf4=@(\n\t\t\t\tf4v1,\n\t\t\t\tf4v2,\n\t\t\t\tnull\n\t\t\t),\n\t\t\tf5=(\n\t\t\t\tfoo=f5v1,\n\t\t\t\tbar=null,\n\t\t\t\tnull=f5v2\n\t\t\t)\n\t\t),\n\t\tnull\n\t)\n)",
+					/* UrlEnc */	"f=@((f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),null)",
+					/* UrlEncT */	"f=@((f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),null)",
+					/* UrlEncR */	"f=@(\n\t(\n\t\tf1=f1v,\n\t\tf2=@(\n\t\t\tf2v1,\n\t\t\tf2v2,\n\t\t\tnull\n\t\t),\n\t\tf3=null,\n\t\tf4=@(\n\t\t\tf4v1,\n\t\t\tf4v2,\n\t\t\tnull\n\t\t),\n\t\tf5=(\n\t\t\tfoo=f5v1,\n\t\t\tbar=null,\n\t\t\tnull=f5v2\n\t\t)\n\t),\n\tnull\n)",
+					/* MsgPack */	"81A1669285A26631663176A26632936632763166327632C0A26633C0A26634936634763166347632C0A2663583A3666F6F66357631A3626172C0C066357632C0",
+					/* MsgPackT */	"81A1669285A26631663176A26632936632763166327632C0A26633C0A26634936634763166347632C0A2663583A3666F6F66357631A3626172C0C066357632C0",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>\n<rdf:Seq>\n<rdf:li rdf:parseType='Resource'>\n<jp:f1>f1v</jp:f1>\n<jp:f2>\n<rdf:Seq>\n<rdf:li>f2v1</rdf:li>\n<rdf:li>f2v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f2>\n<jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:f4>\n<rdf:Seq>\n<rdf:li>f4v1</rdf:li>\n<rdf:li>f4v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f4>\n<jp:f5 rdf:parseType='Resource'>\n<jp:foo>f5v1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>f5v2</jp:_x0000_>\n</jp:f5>\n</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f>\n<rdf:Seq>\n<rdf:li rdf:parseType='Resource'>\n<jp:f1>f1v</jp:f1>\n<jp:f2>\n<rdf:Seq>\n<rdf:li>f2v1</rdf:li>\n<rdf:li>f2v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f2>\n<jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:f4>\n<rdf:Seq>\n<rdf:li>f4v1</rdf:li>\n<rdf:li>f4v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f4>\n<jp:f5 rdf:parseType='Resource'>\n<jp:foo>f5v1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>f5v2</jp:_x0000_>\n</jp:f5>\n</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f>\n      <rdf:Seq>\n        <rdf:li rdf:parseType='Resource'>\n          <jp:f1>f1v</jp:f1>\n          <jp:f2>\n            <rdf:Seq>\n              <rdf:li>f2v1</rdf:li>\n              <rdf:li>f2v2</rdf:li>\n              <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n            </rdf:Seq>\n          </jp:f2>\n          <jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          <jp:f4>\n            <rdf:Seq>\n              <rdf:li>f4v1</rdf:li>\n              <rdf:li>f4v2</rdf:li>\n              <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n            </rdf:Seq>\n          </jp:f4>\n          <jp:f5 rdf:parseType='Resource'>\n            <jp:foo>f5v1</jp:foo>\n            <jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n            <jp:_x0000_>f5v2</jp:_x0000_>\n          </jp:f5>\n        </rdf:li>\n        <rdf:li rdf:r
 esource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n      </rdf:Seq>\n    </jp:f>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReaderBeanListField getInput() throws Exception {
+						return new BeanWithReaderBeanListField().init();
+					}
+				}
+			},
+			{ 	/* 8 */
+				new ComboInput<BeanWithReaderBeanMapField>(
+					"BeanWithReaderBeanMapField",
+					BeanWithReaderBeanMapField.class,
+					null,
+					/* Json */		"{f:{foo:{f1:f1v,f2:[f2v1,f2v2,null],f3:null,f4:[f4v1,f4v2,null],f5:{foo:f5v1,bar:null,null:f5v2}},bar:null,null:{f1:f1v,f2:[f2v1,f2v2,null],f3:null,f4:[f4v1,f4v2,null],f5:{foo:f5v1,bar:null,null:f5v2}}}}",
+					/* JsonT */		"{f:{foo:{f1:f1v,f2:[f2v1,f2v2,null],f3:null,f4:[f4v1,f4v2,null],f5:{foo:f5v1,bar:null,null:f5v2}},bar:null,null:{f1:f1v,f2:[f2v1,f2v2,null],f3:null,f4:[f4v1,f4v2,null],f5:{foo:f5v1,bar:null,null:f5v2}}}}",
+					/* JsonR */		"{\n\tf: {\n\t\tfoo: {\n\t\t\tf1: f1v,\n\t\t\tf2: [\n\t\t\t\tf2v1,\n\t\t\t\tf2v2,\n\t\t\t\tnull\n\t\t\t],\n\t\t\tf3: null,\n\t\t\tf4: [\n\t\t\t\tf4v1,\n\t\t\t\tf4v2,\n\t\t\t\tnull\n\t\t\t],\n\t\t\tf5: {\n\t\t\t\tfoo: f5v1,\n\t\t\t\tbar: null,\n\t\t\t\tnull: f5v2\n\t\t\t}\n\t\t},\n\t\tbar: null,\n\t\tnull: {\n\t\t\tf1: f1v,\n\t\t\tf2: [\n\t\t\t\tf2v1,\n\t\t\t\tf2v2,\n\t\t\t\tnull\n\t\t\t],\n\t\t\tf3: null,\n\t\t\tf4: [\n\t\t\t\tf4v1,\n\t\t\t\tf4v2,\n\t\t\t\tnull\n\t\t\t],\n\t\t\tf5: {\n\t\t\t\tfoo: f5v1,\n\t\t\t\tbar: null,\n\t\t\t\tnull: f5v2\n\t\t\t}\n\t\t}\n\t}\n}",
+					/* Xml */		"<object><f><foo><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 _type='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar _type='null'/><_x0000_>f5v2</_x0000_></f5></foo><bar _type='null'/><_x0000_><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 _type='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar _type='null'/><_x0000_>f5v2</_x0000_></f5></_x0000_></f></object>",
+					/* XmlT */		"<object><f><foo><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 t='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar t='null'/><_x0000_>f5v2</_x0000_></f5></foo><bar t='null'/><_x0000_><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 t='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar t='null'/><_x0000_>f5v2</_x0000_></f5></_x0000_></f></object>",
+					/* XmlR */		"<object>\n\t<f>\n\t\t<foo>\n\t\t\t<f1>f1v</f1>\n\t\t\t<f2>\n\t\t\t\tf2v1\n\t\t\t\tf2v2\n\t\t\t\t<null/>\n\t\t\t</f2>\n\t\t\t<f3 _type='null'/>\n\t\t\t<f4>\n\t\t\t\tf4v1\n\t\t\t\tf4v2\n\t\t\t\t<null/>\n\t\t\t</f4>\n\t\t\t<f5>\n\t\t\t\t<foo>f5v1</foo>\n\t\t\t\t<bar _type='null'/>\n\t\t\t\t<_x0000_>f5v2</_x0000_>\n\t\t\t</f5>\n\t\t</foo>\n\t\t<bar _type='null'/>\n\t\t<_x0000_>\n\t\t\t<f1>f1v</f1>\n\t\t\t<f2>\n\t\t\t\tf2v1\n\t\t\t\tf2v2\n\t\t\t\t<null/>\n\t\t\t</f2>\n\t\t\t<f3 _type='null'/>\n\t\t\t<f4>\n\t\t\t\tf4v1\n\t\t\t\tf4v2\n\t\t\t\t<null/>\n\t\t\t</f4>\n\t\t\t<f5>\n\t\t\t\t<foo>f5v1</foo>\n\t\t\t\t<bar _type='null'/>\n\t\t\t\t<_x0000_>f5v2</_x0000_>\n\t\t\t</f5>\n\t\t</_x0000_>\n\t</f>\n</object>\n",
+					/* XmlNs */		"<object><f><foo><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 _type='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar _type='null'/><_x0000_>f5v2</_x0000_></f5></foo><bar _type='null'/><_x0000_><f1>f1v</f1><f2>f2v1f2v2<null/></f2><f3 _type='null'/><f4>f4v1f4v2<null/></f4><f5><foo>f5v1</foo><bar _type='null'/><_x0000_>f5v2</_x0000_></f5></_x0000_></f></object>",
+					/* Html */		"<table><tr><td>f</td><td><table><tr><td>foo</td><td><table><tr><td>f1</td><td>f1v</td></tr><tr><td>f2</td><td><ul><li>f2v1</li><li>f2v2</li><li><null/></li></ul></td></tr><tr><td>f3</td><td><null/></td></tr><tr><td>f4</td><td><ul><li>f4v1</li><li>f4v2</li><li><null/></li></ul></td></tr><tr><td>f5</td><td><table><tr><td>foo</td><td>f5v1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>f5v2</td></tr></table></td></tr></table></td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td><table><tr><td>f1</td><td>f1v</td></tr><tr><td>f2</td><td><ul><li>f2v1</li><li>f2v2</li><li><null/></li></ul></td></tr><tr><td>f3</td><td><null/></td></tr><tr><td>f4</td><td><ul><li>f4v1</li><li>f4v2</li><li><null/></li></ul></td></tr><tr><td>f5</td><td><table><tr><td>foo</td><td>f5v1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>f5v2</td></tr></table></td></tr></table></td></tr></table></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><table><tr><td>foo</td><td><table><tr><td>f1</td><td>f1v</td></tr><tr><td>f2</td><td><ul><li>f2v1</li><li>f2v2</li><li><null/></li></ul></td></tr><tr><td>f3</td><td><null/></td></tr><tr><td>f4</td><td><ul><li>f4v1</li><li>f4v2</li><li><null/></li></ul></td></tr><tr><td>f5</td><td><table><tr><td>foo</td><td>f5v1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>f5v2</td></tr></table></td></tr></table></td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td><table><tr><td>f1</td><td>f1v</td></tr><tr><td>f2</td><td><ul><li>f2v1</li><li>f2v2</li><li><null/></li></ul></td></tr><tr><td>f3</td><td><null/></td></tr><tr><td>f4</td><td><ul><li>f4v1</li><li>f4v2</li><li><null/></li></ul></td></tr><tr><td>f5</td><td><table><tr><td>foo</td><td>f5v1</td></tr><tr><td>bar</td><td><null/></td></tr><tr><td><null/></td><td>f5v2</td></tr></table></td></tr></table></td></tr></table></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td>\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>foo</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f1</td>\n\t\t\t\t\t\t\t\t<td>f1v</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f2</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t<li>f2v1</li>\n\t\t\t\t\t\t\t\t\t\t<li>f2v2</li>\n\t\t\t\t\t\t\t\t\t\t<li><null/></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f3</td>\n\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f4</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t<li>f4v1</li>\n\t\t\t\t\t\t\t\t\t\t<li>f4v2</li>\n\t\t\t\t\t\t\t\t\t\t<li><null/></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f5</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<table>\
 n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>foo</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>f5v1</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>bar</td>\n\t\t\t\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t\t\t\t\t<td>f5v2</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>bar</td>\n\t\t\t\t\t<td><null/></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f1</td>\n\t\t\t\t\t\t\t\t<td>f1v</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f2</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t<li>f2v1</li>\n\t\t\t\t\t\t\t\t\t\t<li>f2v2</li>\n\t\t\t\t\t\t\t\t\t\t<li><null/></li>\n\t\t\t\t\t\t\t\t\t</ul
 >\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f3</td>\n\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f4</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t<li>f4v1</li>\n\t\t\t\t\t\t\t\t\t\t<li>f4v2</li>\n\t\t\t\t\t\t\t\t\t\t<li><null/></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>f5</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>foo</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>f5v1</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>bar</td>\n\t\t\t\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td><null/></td>\n\t\t\t\t\t\t\t\t\t\t\t<td>f5v2</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table
 >\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=(foo=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),bar=null,null=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2))))",
+					/* UonT */		"(f=(foo=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),bar=null,null=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2))))",
+					/* UonR */		"(\n\tf=(\n\t\tfoo=(\n\t\t\tf1=f1v,\n\t\t\tf2=@(\n\t\t\t\tf2v1,\n\t\t\t\tf2v2,\n\t\t\t\tnull\n\t\t\t),\n\t\t\tf3=null,\n\t\t\tf4=@(\n\t\t\t\tf4v1,\n\t\t\t\tf4v2,\n\t\t\t\tnull\n\t\t\t),\n\t\t\tf5=(\n\t\t\t\tfoo=f5v1,\n\t\t\t\tbar=null,\n\t\t\t\tnull=f5v2\n\t\t\t)\n\t\t),\n\t\tbar=null,\n\t\tnull=(\n\t\t\tf1=f1v,\n\t\t\tf2=@(\n\t\t\t\tf2v1,\n\t\t\t\tf2v2,\n\t\t\t\tnull\n\t\t\t),\n\t\t\tf3=null,\n\t\t\tf4=@(\n\t\t\t\tf4v1,\n\t\t\t\tf4v2,\n\t\t\t\tnull\n\t\t\t),\n\t\t\tf5=(\n\t\t\t\tfoo=f5v1,\n\t\t\t\tbar=null,\n\t\t\t\tnull=f5v2\n\t\t\t)\n\t\t)\n\t)\n)",
+					/* UrlEnc */	"f=(foo=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),bar=null,null=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)))",
+					/* UrlEncT */	"f=(foo=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)),bar=null,null=(f1=f1v,f2=@(f2v1,f2v2,null),f3=null,f4=@(f4v1,f4v2,null),f5=(foo=f5v1,bar=null,null=f5v2)))",
+					/* UrlEncR */	"f=(\n\tfoo=(\n\t\tf1=f1v,\n\t\tf2=@(\n\t\t\tf2v1,\n\t\t\tf2v2,\n\t\t\tnull\n\t\t),\n\t\tf3=null,\n\t\tf4=@(\n\t\t\tf4v1,\n\t\t\tf4v2,\n\t\t\tnull\n\t\t),\n\t\tf5=(\n\t\t\tfoo=f5v1,\n\t\t\tbar=null,\n\t\t\tnull=f5v2\n\t\t)\n\t),\n\tbar=null,\n\tnull=(\n\t\tf1=f1v,\n\t\tf2=@(\n\t\t\tf2v1,\n\t\t\tf2v2,\n\t\t\tnull\n\t\t),\n\t\tf3=null,\n\t\tf4=@(\n\t\t\tf4v1,\n\t\t\tf4v2,\n\t\t\tnull\n\t\t),\n\t\tf5=(\n\t\t\tfoo=f5v1,\n\t\t\tbar=null,\n\t\t\tnull=f5v2\n\t\t)\n\t)\n)",
+					/* MsgPack */	"81A16683A3666F6F85A26631663176A26632936632763166327632C0A26633C0A26634936634763166347632C0A2663583A3666F6F66357631A3626172C0C066357632A3626172C0C085A26631663176A26632936632763166327632C0A26633C0A26634936634763166347632C0A2663583A3666F6F66357631A3626172C0C066357632",
+					/* MsgPackT */	"81A16683A3666F6F85A26631663176A26632936632763166327632C0A26633C0A26634936634763166347632C0A2663583A3666F6F66357631A3626172C0C066357632A3626172C0C085A26631663176A26632936632763166327632C0A26633C0A26634936634763166347632C0A2663583A3666F6F66357631A3626172C0C066357632",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:parseType='Resource'>\n<jp:foo rdf:parseType='Resource'>\n<jp:f1>f1v</jp:f1>\n<jp:f2>\n<rdf:Seq>\n<rdf:li>f2v1</rdf:li>\n<rdf:li>f2v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f2>\n<jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:f4>\n<rdf:Seq>\n<rdf:li>f4v1</rdf:li>\n<rdf:li>f4v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f4>\n<jp:f5 rdf:parseType='Resource'>\n<jp:foo>f5v1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>f5v2</jp:_x0000_>\n</jp:f5>\n</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_ rdf:parseType='Resource'>\n<jp:f1>f1v</jp:f1>\n<jp:f2>\n<rdf:Seq>\n<rdf:li>f2v1</rdf:li>\n<rdf:li>f2v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n<
 /jp:f2>\n<jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:f4>\n<rdf:Seq>\n<rdf:li>f4v1</rdf:li>\n<rdf:li>f4v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f4>\n<jp:f5 rdf:parseType='Resource'>\n<jp:foo>f5v1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>f5v2</jp:_x0000_>\n</jp:f5>\n</jp:_x0000_>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:parseType='Resource'>\n<jp:foo rdf:parseType='Resource'>\n<jp:f1>f1v</jp:f1>\n<jp:f2>\n<rdf:Seq>\n<rdf:li>f2v1</rdf:li>\n<rdf:li>f2v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f2>\n<jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:f4>\n<rdf:Seq>\n<rdf:li>f4v1</rdf:li>\n<rdf:li>f4v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f4>\n<jp:f5 rdf:parseType='Resource'>\n<jp:foo>f5v1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>f5v2</jp:_x0000_>\n</jp:f5>\n</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_ rdf:parseType='Resource'>\n<jp:f1>f1v</jp:f1>\n<jp:f2>\n<rdf:Seq>\n<rdf:li>f2v1</rdf:li>\n<rdf:li>f2v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n
 </jp:f2>\n<jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:f4>\n<rdf:Seq>\n<rdf:li>f4v1</rdf:li>\n<rdf:li>f4v2</rdf:li>\n<rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Seq>\n</jp:f4>\n<jp:f5 rdf:parseType='Resource'>\n<jp:foo>f5v1</jp:foo>\n<jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n<jp:_x0000_>f5v2</jp:_x0000_>\n</jp:f5>\n</jp:_x0000_>\n</jp:f>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f rdf:parseType='Resource'>\n      <jp:foo rdf:parseType='Resource'>\n        <jp:f1>f1v</jp:f1>\n        <jp:f2>\n          <rdf:Seq>\n            <rdf:li>f2v1</rdf:li>\n            <rdf:li>f2v2</rdf:li>\n            <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          </rdf:Seq>\n        </jp:f2>\n        <jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n        <jp:f4>\n          <rdf:Seq>\n            <rdf:li>f4v1</rdf:li>\n            <rdf:li>f4v2</rdf:li>\n            <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          </rdf:Seq>\n        </jp:f4>\n        <jp:f5 rdf:parseType='Resource'>\n          <jp:foo>f5v1</jp:foo>\n          <jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          <jp:_x0000_>f5v2</jp:_x0000_>\n        </jp:f5>\n      </jp:foo>\n      <jp:bar rdf:resource='http://www.w3.org/1999/02/22-rd
 f-syntax-ns#nil'/>\n      <jp:_x0000_ rdf:parseType='Resource'>\n        <jp:f1>f1v</jp:f1>\n        <jp:f2>\n          <rdf:Seq>\n            <rdf:li>f2v1</rdf:li>\n            <rdf:li>f2v2</rdf:li>\n            <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          </rdf:Seq>\n        </jp:f2>\n        <jp:f3 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n        <jp:f4>\n          <rdf:Seq>\n            <rdf:li>f4v1</rdf:li>\n            <rdf:li>f4v2</rdf:li>\n            <rdf:li rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          </rdf:Seq>\n        </jp:f4>\n        <jp:f5 rdf:parseType='Resource'>\n          <jp:foo>f5v1</jp:foo>\n          <jp:bar rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n          <jp:_x0000_>f5v2</jp:_x0000_>\n        </jp:f5>\n      </jp:_x0000_>\n    </jp:f>\n  </rdf:Description>\n</rdf:RDF>\n"
+				) {
+					@Override
+					public BeanWithReaderBeanMapField getInput() throws Exception {
+						return new BeanWithReaderBeanMapField().init();
+					}
+				}
+			},
+		});
+	}
+
+	public ReaderObjectComboTest(ComboInput<?> comboInput) {
+		super(comboInput);
+	}
+
+	@Override
+	protected Serializer applySettings(Serializer s) throws Exception {
+		return s.builder().trimNullProperties(false).build();
+	}
+
+	public static class BeanWithReaderField {
+		public Reader f;
+		public BeanWithReaderField init() {
+			f = new StringReader("fv");
+			return this;
+		}
+	}
+
+	public static class BeanWithReader1dField {
+		public Reader[] f;
+		public BeanWithReader1dField init() {
+			f = new Reader[]{new StringReader("fv1"),new StringReader("fv2"),null};
+			return this;
+		}
+	}
+
+	public static class BeanWithReaderNullField {
+		public Reader f;
+		public BeanWithReaderNullField init() {
+			f = null;
+			return this;
+		}
+	}
+
+	public static class BeanWithReaderListField {
+		public List<Reader> f;
+		public BeanWithReaderListField init() {
+			f = new AList<Reader>()
+				.append(new StringReader("fv1"))
+				.append(new StringReader("fv2"))
+				.append(null)
+			;
+			return this;
+		}
+	}
+
+	public static class BeanWithReaderMapField {
+		public Map<String,Reader> f;
+		public BeanWithReaderMapField init() {
+			f = new AMap<String,Reader>()
+				.append("foo", new StringReader("fv1"))
+				.append("bar", null)
+				.append(null, new StringReader("fv2"))
+			;
+			return this;
+		}
+	}
+
+	public static class BeanWithReaderBeanListField {
+		public List<B> f;
+		public BeanWithReaderBeanListField init() {
+			f = new AList<B>()
+				.append(new B().init())
+				.append(null)
+			;
+			return this;
+		}
+	}
+
+	public static class BeanWithReaderBeanMapField {
+		public Map<String,B> f;
+		public BeanWithReaderBeanMapField init() {
+			f = new AMap<String,B>()
+				.append("foo", new B().init())
+				.append("bar", null)
+				.append(null, new B().init())
+			;
+			return this;
+		}
+	}
+
+	public static class B {
+		public Reader f1;
+		public Reader[] f2;
+		public Reader f3;
+		public List<Reader> f4;
+		public Map<String,Reader> f5;
+
+		public B init() {
+			f1 = new StringReader("f1v");
+			f2 = new Reader[]{new StringReader("f2v1"),new StringReader("f2v2"),null};
+			f3 = null;
+			f4 = new AList<Reader>()
+				.append(new StringReader("f4v1"))
+				.append(new StringReader("f4v2"))
+				.append(null)
+			;
+			f5 = new AMap<String,Reader>()
+				.append("foo", new StringReader("f5v1"))
+				.append("bar", null)
+				.append(null, new StringReader("f5v2"))
+			;
+			return this;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
new file mode 100755
index 0000000..b5e2db9
--- /dev/null
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/SerializerGroupTest.java
@@ -0,0 +1,154 @@
+// ***************************************************************************************************************************
+// * 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.serializer;
+
+import static org.apache.juneau.TestUtils.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.json.*;
+import org.junit.*;
+
+@SuppressWarnings({"javadoc"})
+public class SerializerGroupTest {
+
+	//====================================================================================================
+	// Trim nulls from beans
+	//====================================================================================================
+	@Test
+	public void testSerializerGroupMatching() throws Exception {
+
+		SerializerGroup sg = new SerializerGroupBuilder().append(SA1.class, SA2.class, SA3.class).build();
+		assertType(SA1.class, sg.getSerializer("text/foo"));
+		assertType(SA1.class, sg.getSerializer("text/foo_a"));
+		assertType(SA1.class, sg.getSerializer("text/xxx+foo_a"));
+		assertType(SA1.class, sg.getSerializer("text/foo_a+xxx"));
+		assertType(SA2.class, sg.getSerializer("text/foo+bar"));
+		assertType(SA2.class, sg.getSerializer("text/foo+bar_a"));
+		assertType(SA2.class, sg.getSerializer("text/bar+foo"));
+		assertType(SA2.class, sg.getSerializer("text/bar_a+foo"));
+		assertType(SA2.class, sg.getSerializer("text/bar+foo+xxx"));
+		assertType(SA2.class, sg.getSerializer("text/bar_a+foo+xxx"));
+		assertType(SA3.class, sg.getSerializer("text/baz"));
+		assertType(SA3.class, sg.getSerializer("text/baz_a"));
+		assertType(SA3.class, sg.getSerializer("text/baz+yyy"));
+		assertType(SA3.class, sg.getSerializer("text/baz_a+yyy"));
+		assertType(SA3.class, sg.getSerializer("text/yyy+baz"));
+		assertType(SA3.class, sg.getSerializer("text/yyy+baz_a"));
+
+		assertType(SA1.class, sg.getSerializer("text/foo;q=0.9,text/foo+bar;q=0.8"));
+		assertType(SA2.class, sg.getSerializer("text/foo;q=0.8,text/foo+bar;q=0.9"));
+	}
+
+
+	public static class SA1 extends JsonSerializer {
+		public SA1(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/foo", "text/foo_a");
+		}
+	}
+
+	public static class SA2 extends JsonSerializer {
+		public SA2(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/foo+bar", "text/foo+bar_a");
+		}
+	}
+
+	public static class SA3 extends JsonSerializer {
+		public SA3(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/baz", "text/baz_a");
+		}
+	}
+
+	//====================================================================================================
+	// Test inheritence
+	//====================================================================================================
+	@Test
+	public void testInheritence() throws Exception {
+		SerializerGroupBuilder gb = null;
+		SerializerGroup g = null;
+
+		gb = new SerializerGroupBuilder().append(SB1.class, SB2.class);
+		g = gb.build();
+		assertObjectEquals("['text/1','text/2','text/2a']", g.getSupportedMediaTypes());
+
+		gb = new SerializerGroupBuilder(g).append(SB3.class, SB4.class);
+		g = gb.build();
+		assertObjectEquals("['text/3','text/4','text/4a','text/1','text/2','text/2a']", g.getSupportedMediaTypes());
+
+		gb = new SerializerGroupBuilder(g).append(SB5.class);
+		g = gb.build();
+		assertObjectEquals("['text/5','text/3','text/4','text/4a','text/1','text/2','text/2a']", g.getSupportedMediaTypes());
+	}
+
+	public static class SB1 extends JsonSerializer {
+		public SB1(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/1");
+		}
+	}
+
+	public static class SB2 extends JsonSerializer {
+		public SB2(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/2", "text/2a");
+		}
+	}
+
+	public static class SB3 extends JsonSerializer {
+		public SB3(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/3");
+		}
+	}
+
+	public static class SB4 extends JsonSerializer {
+		public SB4(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/4", "text/4a");
+		}
+	}
+
+	public static class SB5 extends JsonSerializer {
+		public SB5(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/5");
+		}
+	}
+
+	//====================================================================================================
+	// Test media type with meta-characters
+	//====================================================================================================
+	@Test
+	public void testMediaTypesWithMetaCharacters() throws Exception {
+		SerializerGroupBuilder gb = null;
+		SerializerGroup g = null;
+
+		gb = new SerializerGroupBuilder().append(SC1.class, SC2.class, SC3.class);
+		g = gb.build();
+		assertType(SC1.class, g.getSerializer("text/foo"));
+		assertType(SC2.class, g.getSerializer("foo/json"));
+		assertType(SC3.class, g.getSerializer("foo/foo"));
+	}
+
+	public static class SC1 extends JsonSerializer {
+		public SC1(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "text/*");
+		}
+	}
+
+	public static class SC2 extends JsonSerializer {
+		public SC2(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "*/json");
+		}
+	}
+
+	public static class SC3 extends JsonSerializer {
+		public SC3(PropertyStore propertyStore) {
+			super(propertyStore, "application/json", "*/*");
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/TestURI.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/TestURI.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/TestURI.java
new file mode 100755
index 0000000..80c1b61
--- /dev/null
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/serializer/TestURI.java
@@ -0,0 +1,92 @@
+// ***************************************************************************************************************************
+// * 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.serializer;
+
+import java.net.URI;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.jena.annotation.*;
+import org.apache.juneau.xml.*;
+import org.apache.juneau.xml.annotation.*;
+
+@SuppressWarnings("javadoc")
+@Bean(sort=true)
+public class TestURI {
+
+	// String annotated as a URI
+	@org.apache.juneau.annotation.URI
+	@Rdf(beanUri=true)
+	@Xml(format=XmlFormat.ATTR)
+	public String f0 = "f0/x0";
+
+	// URI properties
+	public URI
+		f1a = URI.create("http://www.apache.org/f1a"),
+		f1b = URI.create("/f1b"),
+		f1c = URI.create("/f1c/x/y"),
+		f1d = URI.create("f1d"),
+		f1e = URI.create("f1e/x/y"),
+		f1f = URI.create(""),
+		f1g = URI.create("servlet:/f1g/x"),
+		f1h = URI.create("servlet:/f1h"),
+		f1i = URI.create("servlet:/"),
+		f1j = URI.create("servlet:/.."),
+		f1k = URI.create("context:/f1j/x"),
+		f1l = URI.create("context:/f1k"),
+		f1m = URI.create("context:/"),
+		f1n = URI.create("context:/.."),
+		fio = null;
+
+	// Strings annotated with @URI properties
+	@org.apache.juneau.annotation.URI
+	public String
+		f2a = "http://www.apache.org/f2a",
+		f2b = "/f2b",
+		f2c = "/f2c/x/y",
+		f2d = "f2d",
+		f2e = "f2e/x/y",
+		f2f = "",
+		f2g = "servlet:/f2g/x",
+		f2h = "servlet:/f2h",
+		f2i = "servlet:/",
+		f2j = "servlet:/..",
+		f2k = "context:/f2j/x",
+		f2l = "context:/f2k",
+		f2m = "context:/",
+		f2n = "context:/..",
+		f2o = null;
+
+	// Strings with labels
+	@org.apache.juneau.annotation.URI
+	public String
+		f3a = "http://www.apache.org/f3a/x?label=MY_LABEL&foo=bar",
+		f3b = XmlUtils.urlEncode("<>&'\""),
+		f3c = "<>&'\"";  // Invalid URI, but should produce parsable output.
+
+	// @URI on bean
+	public TestURIb f4 = new TestURIb();
+
+	// @URI on bean property method.
+	@org.apache.juneau.annotation.URI
+	public String getF5() {
+		return "f5/x";
+	}
+
+	@org.apache.juneau.annotation.URI
+	public static class TestURIb {
+		@Override /* Object */
+		public String toString() {
+			return "test/uri/b";
+		}
+	}
+}
\ No newline at end of file


Mime
View raw message