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 2005/12/16 05:08:11 UTC
svn commit: r357115 [3/3] - in /webservices/axis2/trunk/c: include/
modules/core/deployment/src/ modules/core/description/src/
modules/core/engine/src/ modules/core/phaseresolver/src/
modules/core/transport/http/src/ modules/util/src/ modules/wsdl/src/...
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=357115&r1=357114&r2=357115&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 Thu Dec 15 20:06:29 2005
@@ -6,7 +6,7 @@
CuSuite* axis2_descriptionGetSuite() {
CuSuite* suite = CuSuiteNew();
- /*SUITE_ADD_TEST(suite, Testaxis2_op_set_remaining_phases_inflow);*/
+ SUITE_ADD_TEST(suite, Testaxis2_op_set_remaining_phases_inflow);
SUITE_ADD_TEST(suite, Testaxis2_svc_add_module_ops);
return suite;
}
Modified: webservices/axis2/trunk/c/test/unit/core/description/test_op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_op.c?rev=357115&r1=357114&r2=357115&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_op.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_op.c Thu Dec 15 20:06:29 2005
@@ -1,7 +1,7 @@
#include "test_op.h"
void add_handlers_to_flow(struct axis2_flow *flow, axis2_env_t **env);
-axis2_array_list_t *get_op_in_phases(axis2_env_t **env);
+axis2_array_list_t *get_op_op_in_phases(axis2_env_t **env);
void Testaxis2_op_set_remaining_phases_inflow(CuTest *tc)
{
@@ -13,7 +13,7 @@
axis2_env_t *env = axis2_env_create (allocator);
struct axis2_op *op = axis2_op_create(&env);
- op_in_phases = get_op_in_phases(&env);
+ op_in_phases = get_op_op_in_phases(&env);
actual = AXIS2_OP_SET_REMAINING_PHASES_INFLOW(op, &env, op_in_phases);
CuAssertIntEquals(tc, expected, actual);
@@ -22,7 +22,7 @@
/** helper method. This is the requirement method from phases_info's
* axis2_get_op_in_phases method
*/
-axis2_array_list_t *get_op_in_phases(axis2_env_t **env)
+axis2_array_list_t *get_op_op_in_phases(axis2_env_t **env)
{
struct axis2_phase *phase = NULL;
axis2_array_list_t *op_in_phases = NULL;
@@ -39,9 +39,6 @@
AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
phase = axis2_phase_create(env, AXIS2_PHASE_DISPATCH);
- AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
-
- phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
return op_in_phases;
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=357115&r1=357114&r2=357115&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 Thu Dec 15 20:06:29 2005
@@ -1,14 +1,15 @@
#include "test_svc.h"
struct axis2_module_desc *create_module_desc(axis2_env_t **env);
-void add_handlers_to_flow(struct axis2_flow *flow, axis2_env_t **env);
+void add_handlers_to_flow(struct axis2_flow *flow, axis2_env_t **env);
+axis2_array_list_t *get_svc_op_in_phases(axis2_env_t **env);
void Testaxis2_svc_add_module_ops(CuTest *tc)
{
struct axis2_module_desc *module_desc = NULL;
struct axis2_conf *conf = NULL;
struct axis2_svc *svc = NULL;
- axis2_status_t expected = AXIS2_SUCCESS;
+ axis2_status_t expected = AXIS2_FAILURE;
axis2_status_t actual = AXIS2_FAILURE;
struct axis2_flow *inflow = NULL;
@@ -21,8 +22,8 @@
inflow = axis2_flow_create(&env);
add_handlers_to_flow(inflow, &env);
svc = axis2_svc_create(&env);
- axis2_svc_set_inflow(svc, &env, inflow);
- actual = axis2_svc_add_module_ops(svc, &env, module_desc, conf);
+ AXIS2_SVC_SET_INFLOW(svc, &env, inflow);
+ actual = AXIS2_SVC_ADD_MODULE_OPS(svc, &env, module_desc, conf);
CuAssertIntEquals(tc, expected, actual);
@@ -33,15 +34,20 @@
struct axis2_op *op = NULL;
axis2_qname_t *op_qname = NULL;
struct axis2_module_desc *module_desc = NULL;
+ axis2_array_list_t *op_in_phases = NULL;
module_desc = axis2_module_desc_create(env);
op_qname = axis2_qname_create(env, "op_name1", NULL, NULL);
op = axis2_op_create_with_name(env, op_qname);
- int status = AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
+ op_in_phases = get_svc_op_in_phases(env);
+ AXIS2_OP_SET_REMAINING_PHASES_INFLOW(op, env, op_in_phases);
+ AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
op_qname = axis2_qname_create(env, "op_name2", NULL, NULL);
op = axis2_op_create_with_name(env, op_qname);
+ op_in_phases = get_svc_op_in_phases(env);
+ AXIS2_OP_SET_REMAINING_PHASES_INFLOW(op, env, op_in_phases);
AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
return module_desc;
@@ -56,8 +62,8 @@
struct axis2_phase_rule *rule = NULL;
rule = axis2_phase_rule_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
- axis2_phase_rule_set_before(rule, env, "before");
- axis2_phase_rule_set_after(rule, env, "after");
+ AXIS2_PHASE_RULE_SET_BEFORE(rule, env, "before");
+ AXIS2_PHASE_RULE_SET_AFTER(rule, env, "after");
qname = axis2_qname_create(env, "handler1", NULL, NULL);
handler_desc = axis2_handler_desc_create_with_qname(env, qname);
AXIS2_HANDLER_DESC_SET_RULES(handler_desc, env, rule);
@@ -67,8 +73,8 @@
AXIS2_FLOW_ADD_HANDLER(flow, env, handler_desc);
rule = axis2_phase_rule_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
- axis2_phase_rule_set_before(rule, env, "before");
- axis2_phase_rule_set_after(rule, env, "after");
+ AXIS2_PHASE_RULE_SET_BEFORE(rule, env, "before");
+ AXIS2_PHASE_RULE_SET_AFTER(rule, env, "after");
qname = axis2_qname_create(env, "handler2", NULL, NULL);
handler_desc = axis2_handler_desc_create_with_qname(env, qname);
AXIS2_HANDLER_DESC_SET_RULES(handler_desc, env, rule);
@@ -78,8 +84,8 @@
AXIS2_FLOW_ADD_HANDLER(flow, env, handler_desc);
rule = axis2_phase_rule_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
- axis2_phase_rule_set_before(rule, env, "before");
- axis2_phase_rule_set_after(rule, env, "after");
+ AXIS2_PHASE_RULE_SET_BEFORE(rule, env, "before");
+ AXIS2_PHASE_RULE_SET_AFTER(rule, env, "after");
qname = axis2_qname_create(env, "handler3", NULL, NULL);
handler_desc = axis2_handler_desc_create_with_qname(env, qname);
AXIS2_HANDLER_DESC_SET_RULES(handler_desc, env, rule);
@@ -87,4 +93,29 @@
AXIS2_HANDLER_INIT(handler, env, handler_desc);
AXIS2_HANDLER_DESC_SET_HANDLER(handler_desc, env, handler);
AXIS2_FLOW_ADD_HANDLER(flow, env, handler_desc);
+}
+
+/** helper method. This is the requirement method from phases_info's
+ * axis2_get_op_in_phases method
+ */
+axis2_array_list_t *get_svc_op_in_phases(axis2_env_t **env)
+{
+ struct axis2_phase *phase = NULL;
+ axis2_array_list_t *op_in_phases = NULL;
+
+ op_in_phases = axis2_array_list_create(env, 0);
+
+ phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
+ AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
+
+ phase = axis2_phase_create(env, AXIS2_PHASE_TRANSPORTIN);
+ AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
+
+ phase = axis2_phase_create(env, AXIS2_PHASE_PRE_DISPATCH);
+ AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
+
+ phase = axis2_phase_create(env, AXIS2_PHASE_DISPATCH);
+ AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
+
+ return op_in_phases;
}
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=357115&r1=357114&r2=357115&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 Thu Dec 15 20:06:29 2005
@@ -13,6 +13,8 @@
#include <axis2_op.h>
#include <axis2_flow.h>
#include <axis2_wsdl_op.h>
+#include <axis2_phase.h>
+#include <axis2_svc.h>
struct axis2_svc;
struct axis2_op;
@@ -20,6 +22,7 @@
struct axis2_wsdl_op;
struct axis2_conf;
struct axis2_flow;
+struct axis2_phase;
void Testaxis2_svc_add_module_ops(CuTest *tc);
Modified: webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c?rev=357115&r1=357114&r2=357115&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c Thu Dec 15 20:06:29 2005
@@ -18,11 +18,9 @@
axis2_allocator_t *allocator = axis2_allocator_init (NULL);
axis2_env_t *env = axis2_env_create (allocator);
-
struct axis2_op *optr = axis2_op_create(&env);
op_in_phases = get_op_in_phases(&env);
AXIS2_OP_SET_REMAINING_PHASES_INFLOW(optr, &env, op_in_phases);
-
flow = axis2_flow_create(&env);
add_handlers_to_flow(flow, &env);
module_desc = axis2_module_desc_create(&env);