Author: billblough
Date: Wed May  2 03:47:42 2018
New Revision: 1830723

URL: http://svn.apache.org/viewvc?rev=1830723&view=rev
Log:
Add deserialziation test for AXIS2C-1627

Modified:
    axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc

Modified: axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc?rev=1830723&r1=1830722&r2=1830723&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc (original)
+++ axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc Wed May  2 
03:47:42 2018
@@ -139,11 +139,13 @@ TEST_F(TestAttribute, test_attribute_pre
 }
 
 /* AXIS2C-1627 */
-TEST_F(TestAttribute, test_special_char_serialization)
+TEST_F(TestAttribute, test_special_chars)
 {
      axiom_namespace_t * ns = axiom_namespace_create(m_env, "namespace", "ns");
 
+     char * attribute;
      axiom_node_t * node;
+     axiom_node_t * deserialized_node;
      axiom_element_t * element = axiom_element_create(m_env, NULL, "el", ns, 
&node);
 
      axiom_element_set_text(element, m_env, "T1 & T2", node);
@@ -153,4 +155,14 @@ TEST_F(TestAttribute, test_special_char_
 
      ASSERT_STREQ(xml, "<ns:el xmlns:ns=\"namespace\" name=\"A1 &amp; A2\">T1 
&amp; T2</ns:el>");
 
+     deserialized_node = axiom_node_create_from_buffer(m_env, xml);
+
+     axiom_element_t * deserialized_element = 
(axiom_element_t*)axiom_node_get_data_element(deserialized_node, m_env);
+
+     attribute = 
axiom_element_get_attribute_value_by_name(deserialized_element, m_env,"name");
+     char * text = axiom_element_get_text(deserialized_element, m_env, 
deserialized_node);
+
+     ASSERT_STREQ(attribute, "A1 & A2");
+     ASSERT_STREQ(text, "T1 & T2");
+
 }


Reply via email to