axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billblo...@apache.org
Subject svn commit: r1831004 - in /axis/axis2/c/core/trunk: axiom/test/om/test_om.cc neethi/test/test.cc
Date Sat, 05 May 2018 20:49:24 GMT
Author: billblough
Date: Sat May  5 20:49:24 2018
New Revision: 1831004

URL: http://svn.apache.org/viewvc?rev=1831004&view=rev
Log:
Rename some vars in axiom and neethi tests for consistency

Modified:
    axis/axis2/c/core/trunk/axiom/test/om/test_om.cc
    axis/axis2/c/core/trunk/neethi/test/test.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=1831004&r1=1831003&r2=1831004&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 20:49:24 2018
@@ -69,18 +69,18 @@ class TestOM: public ::testing::Test
             m_axis_log = axutil_log_create(m_allocator, NULL, NULL);
             m_error = axutil_error_create(m_allocator);
 
-            m_environment = axutil_env_create_with_error_log(m_allocator, m_error, m_axis_log);
+            m_env = axutil_env_create_with_error_log(m_allocator, m_error, m_axis_log);
 
         }
 
         void TearDown()
         {
-            axutil_env_free(m_environment);
+            axutil_env_free(m_env);
         }
 
 
         axutil_allocator_t *m_allocator = NULL;
-        axutil_env_t *m_environment = NULL;
+        axutil_env_t *m_env = NULL;
         axutil_error_t *m_error = NULL;
         axutil_log_t *m_axis_log = NULL;
 
@@ -114,60 +114,60 @@ TEST_F(TestOM, test_om_build) {
 
     /** create pull parser */
     reader =
-        axiom_xml_reader_create_for_io(m_environment, read_input, NULL, f,
+        axiom_xml_reader_create_for_io(m_env, read_input, NULL, f,
                                        NULL);
     ASSERT_NE(reader, nullptr);
 
      /** create axiom_stax_builder by parsing pull_parser struct */
-    builder = axiom_stax_builder_create(m_environment, reader);
+    builder = axiom_stax_builder_create(m_env, reader);
     ASSERT_NE(builder, nullptr);
 
     /**
         create an om document
         document is the container of om model created using builder
     */
-    document = axiom_stax_builder_get_document(builder, m_environment);
+    document = axiom_stax_builder_get_document(builder, m_env);
     ASSERT_NE(document, nullptr);
 
-    node1 = axiom_document_get_root_element(document, m_environment);
+    node1 = axiom_document_get_root_element(document, m_env);
     ASSERT_NE(node1, nullptr);
     if (node1)
     {
         /** print root node information */
-        ele1 = (axiom_element_t*)axiom_node_get_data_element(node1, m_environment);
+        ele1 = (axiom_element_t*)axiom_node_get_data_element(node1, m_env);
         if (ele1)
         {
             printf("root localname %s\n",
-                   axiom_element_get_localname(ele1, m_environment));
+                   axiom_element_get_localname(ele1, m_env));
 
-            hash = axiom_element_get_all_attributes(ele1,m_environment);
+            hash = axiom_element_get_all_attributes(ele1,m_env);
             if(hash)
             {
                 axutil_hash_index_t *hi;
                 const void *key= NULL;
                 void *val = NULL;
-                for (hi = axutil_hash_first(hash,m_environment); hi; hi = axutil_hash_next(m_environment,
hi))
+                for (hi = axutil_hash_first(hash,m_env); hi; hi = axutil_hash_next(m_env,
hi))
                 {
                     axutil_hash_this(hi, &key, NULL,&val);
                     if(val)
                     {
                         printf(" Attribute name: %s",
-                            axiom_attribute_get_localname((axiom_attribute_t *)val,m_environment));
+                            axiom_attribute_get_localname((axiom_attribute_t *)val,m_env));
                         printf("   value: %s\n",
-                            axiom_attribute_get_value((axiom_attribute_t *)val,m_environment));
+                            axiom_attribute_get_value((axiom_attribute_t *)val,m_env));
                     }
                 }
             }
         }
 
-        ns = axiom_element_get_namespace(ele1, m_environment, node1);
+        ns = axiom_element_get_namespace(ele1, m_env, node1);
 
         if (ns)
         {
             printf("root ns prefix %s\n",
-                   axiom_namespace_get_prefix(ns, m_environment));
+                   axiom_namespace_get_prefix(ns, m_env));
             printf("root ns uri %s\n",
-                   axiom_namespace_get_uri(ns, m_environment));
+                   axiom_namespace_get_uri(ns, m_env));
                         printf("=============================================");
 
         }
@@ -178,39 +178,39 @@ TEST_F(TestOM, test_om_build) {
 
     /** build the document continuously untill all the xml file is built in to a om model
*/
 
-    node2 = axiom_document_build_next(document, m_environment);
+    node2 = axiom_document_build_next(document, m_env);
     do
     {
 
         if (!node2)
             break;
 
-        switch (axiom_node_get_node_type(node2, m_environment))
+        switch (axiom_node_get_node_type(node2, m_env))
         {
         case AXIOM_ELEMENT:
             ele2 =
                 (axiom_element_t *) axiom_node_get_data_element(node2,
-                                                                m_environment);
+                                                                m_env);
                     printf("=============================================");
-            if (ele2 && axiom_element_get_localname(ele2, m_environment))
+            if (ele2 && axiom_element_get_localname(ele2, m_env))
             {
                 printf("\n localname %s\n",
-                           axiom_element_get_localname(ele2, m_environment));
-                hash = axiom_element_get_all_attributes(ele2,m_environment);
+                           axiom_element_get_localname(ele2, m_env));
+                hash = axiom_element_get_all_attributes(ele2,m_env);
                 if(hash)
                 {
                     axutil_hash_index_t *hi;
                     const void *key= NULL;
                     void *val = NULL;
-                    for (hi = axutil_hash_first(hash,m_environment); hi; hi = axutil_hash_next(m_environment,
hi))
+                    for (hi = axutil_hash_first(hash,m_env); hi; hi = axutil_hash_next(m_env,
hi))
                     {
                         axutil_hash_this(hi, &key, NULL,&val);
                         if(val)
                         {
                             printf(" Attribute name: %s",
-                                axiom_attribute_get_localname((axiom_attribute_t *)val,m_environment));
+                                axiom_attribute_get_localname((axiom_attribute_t *)val,m_env));
                             printf("   value: %s\n",
-                                axiom_attribute_get_value((axiom_attribute_t *)val,m_environment));
+                                axiom_attribute_get_value((axiom_attribute_t *)val,m_env));
                         }
                     }
                 }
@@ -227,17 +227,17 @@ TEST_F(TestOM, test_om_build) {
 
             text =
                 (axiom_text_t *) axiom_node_get_data_element(node2,
-                                                             m_environment);
-            if (text && axiom_text_get_value(text, m_environment))
+                                                             m_env);
+            if (text && axiom_text_get_value(text, m_env))
                 printf("\n text value  %s \n",
-                       axiom_text_get_value(text, m_environment));
+                       axiom_text_get_value(text, m_env));
             break;
 
         default:
             break;
         }
 
-        node2 = axiom_document_build_next(document, m_environment);
+        node2 = axiom_document_build_next(document, m_env);
     }
     while (node2);
     printf("END: pull document\n");
@@ -245,24 +245,24 @@ TEST_F(TestOM, test_om_build) {
     printf("Serialize pulled document\n");
 
     writer =
-        axiom_xml_writer_create_for_memory(m_environment, NULL, AXIS2_TRUE, 0,
+        axiom_xml_writer_create_for_memory(m_env, NULL, AXIS2_TRUE, 0,
                                            AXIS2_XML_PARSER_TYPE_BUFFER);
-    om_output = axiom_output_create(m_environment, writer);
+    om_output = axiom_output_create(m_env, writer);
 
-    axiom_node_serialize_sub_tree(node3, m_environment, om_output);
+    axiom_node_serialize_sub_tree(node3, m_env, om_output);
 
-    buffer = (axis2_char_t *) axiom_xml_writer_get_xml(writer, m_environment);
+    buffer = (axis2_char_t *) axiom_xml_writer_get_xml(writer, m_env);
 
     if (buffer)
         printf("Sub Tree = %s\n", buffer);
 
-    axiom_output_free(om_output, m_environment);
+    axiom_output_free(om_output, m_env);
 
-    //axiom_stax_builder_free(builder, m_environment);
+    //axiom_stax_builder_free(builder, m_env);
 
 /*     if (buffer) */
 
-/*         AXIS2_FREE(m_environment->allocator, buffer); */
+/*         AXIS2_FREE(m_env->allocator, buffer); */
     printf("\nend test_om_build\n");
     fclose(f);
     return;
@@ -308,38 +308,38 @@ TEST_F(TestOM, test_om_serialize) {
     printf("\nstart test_om_serialize\n");
 
     ns1 =
-        axiom_namespace_create(m_environment,
+        axiom_namespace_create(m_env,
                                "http://ws.apache.org/axis2/c/om", "axiom");
-    ns2 = axiom_namespace_create(m_environment, "urn:ISBN:0-395-74341-6", "isbn");
-    ele1 = axiom_element_create(m_environment, NULL, "book", ns1, &node1);
-    axiom_element_declare_namespace(ele1, m_environment, node1, ns2);
+    ns2 = axiom_namespace_create(m_env, "urn:ISBN:0-395-74341-6", "isbn");
+    ele1 = axiom_element_create(m_env, NULL, "book", ns1, &node1);
+    axiom_element_declare_namespace(ele1, m_env, node1, ns2);
 
-    ele2 = axiom_element_create(m_environment, node1, "title", ns1, &node2);
-    attr1 = axiom_attribute_create(m_environment, "title22", NULL, NULL);
+    ele2 = axiom_element_create(m_env, node1, "title", ns1, &node2);
+    attr1 = axiom_attribute_create(m_env, "title22", NULL, NULL);
 
-    axiom_element_add_attribute(ele2, m_environment, attr1, node2);
+    axiom_element_add_attribute(ele2, m_env, attr1, node2);
 
-    text1 = axiom_text_create(m_environment, node2, "Axis2/C OM HOWTO", &node3);
+    text1 = axiom_text_create(m_env, node2, "Axis2/C OM HOWTO", &node3);
 
-    ele3 = axiom_element_create(m_environment, node1, "number", ns2, &node4);
+    ele3 = axiom_element_create(m_env, node1, "number", ns2, &node4);
 
-    text1 = axiom_text_create(m_environment, node4, "1748491379", &node5);
+    text1 = axiom_text_create(m_env, node4, "1748491379", &node5);
 
-    ele4 = axiom_element_create(m_environment, node1, "author", ns1, &node6);
+    ele4 = axiom_element_create(m_env, node1, "author", ns1, &node6);
 
-    attr1 = axiom_attribute_create(m_environment, "title", "Mr", ns1);
+    attr1 = axiom_attribute_create(m_env, "title", "Mr", ns1);
 
-    axiom_element_add_attribute(ele4, m_environment, attr1, node6);
+    axiom_element_add_attribute(ele4, m_env, attr1, node6);
 
-    attr2 = axiom_attribute_create(m_environment, "name", "Axitoc Oman", ns1);
+    attr2 = axiom_attribute_create(m_env, "name", "Axitoc Oman", ns1);
 
-    axiom_element_add_attribute(ele4, m_environment, attr2, node6);
+    axiom_element_add_attribute(ele4, m_env, attr2, node6);
 
-    data_source = axiom_data_source_create(m_environment, node1, &node6);
-    stream = axiom_data_source_get_stream(data_source, m_environment);
+    data_source = axiom_data_source_create(m_env, node1, &node6);
+    stream = axiom_data_source_get_stream(data_source, m_env);
     if (stream)
     {
-        axutil_stream_write(stream, m_environment,
+        axutil_stream_write(stream, m_env,
                             "<this xmlns:axiom=\"http://ws.apache.org/axis2/c/om\">is
a test</this>",
                             axutil_strlen
                             ("<this xmlns:axiom=\"http://ws.apache.org/axis2/c/om\">is
a test</this>"));
@@ -347,26 +347,26 @@ TEST_F(TestOM, test_om_serialize) {
 
     /* serializing stuff */
     writer =
-        axiom_xml_writer_create_for_memory(m_environment, NULL, AXIS2_TRUE, 0,
+        axiom_xml_writer_create_for_memory(m_env, NULL, AXIS2_TRUE, 0,
                                            AXIS2_XML_PARSER_TYPE_BUFFER);
-    om_output = axiom_output_create(m_environment, writer);
+    om_output = axiom_output_create(m_env, writer);
 
     printf("Serialize built document\n");
-    status = axiom_node_serialize(node1, m_environment, om_output);
+    status = axiom_node_serialize(node1, m_env, om_output);
     ASSERT_EQ(status, AXIS2_SUCCESS);
 
     printf("\naxiom_node_serialize success\n");
     /* end serializing stuff */
 
-    axiom_node_free_tree(node1, m_environment);
+    axiom_node_free_tree(node1, m_env);
     output_buffer =
-        (axis2_char_t *) axiom_xml_writer_get_xml(writer, m_environment);
+        (axis2_char_t *) axiom_xml_writer_get_xml(writer, m_env);
 
-    axiom_output_free(om_output, m_environment);
+    axiom_output_free(om_output, m_env);
     /*    if (output_buffer) */
     /*     { */
     /*         printf("%s", output_buffer); */
-    /*         AXIS2_FREE(m_environment->allocator, output_buffer); */
+    /*         AXIS2_FREE(m_env->allocator, output_buffer); */
     /*     } */
 
     printf("\nend test_om_serialize\n");
@@ -385,18 +385,18 @@ TEST_F(TestOM, test_om_buffer) {
 
     printf("\nstart test_om_bufer\n");
 
-    axiom_node_t * om_node = axiom_node_create_from_buffer(m_environment, xml);
+    axiom_node_t * om_node = axiom_node_create_from_buffer(m_env, xml);
 
-    output = axiom_node_to_string(om_node,m_environment);
+    output = axiom_node_to_string(om_node,m_env);
 
     ASSERT_EQ(0, axutil_strcmp(xml,xml_unaltered));
 
     ASSERT_EQ(0, axutil_strcmp(output,xml_unaltered));
 
-    axiom_node_free_tree(om_node,m_environment);
-    AXIS2_FREE(m_environment->allocator, output);
-    AXIS2_FREE(m_environment->allocator, xml);
-    AXIS2_FREE(m_environment->allocator, xml_unaltered);
+    axiom_node_free_tree(om_node,m_env);
+    AXIS2_FREE(m_env->allocator, output);
+    AXIS2_FREE(m_env->allocator, xml);
+    AXIS2_FREE(m_env->allocator, xml_unaltered);
 
     printf("\nend test_om_bufer\n");
 
@@ -406,26 +406,26 @@ TEST_F(TestOM, test_om_buffer) {
 /* AXIS2C-1627 */
 TEST_F(TestOM, test_attr_special_chars)
 {
-     axiom_namespace_t * ns = axiom_namespace_create(m_environment, "namespace", "ns");
+     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_environment, NULL, "el", ns, &node);
+     axiom_element_t * element = axiom_element_create(m_env, 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);
+     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_environment);
+     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_environment, xml);
+     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_environment);
+     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_environment,"name");
-     char * text = axiom_element_get_text(deserialized_element, m_environment, deserialized_node);
+     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");

Modified: axis/axis2/c/core/trunk/neethi/test/test.cc
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/neethi/test/test.cc?rev=1831004&r1=1831003&r2=1831004&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/neethi/test/test.cc (original)
+++ axis/axis2/c/core/trunk/neethi/test/test.cc Sat May  5 20:49:24 2018
@@ -42,18 +42,18 @@ class TestNeethi: public ::testing::Test
             m_axis_log = axutil_log_create(m_allocator, NULL, NULL);
             m_error = axutil_error_create(m_allocator);
 
-            m_environment = axutil_env_create_with_error_log(m_allocator, m_error, m_axis_log);
+            m_env = axutil_env_create_with_error_log(m_allocator, m_error, m_axis_log);
 
         }
 
         void TearDown()
         {
-            axutil_env_free(m_environment);
+            axutil_env_free(m_env);
         }
 
 
         axutil_allocator_t *m_allocator = NULL;
-        axutil_env_t *m_environment = NULL;
+        axutil_env_t *m_env = NULL;
         axutil_error_t *m_error = NULL;
         axutil_log_t *m_axis_log = NULL;
 
@@ -71,29 +71,29 @@ TEST_F(TestNeethi, test_get_policy)
 
     char *filename = "policies/symmetric_binding_policy.xml";
 
-    reader = axiom_xml_reader_create_for_file(m_environment, filename, NULL);
+    reader = axiom_xml_reader_create_for_file(m_env, filename, NULL);
     ASSERT_NE(reader, nullptr);
 
-    builder = axiom_stax_builder_create(m_environment, reader);
+    builder = axiom_stax_builder_create(m_env, reader);
     ASSERT_NE(builder, nullptr);
 
-    document = axiom_stax_builder_get_document(builder, m_environment);
+    document = axiom_stax_builder_get_document(builder, m_env);
     ASSERT_NE(document, nullptr);
 
-    root = axiom_document_get_root_element(document, m_environment);
-    /*root = axiom_document_build_all(document, m_environment); */
+    root = axiom_document_get_root_element(document, m_env);
+    /*root = axiom_document_build_all(document, m_env); */
     ASSERT_NE(root, nullptr);
 
     if (root)
     {
-        if (axiom_node_get_node_type(root, m_environment) == AXIOM_ELEMENT)
+        if (axiom_node_get_node_type(root, m_env) == AXIOM_ELEMENT)
         {
             root_ele =
-                (axiom_element_t *) axiom_node_get_data_element(root, m_environment);
+                (axiom_element_t *) axiom_node_get_data_element(root, m_env);
             if (root_ele)
             {
                 neethi_policy_t *neethi_policy = NULL;
-                neethi_policy = neethi_engine_get_policy(m_environment, root, root_ele);
+                neethi_policy = neethi_engine_get_policy(m_env, root, root_ele);
                 ASSERT_NE(neethi_policy, nullptr);
 
                 if(neethi_policy)
@@ -101,17 +101,17 @@ TEST_F(TestNeethi, test_get_policy)
                     axis2_char_t *id = NULL;
                     axis2_char_t *name = NULL;
 
-                    id = neethi_policy_get_id(neethi_policy, m_environment); 
+                    id = neethi_policy_get_id(neethi_policy, m_env); 
                     if(id)
                     {
                         printf("Id is : %s\n", id);
                     }   
-                    name = neethi_policy_get_name(neethi_policy, m_environment);
+                    name = neethi_policy_get_name(neethi_policy, m_env);
                     if(name)
                     {
                         printf("Name is : %s\n", name);
                     }
-                    neethi_policy_free(neethi_policy, m_environment);
+                    neethi_policy_free(neethi_policy, m_env);
                     neethi_policy = NULL;
 
                     printf("Successful \n");
@@ -135,7 +135,7 @@ TEST_F(TestNeethi, test_get_policy)
 
     if(builder)
     {
-        axiom_stax_builder_free(builder, m_environment);
+        axiom_stax_builder_free(builder, m_env);
         builder = NULL;
     }
 



Mime
View raw message