Repository: incubator-juneau
Updated Branches:
  refs/heads/master 4d73a6368 -> 1321591d3


Bug fixes and tests.

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

Branch: refs/heads/master
Commit: 1321591d30c1a361a52769d38ef85ebc70a7da10
Parents: 4d73a63
Author: JamesBognar <[email protected]>
Authored: Mon Apr 3 11:18:46 2017 -0400
Committer: JamesBognar <[email protected]>
Committed: Mon Apr 3 11:18:46 2017 -0400

----------------------------------------------------------------------
 .../org/apache/juneau/html/BasicHtmlTest.java   |  38 +--
 .../transforms/BeanDictionaryComboTest.java     | 246 +++++++++++++++++++
 .../java/org/apache/juneau/html/HtmlParser.java |   4 +-
 .../org/apache/juneau/html/HtmlSerializer.java  |   9 +-
 4 files changed, 272 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/1321591d/juneau-core-test/src/test/java/org/apache/juneau/html/BasicHtmlTest.java
----------------------------------------------------------------------
diff --git 
a/juneau-core-test/src/test/java/org/apache/juneau/html/BasicHtmlTest.java 
b/juneau-core-test/src/test/java/org/apache/juneau/html/BasicHtmlTest.java
index e6fec70..2cf1fcd 100644
--- a/juneau-core-test/src/test/java/org/apache/juneau/html/BasicHtmlTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/html/BasicHtmlTest.java
@@ -512,11 +512,11 @@ public class BasicHtmlTest {
                                        +"<tr>"
                                                +"<td>b2</td>"
                                                +"<td>"
-                                                       +"<table _type='B^'>"
+                                                       +"<table _type='array'>"
                                                                +"<tr>"
                                                                        
+"<th>b</th>"
                                                                +"</tr>"
-                                                               +"<tr>"
+                                                               +"<tr 
_type='B'>"
                                                                        
+"<td>foo</td>"
                                                                +"</tr>"
                                                        +"</table>"
@@ -553,11 +553,11 @@ public class BasicHtmlTest {
                                        +"\t<tr>\n"
                                                +"\t\t<td>b2</td>\n"
                                                +"\t\t<td>\n"
-                                                       +"\t\t\t<table 
_type='B^'>\n"
+                                                       +"\t\t\t<table 
_type='array'>\n"
                                                                
+"\t\t\t\t<tr>\n"
                                                                        
+"\t\t\t\t\t<th>b</th>\n"
                                                                
+"\t\t\t\t</tr>\n"
-                                                               
+"\t\t\t\t<tr>\n"
+                                                               +"\t\t\t\t<tr 
_type='B'>\n"
                                                                        
+"\t\t\t\t\t<td>foo</td>\n"
                                                                
+"\t\t\t\t</tr>\n"
                                                        +"\t\t\t</table>\n"
@@ -579,7 +579,7 @@ public class BasicHtmlTest {
                                +"</table>\n",
                        },
                        {
-                               "BeanWithPropertiesWithArrayTypeNames",
+                               "BeanWithPropertiesWith2dArrayTypeNames",
                                new 
BeanWithPropertiesWith2dArrayTypeNames().init(),
                                "<table>"
                                        +"<tr>"
@@ -602,7 +602,7 @@ public class BasicHtmlTest {
                                        +"<tr>"
                                                +"<td>b2</td>"
                                                +"<td>"
-                                                               +"<ul 
_type='B^^'>"
+                                                               +"<ul>"
                                                                        +"<li>"
                                                                                
+"<table _type='array'>"
                                                                                
        +"<tr>"
@@ -655,7 +655,7 @@ public class BasicHtmlTest {
                                        +"\t<tr>\n"
                                                +"\t\t<td>b2</td>\n"
                                                +"\t\t<td>\n"
-                                                       +"\t\t\t<ul 
_type='B^^'>\n"
+                                                       +"\t\t\t<ul>\n"
                                                                
+"\t\t\t\t<li>\n"
                                                                        
+"\t\t\t\t\t<table _type='array'>\n"
                                                                                
+"\t\t\t\t\t\t<tr>\n"
@@ -979,11 +979,11 @@ public class BasicHtmlTest {
                                        +"<tr>"
                                                +"<td>ia1</td>"
                                                +"<td>"
-                                                       +"<table _type='A^'>"
+                                                       +"<table _type='array'>"
                                                                +"<tr>"
                                                                        
+"<th>a</th>"
                                                                +"</tr>"
-                                                               +"<tr>"
+                                                               +"<tr 
_type='A'>"
                                                                        
+"<td>foo</td>"
                                                                +"</tr>"
                                                        +"</table>"
@@ -1005,11 +1005,11 @@ public class BasicHtmlTest {
                                        +"<tr>"
                                                +"<td>aa1</td>"
                                                +"<td>"
-                                                       +"<table _type='A^'>"
+                                                       +"<table _type='array'>"
                                                                +"<tr>"
                                                                        
+"<th>a</th>"
                                                                +"</tr>"
-                                                               +"<tr>"
+                                                               +"<tr 
_type='A'>"
                                                                        
+"<td>foo</td>"
                                                                +"</tr>"
                                                        +"</table>"
@@ -1031,11 +1031,11 @@ public class BasicHtmlTest {
                                        +"<tr>"
                                                +"<td>o1</td>"
                                                +"<td>"
-                                                       +"<table _type='A^'>"
+                                                       +"<table _type='array'>"
                                                                +"<tr>"
                                                                        
+"<th>a</th>"
                                                                +"</tr>"
-                                                               +"<tr>"
+                                                               +"<tr 
_type='A'>"
                                                                        
+"<td>foo</td>"
                                                                +"</tr>"
                                                        +"</table>"
@@ -1072,11 +1072,11 @@ public class BasicHtmlTest {
                                        +"\t<tr>\n"
                                                +"\t\t<td>ia1</td>\n"
                                                +"\t\t<td>\n"
-                                                       +"\t\t\t<table 
_type='A^'>\n"
+                                                       +"\t\t\t<table 
_type='array'>\n"
                                                                
+"\t\t\t\t<tr>\n"
                                                                        
+"\t\t\t\t\t<th>a</th>\n"
                                                                
+"\t\t\t\t</tr>\n"
-                                                               
+"\t\t\t\t<tr>\n"
+                                                               +"\t\t\t\t<tr 
_type='A'>\n"
                                                                        
+"\t\t\t\t\t<td>foo</td>\n"
                                                                
+"\t\t\t\t</tr>\n"
                                                        +"\t\t\t</table>\n"
@@ -1098,11 +1098,11 @@ public class BasicHtmlTest {
                                        +"\t<tr>\n"
                                                +"\t\t<td>aa1</td>\n"
                                                +"\t\t<td>\n"
-                                                       +"\t\t\t<table 
_type='A^'>\n"
+                                                       +"\t\t\t<table 
_type='array'>\n"
                                                                
+"\t\t\t\t<tr>\n"
                                                                        
+"\t\t\t\t\t<th>a</th>\n"
                                                                
+"\t\t\t\t</tr>\n"
-                                                               
+"\t\t\t\t<tr>\n"
+                                                               +"\t\t\t\t<tr 
_type='A'>\n"
                                                                        
+"\t\t\t\t\t<td>foo</td>\n"
                                                                
+"\t\t\t\t</tr>\n"
                                                        +"\t\t\t</table>\n"
@@ -1124,11 +1124,11 @@ public class BasicHtmlTest {
                                        +"\t<tr>\n"
                                                +"\t\t<td>o1</td>\n"
                                                +"\t\t<td>\n"
-                                                       +"\t\t\t<table 
_type='A^'>\n"
+                                                       +"\t\t\t<table 
_type='array'>\n"
                                                                
+"\t\t\t\t<tr>\n"
                                                                        
+"\t\t\t\t\t<th>a</th>\n"
                                                                
+"\t\t\t\t</tr>\n"
-                                                               
+"\t\t\t\t<tr>\n"
+                                                               +"\t\t\t\t<tr 
_type='A'>\n"
                                                                        
+"\t\t\t\t\t<td>foo</td>\n"
                                                                
+"\t\t\t\t</tr>\n"
                                                        +"\t\t\t</table>\n"

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/1321591d/juneau-core-test/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
----------------------------------------------------------------------
diff --git 
a/juneau-core-test/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
 
b/juneau-core-test/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
new file mode 100644
index 0000000..5ccd899
--- /dev/null
+++ 
b/juneau-core-test/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
@@ -0,0 +1,246 @@
+// 
***************************************************************************************************************************
+// * 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.transforms;
+
+import java.util.*;
+
+import org.apache.juneau.*;
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.parser.*;
+import org.apache.juneau.serializer.*;
+import org.junit.runner.*;
+import org.junit.runners.*;
+
+/**
+ * Exhaustive serialization tests for the CalendarSwap class.
+ */
+@RunWith(Parameterized.class)
+@SuppressWarnings({"javadoc"})
+public class BeanDictionaryComboTest extends ComboTest {
+
+       @Parameterized.Parameters
+       public static Collection<Object[]> getParameters() {
+               return Arrays.asList(new Object[][] {
+                       {       /* 0 */
+                               "A",
+                               new A().init(),
+                               /* Json */              "{_type:'A',a:1}",
+                               /* JsonT */             "{t:'A',a:1}",
+                               /* JsonR */             "{\n\t_type: 'A',\n\ta: 
1\n}",
+                               /* Xml */               "<A><a>1</a></A>",
+                               /* XmlT */              "<A><a>1</a></A>",
+                               /* XmlR */              
"<A>\n\t<a>1</a>\n</A>\n",
+                               /* XmlNs */             "<A><a>1</a></A>",
+                               /* Html */              "<table 
_type='A'><tr><td>a</td><td>1</td></tr></table>",
+                               /* HtmlT */             "<table 
t='A'><tr><td>a</td><td>1</td></tr></table>",
+                               /* HtmlR */             "<table 
_type='A'>\n\t<tr>\n\t\t<td>a</td>\n\t\t<td>1</td>\n\t</tr>\n</table>\n",
+                               /* Uon */               "(_type=A,a=1)",
+                               /* UonT */              "(t=A,a=1)",
+                               /* UonR */              
"(\n\t_type=A,\n\ta=1\n)",
+                               /* UrlEnc */    "_type=A&a=1",
+                               /* UrlEncT */   "t=A&a=1",
+                               /* UrlEncR */   "_type=A\n&a=1",
+                               /* MsgPack */   "82A55F74797065A141A16101",
+                               /* MsgPackT */  "82A174A141A16101",
+                               /* RdfXml */    
"<rdf:RDF>\n<rdf:Description>\n<jp:_type>A</jp:_type>\n<jp:a>1</jp:a>\n</rdf:Description>\n</rdf:RDF>\n",
+                               /* RdfXmlT */   
"<rdf:RDF>\n<rdf:Description>\n<jp:t>A</jp:t>\n<jp:a>1</jp:a>\n</rdf:Description>\n</rdf:RDF>\n",
+                               /* RdfXmlR */   "<rdf:RDF>\n  
<rdf:Description>\n    <jp:_type>A</jp:_type>\n    <jp:a>1</jp:a>\n  
</rdf:Description>\n</rdf:RDF>\n",
+                       },
+                       {
+                               "A[]",
+                               new A[]{new A().init()},
+                               /* Json */              "[{_type:'A',a:1}]",
+                               /* JsonT */             "[{t:'A',a:1}]",
+                               /* JsonR */             "[\n\t{\n\t\t_type: 
'A',\n\t\ta: 1\n\t}\n]",
+                               /* Xml */               "<array 
_type='A^'><A><a>1</a></A></array>",
+                               /* XmlT */              "<array 
t='A^'><A><a>1</a></A></array>",
+                               /* XmlR */              "<array 
_type='A^'>\n\t<A>\n\t\t<a>1</a>\n\t</A>\n</array>\n",
+                               /* XmlNs */             "<array 
_type='A^'><A><a>1</a></A></array>",
+                               /* Html */              "<table 
_type='array'><tr><th>a</th></tr><tr _type='A'><td>1</td></tr></table>",
+                               /* HtmlT */             "<table 
t='array'><tr><th>a</th></tr><tr t='A'><td>1</td></tr></table>",
+                               /* HtmlR */             "<table 
_type='array'>\n\t<tr>\n\t\t<th>a</th>\n\t</tr>\n\t<tr 
_type='A'>\n\t\t<td>1</td>\n\t</tr>\n</table>\n",
+                               /* Uon */               "@((_type=A,a=1))",
+                               /* UonT */              "@((t=A,a=1))",
+                               /* UonR */              
"@(\n\t(\n\t\t_type=A,\n\t\ta=1\n\t)\n)",
+                               /* UrlEnc */    "0=(_type=A,a=1)",
+                               /* UrlEncT */   "0=(t=A,a=1)",
+                               /* UrlEncR */   "0=(\n\t_type=A,\n\ta=1\n)",
+                               /* MsgPack */   "9182A55F74797065A141A16101",
+                               /* MsgPackT */  "9182A174A141A16101",
+                               /* RdfXml */    "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:_type>A</jp:_type>\n<jp:a>1</jp:a>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlT */   "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:t>A</jp:t>\n<jp:a>1</jp:a>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlR */   "<rdf:RDF>\n  <rdf:Seq>\n    
<rdf:li rdf:parseType='Resource'>\n      <jp:_type>A</jp:_type>\n      
<jp:a>1</jp:a>\n    </rdf:li>\n  </rdf:Seq>\n</rdf:RDF>\n",
+                       },
+                       {
+                               "IA[]",
+                               new IA[]{new A().init()},
+                               /* Json */              "[{_type:'A',a:1}]",
+                               /* JsonT */             "[{t:'A',a:1}]",
+                               /* JsonR */             "[\n\t{\n\t\t_type: 
'A',\n\t\ta: 1\n\t}\n]",
+                               /* Xml */               
"<array><A><a>1</a></A></array>",
+                               /* XmlT */              
"<array><A><a>1</a></A></array>",
+                               /* XmlR */              
"<array>\n\t<A>\n\t\t<a>1</a>\n\t</A>\n</array>\n",
+                               /* XmlNs */             
"<array><A><a>1</a></A></array>",
+                               /* Html */              "<table 
_type='array'><tr><th>a</th></tr><tr _type='A'><td>1</td></tr></table>",
+                               /* HtmlT */             "<table 
t='array'><tr><th>a</th></tr><tr t='A'><td>1</td></tr></table>",
+                               /* HtmlR */             "<table 
_type='array'>\n\t<tr>\n\t\t<th>a</th>\n\t</tr>\n\t<tr 
_type='A'>\n\t\t<td>1</td>\n\t</tr>\n</table>\n",
+                               /* Uon */               "@((_type=A,a=1))",
+                               /* UonT */              "@((t=A,a=1))",
+                               /* UonR */              
"@(\n\t(\n\t\t_type=A,\n\t\ta=1\n\t)\n)",
+                               /* UrlEnc */    "0=(_type=A,a=1)",
+                               /* UrlEncT */   "0=(t=A,a=1)",
+                               /* UrlEncR */   "0=(\n\t_type=A,\n\ta=1\n)",
+                               /* MsgPack */   "9182A55F74797065A141A16101",
+                               /* MsgPackT */  "9182A174A141A16101",
+                               /* RdfXml */    "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:_type>A</jp:_type>\n<jp:a>1</jp:a>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlT */   "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:t>A</jp:t>\n<jp:a>1</jp:a>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlR */   "<rdf:RDF>\n  <rdf:Seq>\n    
<rdf:li rdf:parseType='Resource'>\n      <jp:_type>A</jp:_type>\n      
<jp:a>1</jp:a>\n    </rdf:li>\n  </rdf:Seq>\n</rdf:RDF>\n",
+                       },
+                       {
+                               "B",
+                               new B().init(),
+                               /* Json */              "{z:'B',b:1}",
+                               /* JsonT */             "{z:'B',b:1}",
+                               /* JsonR */             "{\n\tz: 'B',\n\tb: 
1\n}",
+                               /* Xml */               "<B><b>1</b></B>",
+                               /* XmlT */              "<B><b>1</b></B>",
+                               /* XmlR */              
"<B>\n\t<b>1</b>\n</B>\n",
+                               /* XmlNs */             "<B><b>1</b></B>",
+                               /* Html */              "<table 
z='B'><tr><td>b</td><td>1</td></tr></table>",
+                               /* HtmlT */             "<table 
z='B'><tr><td>b</td><td>1</td></tr></table>",
+                               /* HtmlR */             "<table 
z='B'>\n\t<tr>\n\t\t<td>b</td>\n\t\t<td>1</td>\n\t</tr>\n</table>\n",
+                               /* Uon */               "(z=B,b=1)",
+                               /* UonT */              "(z=B,b=1)",
+                               /* UonR */              "(\n\tz=B,\n\tb=1\n)",
+                               /* UrlEnc */    "z=B&b=1",
+                               /* UrlEncT */   "z=B&b=1",
+                               /* UrlEncR */   "z=B\n&b=1",
+                               /* MsgPack */   "82A17AA142A16201",
+                               /* MsgPackT */  "82A17AA142A16201",
+                               /* RdfXml */    
"<rdf:RDF>\n<rdf:Description>\n<jp:z>B</jp:z>\n<jp:b>1</jp:b>\n</rdf:Description>\n</rdf:RDF>\n",
+                               /* RdfXmlT */   
"<rdf:RDF>\n<rdf:Description>\n<jp:z>B</jp:z>\n<jp:b>1</jp:b>\n</rdf:Description>\n</rdf:RDF>\n",
+                               /* RdfXmlR */   "<rdf:RDF>\n  
<rdf:Description>\n    <jp:z>B</jp:z>\n    <jp:b>1</jp:b>\n  
</rdf:Description>\n</rdf:RDF>\n",
+                       },
+                       {
+                               "B[]",
+                               new B[]{new B().init()},
+                               /* Json */              "[{z:'B',b:1}]",
+                               /* JsonT */             "[{z:'B',b:1}]",
+                               /* JsonR */             "[\n\t{\n\t\tz: 
'B',\n\t\tb: 1\n\t}\n]",
+                               /* Xml */               "<array 
_type='B^'><B><b>1</b></B></array>",
+                               /* XmlT */              "<array 
t='B^'><B><b>1</b></B></array>",
+                               /* XmlR */              "<array 
_type='B^'>\n\t<B>\n\t\t<b>1</b>\n\t</B>\n</array>\n",
+                               /* XmlNs */             "<array 
_type='B^'><B><b>1</b></B></array>",
+                               /* Html */              "<table 
_type='array'><tr><th>b</th></tr><tr z='B'><td>1</td></tr></table>",
+                               /* HtmlT */             "<table 
t='array'><tr><th>b</th></tr><tr z='B'><td>1</td></tr></table>",
+                               /* HtmlR */             "<table 
_type='array'>\n\t<tr>\n\t\t<th>b</th>\n\t</tr>\n\t<tr 
z='B'>\n\t\t<td>1</td>\n\t</tr>\n</table>\n",
+                               /* Uon */               "@((z=B,b=1))",
+                               /* UonT */              "@((z=B,b=1))",
+                               /* UonR */              
"@(\n\t(\n\t\tz=B,\n\t\tb=1\n\t)\n)",
+                               /* UrlEnc */    "0=(z=B,b=1)",
+                               /* UrlEncT */   "0=(z=B,b=1)",
+                               /* UrlEncR */   "0=(\n\tz=B,\n\tb=1\n)",
+                               /* MsgPack */   "9182A17AA142A16201",
+                               /* MsgPackT */  "9182A17AA142A16201",
+                               /* RdfXml */    "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:z>B</jp:z>\n<jp:b>1</jp:b>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlT */   "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:z>B</jp:z>\n<jp:b>1</jp:b>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlR */   "<rdf:RDF>\n  <rdf:Seq>\n    
<rdf:li rdf:parseType='Resource'>\n      <jp:z>B</jp:z>\n      <jp:b>1</jp:b>\n 
   </rdf:li>\n  </rdf:Seq>\n</rdf:RDF>\n",
+                       },
+                       {
+                               "IB[]",
+                               new IB[]{new B().init()},
+                               /* Json */              "[{z:'B',b:1}]",
+                               /* JsonT */             "[{z:'B',b:1}]",
+                               /* JsonR */             "[\n\t{\n\t\tz: 
'B',\n\t\tb: 1\n\t}\n]",
+                               /* Xml */               
"<array><B><b>1</b></B></array>",
+                               /* XmlT */              
"<array><B><b>1</b></B></array>",
+                               /* XmlR */              
"<array>\n\t<B>\n\t\t<b>1</b>\n\t</B>\n</array>\n",
+                               /* XmlNs */             
"<array><B><b>1</b></B></array>",
+                               /* Html */              "<table 
_type='array'><tr><th>b</th></tr><tr z='B'><td>1</td></tr></table>",
+                               /* HtmlT */             "<table 
t='array'><tr><th>b</th></tr><tr z='B'><td>1</td></tr></table>",
+                               /* HtmlR */             "<table 
_type='array'>\n\t<tr>\n\t\t<th>b</th>\n\t</tr>\n\t<tr 
z='B'>\n\t\t<td>1</td>\n\t</tr>\n</table>\n",
+                               /* Uon */               "@((z=B,b=1))",
+                               /* UonT */              "@((z=B,b=1))",
+                               /* UonR */              
"@(\n\t(\n\t\tz=B,\n\t\tb=1\n\t)\n)",
+                               /* UrlEnc */    "0=(z=B,b=1)",
+                               /* UrlEncT */   "0=(z=B,b=1)",
+                               /* UrlEncR */   "0=(\n\tz=B,\n\tb=1\n)",
+                               /* MsgPack */   "9182A17AA142A16201",
+                               /* MsgPackT */  "9182A17AA142A16201",
+                               /* RdfXml */    "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:z>B</jp:z>\n<jp:b>1</jp:b>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlT */   "<rdf:RDF>\n<rdf:Seq>\n<rdf:li 
rdf:parseType='Resource'>\n<jp:z>B</jp:z>\n<jp:b>1</jp:b>\n</rdf:li>\n</rdf:Seq>\n</rdf:RDF>\n",
+                               /* RdfXmlR */   "<rdf:RDF>\n  <rdf:Seq>\n    
<rdf:li rdf:parseType='Resource'>\n      <jp:z>B</jp:z>\n      <jp:b>1</jp:b>\n 
   </rdf:li>\n  </rdf:Seq>\n</rdf:RDF>\n",
+                       },
+               });
+       }
+       
+       public BeanDictionaryComboTest(
+                       String label, 
+                       Object in,
+                       String oJson, String oJsonT, String oJsonR,
+                       String oXml, String oXmlT, String oXmlR, String oXmlNs,
+                       String oHtml, String oHtmlT, String oHtmlR,
+                       String oUon, String oUonT, String oUonR,
+                       String oUrlEncoding, String oUrlEncodingT, String 
oUrlEncodingR,
+                       String oMsgPack, String oMsgPackT,
+                       String oRdfXml, String oRdfXmlT, String oRdfXmlR
+               ) {
+               super(
+                       label,
+                       in, 
+                       oJson, oJsonT, oJsonR,
+                       oXml, oXmlT, oXmlR, oXmlNs,
+                       oHtml, oHtmlT, oHtmlR,
+                       oUon, oUonT, oUonR,
+                       oUrlEncoding, oUrlEncodingT, oUrlEncodingR,
+                       oMsgPack, oMsgPackT,
+                       oRdfXml, oRdfXmlT, oRdfXmlR
+               );
+       }
+       
+       @Override
+       protected Serializer applySettings(Serializer s) throws Exception {
+               return s.builder().trimNullProperties(false).build();
+       }
+       
+       @Override
+       protected Parser applySettings(Parser p) throws Exception {
+               return p.builder().build();
+       }
+       
+       @Bean(beanDictionary={A.class})
+       public static interface IA {}
+       
+       @Bean(typeName="A")
+       public static class A implements IA {
+               public int a;
+               
+               public A init() {
+                       a = 1;
+                       return this;
+               }
+       }
+
+       @Bean(beanDictionary={B.class}, typePropertyName="z")
+       public static interface IB {}
+       
+       @Bean(typeName="B")
+       public static class B implements IB {
+               public int b;
+               
+               public B init() {
+                       b = 1;
+                       return this;
+               }
+       }
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/1321591d/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 5e65356..bcc5bf2 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
@@ -409,7 +409,7 @@ public class HtmlParser extends XmlParser {
                                }
                                l.add(m == null ? null : (E)m.getBean());
                        } else {
-                               String c = 
getAttributes(r).get(session.getBeanTypePropertyName(type));
+                               String c = 
getAttributes(r).get(session.getBeanTypePropertyName(type.getElementType()));
                                Map m = (Map)(elementType.isMap() && 
elementType.canCreateNewInstance(l) ? elementType.newInstance(l) : new 
ObjectMap(session));
                                for (int i = 0; i < keys.size(); i++) {
                                        tag = nextTag(r, TD, NULL);
@@ -428,7 +428,7 @@ public class HtmlParser extends XmlParser {
                                }
                                if (m != null && c != null) {
                                        ObjectMap m2 = (m instanceof ObjectMap 
? (ObjectMap)m : new ObjectMap(m).setBeanSession(session));
-                                       
m2.put(session.getBeanTypePropertyName(type), c);
+                                       
m2.put(session.getBeanTypePropertyName(type.getElementType()), c);
                                        l.add((E)session.cast(m2, pMeta, 
elementType));
                                } else {
                                        l.add((E)m);

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/1321591d/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
----------------------------------------------------------------------
diff --git 
a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java 
b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
index 28b31c0..abb55c8 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlSerializer.java
@@ -257,7 +257,7 @@ public class HtmlSerializer extends XmlSerializer {
                        sType = aType.getSerializedClassMeta();
                        String typeName = null;
                        if (session.isAddBeanTypeProperties() && ! 
eType.equals(aType))
-                               typeName = aType.getResolvedDictionaryName();
+                               typeName = aType.getDictionaryName();
 
                        // Swap if necessary
                        PojoSwap swap = aType.getPojoSwap();
@@ -467,7 +467,7 @@ public class HtmlSerializer extends XmlSerializer {
 
                String type2 = null;
                if (sType != eType)
-                       type2 = sType.getResolvedDictionaryName();
+                       type2 = sType.getDictionaryName();
                if (type2 == null)
                        type2 = "array";
 
@@ -503,8 +503,9 @@ public class HtmlSerializer extends XmlSerializer {
 
                                out.oTag(i+1, "tr");
                                String typeName = (cm == null ? null : 
cm.getDictionaryName());
-                               if (typeName != null && sType.getElementType() 
!= cm)
-                                       out.attr(btpn, typeName);
+                               String typeProperty = 
session.getBeanTypePropertyName(cm);
+                               if (typeName != null && eType.getElementType() 
!= cm)
+                                       out.attr(typeProperty, typeName);
                                out.cTag().nl();
 
                                if (cm == null) {

Reply via email to