Author: billblough
Date: Sat May  5 05:57:17 2018
New Revision: 1830953

URL: http://svn.apache.org/viewvc?rev=1830953&view=rev
Log:
Fix circular dependency introduced by tests for AXISC-1627

The tests for AXISC-1627 created a circular link dependency between
axiom and guththila.  Since the tests provided with the fix relied on
axiom calls, it made sense to move the tests to the axiom subproject.
This has the benefit of testing other parsers for this issue, instead of only
guththila.

Modified:
    axis/axis2/c/core/trunk/axiom/test/om/test_om.cc
    axis/axis2/c/core/trunk/guththila/tests/Makefile.am
    axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc

Modified: axis/axis2/c/core/trunk/axiom/test/om/test_om.cc
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/test/om/test_om.cc?rev=1830953&r1=1830952&r2=1830953&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/test/om/test_om.cc (original)
+++ axis/axis2/c/core/trunk/axiom/test/om/test_om.cc Sat May  5 05:57:17 2018
@@ -402,3 +402,31 @@ TEST_F(TestOM, test_om_buffer) {
 
     return;
 }
+
+/* AXIS2C-1627 */
+TEST_F(TestOM, test_attr_special_chars)
+{
+     axiom_namespace_t * ns = axiom_namespace_create(m_environment, 
"namespace", "ns");
+
+     char * attribute;
+     axiom_node_t * node;
+     axiom_node_t * deserialized_node;
+     axiom_element_t * element = axiom_element_create(m_environment, NULL, 
"el", ns, &node);
+
+     axiom_element_set_text(element, m_environment, "T1 & T2", node);
+     axiom_element_add_attribute(element, m_environment, 
axiom_attribute_create(m_environment, "name", "A1 & A2", NULL), node);
+
+     axis2_char_t * xml = axiom_node_to_string(node, m_environment);
+
+     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_environment, xml);
+
+     axiom_element_t * deserialized_element = 
(axiom_element_t*)axiom_node_get_data_element(deserialized_node, m_environment);
+
+     attribute = 
axiom_element_get_attribute_value_by_name(deserialized_element, 
m_environment,"name");
+     char * text = axiom_element_get_text(deserialized_element, m_environment, 
deserialized_node);
+
+     ASSERT_STREQ(attribute, "A1 & A2");
+     ASSERT_STREQ(text, "T1 & T2");
+}

Modified: axis/axis2/c/core/trunk/guththila/tests/Makefile.am
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/guththila/tests/Makefile.am?rev=1830953&r1=1830952&r2=1830953&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/guththila/tests/Makefile.am (original)
+++ axis/axis2/c/core/trunk/guththila/tests/Makefile.am Sat May  5 05:57:17 2018
@@ -34,6 +34,5 @@ test_attribute_SOURCES = test_attribute.
 test_attribute_LDADD = \
                                 $(top_builddir)/src/libguththila.la \
                                 ../../util/src/libaxutil.la \
-                                ../../axiom/src/om/libaxis2_axiom.la \
                                 $(top_builddir)/$(GTEST)/libgtest.a \
                                 $(top_builddir)/$(GTEST)/libgtest_main.a

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=1830953&r1=1830952&r2=1830953&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc (original)
+++ axis/axis2/c/core/trunk/guththila/tests/test_attribute.cc Sat May  5 
05:57:17 2018
@@ -137,32 +137,3 @@ TEST_F(TestAttribute, test_attribute_pre
     m_parser = nullptr;
 
 }
-
-/* AXIS2C-1627 */
-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);
-     axiom_element_add_attribute(element, m_env, axiom_attribute_create(m_env, 
"name", "A1 & A2", NULL), node);
-
-     axis2_char_t * xml = axiom_node_to_string(node, m_env);
-
-     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