diff --git a/README.md b/README.md index 00993b34..191db69c 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ Library to do file related REST API calls from JavaScript. Library to do REST API calls from JavaScript using promises instead of callbacks. -**smartsync.js** +**mobilesync.js** -Contains the SmartSync data library. +Contains the MobileSync data library. This library depends on force.js and cordova.force.js. It also requires underscore and backbone. # /test @@ -36,7 +36,7 @@ Contains all the tests for the SalesforceMobileSDK JavaScript libraries. HTML page to run the tests outside the container. -**MockCordova.js, MockSDKInfo.js, MockSmartStore.js, MockSmartSyncPlugin.js** +**MockCordova.js, MockSDKInfo.js, MockSmartStore.js, MockMobileSyncPlugin.js** Libraries used to mock the container when running tests directly in a browser. @@ -48,6 +48,6 @@ Super class of test suites. Test suites for SmartStore. -**SFSmartSyncTestSuite.js** +**SFMobileSyncTestSuite.js** -Test suite for SmartSync library. +Test suite for MobileSync library. diff --git a/gen/cordova_plugins.js b/gen/cordova_plugins.js index e0d0aa89..8ef59d8b 100644 --- a/gen/cordova_plugins.js +++ b/gen/cordova_plugins.js @@ -27,8 +27,8 @@ module.exports = [ ] }, { - "file": "plugins/com.salesforce/com.salesforce.plugin.smartsync.js", - "id": "com.salesforce.plugin.smartsync", + "file": "plugins/com.salesforce/com.salesforce.plugin.mobilesync.js", + "id": "com.salesforce.plugin.mobilesync", }, { "file": "plugins/com.salesforce/com.salesforce.util.bootstrap.js", diff --git a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js similarity index 99% rename from gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js rename to gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js index 2668c596..38b412e6 100644 --- a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js +++ b/gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js @@ -26,7 +26,7 @@ // Version this js was shipped with var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; -var SERVICE = "com.salesforce.smartsync"; +var SERVICE = "com.salesforce.mobilesync"; var exec = require("com.salesforce.util.exec").exec; var defaultStoreConfig = {'isGlobalStore':false}; diff --git a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js similarity index 98% rename from gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js rename to gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js index 7532dc3b..9c551aec 100644 --- a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js +++ b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js @@ -1,4 +1,4 @@ -cordova.define("com.salesforce.plugin.smartsync", function(require, exports, module) { +cordova.define("com.salesforce.plugin.mobilesync", function(require, exports, module) { /* * Copyright (c) 2012-present, salesforce.com, inc. * All rights reserved. @@ -27,7 +27,7 @@ cordova.define("com.salesforce.plugin.smartsync", function(require, exports, mod // Version this js was shipped with var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; -var SERVICE = "com.salesforce.smartsync"; +var SERVICE = "com.salesforce.mobilesync"; var exec = require("com.salesforce.util.exec").exec; var defaultStoreConfig = {'isGlobalStore':false}; diff --git a/libs/cordova.force.js b/libs/cordova.force.js index e07ef946..65963a1b 100644 --- a/libs/cordova.force.js +++ b/libs/cordova.force.js @@ -1078,8 +1078,8 @@ cordova.define("com.salesforce.plugin.smartstore.client", function(require, expo // For backward compatibility navigator.smartstoreClient = cordova.require("com.salesforce.plugin.smartstore.client"); -cordova.define("com.salesforce.plugin.smartsync", function (require, exports, module) { - var SERVICE = "com.salesforce.smartsync"; +cordova.define("com.salesforce.plugin.mobilesync", function (require, exports, module) { + var SERVICE = "com.salesforce.mobilesync"; var exec = require("com.salesforce.util.exec").exec; var defaultStoreConfig = {'isGlobalStore':false}; diff --git a/libs/smartsync.js b/libs/mobilesync.js similarity index 99% rename from libs/smartsync.js rename to libs/mobilesync.js index 9df59cee..fa372a64 100644 --- a/libs/smartsync.js +++ b/libs/mobilesync.js @@ -84,7 +84,7 @@ { var sdkinfo = cordova.require("com.salesforce.plugin.sdkinfo"); if(sdkinfo && typeof(sdkinfo.registerAppFeature) === 'function'){ - // register SmartSync JS App feature + // register MobileSync JS App feature sdkinfo.registerAppFeature('SJ'); } } diff --git a/samples/accounteditor/AccountEditor.html b/samples/accounteditor/AccountEditor.html index 0eed50c4..5d3f989c 100644 --- a/samples/accounteditor/AccountEditor.html +++ b/samples/accounteditor/AccountEditor.html @@ -28,7 +28,7 @@ - + diff --git a/samples/accounteditor/js/mobilesync.js b/samples/accounteditor/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/accounteditor/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/accounteditor/js/smartsync.js b/samples/accounteditor/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/accounteditor/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/samples/fileexplorer/FileExplorer.html b/samples/fileexplorer/FileExplorer.html index 4636a7ab..ae35ff52 100644 --- a/samples/fileexplorer/FileExplorer.html +++ b/samples/fileexplorer/FileExplorer.html @@ -28,7 +28,7 @@ - + diff --git a/samples/fileexplorer/js/mobilesync.js b/samples/fileexplorer/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/fileexplorer/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/fileexplorer/js/smartsync.js b/samples/fileexplorer/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/fileexplorer/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/samples/smartsyncexplorer/SmartSyncExplorer.html b/samples/mobilesyncexplorer/MobileSyncExplorer.html similarity index 97% rename from samples/smartsyncexplorer/SmartSyncExplorer.html rename to samples/mobilesyncexplorer/MobileSyncExplorer.html index 53ac923c..d73ff4b9 100644 --- a/samples/smartsyncexplorer/SmartSyncExplorer.html +++ b/samples/mobilesyncexplorer/MobileSyncExplorer.html @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -175,11 +175,11 @@

Contacts

}, syncDown: function() { - cordova.require("com.salesforce.plugin.smartsync").reSync("syncDownContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").reSync("syncDownContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); }, syncUp: function() { - cordova.require("com.salesforce.plugin.smartsync").reSync("syncUpContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").reSync("syncUpContacts" /* see usersyncs.json */, this.handleSyncUpdate.bind(this)); }, sync: function() { diff --git a/samples/smartsyncexplorer/bootconfig.json b/samples/mobilesyncexplorer/bootconfig.json similarity index 89% rename from samples/smartsyncexplorer/bootconfig.json rename to samples/mobilesyncexplorer/bootconfig.json index ec2ff946..7083be68 100644 --- a/samples/smartsyncexplorer/bootconfig.json +++ b/samples/mobilesyncexplorer/bootconfig.json @@ -3,7 +3,7 @@ "oauthRedirectURI": "testsfdc:///mobilesdk/detect/oauth/done", "oauthScopes": ["api","web"], "isLocal": true, - "startPage": "SmartSyncExplorer.html", + "startPage": "MobileSyncExplorer.html", "errorPage": "error.html", "shouldAuthenticate": true, "attemptOfflineLoad": false, diff --git a/samples/smartsyncexplorer/css/ratchet-theme-ios.css b/samples/mobilesyncexplorer/css/ratchet-theme-ios.css similarity index 100% rename from samples/smartsyncexplorer/css/ratchet-theme-ios.css rename to samples/mobilesyncexplorer/css/ratchet-theme-ios.css diff --git a/samples/smartsyncexplorer/css/ratchet.css b/samples/mobilesyncexplorer/css/ratchet.css similarity index 100% rename from samples/smartsyncexplorer/css/ratchet.css rename to samples/mobilesyncexplorer/css/ratchet.css diff --git a/samples/smartsyncexplorer/css/styles.css b/samples/mobilesyncexplorer/css/styles.css similarity index 100% rename from samples/smartsyncexplorer/css/styles.css rename to samples/mobilesyncexplorer/css/styles.css diff --git a/samples/smartsyncexplorer/js/MockCordova.js b/samples/mobilesyncexplorer/js/MockCordova.js similarity index 100% rename from samples/smartsyncexplorer/js/MockCordova.js rename to samples/mobilesyncexplorer/js/MockCordova.js diff --git a/samples/mobilesyncexplorer/js/MockMobileSyncPlugin.js b/samples/mobilesyncexplorer/js/MockMobileSyncPlugin.js new file mode 120000 index 00000000..a1547e01 --- /dev/null +++ b/samples/mobilesyncexplorer/js/MockMobileSyncPlugin.js @@ -0,0 +1 @@ +../../../test/MockMobileSyncPlugin.js \ No newline at end of file diff --git a/samples/smartsyncexplorer/js/MockSmartStore.js b/samples/mobilesyncexplorer/js/MockSmartStore.js similarity index 100% rename from samples/smartsyncexplorer/js/MockSmartStore.js rename to samples/mobilesyncexplorer/js/MockSmartStore.js diff --git a/samples/smartsyncexplorer/js/auth.js b/samples/mobilesyncexplorer/js/auth.js similarity index 100% rename from samples/smartsyncexplorer/js/auth.js rename to samples/mobilesyncexplorer/js/auth.js diff --git a/samples/smartsyncexplorer/js/backbone-min.js b/samples/mobilesyncexplorer/js/backbone-min.js similarity index 100% rename from samples/smartsyncexplorer/js/backbone-min.js rename to samples/mobilesyncexplorer/js/backbone-min.js diff --git a/samples/smartsyncexplorer/js/backbone.js b/samples/mobilesyncexplorer/js/backbone.js similarity index 100% rename from samples/smartsyncexplorer/js/backbone.js rename to samples/mobilesyncexplorer/js/backbone.js diff --git a/samples/smartsyncexplorer/js/cordova.force.js b/samples/mobilesyncexplorer/js/cordova.force.js similarity index 100% rename from samples/smartsyncexplorer/js/cordova.force.js rename to samples/mobilesyncexplorer/js/cordova.force.js diff --git a/samples/smartsyncexplorer/js/fastclick.js b/samples/mobilesyncexplorer/js/fastclick.js similarity index 100% rename from samples/smartsyncexplorer/js/fastclick.js rename to samples/mobilesyncexplorer/js/fastclick.js diff --git a/samples/smartsyncexplorer/js/force+promise.js b/samples/mobilesyncexplorer/js/force+promise.js similarity index 100% rename from samples/smartsyncexplorer/js/force+promise.js rename to samples/mobilesyncexplorer/js/force+promise.js diff --git a/samples/smartsyncexplorer/js/force.js b/samples/mobilesyncexplorer/js/force.js similarity index 100% rename from samples/smartsyncexplorer/js/force.js rename to samples/mobilesyncexplorer/js/force.js diff --git a/samples/smartsyncexplorer/js/jquery.min.js b/samples/mobilesyncexplorer/js/jquery.min.js similarity index 100% rename from samples/smartsyncexplorer/js/jquery.min.js rename to samples/mobilesyncexplorer/js/jquery.min.js diff --git a/samples/mobilesyncexplorer/js/mobilesync.js b/samples/mobilesyncexplorer/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/mobilesyncexplorer/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/smartsyncexplorer/js/stackrouter.js b/samples/mobilesyncexplorer/js/stackrouter.js similarity index 100% rename from samples/smartsyncexplorer/js/stackrouter.js rename to samples/mobilesyncexplorer/js/stackrouter.js diff --git a/samples/smartsyncexplorer/js/underscore-min.js b/samples/mobilesyncexplorer/js/underscore-min.js similarity index 100% rename from samples/smartsyncexplorer/js/underscore-min.js rename to samples/mobilesyncexplorer/js/underscore-min.js diff --git a/samples/smartsyncexplorer/userstore.json b/samples/mobilesyncexplorer/userstore.json similarity index 100% rename from samples/smartsyncexplorer/userstore.json rename to samples/mobilesyncexplorer/userstore.json diff --git a/samples/smartsyncexplorer/usersyncs.json b/samples/mobilesyncexplorer/usersyncs.json similarity index 100% rename from samples/smartsyncexplorer/usersyncs.json rename to samples/mobilesyncexplorer/usersyncs.json diff --git a/samples/notesync/NoteSync.html b/samples/notesync/NoteSync.html index 37bfe2df..0e893059 100644 --- a/samples/notesync/NoteSync.html +++ b/samples/notesync/NoteSync.html @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -161,11 +161,11 @@

<%= Title %>

syncDown: function() { var target = {type:"custom", androidImpl:"com.salesforce.samples.notesync.ContentSoqlSyncDownTarget", iOSImpl:"SFContentSoqlSyncDownTarget", query:"SELECT " + this.fieldlist.join(",") + " FROM ContentNote LIMIT 1000"}; - cordova.require("com.salesforce.plugin.smartsync").syncDown(target, "notes", {mergeMode:Force.MERGE_MODE_DOWNLOAD.LEAVE_IF_CHANGED}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncDown(target, "notes", {mergeMode:Force.MERGE_MODE_DOWNLOAD.LEAVE_IF_CHANGED}, this.handleSyncUpdate.bind(this)); }, syncUp: function(event) { - cordova.require("com.salesforce.plugin.smartsync").syncUp("notes", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncUp("notes", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); }, inspect: function() { diff --git a/samples/notesync/js/MockMobileSyncPlugin.js b/samples/notesync/js/MockMobileSyncPlugin.js new file mode 120000 index 00000000..a1547e01 --- /dev/null +++ b/samples/notesync/js/MockMobileSyncPlugin.js @@ -0,0 +1 @@ +../../../test/MockMobileSyncPlugin.js \ No newline at end of file diff --git a/samples/notesync/js/MockSmartSyncPlugin.js b/samples/notesync/js/MockSmartSyncPlugin.js deleted file mode 120000 index 895888b4..00000000 --- a/samples/notesync/js/MockSmartSyncPlugin.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/MockSmartSyncPlugin.js \ No newline at end of file diff --git a/samples/notesync/js/mobilesync.js b/samples/notesync/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/notesync/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/notesync/js/smartsync.js b/samples/notesync/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/notesync/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/samples/simplesyncreact/SimpleSync.html b/samples/simplesyncreact/SimpleSync.html index 44420322..9d0b7c8e 100644 --- a/samples/simplesyncreact/SimpleSync.html +++ b/samples/simplesyncreact/SimpleSync.html @@ -22,7 +22,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -120,7 +120,7 @@

Users

}, syncDown: function(target) { - cordova.require("com.salesforce.plugin.smartsync").syncDown(target, "users", {}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncDown(target, "users", {}, this.handleSyncUpdate.bind(this)); }, syncDownMru: function(event) { @@ -136,7 +136,7 @@

Users

}, syncUp: function(event) { - cordova.require("com.salesforce.plugin.smartsync").syncUp("users", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); + cordova.require("com.salesforce.plugin.mobilesync").syncUp("users", {fieldlist: this.fieldlist}, this.handleSyncUpdate.bind(this)); }, cacheSize: function() { diff --git a/samples/simplesyncreact/js/MockMobileSyncPlugin.js b/samples/simplesyncreact/js/MockMobileSyncPlugin.js new file mode 120000 index 00000000..a1547e01 --- /dev/null +++ b/samples/simplesyncreact/js/MockMobileSyncPlugin.js @@ -0,0 +1 @@ +../../../test/MockMobileSyncPlugin.js \ No newline at end of file diff --git a/samples/simplesyncreact/js/MockSmartSyncPlugin.js b/samples/simplesyncreact/js/MockSmartSyncPlugin.js deleted file mode 120000 index 895888b4..00000000 --- a/samples/simplesyncreact/js/MockSmartSyncPlugin.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/MockSmartSyncPlugin.js \ No newline at end of file diff --git a/samples/simplesyncreact/js/mobilesync.js b/samples/simplesyncreact/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/simplesyncreact/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/simplesyncreact/js/smartsync.js b/samples/simplesyncreact/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/simplesyncreact/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/samples/smartsyncexplorer/js/MockSmartSyncPlugin.js b/samples/smartsyncexplorer/js/MockSmartSyncPlugin.js deleted file mode 120000 index 895888b4..00000000 --- a/samples/smartsyncexplorer/js/MockSmartSyncPlugin.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/MockSmartSyncPlugin.js \ No newline at end of file diff --git a/samples/smartsyncexplorer/js/smartsync.js b/samples/smartsyncexplorer/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/smartsyncexplorer/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/samples/userandgroupsearch/UserAndGroupSearch.html b/samples/userandgroupsearch/UserAndGroupSearch.html index ef817d02..ecf09e43 100644 --- a/samples/userandgroupsearch/UserAndGroupSearch.html +++ b/samples/userandgroupsearch/UserAndGroupSearch.html @@ -27,7 +27,7 @@ - + diff --git a/samples/userandgroupsearch/js/mobilesync.js b/samples/userandgroupsearch/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/userandgroupsearch/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/userandgroupsearch/js/smartsync.js b/samples/userandgroupsearch/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/userandgroupsearch/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/samples/usersearch/UserSearch.html b/samples/usersearch/UserSearch.html index 83750d29..ac946fdc 100644 --- a/samples/usersearch/UserSearch.html +++ b/samples/usersearch/UserSearch.html @@ -27,7 +27,7 @@ - + diff --git a/samples/usersearch/js/mobilesync.js b/samples/usersearch/js/mobilesync.js new file mode 120000 index 00000000..5c8af6b2 --- /dev/null +++ b/samples/usersearch/js/mobilesync.js @@ -0,0 +1 @@ +../../../libs/mobilesync.js \ No newline at end of file diff --git a/samples/usersearch/js/smartsync.js b/samples/usersearch/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/usersearch/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.js \ No newline at end of file diff --git a/setversion.sh b/setversion.sh index 645ce4e1..1acd8bff 100755 --- a/setversion.sh +++ b/setversion.sh @@ -11,7 +11,7 @@ usage () { echo "Use this script to set Mobile SDK version number in source files" echo "Usage: $0 -v " - echo " where: version is the version e.g. 7.2.0" + echo " where: version is the version e.g. 8.0.0" } parse_opts () @@ -73,6 +73,15 @@ echo -e "${YELLOW}*** SETTING VERSION TO ${OPT_VERSION} ***${NC}" echo "*** Updating package.json ***" update_package_json "./package.json" "${OPT_VERSION}" +echo "*** Updating bower.json ***" +update_package_json "./tools/bower.json" "${OPT_VERSION}" + +echo "*** Updating package.json in tools ***" +update_package_json "./tools/package.json" "${OPT_VERSION}" + +echo "*** Updating package-lock.json ***" +update_package_json "./tools/package-lock.json" "${OPT_VERSION}" + echo "*** Updating MockSDKInfo test ***" update_mock_sdk_info "./test/MockSDKInfo.js" "${OPT_VERSION}" diff --git a/test/MockSmartSyncPlugin.js b/test/MockMobileSyncPlugin.js similarity index 94% rename from test/MockSmartSyncPlugin.js rename to test/MockMobileSyncPlugin.js index 2ae31d0c..3f96abd2 100644 --- a/test/MockSmartSyncPlugin.js +++ b/test/MockMobileSyncPlugin.js @@ -25,12 +25,12 @@ */ /** - * MockSmartSyncPlugin + * MockMobileSyncPlugin * Meant for development and testing only, the data is stored in SessionStorage, queries do full scans. * NB: cleanResyncGhosts only works for soql sync down */ -var MockSmartSyncPlugin = (function(window) { +var MockMobileSyncPlugin = (function(window) { // Constructor var module = function(storeConfig) { this.storeConfig = storeConfig; @@ -145,7 +145,7 @@ var MockSmartSyncPlugin = (function(window) { successCB(sync); if (target.type == "refresh") { - // smartsync.js doesn't have something equivalent to the (new in 5.0) refresh sync down + // mobilesync.js doesn't have something equivalent to the (new in 5.0) refresh sync down // So we need to get the local ids, build a soql query out of them // And use that for the collection cache.find({queryType:"range", orderPath:cache.keyField, pageSize:500}) // XXX not handling case with more than 500 local ids @@ -328,7 +328,7 @@ var SyncManagerMap = (function() { syncManager = isGlobalStore?this.globalSyncManagers[storeName]:this.userSyncManagers[storeName]; if(syncManager == null) { - syncManager = new MockSmartSyncPlugin({'isGlobalStore': isGlobalStore,'storeName' :storeName}); + syncManager = new MockMobileSyncPlugin({'isGlobalStore': isGlobalStore,'storeName' :storeName}); if(isGlobalStore == true) this.globalSyncManagers[storeName] = syncManager; else @@ -376,34 +376,34 @@ var syncManagerMap = new SyncManagerMap(); (function (cordova, syncManager, globalSyncManager) { - var SMARTSYNC_SERVICE = "com.salesforce.smartsync"; + var MOBILESYNC_SERVICE = "com.salesforce.mobilesync"; - cordova.interceptExec(SMARTSYNC_SERVICE, "syncUp", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "syncUp", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.syncUp(args[0].target, args[0].soupName, args[0].options, args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "syncDown", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "syncDown", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.syncDown(args[0].target, args[0].soupName, args[0].options, args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "getSyncStatus", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "getSyncStatus", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.getSyncStatus(args[0].syncId || args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "reSync", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "reSync", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.reSync(args[0].syncId || args[0].syncName, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "cleanResyncGhosts", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "cleanResyncGhosts", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.cleanResyncGhosts(args[0].syncId, successCB, errorCB); }); - cordova.interceptExec(SMARTSYNC_SERVICE, "deleteSync", function (successCB, errorCB, args) { + cordova.interceptExec(MOBILESYNC_SERVICE, "deleteSync", function (successCB, errorCB, args) { var mgr = syncManagerMap.getSyncManager(args); mgr.deleteSync(args[0].syncId || args[0].syncName, successCB, errorCB); }); diff --git a/test/MockSDKInfo.js b/test/MockSDKInfo.js index 42af6897..736da4a6 100644 --- a/test/MockSDKInfo.js +++ b/test/MockSDKInfo.js @@ -46,7 +46,7 @@ var MockSDKInfo = (function(window) { cordova.interceptExec(SDKINFO_SERVICE, "getInfo", function (successCB, errorCB, args) { successCB(new SDKInfo("8.0.0", - ["com.salesforce.oauth", "com.salesforce.sdkinfo", "com.salesforce.sfaccountmanager", "com.salesforce.network", "com.salesforce.testrunner", "com.salesforce.smartstore", "com.salesforce.smartsync"], + ["com.salesforce.oauth", "com.salesforce.sdkinfo", "com.salesforce.sfaccountmanager", "com.salesforce.network", "com.salesforce.testrunner", "com.salesforce.smartstore", "com.salesforce.mobilesync"], "SalesforceHybridSDKTestApp", "1.0", { "remoteAccessConsumerKey": "3MVG9Iu66FKeHhINkB1l7xt7kR8czFcCTUhgoA8Ol2Ltf1eYHOU4SqQRSEitYFDUpqRWcoQ2.dBv_a1Dyu5xa", diff --git a/test/SFSmartSyncTestSuite.js b/test/SFMobileSyncTestSuite.js similarity index 93% rename from test/SFSmartSyncTestSuite.js rename to test/SFMobileSyncTestSuite.js index 8816aaed..5b9d9a38 100644 --- a/test/SFSmartSyncTestSuite.js +++ b/test/SFMobileSyncTestSuite.js @@ -25,13 +25,13 @@ */ "use strict"; -if (typeof SmartSyncTestSuite === 'undefined') { +if (typeof MobileSyncTestSuite === 'undefined') { /** * Constructor */ -var SmartSyncTestSuite = function () { - SFTestSuite.call(this, "SmartSyncTestSuite"); +var MobileSyncTestSuite = function () { + SFTestSuite.call(this, "MobileSyncTestSuite"); //default store config this.defaultStoreConfig = {"isGlobalStore" : false}; this.defaultGlobalStoreConfig = {"isGlobalStore" : true}; @@ -41,18 +41,18 @@ var SmartSyncTestSuite = function () { }; // We are sub-classing SFTestSuite -SmartSyncTestSuite.prototype = new SFTestSuite(); -SmartSyncTestSuite.prototype.constructor = SmartSyncTestSuite; +MobileSyncTestSuite.prototype = new SFTestSuite(); +MobileSyncTestSuite.prototype.constructor = MobileSyncTestSuite; -// SmartSyncPlugin +// MobileSyncPlugin var promiser = cordova.require("com.salesforce.util.promiser").promiser; -SmartSyncTestSuite.prototype.cleanResyncGhosts = promiser(cordova.require("com.salesforce.plugin.smartsync"), "cleanResyncGhosts"); -SmartSyncTestSuite.prototype.reSync = promiser(cordova.require("com.salesforce.plugin.smartsync"), "reSync"); -SmartSyncTestSuite.prototype.syncDown = promiser(cordova.require("com.salesforce.plugin.smartsync"), "syncDown"); -SmartSyncTestSuite.prototype.syncUp = promiser(cordova.require("com.salesforce.plugin.smartsync"), "syncUp"); -SmartSyncTestSuite.prototype.getSyncStatus = promiser(cordova.require("com.salesforce.plugin.smartsync"), "getSyncStatus"); -SmartSyncTestSuite.prototype.deleteSync = promiser(cordova.require("com.salesforce.plugin.smartsync"), "deleteSync"); +MobileSyncTestSuite.prototype.cleanResyncGhosts = promiser(cordova.require("com.salesforce.plugin.mobilesync"), "cleanResyncGhosts"); +MobileSyncTestSuite.prototype.reSync = promiser(cordova.require("com.salesforce.plugin.mobilesync"), "reSync"); +MobileSyncTestSuite.prototype.syncDown = promiser(cordova.require("com.salesforce.plugin.mobilesync"), "syncDown"); +MobileSyncTestSuite.prototype.syncUp = promiser(cordova.require("com.salesforce.plugin.mobilesync"), "syncUp"); +MobileSyncTestSuite.prototype.getSyncStatus = promiser(cordova.require("com.salesforce.plugin.mobilesync"), "getSyncStatus"); +MobileSyncTestSuite.prototype.deleteSync = promiser(cordova.require("com.salesforce.plugin.mobilesync"), "deleteSync"); //------------------------------------------------------------------------------------------------------- @@ -64,8 +64,8 @@ SmartSyncTestSuite.prototype.deleteSync = promiser(cordova.require("com.salesfor /** * TEST Force.StoreCache.init */ -SmartSyncTestSuite.prototype.testStoreCacheInit = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheInit = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; Force.smartstoreClient.soupExists(self.defaultStoreConfig,soupName) @@ -92,8 +92,8 @@ SmartSyncTestSuite.prototype.testStoreCacheInit = function() { /** * TEST Force.StoreCache.retrieve */ -SmartSyncTestSuite.prototype.testStoreCacheRetrieve = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheRetrieve = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -152,8 +152,8 @@ SmartSyncTestSuite.prototype.testStoreCacheRetrieve = function() { /** * TEST Force.StoreCache.save */ -SmartSyncTestSuite.prototype.testStoreCacheSave = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheSave = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -188,7 +188,7 @@ SmartSyncTestSuite.prototype.testStoreCacheSave = function() { assertContains(records[0], {Id:"007", Name:"JamesBond", Mission:"TopSecret2", Organization:"MI6"}); console.log("## Saving partial record to cache with noMerge flag"); - return cache.save({Id:"007", Mission:"TopSecret3"}, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return cache.save({Id:"007", Mission:"TopSecret3"}, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function(record) { console.log("## Direct retrieve from underlying cache"); @@ -211,8 +211,8 @@ SmartSyncTestSuite.prototype.testStoreCacheSave = function() { /** * TEST Force.StoreCache.saveAll */ -SmartSyncTestSuite.prototype.testStoreCacheSaveAll = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheSaveAll = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -256,7 +256,7 @@ SmartSyncTestSuite.prototype.testStoreCacheSaveAll = function() { console.log("## Saving partial records to cache with noMerge flag"); var partialRecords = [{Id:"007", Mission:"TopSecret"},{Id:"008", Team:"Team"}, {Id:"009", Organization:"Org"}]; - return cache.saveAll(partialRecords, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return cache.saveAll(partialRecords, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function(records) { console.log("## Direct retrieve from underlying cache"); @@ -282,8 +282,8 @@ SmartSyncTestSuite.prototype.testStoreCacheSaveAll = function() { /** * TEST Force.StoreCache.remove */ -SmartSyncTestSuite.prototype.testStoreCacheRemove = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheRemove = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -330,8 +330,8 @@ SmartSyncTestSuite.prototype.testStoreCacheRemove = function() { /** * TEST Force.StoreCache.find */ -SmartSyncTestSuite.prototype.testStoreCacheFind = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheFind = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -449,8 +449,8 @@ SmartSyncTestSuite.prototype.testStoreCacheFind = function() { /** * TEST Force.StoreCache.addLocalFields */ -SmartSyncTestSuite.prototype.testStoreCacheAddLocalFields = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheAddLocalFields = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var soupName = "soupFor_" + this.module.currentTestName; var cache = new Force.StoreCache(soupName,null,null,this.defaultStoreConfig.isGlobalStore,this.defaultStoreConfig.storeName); @@ -472,8 +472,8 @@ SmartSyncTestSuite.prototype.testStoreCacheAddLocalFields = function() { /** * TEST Force.StoreCache backed by global store */ -SmartSyncTestSuite.prototype.testStoreCacheWithGlobalStore = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheWithGlobalStore = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var cacheGlobal; @@ -539,8 +539,8 @@ SmartSyncTestSuite.prototype.testStoreCacheWithGlobalStore = function() { /** * TEST Force.StoreCache backed by global store */ -SmartSyncTestSuite.prototype.testStoreCacheWithGlobalStoreNamed = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testStoreCacheWithGlobalStoreNamed = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var cacheGlobal; @@ -612,8 +612,8 @@ SmartSyncTestSuite.prototype.testStoreCacheWithGlobalStoreNamed = function() { /** * TEST Force.SObjectType.describe */ -SmartSyncTestSuite.prototype.testSObjectTypeDescribe = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectTypeDescribe = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -651,8 +651,8 @@ SmartSyncTestSuite.prototype.testSObjectTypeDescribe = function() { /** * TEST Force.SObjectType.getMetadata */ -SmartSyncTestSuite.prototype.testSObjectTypeGetMetadata = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectTypeGetMetadata = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -690,8 +690,8 @@ SmartSyncTestSuite.prototype.testSObjectTypeGetMetadata = function() { /** * TEST Force.SObjectType.describeLayout */ -SmartSyncTestSuite.prototype.testSObjectTypeDescribeLayout = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectTypeDescribeLayout = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -727,8 +727,8 @@ SmartSyncTestSuite.prototype.testSObjectTypeDescribeLayout = function() { /** * TEST Force.SObjectType cache merge by multiple instances */ -SmartSyncTestSuite.prototype.testSObjectTypeCacheOnlyMode = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectTypeCacheOnlyMode = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache, data = { @@ -768,8 +768,8 @@ SmartSyncTestSuite.prototype.testSObjectTypeCacheOnlyMode = function() { /** * TEST Force.SObjectType cache merge by multiple instances */ -SmartSyncTestSuite.prototype.testSObjectTypeCacheMerge = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectTypeCacheMerge = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache, describeResult, metadataResult; @@ -811,8 +811,8 @@ SmartSyncTestSuite.prototype.testSObjectTypeCacheMerge = function() { /** * TEST Force.SObjectType multiple types */ -SmartSyncTestSuite.prototype.testMultiSObjectTypes = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testMultiSObjectTypes = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache, accountDescribe, contactDescribe; @@ -853,8 +853,8 @@ SmartSyncTestSuite.prototype.testMultiSObjectTypes = function() { /** * TEST Force.SObjectType.reset */ -SmartSyncTestSuite.prototype.testSObjectTypeReset = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectTypeReset = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -904,8 +904,8 @@ SmartSyncTestSuite.prototype.testSObjectTypeReset = function() { /** * TEST Force.syncRemoteObjectWithCache for create method */ -SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheCreate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncRemoteObjectWithCacheCreate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -995,8 +995,8 @@ SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheCreate = function() { /** * TEST Force.syncRemoteObjectWithCache for read method */ -SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheRead = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncRemoteObjectWithCacheRead = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -1052,8 +1052,8 @@ SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheRead = function() { /** * TEST Force.syncRemoteObjectWithCache for update method */ -SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheUpdate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncRemoteObjectWithCacheUpdate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -1145,8 +1145,8 @@ SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheUpdate = function() { /** * TEST Force.syncRemoteObjectWithCache for delete method */ -SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheDelete = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncRemoteObjectWithCacheDelete = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -1216,8 +1216,8 @@ SmartSyncTestSuite.prototype.testSyncRemoteObjectWithCacheDelete = function() { /** * TEST Force.syncSObjectWithServer for create method */ -SmartSyncTestSuite.prototype.testSyncSObjectWithServerCreate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectWithServerCreate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -1247,8 +1247,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectWithServerCreate = function() { /** * TEST Force.syncSObjectWithServer for read method */ -SmartSyncTestSuite.prototype.testSyncSObjectWithServerRead = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectWithServerRead = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -1275,8 +1275,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectWithServerRead = function() { /** * TEST Force.syncSObjectWithServer for update method */ -SmartSyncTestSuite.prototype.testSyncSObjectWithServerUpdate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectWithServerUpdate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -1310,8 +1310,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectWithServerUpdate = function() { /** * TEST Force.syncSObjectWithServer for delete method */ -SmartSyncTestSuite.prototype.testSyncSObjectWithServerDelete = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectWithServerDelete = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -1342,8 +1342,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectWithServerDelete = function() { /** * TEST Force.syncSObject for method create */ -SmartSyncTestSuite.prototype.testSyncSObjectCreate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectCreate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; @@ -1392,8 +1392,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectCreate = function() { /** * TEST Force.syncSObject for method retrieve */ -SmartSyncTestSuite.prototype.testSyncSObjectRetrieve = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectRetrieve = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; @@ -1475,8 +1475,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectRetrieve = function() { /** * TEST Force.syncSObject for method update */ -SmartSyncTestSuite.prototype.testSyncSObjectUpdate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectUpdate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -1532,8 +1532,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectUpdate = function() { /** * TEST Force.syncSObject for method delete */ -SmartSyncTestSuite.prototype.testSyncSObjectDelete = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectDelete = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache; var soupName = "soupFor_" + this.module.currentTestName; @@ -1598,8 +1598,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectDelete = function() { /** * TEST Force.syncSObjectDetectConflict for method create */ -SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictCreate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectDetectConflictCreate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache, cacheForOriginals; @@ -1656,8 +1656,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictCreate = function() { /** * TEST Force.syncSObjectDetectConflict for method retrieve */ -SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictRetrieve = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectDetectConflictRetrieve = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache, cacheForOriginals; @@ -1743,8 +1743,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictRetrieve = function() /** * TEST Force.syncSObjectDetectConflict for method update */ -SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictUpdate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectDetectConflictUpdate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache, cacheForOriginals; var soupName = "soupFor_" + this.module.currentTestName; @@ -1922,8 +1922,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictUpdate = function() { /** * TEST Force.syncSObjectDetectConflict for method delete */ -SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictDelete = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncSObjectDetectConflictDelete = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var cache, cacheForOriginals; var soupName = "soupFor_" + this.module.currentTestName; @@ -2111,8 +2111,8 @@ SmartSyncTestSuite.prototype.testSyncSObjectDetectConflictDelete = function() { /** * TEST Force.SObject.fetch */ -SmartSyncTestSuite.prototype.testSObjectFetch = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectFetch = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var soupNameForOriginals = "originalsFor" + soupName; @@ -2157,8 +2157,8 @@ SmartSyncTestSuite.prototype.testSObjectFetch = function() { /** * TEST Force.SObject.save */ -SmartSyncTestSuite.prototype.testSObjectSave = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectSave = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var soupNameForOriginals = "originalsFor" + soupName; @@ -2198,8 +2198,8 @@ SmartSyncTestSuite.prototype.testSObjectSave = function() { /** * TEST Force.SObject.destroy */ -SmartSyncTestSuite.prototype.testSObjectDestroy = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectDestroy = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var soupName = "soupFor_" + this.module.currentTestName; var soupNameForOriginals = "originalsFor" + soupName; @@ -2287,8 +2287,8 @@ SmartSyncTestSuite.prototype.testSObjectDestroy = function() { /** * TEST Force.syncApexRestObjectWithServer For create method */ -SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerCreate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncApexRestObjectWithServerCreate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -2318,8 +2318,8 @@ SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerCreate = function() /** * TEST Force.syncApexRestObjectWithServer for read method */ -SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerRead = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncApexRestObjectWithServerRead = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -2346,8 +2346,8 @@ SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerRead = function() { /** * TEST Force.syncApexRestObjectWithServer for update method */ -SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerUpdate = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncApexRestObjectWithServerUpdate = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -2381,8 +2381,8 @@ SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerUpdate = function() /** * TEST Force.syncApexRestObjectWithServer for delete method */ -SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerDelete = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncApexRestObjectWithServerDelete = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var id; @@ -2447,8 +2447,8 @@ SmartSyncTestSuite.prototype.testSyncApexRestObjectWithServerDelete = function() /** * TEST Force.fetchApexRestObjectsFromServer */ -SmartSyncTestSuite.prototype.testFetchApexRestObjectsFromServer = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testFetchApexRestObjectsFromServer = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var accountNamePrefix = "testFetchApexRestObjectsFromServer" + (new Date()).getTime(); // because we query by name, we don't want to pick up records created by another test run @@ -2482,8 +2482,8 @@ SmartSyncTestSuite.prototype.testFetchApexRestObjectsFromServer = function() { /** * TEST Force.fetchSObjectsFromServer */ -SmartSyncTestSuite.prototype.testFetchSObjectsFromServer = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testFetchSObjectsFromServer = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; @@ -2510,8 +2510,8 @@ SmartSyncTestSuite.prototype.testFetchSObjectsFromServer = function() { /** * TEST Force.fetchSObjects */ -SmartSyncTestSuite.prototype.testFetchSObjects = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testFetchSObjects = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -2616,8 +2616,8 @@ SmartSyncTestSuite.prototype.testFetchSObjects = function() { /** * TEST Force.SObjectCollection.fetch */ -SmartSyncTestSuite.prototype.testSObjectCollectionFetch = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSObjectCollectionFetch = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -2740,10 +2740,10 @@ SmartSyncTestSuite.prototype.testSObjectCollectionFetch = function() { //------------------------------------------------------------------------------------------------------- /** - * TEST smartsyncplugin sync down + * TEST mobilesyncplugin sync down */ -SmartSyncTestSuite.prototype.testSyncDown = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncDown = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -2762,7 +2762,7 @@ SmartSyncTestSuite.prototype.testSyncDown = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { return Promise.all([deleteRecords(idToName), Force.smartstoreClient.removeSoup(self.defaultStoreConfig,soupName)]); @@ -2773,10 +2773,10 @@ SmartSyncTestSuite.prototype.testSyncDown = function() { }; /** - * TEST smartsyncplugin sync down to global store soup + * TEST mobilesyncplugin sync down to global store soup */ -SmartSyncTestSuite.prototype.testSyncDownToGlobalStore = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncDownToGlobalStore = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -2794,7 +2794,7 @@ SmartSyncTestSuite.prototype.testSyncDownToGlobalStore = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultGlobalStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultGlobalStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Check both stores"); @@ -2812,10 +2812,10 @@ SmartSyncTestSuite.prototype.testSyncDownToGlobalStore = function() { }; /** - * TEST smartsyncplugin sync down to global store soup + * TEST mobilesyncplugin sync down to global store soup */ -SmartSyncTestSuite.prototype.testSyncDownToGlobalStoreNamed = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncDownToGlobalStoreNamed = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -2834,7 +2834,7 @@ SmartSyncTestSuite.prototype.testSyncDownToGlobalStoreNamed = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(globalStoreConfigWithName,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(globalStoreConfigWithName,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Check both stores"); @@ -2854,10 +2854,10 @@ SmartSyncTestSuite.prototype.testSyncDownToGlobalStoreNamed = function() { }; /** - * TEST smartsyncplugin sync down with merge mode leave-if-changed + * TEST mobilesyncplugin sync down with merge mode leave-if-changed */ -SmartSyncTestSuite.prototype.testSyncDownWithNoOverwrite = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncDownWithNoOverwrite = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var idToUpdatedName = {}; @@ -2878,7 +2878,7 @@ SmartSyncTestSuite.prototype.testSyncDownWithNoOverwrite = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Updating local records"); @@ -2891,7 +2891,7 @@ SmartSyncTestSuite.prototype.testSyncDownWithNoOverwrite = function() { }) .then(function() { console.log("## Calling sync down with mergeMode leave-if-changed"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToUpdatedName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.LEAVE_IF_CHANGED); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToUpdatedName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.LEAVE_IF_CHANGED); }) .then(function() { console.log("## Checking cache"); @@ -2907,7 +2907,7 @@ SmartSyncTestSuite.prototype.testSyncDownWithNoOverwrite = function() { }); console.log("## Calling sync down with mergeMode overwrite"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Checking cache"); @@ -2930,10 +2930,10 @@ SmartSyncTestSuite.prototype.testSyncDownWithNoOverwrite = function() { }; /** - * TEST smartsyncplugin sync down with refresh-sync-down + * TEST mobilesyncplugin sync down with refresh-sync-down */ -SmartSyncTestSuite.prototype.testRefreshSyncDown = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testRefreshSyncDown = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var idToUpdatedName = {}; @@ -2952,7 +2952,7 @@ SmartSyncTestSuite.prototype.testRefreshSyncDown = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Updating records on server"); @@ -2967,7 +2967,7 @@ SmartSyncTestSuite.prototype.testRefreshSyncDown = function() { console.log("## Calling refresh sync down"); idToName = _.extend(idToName, idToUpdatedName); var target = {soupName:soupName, type:"refresh", sobjectType:"Account", fieldlist:["Id", "Name"]}; - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE, target); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE, target); }) .then(function() { return Promise.all([deleteRecords(idToName), Force.smartstoreClient.removeSoup(self.defaultStoreConfig,soupName)]); @@ -2979,10 +2979,10 @@ SmartSyncTestSuite.prototype.testRefreshSyncDown = function() { /** - * TEST smartsyncplugin reSync + * TEST mobilesyncplugin reSync */ -SmartSyncTestSuite.prototype.testReSync = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testReSync = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var idToUpdatedName = {}; @@ -3002,7 +3002,7 @@ SmartSyncTestSuite.prototype.testReSync = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function(syncId) { syncDownId = syncId; @@ -3031,10 +3031,10 @@ SmartSyncTestSuite.prototype.testReSync = function() { }; /** - * TEST smartsyncplugin cleanResyncGhosts + * TEST mobilesyncplugin cleanResyncGhosts */ -SmartSyncTestSuite.prototype.testCleanResyncGhosts = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testCleanResyncGhosts = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var ids; @@ -3057,7 +3057,7 @@ SmartSyncTestSuite.prototype.testCleanResyncGhosts = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.LEAVE_IF_CHANGED); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.LEAVE_IF_CHANGED); }) .then(function(syncId) { syncDownId = syncId; @@ -3105,10 +3105,10 @@ SmartSyncTestSuite.prototype.testCleanResyncGhosts = function() { }; /** - * TEST smartsyncplugin syncDown + getSyncStatus + deleteSync by id + * TEST mobilesyncplugin syncDown + getSyncStatus + deleteSync by id */ -SmartSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncById = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncById = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -3128,7 +3128,7 @@ SmartSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncById = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function(syncId) { syncDownId = syncId; @@ -3151,10 +3151,10 @@ SmartSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncById = function() { }; /** - * TEST smartsyncplugin syncDown + getSyncStatus + deleteSync by name + * TEST mobilesyncplugin syncDown + getSyncStatus + deleteSync by name */ -SmartSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncByName = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncByName = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var soupName = "soupFor_" + this.module.currentTestName; @@ -3175,7 +3175,7 @@ SmartSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncByName = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE, null, syncName); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE, null, syncName); }) .then(function(syncId) { syncDownId = syncId; @@ -3208,14 +3208,14 @@ SmartSyncTestSuite.prototype.testSyncDownGetSyncDeleteSyncByName = function() { //------------------------------------------------------------------------------------------------------- /** - * TEST smartsyncplugin sync up with locally updated records + * TEST mobilesyncplugin sync up with locally updated records */ -SmartSyncTestSuite.prototype.testSyncUpLocallyUpdated = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyUpdated = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var updatedRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -3231,7 +3231,7 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdated = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Updating local records"); @@ -3269,14 +3269,14 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdated = function() { }; /** - * TEST smartsyncplugin sync up with locally updated records in global store soup + * TEST mobilesyncplugin sync up with locally updated records in global store soup */ -SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStore = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStore = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var updatedRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -3292,7 +3292,7 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStore = function( }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultGlobalStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultGlobalStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Updating local records"); @@ -3338,14 +3338,14 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStore = function( /** - * TEST smartsyncplugin sync up with locally updated records in global store soup + * TEST mobilesyncplugin sync up with locally updated records in global store soup */ -SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStoreNamed = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStoreNamed = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var updatedRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var cache; var storeConfigWithName = {"isGlobalStore" : false, "storeName" : "userStoreFor_" + this.module.currentTestName}; @@ -3364,7 +3364,7 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStoreNamed = func }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(globalStoreConfigWithName,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(globalStoreConfigWithName,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Updating local records"); @@ -3411,15 +3411,15 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithGlobalStoreNamed = func }; /** - * TEST smartsyncplugin sync up with locally updated records and merge mode leave-if-changed + * TEST mobilesyncplugin sync up with locally updated records and merge mode leave-if-changed */ -SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithNoOverwrite = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithNoOverwrite = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var idToUpdatedName = {}; var updatedLocalRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.LEAVE_IF_CHANGED}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.LEAVE_IF_CHANGED}; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -3435,7 +3435,7 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithNoOverwrite = function( }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.LEAVE_IF_CHANGED); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.LEAVE_IF_CHANGED); }) .then(function() { console.log("## Updating local records"); @@ -3485,14 +3485,14 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyUpdatedWithNoOverwrite = function( }; /** - * TEST smartsyncplugin sync up with locally deleted records + * TEST mobilesyncplugin sync up with locally deleted records */ -SmartSyncTestSuite.prototype.testSyncUpLocallyDeleted = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyDeleted = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var deletedRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -3508,7 +3508,7 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyDeleted = function() { }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE); }) .then(function() { console.log("## Deleted local records"); @@ -3545,15 +3545,15 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyDeleted = function() { }; /** - * TEST smartsyncplugin sync up with locally deleted records and merge mode leave-if-changed + * TEST mobilesyncplugin sync up with locally deleted records and merge mode leave-if-changed */ -SmartSyncTestSuite.prototype.testSyncUpLocallyDeletedWithNoOverwrite = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyDeletedWithNoOverwrite = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var idToUpdatedName = {}; var deletedRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.LEAVE_IF_CHANGED}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.LEAVE_IF_CHANGED}; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -3569,7 +3569,7 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyDeletedWithNoOverwrite = function( }) .then(function() { console.log("## Calling sync down"); - return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.LEAVE_IF_CHANGED); + return self.trySyncDown(self.defaultStoreConfig,cache, soupName, idToName, cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.LEAVE_IF_CHANGED); }) .then(function() { console.log("## Deleted local records"); @@ -3622,14 +3622,14 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyDeletedWithNoOverwrite = function( }; /** - * TEST smartsyncplugin sync up with locally created records + * TEST mobilesyncplugin sync up with locally created records */ -SmartSyncTestSuite.prototype.testSyncUpLocallyCreated = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpLocallyCreated = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var createdRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var cache; @@ -3681,14 +3681,14 @@ SmartSyncTestSuite.prototype.testSyncUpLocallyCreated = function() { /** - * TEST smartsyncplugin syncUp + getSyncStatus + deleteSync by id + * TEST mobilesyncplugin syncUp + getSyncStatus + deleteSync by id */ -SmartSyncTestSuite.prototype.testSyncUpGetSyncDeleteSyncById = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpGetSyncDeleteSyncById = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var createdRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var cache; var syncUpId; @@ -3733,14 +3733,14 @@ SmartSyncTestSuite.prototype.testSyncUpGetSyncDeleteSyncById = function() { }; /** - * TEST smartsyncplugin syncUp + getSyncStatus + deleteSync by name + * TEST mobilesyncplugin syncUp + getSyncStatus + deleteSync by name */ -SmartSyncTestSuite.prototype.testSyncUpGetSyncDeleteSyncByName = function() { - console.log("# In SmartSyncTestSuite." + this.module.currentTestName); +MobileSyncTestSuite.prototype.testSyncUpGetSyncDeleteSyncByName = function() { + console.log("# In MobileSyncTestSuite." + this.module.currentTestName); var self = this; var idToName = {}; var createdRecords; - var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.smartsync").MERGE_MODE.OVERWRITE}; + var options = {fieldlist: ["Name"], mergeMode: cordova.require("com.salesforce.plugin.mobilesync").MERGE_MODE.OVERWRITE}; var soupName = "soupFor_" + this.module.currentTestName; var syncName = "syncFor_" + this.module.currentTestName; var cache; @@ -3835,7 +3835,7 @@ var getCaller = function() { throw new Error(); } catch ( e ) { var simplifiedStack = _.filter(_.map(e.stack.split("\n"), - function(line) {var m = line.match(/SmartSyncTestSuite.js:[0-9]*:[0-9]*/); return m == null ? null : m[0];}), + function(line) {var m = line.match(/MobileSyncTestSuite.js:[0-9]*:[0-9]*/); return m == null ? null : m[0];}), function(x) { return x != null; }); return simplifiedStack[2]; // 0->getCaller, 1-->assertContains or checkLocalFlags, 2-->the caller we are interested in! } @@ -4046,7 +4046,7 @@ var tryConflictDetection = function(message, cache, cacheForOriginals, theirs, y /** Helper function to run sync down and consume all status updates until done */ -SmartSyncTestSuite.prototype.trySyncDown = function(storeConfig, cache, soupName, idToName, mergeMode, target, syncName) { +MobileSyncTestSuite.prototype.trySyncDown = function(storeConfig, cache, soupName, idToName, mergeMode, target, syncName) { var isGlobalStore = storeConfig.isGlobalStore; var options = {mergeMode: mergeMode}; target = target || {type:"soql", query:"SELECT Id, Name, LastModifiedDate FROM Account WHERE Id IN ('" + _.keys(idToName).join("','") + "') ORDER BY Name"}; @@ -4076,7 +4076,7 @@ SmartSyncTestSuite.prototype.trySyncDown = function(storeConfig, cache, soupName /** Helper function to run reSync and consume all status updates until done */ -SmartSyncTestSuite.prototype.tryReSync = function(cache, soupName, idToName, syncDownId, updatedCount) { +MobileSyncTestSuite.prototype.tryReSync = function(cache, soupName, idToName, syncDownId, updatedCount) { var numberRecords = _.keys(idToName).length; return this.reSync(syncDownId) .then(function(sync) { @@ -4103,7 +4103,7 @@ SmartSyncTestSuite.prototype.tryReSync = function(cache, soupName, idToName, syn /** Helper function to run sync up and consume all status updates until done */ -SmartSyncTestSuite.prototype.trySyncUp = function(storeConfig, soupName, options, syncName) { +MobileSyncTestSuite.prototype.trySyncUp = function(storeConfig, soupName, options, syncName) { var target = null; var syncUpId; return this.syncUp(storeConfig, target, soupName, options, syncName) diff --git a/test/SFSDKInfoTestSuite.js b/test/SFSDKInfoTestSuite.js index 748f34df..e8ff87f3 100644 --- a/test/SFSDKInfoTestSuite.js +++ b/test/SFSDKInfoTestSuite.js @@ -72,7 +72,7 @@ SDKInfoTestSuite.prototype.testGetInfo = function() { QUnit.equal(sdkInfo.forcePluginsAvailable[2], "com.salesforce.sdkinfo", "wrong force plugins"); QUnit.equal(sdkInfo.forcePluginsAvailable[3], "com.salesforce.sfaccountmanager", "wrong force plugins"); QUnit.equal(sdkInfo.forcePluginsAvailable[4], "com.salesforce.smartstore", "wrong force plugins"); - QUnit.equal(sdkInfo.forcePluginsAvailable[5], "com.salesforce.smartsync", "wrong force plugins"); + QUnit.equal(sdkInfo.forcePluginsAvailable[5], "com.salesforce.mobilesync", "wrong force plugins"); QUnit.equal(sdkInfo.forcePluginsAvailable[6], "com.salesforce.testrunner", "wrong force plugins"); // bootConfig QUnit.ok(sdkInfo.bootConfig.isLocal, "wrong bootConfig.isLocal"); diff --git a/test/forcepluginstest/index.html b/test/forcepluginstest/index.html index 863620ff..5f4a8830 100644 --- a/test/forcepluginstest/index.html +++ b/test/forcepluginstest/index.html @@ -18,7 +18,7 @@ - + @@ -30,7 +30,7 @@ - + - + - + @@ -33,7 +33,7 @@ - + @@ -83,7 +83,7 @@

Salesforce Javascript Libraries Tests

Run ForceJS Tests

Run SmartStore Tests

Run SmartStore Load Tests

-

Run SmartSync Tests

+

Run MobileSync Tests

diff --git a/tools/bower.json b/tools/bower.json index d21a9815..fb2c4651 100644 --- a/tools/bower.json +++ b/tools/bower.json @@ -1,6 +1,6 @@ { "name": "salesforcemobilesdk-shared", - "version": "7.2.0", + "version": "8.0.0", "dependencies": { "jquery": "2.0.3", "underscore": "1.5.2", diff --git a/tools/package.json b/tools/package.json index 890c6a2d..2922d290 100644 --- a/tools/package.json +++ b/tools/package.json @@ -1,6 +1,6 @@ { "name": "salesforcemobilesdk-shared", - "version": "7.2.0", + "version": "8.0.0", "dependencies": {}, "devDependencies": { "grunt": "~0.4.5",