From f9f221803bce0a8caa8eb9f62ea0706fe2f80ddd Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:09:19 -0700 Subject: [PATCH 01/12] Renaming folder name --- .../SmartSyncExplorer.html | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/bootconfig.json | 0 .../css/ratchet-theme-ios.css | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/css/ratchet.css | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/css/styles.css | 0 .../{smartsyncexplorer => mobilesyncexplorer}/js/MockCordova.js | 0 .../js/MockSmartStore.js | 0 .../js/MockSmartSyncPlugin.js | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/js/auth.js | 0 .../{smartsyncexplorer => mobilesyncexplorer}/js/backbone-min.js | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/js/backbone.js | 0 .../{smartsyncexplorer => mobilesyncexplorer}/js/cordova.force.js | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/js/fastclick.js | 0 .../{smartsyncexplorer => mobilesyncexplorer}/js/force+promise.js | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/js/force.js | 0 .../{smartsyncexplorer => mobilesyncexplorer}/js/jquery.min.js | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/js/smartsync.js | 0 .../{smartsyncexplorer => mobilesyncexplorer}/js/stackrouter.js | 0 .../js/underscore-min.js | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/userstore.json | 0 samples/{smartsyncexplorer => mobilesyncexplorer}/usersyncs.json | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename samples/{smartsyncexplorer => mobilesyncexplorer}/SmartSyncExplorer.html (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/bootconfig.json (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/css/ratchet-theme-ios.css (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/css/ratchet.css (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/css/styles.css (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/MockCordova.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/MockSmartStore.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/MockSmartSyncPlugin.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/auth.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/backbone-min.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/backbone.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/cordova.force.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/fastclick.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/force+promise.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/force.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/jquery.min.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/smartsync.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/stackrouter.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/js/underscore-min.js (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/userstore.json (100%) rename samples/{smartsyncexplorer => mobilesyncexplorer}/usersyncs.json (100%) diff --git a/samples/smartsyncexplorer/SmartSyncExplorer.html b/samples/mobilesyncexplorer/SmartSyncExplorer.html similarity index 100% rename from samples/smartsyncexplorer/SmartSyncExplorer.html rename to samples/mobilesyncexplorer/SmartSyncExplorer.html diff --git a/samples/smartsyncexplorer/bootconfig.json b/samples/mobilesyncexplorer/bootconfig.json similarity index 100% rename from samples/smartsyncexplorer/bootconfig.json rename to samples/mobilesyncexplorer/bootconfig.json 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/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/MockSmartSyncPlugin.js b/samples/mobilesyncexplorer/js/MockSmartSyncPlugin.js similarity index 100% rename from samples/smartsyncexplorer/js/MockSmartSyncPlugin.js rename to samples/mobilesyncexplorer/js/MockSmartSyncPlugin.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/smartsyncexplorer/js/smartsync.js b/samples/mobilesyncexplorer/js/smartsync.js similarity index 100% rename from samples/smartsyncexplorer/js/smartsync.js rename to samples/mobilesyncexplorer/js/smartsync.js 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 From 72a8da7bbac616fdbaf07376f7b4426925c3d83c Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:10:01 -0700 Subject: [PATCH 02/12] Renaming to mobilesync library --- libs/{smartsync.js => mobilesync.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libs/{smartsync.js => mobilesync.js} (100%) diff --git a/libs/smartsync.js b/libs/mobilesync.js similarity index 100% rename from libs/smartsync.js rename to libs/mobilesync.js From e80988c33b51cb7df97b76d009ad282f25223e5b Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:25:48 -0700 Subject: [PATCH 03/12] First round of renames within files --- README.md | 10 ++++----- gen/cordova_plugins.js | 6 ++--- .../com.salesforce.plugin.smartsync.js | 2 +- .../com.salesforce.plugin.smartsync.js | 4 ++-- libs/cordova.force.js | 4 ++-- libs/mobilesync.js | 2 +- samples/accounteditor/AccountEditor.html | 2 +- samples/fileexplorer/FileExplorer.html | 2 +- .../mobilesyncexplorer/SmartSyncExplorer.html | 8 +++---- samples/mobilesyncexplorer/bootconfig.json | 2 +- samples/notesync/NoteSync.html | 8 +++---- samples/simplesyncreact/SimpleSync.html | 8 +++---- .../UserAndGroupSearch.html | 2 +- samples/usersearch/UserSearch.html | 2 +- setversion.sh | 10 +++++++++ test/MockSDKInfo.js | 2 +- test/MockSmartSyncPlugin.js | 22 +++++++++---------- test/SFSDKInfoTestSuite.js | 2 +- test/forcepluginstest/index.html | 4 ++-- test/test.html | 10 ++++----- 20 files changed, 61 insertions(+), 51 deletions(-) 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 b76cd97b..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", @@ -62,7 +62,7 @@ module.exports = [ module.exports.metadata = // TOP OF METADATA { - "com.salesforce": "7.2.0" + "com.salesforce": "8.0.0" } // BOTTOM OF METADATA }); diff --git a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js index 2668c596..38b412e6 100644 --- a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js +++ b/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.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.smartsync.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.smartsync.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/mobilesync.js b/libs/mobilesync.js index 9df59cee..fa372a64 100644 --- a/libs/mobilesync.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/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/mobilesyncexplorer/SmartSyncExplorer.html b/samples/mobilesyncexplorer/SmartSyncExplorer.html index 53ac923c..d73ff4b9 100644 --- a/samples/mobilesyncexplorer/SmartSyncExplorer.html +++ b/samples/mobilesyncexplorer/SmartSyncExplorer.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/mobilesyncexplorer/bootconfig.json b/samples/mobilesyncexplorer/bootconfig.json index ec2ff946..7083be68 100644 --- a/samples/mobilesyncexplorer/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/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/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/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/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/setversion.sh b/setversion.sh index ffe9a421..e2bee52a 100755 --- a/setversion.sh +++ b/setversion.sh @@ -39,6 +39,13 @@ update_package_json () gsed -i "s/\"version\":.*\"[^\"]*\"/\"version\": \"${version}\"/g" ${file} } +update_cordova_plugins () +{ + local file=$1 + local version=$2 + gsed -i "s/\"com.salesforce\":.*\"[^\"]*\"/\"com.salesforce\": \"${version}\"/g" ${file} +} + update_mock_sdk_info () { local file=$1 @@ -66,6 +73,9 @@ echo -e "${YELLOW}*** SETTING VERSION TO ${OPT_VERSION} ***${NC}" echo "*** Updating package.json ***" update_package_json "./package.json" "${OPT_VERSION}" +echo "*** Updating cordova_plugins.js ***" +update_cordova_plugins "./gen/cordova_plugins.js" "${OPT_VERSION}" + echo "*** Updating MockSDKInfo test ***" update_mock_sdk_info "./test/MockSDKInfo.js" "${OPT_VERSION}" 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/MockSmartSyncPlugin.js b/test/MockSmartSyncPlugin.js index 2ae31d0c..3f96abd2 100644 --- a/test/MockSmartSyncPlugin.js +++ b/test/MockSmartSyncPlugin.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/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

From 339127e47116ef6d54249a3b758f2354e15e4a99 Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:28:15 -0700 Subject: [PATCH 04/12] Renaming plugin file to mobilesync --- .../com.salesforce.plugin.mobilesync.js | 196 +++++++++++++++++ .../com.salesforce.plugin.mobilesync.js | 198 ++++++++++++++++++ 2 files changed, 394 insertions(+) create mode 100644 gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js create mode 100644 gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js diff --git a/gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js b/gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js new file mode 100644 index 00000000..38b412e6 --- /dev/null +++ b/gen/plugins/com.salesforce/com.salesforce.plugin.mobilesync.js @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2012-present, salesforce.com, inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or + * promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +// Version this js was shipped with +var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; +var SERVICE = "com.salesforce.mobilesync"; + +var exec = require("com.salesforce.util.exec").exec; +var defaultStoreConfig = {'isGlobalStore':false}; + +// Helper function to handle calls that don't specify storeConfig as first argument +// If missing, the caller is re-invoked with false prepended to the arguments list and true is returned +// Otherwise, false is returned +var checkFirstArg = function(argumentsOfCaller) { + // Turning arguments into array + var args = Array.prototype.slice.call(argumentsOfCaller); + + // If first argument is a store config + if (typeof(args[0]) === "object" && args[0].hasOwnProperty("isGlobalStore")) { + return false; + } + // Else pre-pend store config and re-invoke caller + else { + var isGlobalStore = false; + // If first argument is just a boolean + if (typeof(args[0]) === "boolean") { + isGlobalStore = args.shift() || false; + } + // Pre-prending store config + args.unshift({'isGlobalStore': isGlobalStore}); + argumentsOfCaller.callee.apply(null, args); + return true; + } +}; + +// Helper function to handle syncUp calls that don't specify a target as second argument +// If missing, the caller is re-invoked with target {} inserted as second argument and true is returned +// Otherwise, false is returned +var checkTargetArg = function(argumentsOfCaller) { + // Turning arguments into array + var args = Array.prototype.slice.call(argumentsOfCaller); + + // if (storeConfig, soupName, ...) change to (storeConfig, target, soupName, ...) with target = {} + if (typeof(args[1]) === "string") { + var arg0 = args.shift(); + args.unshift({}); + args.unshift(arg0); + argumentsOfCaller.callee.apply(null, args); + return true; + } + else { + return false; + } +} + +// Helper function to handle syncUp/syncDown calls that don't specifiy a syncName argument +// If missing, the caller is re-invoked with syncName null inserted as last argument before callbacks and true is returned +// Otherwise, false is returned +var checkSyncNameArg = function(argumentsOfCaller) { + // Turning arguments into array + var args = Array.prototype.slice.call(argumentsOfCaller); + + // if (storeConfig, target, soupName, options, successCB, errorCB) + // change to (storeConfig, target, soupName, options, syncName, successCB, errorCB) with syncName = null + if (typeof(args[4]) === "function") { + var storeConfig = args.shift(); + var target = args.shift(); + var soupName = args.shift(); + var options = args.shift(); + args.unshift(null); + args.unshift(options); + args.unshift(soupName); + args.unshift(target); + args.unshift(storeConfig); + argumentsOfCaller.callee.apply(null, args); + return true; + } + else { + return false; + } +} + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), syncName is optional +var syncDown = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + if (checkSyncNameArg(arguments)) return; + + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "syncDown", + [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var reSync = function(storeConfig, syncIdOrName, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "reSync", + [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, + "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, + "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var cleanResyncGhosts = function(storeConfig, syncId, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "cleanResyncGhosts", + [{"syncId": syncId, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), target is optional, syncName is optional +var syncUp = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + if (checkTargetArg(arguments)) return; + if (checkSyncNameArg(arguments)) return; + + target = target || {}; + + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "syncUp", + [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var getSyncStatus = function(storeConfig, syncIdOrName, successCB, errorCB) { + if (checkFirstArg(arguments, "boolean", false)) return; + // cordova can't return null, so {} is returned when sync is not found + var wrappedSuccessCB = function(sync) { + if(typeof successCB === "function") { + successCB(sync._soupEntryId === undefined ? null : sync); + } + }; + exec(SALESFORCE_MOBILE_SDK_VERSION, wrappedSuccessCB, errorCB, SERVICE, + "getSyncStatus", + [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, + "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, + "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var deleteSync = function(storeConfig, syncIdOrName, successCB, errorCB) { + if (checkFirstArg(arguments, "boolean", false)) return; + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "deleteSync", + [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, + "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, + "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +var MERGE_MODE = { + OVERWRITE: "OVERWRITE", + LEAVE_IF_CHANGED: "LEAVE_IF_CHANGED" +}; + + +/** + * Part of the module that is public + */ +module.exports = { + MERGE_MODE: MERGE_MODE, + syncDown: syncDown, + syncUp: syncUp, + getSyncStatus: getSyncStatus, + reSync: reSync, + cleanResyncGhosts: cleanResyncGhosts, + deleteSync: deleteSync +}; \ No newline at end of file diff --git a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js new file mode 100644 index 00000000..9c551aec --- /dev/null +++ b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.mobilesync.js @@ -0,0 +1,198 @@ +cordova.define("com.salesforce.plugin.mobilesync", function(require, exports, module) { +/* + * Copyright (c) 2012-present, salesforce.com, inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or + * promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +// Version this js was shipped with +var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; +var SERVICE = "com.salesforce.mobilesync"; + +var exec = require("com.salesforce.util.exec").exec; +var defaultStoreConfig = {'isGlobalStore':false}; + +// Helper function to handle calls that don't specify storeConfig as first argument +// If missing, the caller is re-invoked with false prepended to the arguments list and true is returned +// Otherwise, false is returned +var checkFirstArg = function(argumentsOfCaller) { + // Turning arguments into array + var args = Array.prototype.slice.call(argumentsOfCaller); + + // If first argument is a store config + if (typeof(args[0]) === "object" && args[0].hasOwnProperty("isGlobalStore")) { + return false; + } + // Else pre-pend store config and re-invoke caller + else { + var isGlobalStore = false; + // If first argument is just a boolean + if (typeof(args[0]) === "boolean") { + isGlobalStore = args.shift() || false; + } + // Pre-prending store config + args.unshift({'isGlobalStore': isGlobalStore}); + argumentsOfCaller.callee.apply(null, args); + return true; + } +}; + +// Helper function to handle syncUp calls that don't specify a target as second argument +// If missing, the caller is re-invoked with target {} inserted as second argument and true is returned +// Otherwise, false is returned +var checkTargetArg = function(argumentsOfCaller) { + // Turning arguments into array + var args = Array.prototype.slice.call(argumentsOfCaller); + + // if (storeConfig, soupName, ...) change to (storeConfig, target, soupName, ...) with target = {} + if (typeof(args[1]) === "string") { + var arg0 = args.shift(); + args.unshift({}); + args.unshift(arg0); + argumentsOfCaller.callee.apply(null, args); + return true; + } + else { + return false; + } +} + +// Helper function to handle syncUp/syncDown calls that don't specifiy a syncName argument +// If missing, the caller is re-invoked with syncName null inserted as last argument before callbacks and true is returned +// Otherwise, false is returned +var checkSyncNameArg = function(argumentsOfCaller) { + // Turning arguments into array + var args = Array.prototype.slice.call(argumentsOfCaller); + + // if (storeConfig, target, soupName, options, successCB, errorCB) + // change to (storeConfig, target, soupName, options, syncName, successCB, errorCB) with syncName = null + if (typeof(args[4]) === "function") { + var storeConfig = args.shift(); + var target = args.shift(); + var soupName = args.shift(); + var options = args.shift(); + args.unshift(null); + args.unshift(options); + args.unshift(soupName); + args.unshift(target); + args.unshift(storeConfig); + argumentsOfCaller.callee.apply(null, args); + return true; + } + else { + return false; + } +} + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), syncName is optional +var syncDown = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + if (checkSyncNameArg(arguments)) return; + + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "syncDown", + [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var reSync = function(storeConfig, syncIdOrName, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "reSync", + [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, + "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, + "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var cleanResyncGhosts = function(storeConfig, syncId, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "cleanResyncGhosts", + [{"syncId": syncId, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), target is optional, syncName is optional +var syncUp = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { + if (checkFirstArg(arguments)) return; + if (checkTargetArg(arguments)) return; + if (checkSyncNameArg(arguments)) return; + + target = target || {}; + + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "syncUp", + [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var getSyncStatus = function(storeConfig, syncIdOrName, successCB, errorCB) { + if (checkFirstArg(arguments, "boolean", false)) return; + // cordova can't return null, so {} is returned when sync is not found + var wrappedSuccessCB = function(sync) { + if(typeof successCB === "function") { + successCB(sync._soupEntryId === undefined ? null : sync); + } + }; + exec(SALESFORCE_MOBILE_SDK_VERSION, wrappedSuccessCB, errorCB, SERVICE, + "getSyncStatus", + [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, + "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, + "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) +var deleteSync = function(storeConfig, syncIdOrName, successCB, errorCB) { + if (checkFirstArg(arguments, "boolean", false)) return; + exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, + "deleteSync", + [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, + "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, + "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] + ); +}; + +var MERGE_MODE = { + OVERWRITE: "OVERWRITE", + LEAVE_IF_CHANGED: "LEAVE_IF_CHANGED" +}; + + +/** + * Part of the module that is public + */ +module.exports = { + MERGE_MODE: MERGE_MODE, + syncDown: syncDown, + syncUp: syncUp, + getSyncStatus: getSyncStatus, + reSync: reSync, + cleanResyncGhosts: cleanResyncGhosts, + deleteSync: deleteSync +}; +}); \ No newline at end of file From 8d8acaad3ba5be1429a670692e31dfd9e1707689 Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:29:11 -0700 Subject: [PATCH 05/12] Removing old smartsync plugin files --- .../com.salesforce.plugin.smartsync.js | 196 ----------------- .../com.salesforce.plugin.smartsync.js | 198 ------------------ 2 files changed, 394 deletions(-) delete mode 100644 gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js delete mode 100644 gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js diff --git a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js deleted file mode 100644 index 38b412e6..00000000 --- a/gen/plugins/com.salesforce/com.salesforce.plugin.smartsync.js +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2012-present, salesforce.com, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or - * promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -// Version this js was shipped with -var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; -var SERVICE = "com.salesforce.mobilesync"; - -var exec = require("com.salesforce.util.exec").exec; -var defaultStoreConfig = {'isGlobalStore':false}; - -// Helper function to handle calls that don't specify storeConfig as first argument -// If missing, the caller is re-invoked with false prepended to the arguments list and true is returned -// Otherwise, false is returned -var checkFirstArg = function(argumentsOfCaller) { - // Turning arguments into array - var args = Array.prototype.slice.call(argumentsOfCaller); - - // If first argument is a store config - if (typeof(args[0]) === "object" && args[0].hasOwnProperty("isGlobalStore")) { - return false; - } - // Else pre-pend store config and re-invoke caller - else { - var isGlobalStore = false; - // If first argument is just a boolean - if (typeof(args[0]) === "boolean") { - isGlobalStore = args.shift() || false; - } - // Pre-prending store config - args.unshift({'isGlobalStore': isGlobalStore}); - argumentsOfCaller.callee.apply(null, args); - return true; - } -}; - -// Helper function to handle syncUp calls that don't specify a target as second argument -// If missing, the caller is re-invoked with target {} inserted as second argument and true is returned -// Otherwise, false is returned -var checkTargetArg = function(argumentsOfCaller) { - // Turning arguments into array - var args = Array.prototype.slice.call(argumentsOfCaller); - - // if (storeConfig, soupName, ...) change to (storeConfig, target, soupName, ...) with target = {} - if (typeof(args[1]) === "string") { - var arg0 = args.shift(); - args.unshift({}); - args.unshift(arg0); - argumentsOfCaller.callee.apply(null, args); - return true; - } - else { - return false; - } -} - -// Helper function to handle syncUp/syncDown calls that don't specifiy a syncName argument -// If missing, the caller is re-invoked with syncName null inserted as last argument before callbacks and true is returned -// Otherwise, false is returned -var checkSyncNameArg = function(argumentsOfCaller) { - // Turning arguments into array - var args = Array.prototype.slice.call(argumentsOfCaller); - - // if (storeConfig, target, soupName, options, successCB, errorCB) - // change to (storeConfig, target, soupName, options, syncName, successCB, errorCB) with syncName = null - if (typeof(args[4]) === "function") { - var storeConfig = args.shift(); - var target = args.shift(); - var soupName = args.shift(); - var options = args.shift(); - args.unshift(null); - args.unshift(options); - args.unshift(soupName); - args.unshift(target); - args.unshift(storeConfig); - argumentsOfCaller.callee.apply(null, args); - return true; - } - else { - return false; - } -} - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), syncName is optional -var syncDown = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - if (checkSyncNameArg(arguments)) return; - - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "syncDown", - [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var reSync = function(storeConfig, syncIdOrName, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "reSync", - [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, - "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, - "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var cleanResyncGhosts = function(storeConfig, syncId, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "cleanResyncGhosts", - [{"syncId": syncId, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), target is optional, syncName is optional -var syncUp = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - if (checkTargetArg(arguments)) return; - if (checkSyncNameArg(arguments)) return; - - target = target || {}; - - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "syncUp", - [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var getSyncStatus = function(storeConfig, syncIdOrName, successCB, errorCB) { - if (checkFirstArg(arguments, "boolean", false)) return; - // cordova can't return null, so {} is returned when sync is not found - var wrappedSuccessCB = function(sync) { - if(typeof successCB === "function") { - successCB(sync._soupEntryId === undefined ? null : sync); - } - }; - exec(SALESFORCE_MOBILE_SDK_VERSION, wrappedSuccessCB, errorCB, SERVICE, - "getSyncStatus", - [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, - "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, - "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var deleteSync = function(storeConfig, syncIdOrName, successCB, errorCB) { - if (checkFirstArg(arguments, "boolean", false)) return; - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "deleteSync", - [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, - "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, - "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -var MERGE_MODE = { - OVERWRITE: "OVERWRITE", - LEAVE_IF_CHANGED: "LEAVE_IF_CHANGED" -}; - - -/** - * Part of the module that is public - */ -module.exports = { - MERGE_MODE: MERGE_MODE, - syncDown: syncDown, - syncUp: syncUp, - getSyncStatus: getSyncStatus, - reSync: reSync, - cleanResyncGhosts: cleanResyncGhosts, - deleteSync: deleteSync -}; \ No newline at end of file diff --git a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js b/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js deleted file mode 100644 index 9c551aec..00000000 --- a/gen/plugins_with_define/com.salesforce/com.salesforce.plugin.smartsync.js +++ /dev/null @@ -1,198 +0,0 @@ -cordova.define("com.salesforce.plugin.mobilesync", function(require, exports, module) { -/* - * Copyright (c) 2012-present, salesforce.com, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or - * promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -// Version this js was shipped with -var SALESFORCE_MOBILE_SDK_VERSION = "8.0.0"; -var SERVICE = "com.salesforce.mobilesync"; - -var exec = require("com.salesforce.util.exec").exec; -var defaultStoreConfig = {'isGlobalStore':false}; - -// Helper function to handle calls that don't specify storeConfig as first argument -// If missing, the caller is re-invoked with false prepended to the arguments list and true is returned -// Otherwise, false is returned -var checkFirstArg = function(argumentsOfCaller) { - // Turning arguments into array - var args = Array.prototype.slice.call(argumentsOfCaller); - - // If first argument is a store config - if (typeof(args[0]) === "object" && args[0].hasOwnProperty("isGlobalStore")) { - return false; - } - // Else pre-pend store config and re-invoke caller - else { - var isGlobalStore = false; - // If first argument is just a boolean - if (typeof(args[0]) === "boolean") { - isGlobalStore = args.shift() || false; - } - // Pre-prending store config - args.unshift({'isGlobalStore': isGlobalStore}); - argumentsOfCaller.callee.apply(null, args); - return true; - } -}; - -// Helper function to handle syncUp calls that don't specify a target as second argument -// If missing, the caller is re-invoked with target {} inserted as second argument and true is returned -// Otherwise, false is returned -var checkTargetArg = function(argumentsOfCaller) { - // Turning arguments into array - var args = Array.prototype.slice.call(argumentsOfCaller); - - // if (storeConfig, soupName, ...) change to (storeConfig, target, soupName, ...) with target = {} - if (typeof(args[1]) === "string") { - var arg0 = args.shift(); - args.unshift({}); - args.unshift(arg0); - argumentsOfCaller.callee.apply(null, args); - return true; - } - else { - return false; - } -} - -// Helper function to handle syncUp/syncDown calls that don't specifiy a syncName argument -// If missing, the caller is re-invoked with syncName null inserted as last argument before callbacks and true is returned -// Otherwise, false is returned -var checkSyncNameArg = function(argumentsOfCaller) { - // Turning arguments into array - var args = Array.prototype.slice.call(argumentsOfCaller); - - // if (storeConfig, target, soupName, options, successCB, errorCB) - // change to (storeConfig, target, soupName, options, syncName, successCB, errorCB) with syncName = null - if (typeof(args[4]) === "function") { - var storeConfig = args.shift(); - var target = args.shift(); - var soupName = args.shift(); - var options = args.shift(); - args.unshift(null); - args.unshift(options); - args.unshift(soupName); - args.unshift(target); - args.unshift(storeConfig); - argumentsOfCaller.callee.apply(null, args); - return true; - } - else { - return false; - } -} - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), syncName is optional -var syncDown = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - if (checkSyncNameArg(arguments)) return; - - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "syncDown", - [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var reSync = function(storeConfig, syncIdOrName, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "reSync", - [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, - "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, - "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var cleanResyncGhosts = function(storeConfig, syncId, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "cleanResyncGhosts", - [{"syncId": syncId, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore), target is optional, syncName is optional -var syncUp = function(storeConfig, target, soupName, options, syncName, successCB, errorCB) { - if (checkFirstArg(arguments)) return; - if (checkTargetArg(arguments)) return; - if (checkSyncNameArg(arguments)) return; - - target = target || {}; - - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "syncUp", - [{"syncName": syncName, "target": target, "soupName": soupName, "options": options, "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var getSyncStatus = function(storeConfig, syncIdOrName, successCB, errorCB) { - if (checkFirstArg(arguments, "boolean", false)) return; - // cordova can't return null, so {} is returned when sync is not found - var wrappedSuccessCB = function(sync) { - if(typeof successCB === "function") { - successCB(sync._soupEntryId === undefined ? null : sync); - } - }; - exec(SALESFORCE_MOBILE_SDK_VERSION, wrappedSuccessCB, errorCB, SERVICE, - "getSyncStatus", - [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, - "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, - "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -// Backwards compatibility: storeConfig is optional or could just be a boolean (isGlobalStore) -var deleteSync = function(storeConfig, syncIdOrName, successCB, errorCB) { - if (checkFirstArg(arguments, "boolean", false)) return; - exec(SALESFORCE_MOBILE_SDK_VERSION, successCB, errorCB, SERVICE, - "deleteSync", - [{"syncId": typeof syncIdOrName === "string" ? null : syncIdOrName, - "syncName": typeof syncIdOrName === "string" ? syncIdOrName : null, - "isGlobalStore": storeConfig.isGlobalStore, "storeName": storeConfig.storeName}] - ); -}; - -var MERGE_MODE = { - OVERWRITE: "OVERWRITE", - LEAVE_IF_CHANGED: "LEAVE_IF_CHANGED" -}; - - -/** - * Part of the module that is public - */ -module.exports = { - MERGE_MODE: MERGE_MODE, - syncDown: syncDown, - syncUp: syncUp, - getSyncStatus: getSyncStatus, - reSync: reSync, - cleanResyncGhosts: cleanResyncGhosts, - deleteSync: deleteSync -}; -}); \ No newline at end of file From 14b7f093d436bb39777be771c4914e7cc21e962d Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:30:44 -0700 Subject: [PATCH 06/12] Fixing update script --- setversion.sh | 3 +++ tools/bower.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/setversion.sh b/setversion.sh index e2bee52a..a56a89cc 100755 --- a/setversion.sh +++ b/setversion.sh @@ -73,6 +73,9 @@ 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 cordova_plugins.js ***" update_cordova_plugins "./gen/cordova_plugins.js" "${OPT_VERSION}" 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", From b2900fcaed75489f0c58ef4098ca916e25667177 Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:32:08 -0700 Subject: [PATCH 07/12] One more rename --- test/test.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.html b/test/test.html index f68299f8..0f3f3e52 100644 --- a/test/test.html +++ b/test/test.html @@ -68,7 +68,7 @@ .addEventListener("click", function() {new SmartStoreTestSuite().startTests();}); document.getElementById("link_smartstore_load_test_suite") .addEventListener("click", function() {new SmartStoreLoadTestSuite().startTests();}); - document.getElementById("link_smart_sync_test_suite") + document.getElementById("link_mobile_sync_test_suite") .addEventListener("click", function() {new MobileSyncTestSuite().startTests();}); }); @@ -83,7 +83,7 @@

Salesforce Javascript Libraries Tests

Run ForceJS Tests

Run SmartStore Tests

Run SmartStore Load Tests

-

Run MobileSync Tests

+

Run MobileSync Tests

From a622b7439ec880f1acb842f3bff0c9465755928f Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:37:45 -0700 Subject: [PATCH 08/12] Fixing version numbers and upgrade script --- setversion.sh | 8 +++++++- test/SFForceJSTestSuite.js | 2 +- tools/package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setversion.sh b/setversion.sh index a56a89cc..db45c9dd 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 () @@ -76,6 +76,12 @@ 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 cordova_plugins.js ***" update_cordova_plugins "./gen/cordova_plugins.js" "${OPT_VERSION}" diff --git a/test/SFForceJSTestSuite.js b/test/SFForceJSTestSuite.js index e1c48bc7..2f9db559 100644 --- a/test/SFForceJSTestSuite.js +++ b/test/SFForceJSTestSuite.js @@ -214,7 +214,7 @@ ForceJSTestSuite.prototype.testDeleteFileShare = function() { */ ForceJSTestSuite.prototype.tryUserAgent = function(expectedPlatform, expectedPlatformVersion, expectedModel, userAgent) { var webAppSdkAgent = force.computeWebAppSdkAgent(userAgent); - var match = /SalesforceMobileSDK\/7.2.0 ([^\/]*)\/([^\ ]*) \(([^\)]*)\) ([^\/]*)\/1.0 Web (.*)/.exec(webAppSdkAgent); + var match = /SalesforceMobileSDK\/8.0.0 ([^\/]*)\/([^\ ]*) \(([^\)]*)\) ([^\/]*)\/1.0 Web (.*)/.exec(webAppSdkAgent); if (match != null && match.length == 6) { QUnit.equals(match[1], expectedPlatform, "Wrong platform for user agent [" + userAgent + "]"); QUnit.equals(match[2], expectedPlatformVersion, "Wrong platformVersion for user agent [" + userAgent + "]"); 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", From fe604fb8d2805147f899e41447516cd6371c4a42 Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:41:23 -0700 Subject: [PATCH 09/12] Some file renames --- .../{SmartSyncExplorer.html => MobileSyncExplorer.html} | 0 test/{MockSmartSyncPlugin.js => MockMobileSyncPlugin.js} | 0 test/{SFSmartSyncTestSuite.js => SFMobileSyncTestSuite.js} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename samples/mobilesyncexplorer/{SmartSyncExplorer.html => MobileSyncExplorer.html} (100%) rename test/{MockSmartSyncPlugin.js => MockMobileSyncPlugin.js} (100%) rename test/{SFSmartSyncTestSuite.js => SFMobileSyncTestSuite.js} (100%) diff --git a/samples/mobilesyncexplorer/SmartSyncExplorer.html b/samples/mobilesyncexplorer/MobileSyncExplorer.html similarity index 100% rename from samples/mobilesyncexplorer/SmartSyncExplorer.html rename to samples/mobilesyncexplorer/MobileSyncExplorer.html diff --git a/test/MockSmartSyncPlugin.js b/test/MockMobileSyncPlugin.js similarity index 100% rename from test/MockSmartSyncPlugin.js rename to test/MockMobileSyncPlugin.js diff --git a/test/SFSmartSyncTestSuite.js b/test/SFMobileSyncTestSuite.js similarity index 100% rename from test/SFSmartSyncTestSuite.js rename to test/SFMobileSyncTestSuite.js From 8f97773ed635be353ff7e5793fa2b35cadcd9a17 Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:47:29 -0700 Subject: [PATCH 10/12] Fixing symlinks --- samples/mobilesyncexplorer/js/MockMobileSyncPlugin.js | 1 + samples/mobilesyncexplorer/js/MockSmartSyncPlugin.js | 1 - samples/notesync/js/MockMobileSyncPlugin.js | 1 + samples/notesync/js/MockSmartSyncPlugin.js | 1 - samples/simplesyncreact/js/MockMobileSyncPlugin.js | 1 + samples/simplesyncreact/js/MockSmartSyncPlugin.js | 1 - 6 files changed, 3 insertions(+), 3 deletions(-) create mode 120000 samples/mobilesyncexplorer/js/MockMobileSyncPlugin.js delete mode 120000 samples/mobilesyncexplorer/js/MockSmartSyncPlugin.js create mode 120000 samples/notesync/js/MockMobileSyncPlugin.js delete mode 120000 samples/notesync/js/MockSmartSyncPlugin.js create mode 120000 samples/simplesyncreact/js/MockMobileSyncPlugin.js delete mode 120000 samples/simplesyncreact/js/MockSmartSyncPlugin.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/mobilesyncexplorer/js/MockSmartSyncPlugin.js b/samples/mobilesyncexplorer/js/MockSmartSyncPlugin.js deleted file mode 120000 index 895888b4..00000000 --- a/samples/mobilesyncexplorer/js/MockSmartSyncPlugin.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/MockSmartSyncPlugin.js \ No newline at end of file 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/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 From d2dbbae6a28826c8a6d2b9d0476ff4efe90529b8 Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:52:57 -0700 Subject: [PATCH 11/12] Fixing more symlinks --- samples/accounteditor/js/mobilesync.js | 1 + samples/accounteditor/js/smartsync.js | 1 - samples/fileexplorer/js/mobilesync.js | 1 + samples/fileexplorer/js/smartsync.js | 1 - samples/mobilesyncexplorer/js/mobilesync.js | 1 + samples/mobilesyncexplorer/js/smartsync.js | 1 - samples/notesync/js/mobilesync.js | 1 + samples/notesync/js/smartsync.js | 1 - samples/simplesyncreact/js/mobilesync.js | 1 + samples/simplesyncreact/js/smartsync.js | 1 - samples/userandgroupsearch/js/mobilesync.js | 1 + samples/userandgroupsearch/js/smartsync.js | 1 - samples/usersearch/js/mobilesync.js | 1 + samples/usersearch/js/smartsync.js | 1 - 14 files changed, 7 insertions(+), 7 deletions(-) create mode 120000 samples/accounteditor/js/mobilesync.js delete mode 120000 samples/accounteditor/js/smartsync.js create mode 120000 samples/fileexplorer/js/mobilesync.js delete mode 120000 samples/fileexplorer/js/smartsync.js create mode 120000 samples/mobilesyncexplorer/js/mobilesync.js delete mode 120000 samples/mobilesyncexplorer/js/smartsync.js create mode 120000 samples/notesync/js/mobilesync.js delete mode 120000 samples/notesync/js/smartsync.js create mode 120000 samples/simplesyncreact/js/mobilesync.js delete mode 120000 samples/simplesyncreact/js/smartsync.js create mode 120000 samples/userandgroupsearch/js/mobilesync.js delete mode 120000 samples/userandgroupsearch/js/smartsync.js create mode 120000 samples/usersearch/js/mobilesync.js delete mode 120000 samples/usersearch/js/smartsync.js 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/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/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/mobilesyncexplorer/js/smartsync.js b/samples/mobilesyncexplorer/js/smartsync.js deleted file mode 120000 index b49b3e2e..00000000 --- a/samples/mobilesyncexplorer/js/smartsync.js +++ /dev/null @@ -1 +0,0 @@ -../../../libs/smartsync.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/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/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/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 From f553bd5e29bee1f103ef212a608b063e1c0dd76f Mon Sep 17 00:00:00 2001 From: Bharath Hariharan Date: Wed, 18 Sep 2019 18:58:01 -0700 Subject: [PATCH 12/12] Last round of renames --- test/SFMobileSyncTestSuite.js | 370 +++++++++++++++++----------------- 1 file changed, 185 insertions(+), 185 deletions(-) diff --git a/test/SFMobileSyncTestSuite.js b/test/SFMobileSyncTestSuite.js index 8816aaed..5b9d9a38 100644 --- a/test/SFMobileSyncTestSuite.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)