You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2006/01/11 07:21:14 UTC
svn commit: r367946 - in /webservices/axis2/trunk/c:
modules/core/description/svc.c test/unit/core/description/description_test.c
test/unit/core/description/test_svc.c test/unit/core/description/test_svc.h
Author: damitha
Date: Tue Jan 10 22:21:03 2006
New Revision: 367946
URL: http://svn.apache.org/viewcvs?rev=367946&view=rev
Log:
Added a unit test to test axis2_svc_create_with_qname
Modified:
webservices/axis2/trunk/c/modules/core/description/svc.c
webservices/axis2/trunk/c/test/unit/core/description/description_test.c
webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
webservices/axis2/trunk/c/test/unit/core/description/test_svc.h
Modified: webservices/axis2/trunk/c/modules/core/description/svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/svc.c?rev=367946&r1=367945&r2=367946&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc.c Tue Jan 10 22:21:03 2006
@@ -243,7 +243,7 @@
axis2_qname_t * qname);
axis2_char_t * AXIS2_CALL
-axis2_svc_get_qnamespace(axis2_svc_t *svc,
+axis2_svc_get_namespace(axis2_svc_t *svc,
axis2_env_t **env);
axis2_status_t AXIS2_CALL
@@ -463,7 +463,7 @@
svc_impl->svc.ops->get_endpoint = axis2_svc_get_endpoint;
- svc_impl->svc.ops->get_namespace = axis2_svc_get_qnamespace;
+ svc_impl->svc.ops->get_namespace = axis2_svc_get_namespace;
svc_impl->svc.ops->add_mapping = axis2_svc_add_mapping;
@@ -1389,7 +1389,7 @@
}
axis2_char_t * AXIS2_CALL
-axis2_svc_get_qnamespace(axis2_svc_t *svc,
+axis2_svc_get_namespace(axis2_svc_t *svc,
axis2_env_t **env)
{
return AXIS2_WSDL_SVC_GET_NAMESPACE(svc->wsdl_svc, env);
Modified: webservices/axis2/trunk/c/test/unit/core/description/description_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/description_test.c?rev=367946&r1=367945&r2=367946&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/description_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/description_test.c Tue Jan 10 22:21:03 2006
@@ -8,6 +8,7 @@
CuSuite* suite = CuSuiteNew();
SUITE_ADD_TEST(suite, Testaxis2_op_set_remaining_phases_inflow);
SUITE_ADD_TEST(suite, Testaxis2_svc_add_module_ops);
+ SUITE_ADD_TEST(suite, Testaxis2_svc_create_with_qname);
return suite;
}
Modified: webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_svc.c?rev=367946&r1=367945&r2=367946&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_svc.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_svc.c Tue Jan 10 22:21:03 2006
@@ -12,6 +12,7 @@
axis2_status_t expected = AXIS2_FAILURE;
axis2_status_t actual = AXIS2_FAILURE;
struct axis2_flow *inflow = NULL;
+ axis2_qname_t *svc_qname = NULL;
axis2_allocator_t *allocator = axis2_allocator_init (NULL);
axis2_env_t *env = axis2_env_create (allocator);
@@ -21,7 +22,8 @@
inflow = axis2_flow_create(&env);
add_handlers_to_flow(inflow, &env);
- svc = axis2_svc_create(&env);
+ svc_qname = axis2_qname_create(&env, "service name", NULL, NULL);
+ svc = axis2_svc_create_with_qname(&env, svc_qname);
AXIS2_SVC_SET_INFLOW(svc, &env, inflow);
actual = AXIS2_SVC_ADD_MODULE_OPS(svc, &env, module_desc, conf);
@@ -118,4 +120,29 @@
AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
return op_in_phases;
+}
+
+
+void Testaxis2_svc_create_with_qname(CuTest *tc)
+{
+ axis2_qname_t *qname = NULL;
+ axis2_qname_t *qactual = NULL;
+ axis2_svc_t *svc = NULL;
+ axis2_char_t *expected = NULL;
+ axis2_char_t *actual = NULL;
+
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_env_t *env = axis2_env_create (allocator);
+
+ expected = AXIS2_STRDUP("service name", &env);
+ qname = axis2_qname_create(&env, "service name", NULL, NULL);
+ svc = axis2_svc_create_with_qname(&env, qname);
+ qactual = AXIS2_SVC_GET_QNAME(svc, &env);
+ actual = AXIS2_QNAME_GET_LOCALPART(qactual, &env);
+
+ CuAssertStrEquals(tc, expected, actual);
+
+ AXIS2_FREE((env)->allocator, expected);
+ AXIS2_QNAME_FREE(qname, &env);
+ AXIS2_SVC_FREE(svc, &env);
}
Modified: webservices/axis2/trunk/c/test/unit/core/description/test_svc.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_svc.h?rev=367946&r1=367945&r2=367946&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_svc.h (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_svc.h Tue Jan 10 22:21:03 2006
@@ -25,5 +25,6 @@
struct axis2_phase;
void Testaxis2_svc_add_module_ops(CuTest *tc);
+void Testaxis2_svc_create_with_qname(CuTest *tc);
#endif /* TEST_SVC_H*/