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/16 10:06:19 UTC
svn commit: r369406 - in
/webservices/axis2/trunk/c/test/unit/core/deployment: deployment_test.c
test_dep_engine.c test_dep_engine.h
Author: damitha
Date: Mon Jan 16 01:05:13 2006
New Revision: 369406
URL: http://svn.apache.org/viewcvs?rev=369406&view=rev
Log:
add unit test cases for deployment
Modified:
webservices/axis2/trunk/c/test/unit/core/deployment/deployment_test.c
webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.c
webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.h
Modified: webservices/axis2/trunk/c/test/unit/core/deployment/deployment_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/deployment/deployment_test.c?rev=369406&r1=369405&r2=369406&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/deployment/deployment_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/deployment/deployment_test.c Mon Jan 16 01:05:13 2006
@@ -1,13 +1,24 @@
#include "deployment_test.h"
-#include <string.h>
-#include <stdio.h>
+#include "dep_engine_test.h"
#include <axis2_allocator.h>
#include <axis2_env.h>
CuSuite* axis2_deploymentGetSuite()
{
CuSuite* suite = CuSuiteNew();
- SUITE_ADD_TEST(suite, Testaxis2_phases_info_get_op_in_phases );
+
+ /**
+ * Test cases for axis2_phases_info
+ */
+ /*SUITE_ADD_TEST(suite, Testaxis2_phases_info_get_op_in_phases );*/
+
+ /**
+ * Test cases for axis2_dep_engine
+ */
SUITE_ADD_TEST(suite, Testaxis2_dep_engine_free );
+ SUITE_ADD_TEST(suite,Testaxis2_dep_engine_create);
+ /*SUITE_ADD_TEST(suite,Testaxis2_dep_engine_create_with_repos_name);*/
+ SUITE_ADD_TEST(suite,Testaxis2_dep_engine_load);
+
return suite;
}
Modified: webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.c?rev=369406&r1=369405&r2=369406&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.c Mon Jan 16 01:05:13 2006
@@ -6,18 +6,89 @@
axis2_dep_engine_t *dep_engine = NULL;
axis2_status_t actual = AXIS2_FAILURE;
axis2_status_t expected = AXIS2_SUCCESS;
-
+ axis2_char_t *axis2c_home = NULL;
+
axis2_allocator_t *allocator = axis2_allocator_init (NULL);
axis2_env_t *env = axis2_env_create (allocator);
-
- dep_engine = axis2_dep_engine_create_with_repos_name(&env,
- "/home/damitha/programs/axis2c");
+ axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
+
+ dep_engine = axis2_dep_engine_create_with_repos_name(&env, axis2c_home
+ );
if(!dep_engine)
{
printf("dep engine is not created \n");
- return -1;
+ return;
}
actual = AXIS2_DEP_ENGINE_FREE(dep_engine, &env);
+ printf("ok1");
CuAssertIntEquals(tc, expected, actual);
+ axis2_env_free(env);
+}
+
+
+void Testaxis2_dep_engine_create(CuTest *tc)
+{
+ axis2_env_t *env;
+ axis2_allocator_t *allocator;
+ axis2_dep_engine_t *dep_engine = NULL;
+ allocator = axis2_allocator_init(NULL);
+ env = axis2_env_create(allocator);
+
+ dep_engine = axis2_dep_engine_create(&env);
+
+ CuAssertPtrNotNull(tc,dep_engine);
+
+ if (dep_engine)
+ AXIS2_DEP_ENGINE_FREE(dep_engine, &env);
+ axis2_env_free(env);
+}
+
+void Testaxis2_dep_engine_create_with_repos_name(CuTest *tc)
+{
+ axis2_env_t *env;
+ axis2_allocator_t *allocator;
+ axis2_dep_engine_t *dep_engine = NULL;
+ axis2_char_t *axis2c_home = NULL;
+ allocator = axis2_allocator_init(NULL);
+ env = axis2_env_create(allocator);
+
+ axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
+
+ dep_engine = axis2_dep_engine_create_with_repos_name(&env,axis2c_home);
+
+ CuAssertPtrNotNull(tc,dep_engine);
+
+ if (dep_engine)
+ axis2_dep_engine_free(&dep_engine, &env);
+
+ axis2_env_free(env);
+}
+
+
+void Testaxis2_dep_engine_load(CuTest *tc)
+{
+
+ axis2_env_t *env;
+ axis2_allocator_t *allocator;
+ axis2_conf_t *conf_actual = NULL;
+ axis2_char_t *axis2c_home = NULL;
+ axis2_status_t actual = AXIS2_FAILURE;
+ allocator = axis2_allocator_init(NULL);
+ env = axis2_env_create(allocator);
+
+ axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
+
+ axis2_dep_engine_t *dep_engine = NULL;
+
+ dep_engine = axis2_dep_engine_create_with_repos_name(&env,axis2c_home);
+ if (dep_engine)
+ conf_actual = axis2_dep_engine_load(dep_engine,&env);
+
+ CuAssertPtrNotNull(tc,conf_actual);
+
+ if (conf_actual)
+ AXIS2_CONF_FREE(conf_actual,&env);
+
+ axis2_env_free(env);
}
Modified: webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.h?rev=369406&r1=369405&r2=369406&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.h (original)
+++ webservices/axis2/trunk/c/test/unit/core/deployment/test_dep_engine.h Mon Jan 16 01:05:13 2006
@@ -11,5 +11,8 @@
#include <axis2_dep_engine.h>
void Testaxis2_dep_engine_free(CuTest *tc);
+void Testaxis2_dep_engine_create(CuTest *tc);
+void Testaxis2_dep_engine_create_with_repos_name(CuTest *tc);
+void Testaxis2_dep_engine_load(CuTest *tc);
#endif /* TEST_DEP_ENGINE_H*/