extern void utc_http_startup(void);
extern void utc_http_cleanup(void);
+extern int utc_http_init_n(void);
+extern int utc_http_init_p(void);
extern int utc_http_session_create_p(void);
extern int utc_http_session_create_n(void);
extern int utc_http_session_destroy_n(void);
extern int utc_http_transaction_get_credentials_p(void);
extern int utc_http_transaction_open_authentication_n(void);
extern int utc_http_transaction_open_authentication_p(void);
+extern int utc_http_transaction_resume_n(void);
+extern int utc_http_transaction_pause_n(void);
+extern int utc_http_transaction_response_get_status_text_n(void);
+extern int utc_http_transaction_response_get_version_n(void);
+extern int utc_http_transaction_get_realm_n(void);
extern int utc_http_transaction_submit_n(void);
extern int utc_http_transaction_submit_p(void);
extern int utc_http_deinit_n(void);
extern int utc_http_deinit_p(void);
testcase tc_array[] = {
+ {"utc_http_init_n", utc_http_init_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_init_p", utc_http_init_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_p", utc_http_session_create_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_n", utc_http_session_create_n, utc_http_startup, utc_http_cleanup},
{"utc_http_session_destroy_n", utc_http_session_destroy_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_get_credentials_p", utc_http_transaction_get_credentials_p, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_open_authentication_n", utc_http_transaction_open_authentication_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_open_authentication_p", utc_http_transaction_open_authentication_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_resume_n", utc_http_transaction_resume_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_pause_n", utc_http_transaction_pause_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_status_text_n", utc_http_transaction_response_get_status_text_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_version_n", utc_http_transaction_response_get_version_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_realm_n", utc_http_transaction_get_realm_n},
{"utc_http_transaction_submit_n", utc_http_transaction_submit_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_submit_p", utc_http_transaction_submit_p, utc_http_startup, utc_http_cleanup},
{"utc_http_deinit_p", utc_http_deinit_p, utc_http_startup, utc_http_cleanup},
extern void utc_http_startup(void);
extern void utc_http_cleanup(void);
+extern int utc_http_init_n(void);
+extern int utc_http_init_p(void);
extern int utc_http_session_create_p(void);
extern int utc_http_session_create_n(void);
extern int utc_http_session_destroy_n(void);
extern int utc_http_transaction_get_credentials_p(void);
extern int utc_http_transaction_open_authentication_n(void);
extern int utc_http_transaction_open_authentication_p(void);
+extern int utc_http_transaction_resume_n(void);
+extern int utc_http_transaction_pause_n(void);
+extern int utc_http_transaction_response_get_status_text_n(void);
+extern int utc_http_transaction_response_get_version_n(void);
+extern int utc_http_transaction_get_realm_n(void);
extern int utc_http_transaction_submit_n(void);
extern int utc_http_transaction_submit_p(void);
extern int utc_http_deinit_n(void);
extern int utc_http_deinit_p(void);
testcase tc_array[] = {
+ {"utc_http_init_n", utc_http_init_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_init_p", utc_http_init_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_p", utc_http_session_create_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_n", utc_http_session_create_n, utc_http_startup, utc_http_cleanup},
{"utc_http_session_destroy_n", utc_http_session_destroy_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_get_credentials_p", utc_http_transaction_get_credentials_p, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_open_authentication_n", utc_http_transaction_open_authentication_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_open_authentication_p", utc_http_transaction_open_authentication_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_resume_n", utc_http_transaction_resume_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_pause_n", utc_http_transaction_pause_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_status_text_n", utc_http_transaction_response_get_status_text_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_version_n", utc_http_transaction_response_get_version_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_realm_n", utc_http_transaction_get_realm_n},
{"utc_http_transaction_submit_n", utc_http_transaction_submit_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_submit_p", utc_http_transaction_submit_p, utc_http_startup, utc_http_cleanup},
{"utc_http_deinit_p", utc_http_deinit_p, utc_http_startup, utc_http_cleanup},
extern void utc_http_startup(void);
extern void utc_http_cleanup(void);
+extern int utc_http_init_n(void);
+extern int utc_http_init_p(void);
extern int utc_http_session_create_p(void);
extern int utc_http_session_create_n(void);
extern int utc_http_session_destroy_n(void);
extern int utc_http_transaction_request_get_cookie_p(void);
extern int utc_http_transaction_request_write_body_n(void);
extern int utc_http_transaction_request_write_body_p(void);
+extern int utc_http_transaction_set_http_auth_scheme_n(void);
+extern int utc_http_transaction_set_http_auth_scheme_p(void);
+extern int utc_http_transaction_get_http_auth_scheme_n(void);
+extern int utc_http_transaction_get_http_auth_scheme_p(void);
+extern int utc_http_transaction_set_credentials_n(void);
+extern int utc_http_transaction_set_credentials_p(void);
+extern int utc_http_transaction_get_credentials_n(void);
+extern int utc_http_transaction_get_credentials_p(void);
+extern int utc_http_transaction_open_authentication_n(void);
+extern int utc_http_transaction_open_authentication_p(void);
+extern int utc_http_transaction_resume_n(void);
+extern int utc_http_transaction_pause_n(void);
+extern int utc_http_transaction_response_get_status_text_n(void);
+extern int utc_http_transaction_response_get_version_n(void);
+extern int utc_http_transaction_get_realm_n(void);
extern int utc_http_transaction_submit_n(void);
extern int utc_http_transaction_submit_p(void);
extern int utc_http_deinit_n(void);
extern int utc_http_deinit_p(void);
testcase tc_array[] = {
+ {"utc_http_init_n", utc_http_init_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_init_p", utc_http_init_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_p", utc_http_session_create_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_n", utc_http_session_create_n, utc_http_startup, utc_http_cleanup},
{"utc_http_session_destroy_n", utc_http_session_destroy_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_request_get_cookie_p", utc_http_transaction_request_get_cookie_p, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_request_write_body_n", utc_http_transaction_request_write_body_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_request_write_body_p", utc_http_transaction_request_write_body_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_set_http_auth_scheme_n", utc_http_transaction_set_http_auth_scheme_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_set_http_auth_scheme_p", utc_http_transaction_set_http_auth_scheme_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_http_auth_scheme_n", utc_http_transaction_get_http_auth_scheme_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_http_auth_scheme_p", utc_http_transaction_get_http_auth_scheme_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_set_credentials_n", utc_http_transaction_set_credentials_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_set_credentials_p", utc_http_transaction_set_credentials_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_credentials_n", utc_http_transaction_get_credentials_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_credentials_p", utc_http_transaction_get_credentials_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_open_authentication_n", utc_http_transaction_open_authentication_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_open_authentication_p", utc_http_transaction_open_authentication_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_resume_n", utc_http_transaction_resume_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_pause_n", utc_http_transaction_pause_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_status_text_n", utc_http_transaction_response_get_status_text_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_version_n", utc_http_transaction_response_get_version_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_realm_n", utc_http_transaction_get_realm_n},
{"utc_http_transaction_submit_n", utc_http_transaction_submit_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_submit_p", utc_http_transaction_submit_p, utc_http_startup, utc_http_cleanup},
{"utc_http_deinit_p", utc_http_deinit_p, utc_http_startup, utc_http_cleanup},
extern void utc_http_startup(void);
extern void utc_http_cleanup(void);
+extern int utc_http_init_n(void);
+extern int utc_http_init_p(void);
extern int utc_http_session_create_p(void);
extern int utc_http_session_create_n(void);
extern int utc_http_session_destroy_n(void);
extern int utc_http_transaction_get_credentials_p(void);
extern int utc_http_transaction_open_authentication_n(void);
extern int utc_http_transaction_open_authentication_p(void);
+extern int utc_http_transaction_resume_n(void);
+extern int utc_http_transaction_pause_n(void);
+extern int utc_http_transaction_response_get_status_text_n(void);
+extern int utc_http_transaction_response_get_version_n(void);
+extern int utc_http_transaction_get_realm_n(void);
extern int utc_http_transaction_submit_n(void);
extern int utc_http_transaction_submit_p(void);
extern int utc_http_deinit_n(void);
extern int utc_http_deinit_p(void);
testcase tc_array[] = {
+ {"utc_http_init_n", utc_http_init_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_init_p", utc_http_init_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_p", utc_http_session_create_p, utc_http_startup, utc_http_cleanup},
{"utc_http_session_create_n", utc_http_session_create_n, utc_http_startup, utc_http_cleanup},
{"utc_http_session_destroy_n", utc_http_session_destroy_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_get_credentials_p", utc_http_transaction_get_credentials_p, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_open_authentication_n", utc_http_transaction_open_authentication_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_open_authentication_p", utc_http_transaction_open_authentication_p, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_resume_n", utc_http_transaction_resume_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_pause_n", utc_http_transaction_pause_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_status_text_n", utc_http_transaction_response_get_status_text_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_response_get_version_n", utc_http_transaction_response_get_version_n, utc_http_startup, utc_http_cleanup},
+ {"utc_http_transaction_get_realm_n", utc_http_transaction_get_realm_n},
{"utc_http_transaction_submit_n", utc_http_transaction_submit_n, utc_http_startup, utc_http_cleanup},
{"utc_http_transaction_submit_p", utc_http_transaction_submit_p, utc_http_startup, utc_http_cleanup},
{"utc_http_deinit_p", utc_http_deinit_p, utc_http_startup, utc_http_cleanup},
}
/**
+ * @testcas utc_http_init_n
+ * @since_tizen 3.0
+ * @type Negative
+ * @description Initializes the HTTP module.
+ * @scenario Invoking http_init with invalid parameter.
+ */
+int utc_http_init_n(void)
+{
+ int ret;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_init();
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_init();
+ assert_eq(ret, TIZEN_ERROR_INVALID_OPERATION);
+ return 0;
+}
+
+/**
+ * @testcase utc_http_init_p
+ * @since_tizen 3.0
+ * @type Positive
+ * @description Initializes the HTTP module.
+ * @scenario Invoking http_init with valid parameter.
+ */
+int utc_http_init_p(void)
+{
+ int ret;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_init();
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_deinit();
+ assert_eq(ret, TIZEN_ERROR_NONE);
+ ret = http_init();
+ assert_eq(ret, TIZEN_ERROR_NONE);
+
+ return 0;
+}
+/**
* @testcase utc_http_sesssion_create_p
* @since_tizen 3.0
* @type Positive
}
/**
+ * @testcase utc_http_transaction_resume_n
+ * @since_tizen 3.0
+ * @type Negative
+ * @description Resumes the transaction.
+ * @scenario Invoking http_transaction_resume with invalid parameter.
+ */
+int utc_http_transaction_resume_n(void)
+{
+ int ret;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_transaction_resume(NULL);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_transaction_resume(NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_http_transaction_pause_n
+ * @since_tizen 3.0
+ * @type Negative
+ * @description Pauses the transaction.
+ * @scenario Invoking http_transaction_pause with invalid parameter.
+ */
+int utc_http_transaction_pause_n(void)
+{
+ int ret;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_transaction_pause(NULL, HTTP_PAUSE_ALL);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_transaction_pause(NULL, HTTP_PAUSE_ALL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_http_transaction_response_get_status_text_n
+ * @since_tizen 3.0
+ * @type Negative
+ * @description Gets the HTTP status text from HTTP Response.
+ * @scenario Invoking http_transaction_response_get_status_text with invalid parameter.
+ */
+int utc_http_transaction_response_get_status_text_n(void)
+{
+ int ret;
+ char *status_text;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_transaction_response_get_status_text(NULL, &status_text);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_transaction_response_get_status_text(NULL, &status_text);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+ ret = http_transaction_response_get_status_text(transaction, NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+ ret = http_transaction_response_get_status_text(NULL, NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_http_transaction_response_get_version_n
+ * @since_tizen 3.0
+ * @type Negative
+ * @description Gets the HTTP version from HTTP Response.
+ * @scenario Invoking http_transaction_response_get_version with invalid parameter.
+ */
+int utc_http_transaction_response_get_version_n(void)
+{
+ int ret;
+ http_version_e version;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_transaction_response_get_version(NULL, &version);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_transaction_response_get_version(NULL, &version);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+ ret = http_transaction_response_get_version(transaction, NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+ ret = http_transaction_response_get_version(NULL, NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_http_transaction_get_realm_n
+ * @since_tizen 3.0
+ * @type Negative
+ * @description Gets the HTTP authentication realm.
+ * @scenario Invoking http_transaction_get_realm with invalid parameter.
+ */
+int utc_http_transaction_get_realm_n(void)
+{
+ int ret;
+ char *realm;
+
+#ifdef WEARABLE
+ if (g_internet_supported == false) {
+ ret = http_transaction_get_realm(NULL, &realm);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+#endif
+ ret = http_transaction_get_realm(NULL, &realm);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+ ret = http_transaction_get_realm(transaction, NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+ ret = http_transaction_get_realm(NULL, NULL);
+ assert_eq(ret, HTTP_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
* @testcase utc_http_transaction_submit_n
* @since_tizen 3.0
* @type Negative