axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r369750 - in /webservices/axis2/trunk/c: include/axis2_dll_desc.h include/axis2_error.h modules/core/transport/axis2_transport_sender.h modules/util/class_loader.c test/core/deployment/Makefile.am test/core/deployment/test_deployment.c
Date Tue, 17 Jan 2006 10:55:50 GMT
Author: damitha
Date: Tue Jan 17 02:55:38 2006
New Revision: 369750

URL: http://svn.apache.org/viewcvs?rev=369750&view=rev
Log:
Added a test for transport sender loading


Modified:
    webservices/axis2/trunk/c/include/axis2_dll_desc.h
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/modules/core/transport/axis2_transport_sender.h
    webservices/axis2/trunk/c/modules/util/class_loader.c
    webservices/axis2/trunk/c/test/core/deployment/Makefile.am
    webservices/axis2/trunk/c/test/core/deployment/test_deployment.c

Modified: webservices/axis2/trunk/c/include/axis2_dll_desc.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_dll_desc.h?rev=369750&r1=369749&r2=369750&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_dll_desc.h (original)
+++ webservices/axis2/trunk/c/include/axis2_dll_desc.h Tue Jan 17 02:55:38 2006
@@ -60,7 +60,9 @@
     /** module dll */
     AXIS2_MODULE_DLL,
     /** transport receiver dll */
-    AXIS2_TRANSPORT_RECV_DLL
+    AXIS2_TRANSPORT_RECV_DLL,
+    /** transport sender dll */
+    AXIS2_TRANSPORT_SENDER_DLL
        
 }axis2_dll_type_t;
 

Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=369750&r1=369749&r2=369750&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Tue Jan 17 02:55:38 2006
@@ -446,6 +446,7 @@
         AXIS2_ERROR_ONLY_CHARACTERS_ARE_ALLOWED_HERE,
 
         AXIS2_ERROR_TRANSPORT_RECV_CREATION_FAILED,
+        AXIS2_ERROR_TRANSPORT_SENDER_CREATION_FAILED,
         
         /* Listen failed for the server socket */
         AXIS2_ERROR_SOCKET_LISTEN_FAILED,

Modified: webservices/axis2/trunk/c/modules/core/transport/axis2_transport_sender.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/axis2_transport_sender.h?rev=369750&r1=369749&r2=369750&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/axis2_transport_sender.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/axis2_transport_sender.h Tue Jan 17 02:55:38
2006
@@ -120,10 +120,10 @@
 #define AXIS2_TRANSPORT_SENDER_INIT(transport_sender, env, conf_context, transport_out) \
 		((transport_sender->ops)->init (transport_sender, env, conf_context, transport_out))
 
-#define AXIS2_TRANSPORT_INVOKE(transport_sender, env, msg_ctx) \
+#define AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx) \
 		((transport_sender->ops)->invoke (transport_sender, env, msg_ctx))      
 
-#define AXIS2_TRANSPORT_CLEANUP(transport_sender, env, msg_ctx) \
+#define AXIS2_TRANSPORT_SENDER_CLEANUP(transport_sender, env, msg_ctx) \
 		((transport_sender->ops)->cleanup (transport_sender, env, msg_ctx))      
 
 /*************************** End of function macros ***************************/

Modified: webservices/axis2/trunk/c/modules/util/class_loader.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/class_loader.c?rev=369750&r1=369749&r2=369750&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/class_loader.c (original)
+++ webservices/axis2/trunk/c/modules/util/class_loader.c Tue Jan 17 02:55:38 2006
@@ -51,6 +51,7 @@
     void *handler = NULL; /* axis2_handler */
     void *module = NULL; /* axis2_module */
     void *transport_recv = NULL; /* axis2_transport_receiver */
+    void *transport_sender = NULL; /* axis2_transport_sender */
     CREATE_FUNCT create_funct = NULL;
     axis2_dll_desc_t *dll_desc = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -166,6 +167,20 @@
         }
         return transport_recv;
     }
+    if(AXIS2_TRANSPORT_SENDER_DLL == dll_type)
+    {
+        create_funct(&transport_sender, env);
+        printf("transport sender loaded successfully\n");
+        if(NULL == transport_sender)
+        {
+            printf("transport_sender is null\n");
+            AXIS2_ERROR_SET((*env)->error, 
+                AXIS2_ERROR_TRANSPORT_SENDER_CREATION_FAILED,AXIS2_FAILURE);
+            return NULL;
+        }
+        return transport_sender;
+    }
+
 
     return NULL;    
 }

Modified: webservices/axis2/trunk/c/test/core/deployment/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/core/deployment/Makefile.am?rev=369750&r1=369749&r2=369750&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/core/deployment/Makefile.am (original)
+++ webservices/axis2/trunk/c/test/core/deployment/Makefile.am Tue Jan 17 02:55:38 2006
@@ -1,7 +1,7 @@
 prgbindir=$(prefix)/bin/system_test
 prgbin_PROGRAMS = test_deployment
 SUBDIRS =
-AM_CPPFLAGS = $(CPPFLAGS) -g -O2 -pthread
+AM_CPPFLAGS = $(CPPFLAGS) -g -pthread
 test_deployment_SOURCES = test_deployment.c
 
 test_deployment_LDADD   =  -L$(AXIS2C_HOME)/lib \

Modified: webservices/axis2/trunk/c/test/core/deployment/test_deployment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/core/deployment/test_deployment.c?rev=369750&r1=369749&r2=369750&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/core/deployment/test_deployment.c (original)
+++ webservices/axis2/trunk/c/test/core/deployment/test_deployment.c Tue Jan 17 02:55:38 2006
@@ -126,12 +126,48 @@
     return 0;
 }
 
+axis2_test_transport_sender_load()
+{
+    axis2_dll_desc_t *dll_desc = NULL;
+    axis2_char_t *dll_name = NULL;
+    axis2_transport_sender_t *transport_sender = NULL;
+    axis2_param_t *impl_info_param = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    axis2_char_t *axis2c_home = NULL;
+    axis2_msg_ctx_t *msg_ctx = NULL;
+
+    printf("testing axis2_transport_sender load\n"); 
+    axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+    axis2_env_t *env = axis2_env_create (allocator);
+    
+    msg_ctx = (axis2_msg_ctx_t *) AXIS2_MALLOC(env->allocator, 5);
+    dll_desc = axis2_dll_desc_create(&env);
+    
+    axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
+    dll_name = AXIS2_STRACAT (axis2c_home, "/lib/libaxis2_http_sender.so", &env);
+    printf("transport sender name:%s\n", dll_name);
+    AXIS2_DLL_DESC_SET_NAME(dll_desc, &env, dll_name);
+    AXIS2_DLL_DESC_SET_TYPE(dll_desc, &env, AXIS2_TRANSPORT_SENDER_DLL);
+    axis2_class_loader_init(&env);
+    impl_info_param = axis2_param_create(&env, NULL, NULL);
+    AXIS2_PARAM_SET_VALUE(impl_info_param, &env, dll_desc);
+    transport_sender = (axis2_transport_sender_t *) axis2_class_loader_create_dll(&env,

+        impl_info_param);
+    
+    status = AXIS2_TRANSPORT_SENDER_CLEANUP(transport_sender, &env, msg_ctx);
+    printf("clean status:%d\n", status);
+    AXIS2_FREE(env->allocator, dll_name);
+    printf("transport sender load test successful\n");
+    return 0;
+}
+
 int main()
 {
     /*axis2_test_dep_engine_do_deploy();
     axis2_test_engine_conf_builder_populate_conf();*/
-    axis2_test_dep_engine_load();
+    /*axis2_test_dep_engine_load();*/
     /*axis2_test_transport_receiver_load();*/
+    axis2_test_transport_sender_load();
     
 	return 0;
 }



Mime
View raw message