From: <dg...@su...> - 2009-01-07 12:53:47
|
Author: henrik Date: Wed Jan 7 13:53:17 2009 New Revision: 5048 URL: http://www.opensync.org/changeset/5048 Log: Added a few testcases for Mozilla Calendar Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_add.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_delete.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_fmod.sh (contents, props changed) plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/add1 Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt ============================================================================== --- plugins/mozilla-sync/trunk/tests/CMakeLists.txt Wed Jan 7 10:20:16 2009 (r5047) +++ plugins/mozilla-sync/trunk/tests/CMakeLists.txt Wed Jan 7 13:53:17 2009 (r5048) @@ -35,6 +35,9 @@ CONFIGURE_FILE( "blackbox_test_cal_slow_slow.sh" "tests/blackbox_test_cal_slow_slow.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_slow3.sh" "tests/blackbox_test_cal_slow3.sh" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_slow_fast.sh" "tests/blackbox_test_cal_slow_fast.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_add.sh" "tests/blackbox_test_cal_add.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_delete.sh" "tests/blackbox_test_cal_delete.sh" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_fmod.sh" "tests/blackbox_test_cal_fmod.sh" COPYONLY) CONFIGURE_FILE( "abook.mab" "tests/abook.mab" COPYONLY) CONFIGURE_FILE( "blackbox_test_abook_vcard_additional/add1" "tests/blackbox_test_abook_vcard_additional/add1" COPYONLY) @@ -45,6 +48,7 @@ CONFIGURE_FILE( "storage.sdb_${CALENDAR_VERSION}" "tests/storage.sdb" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_vcard_base/1" "tests/blackbox_test_cal_vcard_base/1" COPYONLY) CONFIGURE_FILE( "blackbox_test_cal_vcard_base/2" "tests/blackbox_test_cal_vcard_base/2" COPYONLY) +CONFIGURE_FILE( "blackbox_test_cal_vevent_additional/add1" "tests/blackbox_test_cal_vevent_additional/add1" COPYONLY) ADD_TEST( blackbox_test_init_thunderbird "blackbox_test_init_thunderbird.sh" ) ADD_TEST( blackbox_test_init_osynctool "blackbox_test_init_osynctool.sh" ) @@ -59,3 +63,6 @@ ADD_TEST( blackbox_test_cal_slow_slow "blackbox_test_cal_slow_slow.sh" ) ADD_TEST( blackbox_test_cal_slow3 "blackbox_test_cal_slow3.sh" ) ADD_TEST( blackbox_test_cal_slow_fast "blackbox_test_cal_slow_fast.sh" ) +ADD_TEST( blackbox_test_cal_add "blackbox_test_cal_add.sh" ) +ADD_TEST( blackbox_test_cal_delete "blackbox_test_cal_delete.sh" ) +ADD_TEST( blackbox_test_cal_fmod "blackbox_test_cal_fmod.sh" ) Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_add.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_add.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,47 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test addtion of VEVENT + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Add event" +initialize_sunbird +initialize_osynctool + +VEVENT_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" +VEVENT_DIR_ADDITIONAL="${SRC_DIR}/blackbox_test_cal_vevent_additional" + +# Create a directory with VEVENTs +# Slow sync it into Sunbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VEVENT_DIR_1 vcard_orig "${VEVENT_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VEVENT_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Add a VEVENT +# Fast sync it into Sunbird +banner_step "Fast sync after add" +cp "${VEVENT_DIR_ADDITIONAL}"/* "${VEVENT_DIR_1}" +copy_dir VEVENT_DIR_A vcard_orig_added "${VEVENT_DIR_BASE}" +cp "${VEVENT_DIR_ADDITIONAL}"/* "${VEVENT_DIR_A}" +msync_sync "${GROUP_NAME_1}" + +# Slow sync Sunbird to a new VEVENT directory in a new group +# And verify that the contents have the new VEVENT added +banner_step "Compare calendar after add" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VEVENT_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VEVENT_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +compare_vcard_dirs "${VEVENT_DIR_A}" "${VEVENT_DIR_1C}" + +success_exit Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_delete.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_delete.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,47 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test deletion of VCard + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Delete event" +initialize_sunbird +initialize_osynctool + +VEVENT_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" + +# Create a directory with events +# Slow sync it into Sunbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VEVENT_DIR_1 vevent_orig "${VEVENT_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VEVENT_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Delete a VEVENT +# Fast sync it into Thunderbird +banner_step "Fast sync after delete" +rm "${VEVENT_DIR_1}/1" +copy_dir VEVENT_DIR_D vevent_orig_deleted "${VEVENT_DIR_BASE}" +rm "${VEVENT_DIR_D}/1" +msync_sync "${GROUP_NAME_1}" + +# Slow sync Sunbird to a new VEVENT directory in a new group +# And verify that the contents have the VEVENT deleted +banner_step "Compare calendar after delete" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VEVENT_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VEVENT_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +compare_vcard_dirs "${VEVENT_DIR_D}" "${VEVENT_DIR_1C}" + +success_exit + Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_fmod.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_fmod.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,46 @@ +#!/bin/bash + +# ====================================================== +# This file is part of the mozilla-sync plugin for OpenSync +# See http://www.KaarPoSoft.dk/bluezync +# $Id$ +# ====================================================== + +# Test modification of VEVENT + +SCRIPT_NAME=`basename $0`; SCRIPT_NAME=${SCRIPT_NAME%.sh} +SRC_DIR=`(cd \`dirname $0\`; pwd)` +source "${SRC_DIR}/blackbox_test_common.shinc" + +initialize_test "Modify VEVENT" +initialize_sunbird +initialize_osynctool + +VEVENT_DIR_BASE="${SRC_DIR}/blackbox_test_cal_vcard_base" + +# Create a directory with VEVENTS +# Slow sync it into Sunbird +banner_step "First slow sync" +GROUP_NAME_1="${SCRIPT_NAME}_slow1" +copy_dir VEVENT_DIR_1 vcard_orig "${VEVENT_DIR_BASE}" +create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VEVENT_DIR_1}" +msync_sync "${GROUP_NAME_1}" + +# Modify a VEVENT +# Fast sync it into Sunbird +banner_step "Fast sync after add" +sed -i s/Location/New\ location/ "${VEVENT_DIR_1}/1" +msync_sync "${GROUP_NAME_1}" + +# Slow sync Sunbird to a new VEVENT directory in a new group +# And verify that the contents have the new VEVENT modified +banner_step "Compare VEVENT add" +GROUP_NAME_1C="${SCRIPT_NAME}_compare1" +make_temp_dir VEVENT_DIR_1C compare1 +create_msync_group_cal_file "${GROUP_NAME_1C}" 1 "${VEVENT_DIR_1C}" +msync_sync "${GROUP_NAME_1C}" +copy_dir VEVENT_DIR_A vevent_orig_for_compare "${VEVENT_DIR_BASE}" +sed -i s/Location/New\ location/ "${VEVENT_DIR_A}/1" +compare_vcard_dirs "${VEVENT_DIR_A}" "${VEVENT_DIR_1C}" + +success_exit Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh ============================================================================== --- plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Wed Jan 7 10:20:16 2009 (r5047) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_slow3.sh Wed Jan 7 13:53:17 2009 (r5048) @@ -22,7 +22,7 @@ # Slow sync it into Thunderbird banner_step "First Calendar slow sync" GROUP_NAME_1="${SCRIPT_NAME}_slow1" -copy_dir VCARD_DIR_1 vcard_orig "${VCARD_DIR_BASE}" +copy_dir VCARD_DIR_1 vevent_orig "${VCARD_DIR_BASE}" create_msync_group_cal_file "${GROUP_NAME_1}" 1 "${VCARD_DIR_1}" msync_sync "${GROUP_NAME_1}" @@ -42,7 +42,7 @@ # Now do a second slow sync to see that this works banner_step "Second slow sync" GROUP_NAME_2="${SCRIPT_NAME}_slow2" -copy_dir VCARD_DIR_2 vcard_orig "${VCARD_DIR_BASE}" +copy_dir VCARD_DIR_2 vevent_orig "${VCARD_DIR_BASE}" create_msync_group_cal_file "${GROUP_NAME_2}" 1 "${VCARD_DIR_2}" msync_sync "${GROUP_NAME_2}" Added: plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/add1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_cal_vevent_additional/add1 Wed Jan 7 13:53:17 2009 (r5048) @@ -0,0 +1,13 @@ +BEGIN:VCALENDAR +PRODID:-//OpenSync//NONSGML OpenSync vformat 0.3//EN +VERSION:1.0 +BEGIN:VEVENT +DCREATED:20081030T105604Z +DTEND:20081030T170000 +DTSTART:20081030T180000 +DESCRIPTION:Description of Additional Event. +LAST-MODIFIED:20081031T105611Z +LOCATION:Location of Additional Event 1 +SUMMARY:Title of Additional Event 1 +END:VEVENT +END:VCALENDAR |