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/23 07:44:57 UTC
svn commit: r371473 - in /webservices/axis2/trunk/c/test/unit/core/engine:
Makefile.am engine_test.c test_conf.c test_conf.h
Author: damitha
Date: Sun Jan 22 22:44:48 2006
New Revision: 371473
URL: http://svn.apache.org/viewcvs?rev=371473&view=rev
Log:
Resolved AXIS2C-24
Added:
webservices/axis2/trunk/c/test/unit/core/engine/test_conf.c
webservices/axis2/trunk/c/test/unit/core/engine/test_conf.h
Modified:
webservices/axis2/trunk/c/test/unit/core/engine/Makefile.am
webservices/axis2/trunk/c/test/unit/core/engine/engine_test.c
Modified: webservices/axis2/trunk/c/test/unit/core/engine/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/engine/Makefile.am?rev=371473&r1=371472&r2=371473&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/engine/Makefile.am (original)
+++ webservices/axis2/trunk/c/test/unit/core/engine/Makefile.am Sun Jan 22 22:44:48 2006
@@ -2,12 +2,17 @@
prglibdir=$(prefix)/lib/unit_test
prglib_LTLIBRARIES = libtest_engine.la
AM_CPPFLAGS = $(CPPFLAGS)
-libtest_engine_la_SOURCES = engine_test.c
+libtest_engine_la_SOURCES = engine_test.c test_conf.c
include_HEADERS=$(top_builddir)/test/unit/core/engine/*.h
INCLUDES = -I$(top_builddir)/include \
-I$(top_builddir)/modules/util \
- -I${CUTEST_HOME}/include
+ -I$(top_builddir)/modules/core/description \
+ -I$(top_builddir)/modules/core/phaseresolver \
+ -I$(top_builddir)/modules/core/transport \
+ -I$(top_builddir)/modules/wsdl \
+ -I${CUTEST_HOME}/include \
+ -I$(top_builddir)/modules/platforms
prgbin_PROGRAMS = engine_test
engine_test_SOURCES = main.c
Modified: webservices/axis2/trunk/c/test/unit/core/engine/engine_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/engine/engine_test.c?rev=371473&r1=371472&r2=371473&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/engine/engine_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/engine/engine_test.c Sun Jan 22 22:44:48 2006
@@ -3,10 +3,12 @@
#include <stdio.h>
#include <axis2_allocator.h>
#include <axis2_env.h>
+#include "test_conf.h"
-CuSuite* axis2_engineGetSuite() {
+CuSuite* axis2_engineGetSuite()
+{
CuSuite* suite = CuSuiteNew();
- /*SUITE_ADD_TEST(suite, Testaxis2_stream_ops_read);*/
+ SUITE_ADD_TEST(suite, Testaxis2_conf_set_default_dispatchers);
return suite;
}
Added: webservices/axis2/trunk/c/test/unit/core/engine/test_conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/engine/test_conf.c?rev=371473&view=auto
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/engine/test_conf.c (added)
+++ webservices/axis2/trunk/c/test/unit/core/engine/test_conf.c Sun Jan 22 22:44:48 2006
@@ -0,0 +1,55 @@
+#include "test_conf.h"
+
+void Testaxis2_conf_set_default_dispatchers(CuTest *tc)
+{
+ axis2_conf_t *conf = NULL;
+ axis2_array_list_t *in_phases = NULL;
+ axis2_status_t expected = AXIS2_SUCCESS;
+ axis2_status_t actual = AXIS2_FAILURE;
+ int i = 0;
+ int size = 0;
+ axis2_phase_t *phase = NULL;
+
+ printf("***************************************************\n");
+ printf("testing axis2_conf_set_default_dispatchers method \n");
+ printf("***************************************************\n");
+
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_env_t *env = axis2_env_create (allocator);
+
+ conf = axis2_conf_create(&env);
+ AXIS2_CONF_SET_DEFAULT_DISPATCHERS(conf, &env);
+ in_phases = AXIS2_CONF_GET_IN_PHASES_UPTO_AND_INCLUDING_POST_DISPATCH(conf, &env);
+ CuAssertPtrNotNull(tc, in_phases);
+ size = AXIS2_ARRAY_LIST_SIZE(in_phases, &env);
+ for(i = 0; i < size; i++)
+ {
+ axis2_qname_t *qname = NULL;
+ axis2_char_t *handler_name = NULL;
+ axis2_array_list_t *handlers = NULL;
+ axis2_handler_t *handler = NULL;
+ int j = 0;
+ int sizej = 0;
+
+ phase = AXIS2_ARRAY_LIST_GET(in_phases, &env, i);
+ handlers = axis2_phase_get_handlers(phase, &env);
+ sizej = AXIS2_ARRAY_LIST_SIZE(handlers, &env);
+ for(j = 0; j < sizej; j++)
+ {
+ handler = AXIS2_ARRAY_LIST_GET(handlers, &env, j);
+ qname = AXIS2_HANDLER_GET_NAME(handler, &env);
+ handler_name = AXIS2_QNAME_GET_LOCALPART(qname, &env);
+ if(0 == AXIS2_STRCMP(handler_name, "addressing_based_dispatcher"))
+ {
+ printf("handler_name:%s\n", handler_name);
+ actual = AXIS2_SUCCESS;
+ break;
+ }
+ }
+ }
+
+ AXIS2_CONF_FREE(conf, &env);
+
+ CuAssertIntEquals(tc, expected, actual);
+}
+
Added: webservices/axis2/trunk/c/test/unit/core/engine/test_conf.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/engine/test_conf.h?rev=371473&view=auto
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/engine/test_conf.h (added)
+++ webservices/axis2/trunk/c/test/unit/core/engine/test_conf.h Sun Jan 22 22:44:48 2006
@@ -0,0 +1,13 @@
+#ifndef TEST_CONF_H
+#define TEST_CONF_H
+
+#include <CuTest.h>
+#include <axis2_allocator.h>
+#include <axis2_env.h>
+#include <axis2_hash.h>
+#include <axis2_string.h>
+#include <axis2_conf.h>
+
+void Testaxis2_conf_set_default_dispatchers(CuTest *tc);
+
+#endif /* TEST_CONF_H*/