You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ko...@apache.org on 2014/09/01 12:04:27 UTC
[1/4] git commit: [OLINGO-418] rename ODataReadOracle ->
ODataVerifyReader
Repository: olingo-odata4-js
Updated Branches:
refs/heads/master 3d06a1b02 -> ccb8c5468
[OLINGO-418] rename ODataReadOracle -> ODataVerifyReader
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/b5bcba4e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/b5bcba4e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/b5bcba4e
Branch: refs/heads/master
Commit: b5bcba4ed328d518b385b5de54be0c79fab6d948
Parents: 3d06a1b
Author: Sven Kobler <sv...@sap.com>
Authored: Mon Sep 1 11:09:09 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Mon Sep 1 11:09:09 2014 +0200
----------------------------------------------------------------------
odatajs/tests/cache-tests.js | 2 +-
odatajs/tests/common/ODataReadOracle.js | 201 -------------------
odatajs/tests/common/ODataReadOracle.svc | 114 -----------
odatajs/tests/common/ODataVerifyReader.svc | 114 +++++++++++
odatajs/tests/common/odataVerifyReader.js | 201 +++++++++++++++++++
odatajs/tests/odata-batch-functional-tests.html | 2 +-
odatajs/tests/odata-batch-functional-tests.js | 4 +-
.../odata-cache-filter-functional-tests.html | 2 +-
.../odata-cache-filter-functional-tests.js | 2 +-
odatajs/tests/odata-cache-functional-tests.html | 2 +-
odatajs/tests/odata-cache-functional-tests.js | 2 +-
.../tests/odata-cache-rx-functional-tests.html | 2 +-
.../tests/odata-cache-rx-functional-tests.js | 2 +-
odatajs/tests/odata-links-functional-tests.html | 2 +-
odatajs/tests/odata-links-functional-tests.js | 8 +-
...ata-metadata-awareness-functional-tests.html | 2 +-
...odata-metadata-awareness-functional-tests.js | 12 +-
odatajs/tests/odata-qunit-tests.htm | 2 +-
...odata-read-crossdomain-functional-tests.html | 2 +-
.../odata-read-crossdomain-functional-tests.js | 6 +-
odatajs/tests/odata-read-functional-tests.html | 2 +-
odatajs/tests/odata-read-functional-tests.js | 48 ++---
.../tests/odata-request-functional-tests.html | 2 +-
odatajs/tests/odata-request-functional-tests.js | 12 +-
.../tests/odata-roundtrip-functional-tests.js | 14 +-
...cache-large-collection-functional-tests.html | 2 +-
...s-cache-large-collection-functional-tests.js | 4 +-
27 files changed, 384 insertions(+), 384 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/cache-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/cache-tests.js b/odatajs/tests/cache-tests.js
index f4c1a1c..7e03764 100644
--- a/odatajs/tests/cache-tests.js
+++ b/odatajs/tests/cache-tests.js
@@ -635,7 +635,7 @@
return result;
};
- ODataReadOracle.readJsonAcrossServerPages(foodsFeed, function (expectData) {
+ ODataVerifyReader.readJsonAcrossServerPages(foodsFeed, function (expectData) {
$.each(tests, function (_, test) {
createNewCache(options).then(function (cache) {
try {
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/common/ODataReadOracle.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/ODataReadOracle.js b/odatajs/tests/common/ODataReadOracle.js
deleted file mode 100644
index 83967ce..0000000
--- a/odatajs/tests/common/ODataReadOracle.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-// Client for the odata.read oracle service
-
-(function (window, undefined) {
- var jsonMime = "application/json";
- var universalMime = "*/*";
-
- var readFeed = function (url, success, mimeType, recognizeDates) {
- /** Calls the ReadFeed endpoint with the specified URL
- * @param {String} url - The URL to read the feed from
- * @param {Function} success - The success callback function
- * @param {String} mimeType - The MIME media type in the Accept header
- */
- var readMethod = getReadMethod(mimeType);
- oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, function (data) {
- success(data);
- });
- };
-
- var readEntry = function (url, success, mimeType, recognizeDates) {
- /** Calls the ReadEntry endpoint with the specified URL
- * @param {String} url - The URL to read the entry from
- * @param {Function} success - The success callback function
- * @param {String} mimeType - The MIME media type in the Accept header
- */
- var readMethod = getReadMethod(mimeType);
- oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, success);
- };
-
- var readLinksEntry = function (url, success) {
- /** Calls the ReadMetadata endpoint with the specified URL
- * @param {String} url - The URL to read the metadata from
- * @param {Function} success - The success callback function
- */
- readJson(
- url,
- success
- );
- };
-
- var readLinksFeed = function (url, success) {
- /** Calls the ReadMetadata endpoint with the specified URL
- * @param {String} url - The URL to read the metadata from
- * @param {Function} success - The success callback function
- */
- readJson(
- url,
- function (data) {
- success(data);
- }
- );
- };
-
- var readMetadata = function (url, success) {
- /** Calls the ReadMetadata endpoint with the specified URL
- * @param {String} url - The URL to read the metadata from
- * @param {Function} success - The success callback function
- */
- oracleRequest("GET", "ReadMetadata", typeof url === "string" ? { url: url} : url, null, null, success);
- };
-
- var readServiceDocument = function (url, success, mimeType) {
- /** Calls the ReadServiceDocument endpoint with the specified URL
- * @param {String} url - The URL to the service
- * @param {Function} success - The success callback function
- * @param {String} mimeType - The MIME type being tested
- */
- var readMethod = getReadMethod(mimeType);
- oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, null, success);
- };
-
- var readJson = function (url, success) {
- $.ajax({
- url: url,
- accepts: null,
- dataType: "json",
- beforeSend: function (xhr) {
- xhr.setRequestHeader("Accept", jsonMime);
- xhr.setRequestHeader("OData-MaxVersion", "4.0");
- },
- success: function (data) {
- success(data);
- }
- });
- };
-
- var readJsonAcrossServerPages = function (url, success) {
- var data = {};
- var readPage = function (url) {
- readJson(url, function (feedData) {
- var nextLink = feedData["@odata.nextLink"];
- if (nextLink) {
- var index = url.indexOf(".svc/", 0);
- if (index != -1) {
- nextLink = url.substring(0, index + 5) + nextLink;
- }
- }
-
- if (data.value && feedData.value) {
- data.value = data.value.concat(feedData.value);
- }
- else {
- for (var property in feedData) {
- if (property != "@odata.nextLink") {
- data[property] = feedData[property];
- }
- }
- }
-
- if (nextLink) {
- readPage(nextLink);
- }
- else {
- success(data);
- }
- });
- };
-
- readPage(url);
- };
-
- var getReadMethod = function (mimeType) {
- switch (mimeType) {
- case jsonMime:
- case universalMime:
- default:
- return "ReadJson";
- }
- };
-
- var oracleRequest = function (method, endpoint, data, mimeType, recognizeDates, success) {
- /** Requests a JSON object from the oracle service, removing WCF-specific artifacts
- * @param {String} method - The HTTP method (GET or POST)
- * @param {String} endpoint - The oracle endpoint
- * @param {Object} data - The data to send with the request
- * @param {Function} reviver - The reviver function to run on each deserialized object
- * @param {Function} success - Success callback
- */
- var url = "./common/ODataReadOracle.svc/" + endpoint;
- if (mimeType) {
- data.mimeType = mimeType;
- }
-
- $.ajax({
- type: method,
- url: url,
- data: data,
- dataType: "text",
- success: function (data) {
- var json = JSON.parse(data);
- success(json);
- }
- });
- };
-
- var removeProperty = function (data, property) {
- /** Removes the specified property recursively from the given object
- * @param {Object} data - The object to operate on
- * @param {String} property - The name of the property to remove
- */
- if (typeof data === "object" && data !== null) {
- if (data[property]) {
- delete data[property];
- }
-
- for (prop in data) {
- removeProperty(data[prop], property);
- }
- }
- };
-
- window.ODataReadOracle = {
- readFeed: readFeed,
- readEntry: readEntry,
- readLinksEntry: readLinksEntry,
- readLinksFeed: readLinksFeed,
- readJson: readJson,
- readJsonAcrossServerPages: readJsonAcrossServerPages,
- readMetadata: readMetadata,
- readServiceDocument: readServiceDocument
- };
-})(window);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/common/ODataReadOracle.svc
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/ODataReadOracle.svc b/odatajs/tests/common/ODataReadOracle.svc
deleted file mode 100644
index 339666c..0000000
--- a/odatajs/tests/common/ODataReadOracle.svc
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-
-<%@ ServiceHost Language="C#" Debug="true" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory"
- Service="DataJS.Tests.ODataReadOracle" %>
-
-//uncomment this line to debug JSON serialization.
-//#define DEBUG_SERIALIZATION
-
-namespace DataJS.Tests
-{
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Runtime.Serialization;
- using System.ServiceModel;
- using System.ServiceModel.Activation;
- using System.ServiceModel.Syndication;
- using System.ServiceModel.Web;
- using System.Xml;
- using System.Xml.Linq;
- using Microsoft.Spatial;
- using Microsoft.OData.Core;
- using System.Web.Script.Serialization;
-
- /// <summary>
- /// Oracle for the OData.read library function
- /// </summary>
- [ServiceContract]
- [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
- [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
- public class ODataReadOracle
- {
- const string jsonlightMediaType = "application/json";
-
- /// <summary>
- /// Reads a URI that will return a metadata object
- /// </summary>
- /// <param name="url">The URL to send the request to</param>
- /// <returns>Stream of metadata in json light format</returns>
- [OperationContract]
- [WebGet]
- public Stream ReadMetadata(string url)
- {
- WebResponse response = WebRequest.Create(ResolveUri(url, UriKind.Absolute)).GetResponse();
- Dictionary<string, object> jsonObject = CsdlReader.ReadCsdl(new StreamReader(response.GetResponseStream()));
- return ReaderUtils.ConvertDictionarytoJsonlightStream(jsonObject);
- }
-
- /// <summary>
- /// Reads a URI that will get the Json response and return the stream
- /// </summary>
- /// <param name="url">URL of the entry</param>
- /// <param name="user">The username for basic authentication</param>
- /// <param name="password">The password for basic authentication</param>
- /// <returns>Stream of the Json response expected to be returned by OData.read</returns>
- [OperationContract]
- [WebGet(ResponseFormat = WebMessageFormat.Json)]
- public Stream ReadJson(string url, string mimeType, string user, string password)
- {
- if (mimeType == null)
- {
- mimeType = jsonlightMediaType + ";odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8";
- }
-
- HttpWebRequest request = (HttpWebRequest)ReaderUtils.CreateRequest(ResolveUri(url, UriKind.Absolute), user, password);
- request.Accept = mimeType;
- WebResponse response = request.GetResponse();
-
- return response.GetResponseStream();
- }
-
- /// <summary>
- /// Resolves the given url string to a URI
- /// </summary>
- /// <param name="url">The given URL string</param>
- /// <param name="urlKind">URI kind to resolve to</param>
- /// <returns>The resolved URI</returns>
- private static string ResolveUri(string url, UriKind uriKind)
- {
- Uri resolvedUri = new Uri(url, UriKind.RelativeOrAbsolute);
- if (!resolvedUri.IsAbsoluteUri)
- {
- // If the given URI is relative, then base it on the Referer URI
- Uri baseUri = new Uri(WebOperationContext.Current.IncomingRequest.Headers["Referer"]);
- resolvedUri = new Uri(baseUri, resolvedUri);
- if (uriKind == UriKind.Relative)
- {
- resolvedUri = baseUri.MakeRelativeUri(resolvedUri);
- }
- }
-
- return resolvedUri.ToString();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/common/ODataVerifyReader.svc
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/ODataVerifyReader.svc b/odatajs/tests/common/ODataVerifyReader.svc
new file mode 100644
index 0000000..101cf36
--- /dev/null
+++ b/odatajs/tests/common/ODataVerifyReader.svc
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+<%@ ServiceHost Language="C#" Debug="true" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory"
+ Service="DataJS.Tests.ODataVerifyReader" %>
+
+//uncomment this line to debug JSON serialization.
+//#define DEBUG_SERIALIZATION
+
+namespace DataJS.Tests
+{
+ using System;
+ using System.Collections.Generic;
+ using System.IO;
+ using System.Linq;
+ using System.Net;
+ using System.Runtime.Serialization;
+ using System.ServiceModel;
+ using System.ServiceModel.Activation;
+ using System.ServiceModel.Syndication;
+ using System.ServiceModel.Web;
+ using System.Xml;
+ using System.Xml.Linq;
+ using Microsoft.Spatial;
+ using Microsoft.OData.Core;
+ using System.Web.Script.Serialization;
+
+ /// <summary>
+ /// Oracle for the OData.read library function
+ /// </summary>
+ [ServiceContract]
+ [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
+ [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
+ public class ODataVerifyReader
+ {
+ const string jsonlightMediaType = "application/json";
+
+ /// <summary>
+ /// Reads a URI that will return a metadata object
+ /// </summary>
+ /// <param name="url">The URL to send the request to</param>
+ /// <returns>Stream of metadata in json light format</returns>
+ [OperationContract]
+ [WebGet]
+ public Stream ReadMetadata(string url)
+ {
+ WebResponse response = WebRequest.Create(ResolveUri(url, UriKind.Absolute)).GetResponse();
+ Dictionary<string, object> jsonObject = CsdlReader.ReadCsdl(new StreamReader(response.GetResponseStream()));
+ return ReaderUtils.ConvertDictionarytoJsonlightStream(jsonObject);
+ }
+
+ /// <summary>
+ /// Reads a URI that will get the Json response and return the stream
+ /// </summary>
+ /// <param name="url">URL of the entry</param>
+ /// <param name="user">The username for basic authentication</param>
+ /// <param name="password">The password for basic authentication</param>
+ /// <returns>Stream of the Json response expected to be returned by OData.read</returns>
+ [OperationContract]
+ [WebGet(ResponseFormat = WebMessageFormat.Json)]
+ public Stream ReadJson(string url, string mimeType, string user, string password)
+ {
+ if (mimeType == null)
+ {
+ mimeType = jsonlightMediaType + ";odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8";
+ }
+
+ HttpWebRequest request = (HttpWebRequest)ReaderUtils.CreateRequest(ResolveUri(url, UriKind.Absolute), user, password);
+ request.Accept = mimeType;
+ WebResponse response = request.GetResponse();
+
+ return response.GetResponseStream();
+ }
+
+ /// <summary>
+ /// Resolves the given url string to a URI
+ /// </summary>
+ /// <param name="url">The given URL string</param>
+ /// <param name="urlKind">URI kind to resolve to</param>
+ /// <returns>The resolved URI</returns>
+ private static string ResolveUri(string url, UriKind uriKind)
+ {
+ Uri resolvedUri = new Uri(url, UriKind.RelativeOrAbsolute);
+ if (!resolvedUri.IsAbsoluteUri)
+ {
+ // If the given URI is relative, then base it on the Referer URI
+ Uri baseUri = new Uri(WebOperationContext.Current.IncomingRequest.Headers["Referer"]);
+ resolvedUri = new Uri(baseUri, resolvedUri);
+ if (uriKind == UriKind.Relative)
+ {
+ resolvedUri = baseUri.MakeRelativeUri(resolvedUri);
+ }
+ }
+
+ return resolvedUri.ToString();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/common/odataVerifyReader.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/odataVerifyReader.js b/odatajs/tests/common/odataVerifyReader.js
new file mode 100644
index 0000000..4e25568
--- /dev/null
+++ b/odatajs/tests/common/odataVerifyReader.js
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+// Client for the odata.read oracle service
+
+(function (window, undefined) {
+ var jsonMime = "application/json";
+ var universalMime = "*/*";
+
+ var readFeed = function (url, success, mimeType, recognizeDates) {
+ /** Calls the ReadFeed endpoint with the specified URL
+ * @param {String} url - The URL to read the feed from
+ * @param {Function} success - The success callback function
+ * @param {String} mimeType - The MIME media type in the Accept header
+ */
+ var readMethod = getReadMethod(mimeType);
+ oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, function (data) {
+ success(data);
+ });
+ };
+
+ var readEntry = function (url, success, mimeType, recognizeDates) {
+ /** Calls the ReadEntry endpoint with the specified URL
+ * @param {String} url - The URL to read the entry from
+ * @param {Function} success - The success callback function
+ * @param {String} mimeType - The MIME media type in the Accept header
+ */
+ var readMethod = getReadMethod(mimeType);
+ oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, success);
+ };
+
+ var readLinksEntry = function (url, success) {
+ /** Calls the ReadMetadata endpoint with the specified URL
+ * @param {String} url - The URL to read the metadata from
+ * @param {Function} success - The success callback function
+ */
+ readJson(
+ url,
+ success
+ );
+ };
+
+ var readLinksFeed = function (url, success) {
+ /** Calls the ReadMetadata endpoint with the specified URL
+ * @param {String} url - The URL to read the metadata from
+ * @param {Function} success - The success callback function
+ */
+ readJson(
+ url,
+ function (data) {
+ success(data);
+ }
+ );
+ };
+
+ var readMetadata = function (url, success) {
+ /** Calls the ReadMetadata endpoint with the specified URL
+ * @param {String} url - The URL to read the metadata from
+ * @param {Function} success - The success callback function
+ */
+ oracleRequest("GET", "ReadMetadata", typeof url === "string" ? { url: url} : url, null, null, success);
+ };
+
+ var readServiceDocument = function (url, success, mimeType) {
+ /** Calls the ReadServiceDocument endpoint with the specified URL
+ * @param {String} url - The URL to the service
+ * @param {Function} success - The success callback function
+ * @param {String} mimeType - The MIME type being tested
+ */
+ var readMethod = getReadMethod(mimeType);
+ oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, null, success);
+ };
+
+ var readJson = function (url, success) {
+ $.ajax({
+ url: url,
+ accepts: null,
+ dataType: "json",
+ beforeSend: function (xhr) {
+ xhr.setRequestHeader("Accept", jsonMime);
+ xhr.setRequestHeader("OData-MaxVersion", "4.0");
+ },
+ success: function (data) {
+ success(data);
+ }
+ });
+ };
+
+ var readJsonAcrossServerPages = function (url, success) {
+ var data = {};
+ var readPage = function (url) {
+ readJson(url, function (feedData) {
+ var nextLink = feedData["@odata.nextLink"];
+ if (nextLink) {
+ var index = url.indexOf(".svc/", 0);
+ if (index != -1) {
+ nextLink = url.substring(0, index + 5) + nextLink;
+ }
+ }
+
+ if (data.value && feedData.value) {
+ data.value = data.value.concat(feedData.value);
+ }
+ else {
+ for (var property in feedData) {
+ if (property != "@odata.nextLink") {
+ data[property] = feedData[property];
+ }
+ }
+ }
+
+ if (nextLink) {
+ readPage(nextLink);
+ }
+ else {
+ success(data);
+ }
+ });
+ };
+
+ readPage(url);
+ };
+
+ var getReadMethod = function (mimeType) {
+ switch (mimeType) {
+ case jsonMime:
+ case universalMime:
+ default:
+ return "ReadJson";
+ }
+ };
+
+ var oracleRequest = function (method, endpoint, data, mimeType, recognizeDates, success) {
+ /** Requests a JSON object from the oracle service, removing WCF-specific artifacts
+ * @param {String} method - The HTTP method (GET or POST)
+ * @param {String} endpoint - The oracle endpoint
+ * @param {Object} data - The data to send with the request
+ * @param {Function} reviver - The reviver function to run on each deserialized object
+ * @param {Function} success - Success callback
+ */
+ var url = "./common/ODataVerifyReader.svc/" + endpoint;
+ if (mimeType) {
+ data.mimeType = mimeType;
+ }
+
+ $.ajax({
+ type: method,
+ url: url,
+ data: data,
+ dataType: "text",
+ success: function (data) {
+ var json = JSON.parse(data);
+ success(json);
+ }
+ });
+ };
+
+ var removeProperty = function (data, property) {
+ /** Removes the specified property recursively from the given object
+ * @param {Object} data - The object to operate on
+ * @param {String} property - The name of the property to remove
+ */
+ if (typeof data === "object" && data !== null) {
+ if (data[property]) {
+ delete data[property];
+ }
+
+ for (prop in data) {
+ removeProperty(data[prop], property);
+ }
+ }
+ };
+
+ window.ODataVerifyReader = {
+ readFeed: readFeed,
+ readEntry: readEntry,
+ readLinksEntry: readLinksEntry,
+ readLinksFeed: readLinksFeed,
+ readJson: readJson,
+ readJsonAcrossServerPages: readJsonAcrossServerPages,
+ readMetadata: readMetadata,
+ readServiceDocument: readServiceDocument
+ };
+})(window);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-batch-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-batch-functional-tests.html b/odatajs/tests/odata-batch-functional-tests.html
index 4f79204..baf9b54 100644
--- a/odatajs/tests/odata-batch-functional-tests.html
+++ b/odatajs/tests/odata-batch-functional-tests.html
@@ -29,7 +29,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<script type="text/javascript">
window.TestSynchronizer.init(QUnit);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-batch-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-batch-functional-tests.js b/odatajs/tests/odata-batch-functional-tests.js
index 328bb66..4ff56ce 100644
--- a/odatajs/tests/odata-batch-functional-tests.js
+++ b/odatajs/tests/odata-batch-functional-tests.js
@@ -53,7 +53,7 @@
var verifyBatchResponses = function (batchRequests, elementTypes, serviceRoot, batchResponses, done) {
forEachAsync(batchRequests, function (index, batchRequest, doneOne) {
if (batchRequest.requestUri) {
- var readFeedOrEntry = elementTypes[index] == "feed" ? ODataReadOracle.readFeed : ODataReadOracle.readEntry;
+ var readFeedOrEntry = elementTypes[index] == "feed" ? ODataVerifyReader.readFeed : ODataVerifyReader.readEntry;
djstest.assertAreEqual(batchResponses[index].statusCode, httpStatusCode.ok, "Verify response code for: GET " + batchRequest.requestUri);
readFeedOrEntry(serviceRoot + "/" + batchRequest.requestUri, function (expectedData) {
djstest.assertAreEqualDeep(batchResponses[index].data, expectedData, "Verify data for: GET " + batchRequest.requestUri);
@@ -73,7 +73,7 @@
if (changeRequest.method == "POST") {
djstest.assertAreEqual(changeResponse.statusCode, httpStatusCode.created, "Verify response code for: " + httpOperation);
- ODataReadOracle.readEntry(changeResponse.headers["Location"], function (expectedData) {
+ ODataVerifyReader.readEntry(changeResponse.headers["Location"], function (expectedData) {
djstest.assertAreEqualDeep(changeResponse.data, expectedData, "Verify response data for: " + httpOperation);
doneOne();
}, changeRequest.headers.Accept);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-cache-filter-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-filter-functional-tests.html b/odatajs/tests/odata-cache-filter-functional-tests.html
index 94cfe2e..6e25f80 100644
--- a/odatajs/tests/odata-cache-filter-functional-tests.html
+++ b/odatajs/tests/odata-cache-filter-functional-tests.html
@@ -40,7 +40,7 @@
<script type="text/javascript" src="common/djstest.js"></script>
<script type="text/javascript" src="common/CacheOracle.js"></script>
<script type="text/javascript" src="common/ObservableHttpClient.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="odata-cache-filter-functional-tests.js"></script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-cache-filter-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-filter-functional-tests.js b/odatajs/tests/odata-cache-filter-functional-tests.js
index 0fd08f3..c9024d2 100644
--- a/odatajs/tests/odata-cache-filter-functional-tests.js
+++ b/odatajs/tests/odata-cache-filter-functional-tests.js
@@ -162,7 +162,7 @@
index = 0;
}
- window.ODataReadOracle.readJsonAcrossServerPages(feed, function (expectData) {
+ window.ODataVerifyReader.readJsonAcrossServerPages(feed, function (expectData) {
if (backwards) {
cache.filterBack(index, count, predicate).then(function (actualResults) {
var expectedResults = CacheOracle.getExpectedFilterResults(expectData, index, count, predicate, backwards);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-cache-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-functional-tests.html b/odatajs/tests/odata-cache-functional-tests.html
index f158030..0a5618b 100644
--- a/odatajs/tests/odata-cache-functional-tests.html
+++ b/odatajs/tests/odata-cache-functional-tests.html
@@ -40,7 +40,7 @@
<script type="text/javascript" src="common/djstest.js"></script>
<script type="text/javascript" src="common/CacheOracle.js"></script>
<script type="text/javascript" src="common/ObservableHttpClient.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="odata-cache-functional-tests.js"></script>
</head>
<body>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-cache-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-functional-tests.js b/odatajs/tests/odata-cache-functional-tests.js
index ac63460..4e4b4dd 100644
--- a/odatajs/tests/odata-cache-functional-tests.js
+++ b/odatajs/tests/odata-cache-functional-tests.js
@@ -154,7 +154,7 @@
if (typeof source === "string") {
var expectedRangeUrl = source + "?$skip=" + skipValue + "&$top=" + takeValue;
- window.ODataReadOracle.readJsonAcrossServerPages(expectedRangeUrl, assertData);
+ window.ODataVerifyReader.readJsonAcrossServerPages(expectedRangeUrl, assertData);
} else {
source.read(skipValue, takeValue, assertData);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-cache-rx-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-rx-functional-tests.html b/odatajs/tests/odata-cache-rx-functional-tests.html
index aab512c..728e833 100644
--- a/odatajs/tests/odata-cache-rx-functional-tests.html
+++ b/odatajs/tests/odata-cache-rx-functional-tests.html
@@ -37,7 +37,7 @@
<script type="text/javascript" src="../build/odatajs-4.0.0-beta-01.js"></script>
<script type="text/javascript" src="common/common.js"></script>
<script type="text/javascript" src="common/djstest.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/ODataVerifyReader.js"></script>
<script type="text/javascript" src="common/rx.js"></script>
<script type="text/javascript" src="odata-cache-rx-functional-tests.js"></script>
</head>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-cache-rx-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-rx-functional-tests.js b/odatajs/tests/odata-cache-rx-functional-tests.js
index 453e586..714cccb 100644
--- a/odatajs/tests/odata-cache-rx-functional-tests.js
+++ b/odatajs/tests/odata-cache-rx-functional-tests.js
@@ -75,7 +75,7 @@
var options = { name: "cache" + new Date().valueOf(), source: params.feedUri, pageSize: params.pageSize, prefetchSize: 0 };
var cache = odatajs.cache.createDataCache(options);
- ODataReadOracle.readJsonAcrossServerPages(params.feedUri, function (collection) {
+ ODataVerifyReader.readJsonAcrossServerPages(params.feedUri, function (collection) {
assertObservables(params.operator(cache.toObservable()), params.operator(window.Rx.Observable.FromArray(collection.value)), function () {
djstest.destroyCacheAndDone(cache);
});
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-links-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-links-functional-tests.html b/odatajs/tests/odata-links-functional-tests.html
index 21952d8..48eaac7 100644
--- a/odatajs/tests/odata-links-functional-tests.html
+++ b/odatajs/tests/odata-links-functional-tests.html
@@ -30,7 +30,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<script type="text/javascript">
window.TestSynchronizer.init(QUnit);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-links-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-links-functional-tests.js b/odatajs/tests/odata-links-functional-tests.js
index eb64ec0..8ff2f5d 100644
--- a/odatajs/tests/odata-links-functional-tests.js
+++ b/odatajs/tests/odata-links-functional-tests.js
@@ -171,7 +171,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: params.linksFeed, headers: headers },
function (data, response) {
- window.ODataReadOracle.readLinksFeed(params.linksFeed,
+ window.ODataVerifyReader.readLinksFeed(params.linksFeed,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -186,7 +186,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: params.linksEntry, headers: headers },
function (data, response) {
- window.ODataReadOracle.readLinksEntry(params.linksEntry,
+ window.ODataVerifyReader.readLinksEntry(params.linksEntry,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -210,7 +210,7 @@
odatajs.oData.request(request, function (data, response) {
var httpOperation = request.method + " " + request.requestUri;
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code: " + httpOperation);
- ODataReadOracle.readLinksEntry(request.requestUri, function (actualData) {
+ ODataVerifyReader.readLinksEntry(request.requestUri, function (actualData) {
if (actualData && actualData["@odata.context"]) {
delete actualData["@odata.context"];
}
@@ -260,7 +260,7 @@
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code: " + httpOperation);
odatajs.oData.read(request.requestUri, function (data, response) {
- ODataReadOracle.readLinksFeed(request.requestUri, function (actualData) {
+ ODataVerifyReader.readLinksFeed(request.requestUri, function (actualData) {
djstest.assertAreEqualDeep(actualData, response.data, "Verify updated links entry against the request: " + httpOperation);
deleteAndVerify();
});
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-metadata-awareness-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-metadata-awareness-functional-tests.html b/odatajs/tests/odata-metadata-awareness-functional-tests.html
index fc5bb0b..2b33dbc 100644
--- a/odatajs/tests/odata-metadata-awareness-functional-tests.html
+++ b/odatajs/tests/odata-metadata-awareness-functional-tests.html
@@ -29,7 +29,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<script type="text/javascript">
window.TestSynchronizer.init(QUnit);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-metadata-awareness-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-metadata-awareness-functional-tests.js b/odatajs/tests/odata-metadata-awareness-functional-tests.js
index a5d2887..1f5638d 100644
--- a/odatajs/tests/odata-metadata-awareness-functional-tests.js
+++ b/odatajs/tests/odata-metadata-awareness-functional-tests.js
@@ -134,7 +134,7 @@
OData.defaultMetadata.push(metadata);
odatajs.oData.read({ requestUri: entryUri, headers: acceptHeaders }, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.ok, "Verify response code");
- ODataReadOracle.readJson(entryUri, function (expectedData) {
+ ODataVerifyReader.readJson(entryUri, function (expectedData) {
djstest.assertWithoutMetadata(data, expectedData, "Verify data");
djstest.done();
})
@@ -163,7 +163,7 @@
OData.defaultMetadata.push(metadata);
odatajs.oData.read({ requestUri: entryUri, headers: acceptHeaders }, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.ok, "Verify response code");
- ODataReadOracle.readJson(entryUri, function (expectedData) {
+ ODataVerifyReader.readJson(entryUri, function (expectedData) {
djstest.assertWithoutMetadata(data, expectedData, "Verify data");
djstest.done();
})
@@ -177,7 +177,7 @@
getMetadata(function (metadata) {
odatajs.oData.request({ requestUri: params.feedUri, method: "POST", headers: djstest.clone(mimeHeaders), data: postEntry }, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.created, "Verify response code");
- ODataReadOracle.readJson(feedUri + "(" + postEntry.ID + ")", function (actualData) {
+ ODataVerifyReader.readJson(feedUri + "(" + postEntry.ID + ")", function (actualData) {
djstest.assertWithoutMetadata(actualData, postEntry, "Verify new entry data against server");
djstest.done();
})
@@ -192,7 +192,7 @@
OData.defaultMetadata.push(metadata);
odatajs.oData.request({ requestUri: entryUri, method: "PUT", headers: djstest.clone(mimeHeaders), data: params.testEntry.data }, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code");
- ODataReadOracle.readJson(entryUri, function (actualData) {
+ ODataVerifyReader.readJson(entryUri, function (actualData) {
djstest.assertWithoutMetadata(actualData, $.extend({ ID: 0 }, params.testEntry.data), "Verify updated entry data against server");
djstest.done();
})
@@ -210,7 +210,7 @@
getMetadata(function (metadata) {
odatajs.oData.read({ requestUri: entryUri, headers: acceptHeaders }, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.ok, "Verify response code");
- ODataReadOracle.readJson(entryUri, function (expectedData) {
+ ODataVerifyReader.readJson(entryUri, function (expectedData) {
djstest.assertWithoutMetadata(data, expectedData, "Verify data");
djstest.done();
})
@@ -230,7 +230,7 @@
odatajs.oData.read({ requestUri: specialDaysEndpoint, headers: { Accept: params.accept} }, function (data, response) {
// Because our oracle isn't metadata aware, it is not 100% correct, so we will pass in recognizeDates = true
// in all cases and manually fix up the property that was incorrectly converted
- window.ODataReadOracle.readFeed(specialDaysEndpoint, function (expectedData) {
+ window.ODataVerifyReader.readFeed(specialDaysEndpoint, function (expectedData) {
// Fix up the string property that has a "date-like" string deliberately injected
expectedData.results[2].Name = "/Date(" + expectedData.results[2].Name.valueOf() + ")/";
djstest.assertAreEqualDeep(data, expectedData, "Verify response data");
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-qunit-tests.htm
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-qunit-tests.htm b/odatajs/tests/odata-qunit-tests.htm
index 3054691..6d2de29 100644
--- a/odatajs/tests/odata-qunit-tests.htm
+++ b/odatajs/tests/odata-qunit-tests.htm
@@ -34,7 +34,7 @@
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<!--<script type="text/javascript" src="common/rx.js"></script>-->
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-read-crossdomain-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-read-crossdomain-functional-tests.html b/odatajs/tests/odata-read-crossdomain-functional-tests.html
index 86ce093..784aec6 100644
--- a/odatajs/tests/odata-read-crossdomain-functional-tests.html
+++ b/odatajs/tests/odata-read-crossdomain-functional-tests.html
@@ -30,7 +30,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/ODataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<script type="text/javascript">
window.TestSynchronizer.init(QUnit);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-read-crossdomain-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-read-crossdomain-functional-tests.js b/odatajs/tests/odata-read-crossdomain-functional-tests.js
index 9e8aca9..06dcfa1 100644
--- a/odatajs/tests/odata-read-crossdomain-functional-tests.js
+++ b/odatajs/tests/odata-read-crossdomain-functional-tests.js
@@ -78,7 +78,7 @@
djstest.log("Reading data over the wire.");
odatajs.oData.read(request, function (data, response) {
djstest.log("Verifying data over the wire from Oracle.");
- window.ODataReadOracle.readFeed(azureOdataFeed, function (expectedData) {
+ window.ODataVerifyReader.readFeed(azureOdataFeed, function (expectedData) {
data = fixConstructors(data);
djstest.assertWithoutMetadata(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -93,7 +93,7 @@
djstest.log("Reading data over the wire.");
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} }, function (data, response) {
djstest.log("Verifying data over the wire from Oracle.");
- window.ODataReadOracle.readEntry(endPoint, function (expectedData) {
+ window.ODataVerifyReader.readEntry(endPoint, function (expectedData) {
data = fixConstructors(data);
djstest.assertWithoutMetadata(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -127,7 +127,7 @@
var validateExpectedRange = function (cache, data, feed, skipValue, takeValue) {
var expectedRangeUrl = feed + "?$skip=" + skipValue + "&$top=" + takeValue;
- window.ODataReadOracle.readFeed(expectedRangeUrl, function (expectedData) {
+ window.ODataVerifyReader.readFeed(expectedRangeUrl, function (expectedData) {
if (expectedData.results) {
expectedData = expectedData.results;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-read-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-read-functional-tests.html b/odatajs/tests/odata-read-functional-tests.html
index 11d930d..7114113 100644
--- a/odatajs/tests/odata-read-functional-tests.html
+++ b/odatajs/tests/odata-read-functional-tests.html
@@ -30,7 +30,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/ODataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<script type="text/javascript">
window.TestSynchronizer.init(QUnit);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-read-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-read-functional-tests.js b/odatajs/tests/odata-read-functional-tests.js
index 6253856..29f28e4 100644
--- a/odatajs/tests/odata-read-functional-tests.js
+++ b/odatajs/tests/odata-read-functional-tests.js
@@ -78,7 +78,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: feed, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(feed,
+ window.ODataVerifyReader.readFeed(feed,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -94,7 +94,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endPoint,
+ window.ODataVerifyReader.readEntry(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -110,7 +110,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: "./endpoints/FoodStoreDataServiceV4.svc/Foods(1)", headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endPoint,
+ window.ODataVerifyReader.readEntry(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -125,7 +125,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endPoint,
+ window.ODataVerifyReader.readEntry(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -141,7 +141,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endPoint,
+ window.ODataVerifyReader.readEntry(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -157,7 +157,7 @@
var endPoint = feed + "(4)";
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endPoint,
+ window.ODataVerifyReader.readEntry(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -174,7 +174,7 @@
var endPoint = feed + "(5)";
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endPoint,
+ window.ODataVerifyReader.readEntry(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -190,7 +190,7 @@
djstest.assertsExpected(2);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endpoint,
+ window.ODataVerifyReader.readEntry(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data.value, expectedData.value, "Verify inline feed");
djstest.assertAreEqualDeep(data, expectedData, "Verify entry");
@@ -207,7 +207,7 @@
djstest.assertsExpected(2);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(endpoint,
+ window.ODataVerifyReader.readFeed(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data.value, expectedData.value, "Verify inline feed");
djstest.assertAreEqualDeep(data, expectedData, "Verify feed");
@@ -224,7 +224,7 @@
djstest.assertsExpected(2);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endpoint,
+ window.ODataVerifyReader.readEntry(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data.Category, expectedData.Category, "Verify inline entry");
djstest.assertAreEqualDeep(data, expectedData, "Verify entry");
@@ -241,7 +241,7 @@
djstest.assertsExpected(2);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(endpoint,
+ window.ODataVerifyReader.readFeed(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data.value, expectedData.value, "Verify inline data");
djstest.assertAreEqualDeep(data, expectedData, "Verify feed");
@@ -257,7 +257,7 @@
djstest.assertsExpected(2);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(endpoint,
+ window.ODataVerifyReader.readFeed(endpoint,
function (expectedData) {
djstest.assertAreEqual(data["@odata.count"], expectedData["@odata.count"], "Verify count in response data");
djstest.assertAreEqualDeep(data, expectedData, "Verify feed");
@@ -274,7 +274,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endpoint,
+ window.ODataVerifyReader.readEntry(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify select result");
djstest.done();
@@ -289,7 +289,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(endpoint,
+ window.ODataVerifyReader.readFeed(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify select result");
djstest.done();
@@ -304,7 +304,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endpoint,
+ window.ODataVerifyReader.readEntry(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify select result");
djstest.done();
@@ -319,7 +319,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(endpoint,
+ window.ODataVerifyReader.readFeed(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify response data");
djstest.done();
@@ -333,7 +333,7 @@
djstest.assertsExpected(2);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readFeed(endpoint,
+ window.ODataVerifyReader.readFeed(endpoint,
function (expectedData) {
djstest.assertAreEqual(data["@odata.context"], expectedData["@odata.context"], "Verify count in response data");
djstest.assertAreEqualDeep(data, expectedData, "Verify feed");
@@ -348,7 +348,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endpoint,
+ window.ODataVerifyReader.readEntry(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify entry");
djstest.done();
@@ -362,7 +362,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readEntry(endpoint,
+ window.ODataVerifyReader.readEntry(endpoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify entry");
djstest.done();
@@ -435,7 +435,7 @@
var endpoint = "./endpoints/BasicAuthDataService.svc/Customers";
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept }, user: user, password: password }, function (data, response) {
- window.ODataReadOracle.readFeed({ url: endpoint, user: user, password: password }, function (expectedData) {
+ window.ODataVerifyReader.readFeed({ url: endpoint, user: user, password: password }, function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
}, handlerAccept);
@@ -446,7 +446,7 @@
var endpoint = "./endpoints/BasicAuthDataService.svc/Customers(1)";
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: endpoint, headers: { Accept: handlerAccept }, user: user, password: password }, function (data, response) {
- window.ODataReadOracle.readEntry({ url: endpoint, user: user, password: password }, function (expectedData) {
+ window.ODataVerifyReader.readEntry({ url: endpoint, user: user, password: password }, function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
}, handlerAccept);
@@ -467,7 +467,7 @@
djstest.assertsExpected(1);
odatajs.oData.read({ requestUri: params.serviceName, headers: { Accept: params.handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readServiceDocument(serviceName,
+ window.ODataVerifyReader.readServiceDocument(serviceName,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -507,7 +507,7 @@
var endPoint = params.serviceName + "$metadata";
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: params.handlerAccept} },
function (data, response) {
- window.ODataReadOracle.readMetadata(endPoint,
+ window.ODataVerifyReader.readMetadata(endPoint,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -560,7 +560,7 @@
odatajs.oData.read({ requestUri: csdlFile, headers: { Accept: "text/xml"} },
function (data) {
- window.ODataReadOracle.readMetadata(csdlFile,
+ window.ODataVerifyReader.readMetadata(csdlFile,
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-request-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-request-functional-tests.html b/odatajs/tests/odata-request-functional-tests.html
index 4148634..331cf8c 100644
--- a/odatajs/tests/odata-request-functional-tests.html
+++ b/odatajs/tests/odata-request-functional-tests.html
@@ -29,7 +29,7 @@
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="common/TestSynchronizerClient.js"></script>
<script type="text/javascript">
window.TestSynchronizer.init(QUnit);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-request-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-request-functional-tests.js b/odatajs/tests/odata-request-functional-tests.js
index 82e4258..eadb6a6 100644
--- a/odatajs/tests/odata-request-functional-tests.js
+++ b/odatajs/tests/odata-request-functional-tests.js
@@ -51,7 +51,7 @@
djstest.log("Status code:" + response.statusCode);
djstest.assertAreEqual(response.statusCode, httpStatusCode.created, "Verify response code: " + httpOperation);
djstest.log("Uri:" + request.requestUri);
- ODataReadOracle.readEntry(response.headers["Location"], function (expectedData) {
+ ODataVerifyReader.readEntry(response.headers["Location"], function (expectedData) {
djstest.assertAreEqualDeep(response.data, expectedData, "Verify new entry against response: " + httpOperation);
done();
}, request.headers.Accept);
@@ -65,7 +65,7 @@
djstest.log("Status code:" + response.statusCode);
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code: " + httpOperation);
djstest.log("Uri:" + request.requestUri);
- ODataReadOracle.readEntry(request.requestUri, function(actualData) {
+ ODataVerifyReader.readEntry(request.requestUri, function(actualData) {
var requestData = tryRemoveOdataType(request.data);
djstest.assertAreEqualDeep(subset(actualData, requestData), requestData, "Verify updated entry: " + httpOperation);
done();
@@ -76,12 +76,12 @@
var verifyPatch = function (request, done) {
var httpOperation = request.method + " " + request.requestUri;
djstest.log(httpOperation);
- ODataReadOracle.readEntry(request.requestUri, function (originalData) {
+ ODataVerifyReader.readEntry(request.requestUri, function (originalData) {
odatajs.oData.request(request, function (data, response) {
djstest.log("Status code:" + response.statusCode);
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code");
djstest.log("Uri:" + request.requestUri);
- ODataReadOracle.readEntry(request.requestUri, function (actualData) {
+ ODataVerifyReader.readEntry(request.requestUri, function (actualData) {
// Merge the original data with the updated data to get the expected data
var expectedData = $.extend(true, {}, originalData, request.data);
@@ -256,7 +256,7 @@
djstest.assertsExpected(3);
verifyRequest(request, function () {
- ODataReadOracle.readEntry(foodsFeed + "(" + newFood.FoodID + ")", function (actualData) {
+ ODataVerifyReader.readEntry(foodsFeed + "(" + newFood.FoodID + ")", function (actualData) {
djstest.assertAreEqual(actualData.Name, newFood.Name, "Verify inline entities were added");
djstest.done();
}, headers ? headers.Accept : undefined);
@@ -278,7 +278,7 @@
djstest.assertsExpected(3);
verifyRequest(request, function () {
- ODataReadOracle.readEntry(categoriesFeed + "(" + request.data.Category.CategoryID + ")", function (actualData) {
+ ODataVerifyReader.readEntry(categoriesFeed + "(" + request.data.Category.CategoryID + ")", function (actualData) {
djstest.assertAreEqual(actualData.Name, request.data.Category.Name, "Verify inline entities were added");
djstest.done();
}, headers ? headers.Accept : undefined);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odata-roundtrip-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-roundtrip-functional-tests.js b/odatajs/tests/odata-roundtrip-functional-tests.js
index 6e3c356..597c273 100644
--- a/odatajs/tests/odata-roundtrip-functional-tests.js
+++ b/odatajs/tests/odata-roundtrip-functional-tests.js
@@ -41,7 +41,7 @@
var httpOperation = request.method + " " + request.requestUri;
odatajs.oData.request(request, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.created, "Verify response code: " + httpOperation);
- ODataReadOracle.readJson(data.__metadata.uri, function (expectedData) {
+ ODataVerifyReader.readJson(data.__metadata.uri, function (expectedData) {
djstest.assertAreEqualDeep(response.data, expectedData, "Verify new entry against response: " + httpOperation);
done();
}, request.headers.Accept);
@@ -52,7 +52,7 @@
var httpOperation = request.method + " " + request.requestUri;
odatajs.oData.request(request, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code: " + httpOperation);
- ODataReadOracle.readJson(request.requestUri, function (actualData) {
+ ODataVerifyReader.readJson(request.requestUri, function (actualData) {
djstest.assertAreEqualDeep(actualData, request.data, "Verify updated entry: " + httpOperation);
done();
}, request.headers.Accept);
@@ -61,10 +61,10 @@
var verifyMerge = function (request, done) {
var httpOperation = request.method + " " + request.requestUri;
- ODataReadOracle.readJson(request.requestUri, function (originalData) {
+ ODataVerifyReader.readJson(request.requestUri, function (originalData) {
odatajs.oData.request(request, function (data, response) {
djstest.assertAreEqual(response.statusCode, httpStatusCode.noContent, "Verify response code");
- ODataReadOracle.readJson(request.requestUri, function (actualData) {
+ ODataVerifyReader.readJson(request.requestUri, function (actualData) {
// Merge the original data with the updated data to get the expected data
var expectedData = $.extend(true, {}, originalData, request.data);
djstest.assertAreEqualDeep(actualData, expectedData, "Verify merged data");
@@ -323,7 +323,7 @@
function () {
odatajs.oData.read({ requestUri: foodsFeed + "(216)", headers: { Accept: mimeType} },
function (data, response) {
- ODataReadOracle.readJson(foodsFeed + "(216)",
+ ODataVerifyReader.readJson(foodsFeed + "(216)",
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -347,7 +347,7 @@
function () {
odatajs.oData.read({ requestUri: categoriesFeed + "(81)", headers: { Accept: mimeType} },
function (data, response) {
- ODataReadOracle.readJson(categoriesFeed + "(81)",
+ ODataVerifyReader.readJson(categoriesFeed + "(81)",
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
@@ -376,7 +376,7 @@
function () {
odatajs.oData.read({ requestUri: categoriesFeed + "(81)", headers: { Accept: mimeType} },
function (data, response) {
- ODataReadOracle.readJson(categoriesFeed + "(81)",
+ ODataVerifyReader.readJson(categoriesFeed + "(81)",
function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Response data not same as expected");
djstest.done();
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odatajs-cache-large-collection-functional-tests.html b/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
index 746d912..1a0056e 100644
--- a/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
+++ b/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
@@ -40,7 +40,7 @@
<script type="text/javascript" src="common/djstest-browser.js"></script>
<script type="text/javascript" src="common/CacheOracle.js"></script>
<script type="text/javascript" src="common/ObservableHttpClient.js"></script>
- <script type="text/javascript" src="common/ODataReadOracle.js"></script>
+ <script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="odatajs-cache-large-collection-functional-tests.js"></script>
</head>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/b5bcba4e/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odatajs-cache-large-collection-functional-tests.js b/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
index 557510e..a9b37e5 100644
--- a/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
+++ b/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
@@ -144,7 +144,7 @@
cache.readRange(params.skip, params.take).then(function (data) {
var expectedRangeUrl = params.feed + "?$skip=" + params.skip + "&$top=" + params.take;
cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "largeCollection requests with prefetch", false, true);
- window.ODataReadOracle.readJsonAcrossServerPages(expectedRangeUrl, function (expectedData) {
+ window.ODataVerifyReader.readJsonAcrossServerPages(expectedRangeUrl, function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify response data");
});
}, function (err) {
@@ -170,7 +170,7 @@
cache.readRange(params.skip, params.take).then(function (data) {
var expectedRangeUrl = params.feed + "?$skip=" + params.skip + "&$top=" + params.take;
cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "largeCollection requests without prefetch", false, false);
- window.ODataReadOracle.readJsonAcrossServerPages(expectedRangeUrl, function (expectedData) {
+ window.ODataVerifyReader.readJsonAcrossServerPages(expectedRangeUrl, function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify response data");
djstest.done();
});
[4/4] git commit: [OLINGO-418] update JSLib.csproj with new filenames
Posted by ko...@apache.org.
[OLINGO-418] update JSLib.csproj with new filenames
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/ccb8c546
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/ccb8c546
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/ccb8c546
Branch: refs/heads/master
Commit: ccb8c5468335fe576d690d64790c643b5d007cb9
Parents: 4a458d7
Author: Sven Kobler <sv...@sap.com>
Authored: Mon Sep 1 12:03:59 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Mon Sep 1 12:03:59 2014 +0200
----------------------------------------------------------------------
odatajs/JSLib.csproj | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/ccb8c546/odatajs/JSLib.csproj
----------------------------------------------------------------------
diff --git a/odatajs/JSLib.csproj b/odatajs/JSLib.csproj
index a3f6647..27253b1 100644
--- a/odatajs/JSLib.csproj
+++ b/odatajs/JSLib.csproj
@@ -57,7 +57,7 @@
<Content Include="src\lib\store\indexeddb.js" />
<Content Include="src\lib\store\memory.js" />
<Content Include="tests\cache-tests.js" />
- <Content Include="tests\common\CacheOracle.js" />
+ <Content Include="tests\common\CacheVerifier.js" />
<Content Include="tests\common\common.js" />
<Content Include="tests\common\Instrument.svc" />
<Content Include="tests\common\Instrument.js" />
@@ -66,8 +66,8 @@
<Content Include="tests\common\djstest.js" />
<Content Include="tests\common\gpo-ie8-tour-disable.reg" />
<Content Include="tests\common\ObservableHttpClient.js" />
- <Content Include="tests\common\ODataReadOracle.js" />
- <Content Include="tests\common\ODataReadOracle.svc" />
+ <Content Include="tests\common\ODataVerifyReader.js" />
+ <Content Include="tests\common\ODataVerifyReader.svc" />
<Content Include="tests\common\rx.js" />
<Content Include="tests\common\TestLogger.svc" />
<Content Include="tests\common\TestSynchronizerClient.js" />
@@ -138,18 +138,23 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.OData.Client, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.OData.Client.6.5.0\lib\net40\Microsoft.OData.Client.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.OData.Core">
+ <Reference Include="Microsoft.OData.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.OData.Core.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.OData.Edm">
+ <Reference Include="Microsoft.OData.Edm, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.OData.Edm.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OData.Service, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.OData.Service.6.5.0\lib\net40\Microsoft.OData.Service.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.Spatial">
+ <Reference Include="Microsoft.Spatial, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>packages\Microsoft.Spatial.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
</Reference>
<Reference Include="System" />
[3/4] git commit: [OLINGO-416] - avoid commiting temporary objects
Posted by ko...@apache.org.
[OLINGO-416] - avoid commiting temporary objects
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/4a458d71
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/4a458d71
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/4a458d71
Branch: refs/heads/master
Commit: 4a458d71836242a9a4c0ff4e36d21c53dbe24e53
Parents: 3fd8e71
Author: Sven Kobler <sv...@sap.com>
Authored: Mon Sep 1 11:26:56 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Mon Sep 1 11:26:56 2014 +0200
----------------------------------------------------------------------
.gitignore | 1 +
odatajs/.gitignore | 14 +++++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4a458d71/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1521c8b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+dist
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4a458d71/odatajs/.gitignore
----------------------------------------------------------------------
diff --git a/odatajs/.gitignore b/odatajs/.gitignore
index d7c3df6..40682f2 100644
--- a/odatajs/.gitignore
+++ b/odatajs/.gitignore
@@ -1,7 +1,15 @@
-node_modules/
-build
-dist
localgrunt.config
+
+# testing copies
+demo/scripts/odatajs-4.0.0-beta-01*
+
+# build artefacts
+build
+
+# nodejs temporary objects
+node_modules
+
+# C.net server temporary objects
bin/
obj/
packages/
[2/4] git commit: [OLINGO-418] rename CacheOracle -> CacheVerifier
Posted by ko...@apache.org.
[OLINGO-418] rename CacheOracle -> CacheVerifier
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/commit/3fd8e711
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/3fd8e711
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/3fd8e711
Branch: refs/heads/master
Commit: 3fd8e71142e7455d925cabf9139baa4b5082088f
Parents: b5bcba4
Author: Sven Kobler <sv...@sap.com>
Authored: Mon Sep 1 11:22:27 2014 +0200
Committer: Sven Kobler <sv...@sap.com>
Committed: Mon Sep 1 11:22:27 2014 +0200
----------------------------------------------------------------------
odatajs/tests/cache-tests.js | 4 +-
odatajs/tests/code/jsdate.cs | 2 +-
odatajs/tests/common/CacheOracle.js | 241 -------------------
odatajs/tests/common/CacheVerifier.js | 241 +++++++++++++++++++
odatajs/tests/common/ODataVerifyReader.svc | 2 +-
odatajs/tests/common/odataVerifyReader.js | 16 +-
odatajs/tests/endpoints/CustomDataService.svc | 2 +-
.../odata-cache-filter-functional-tests.html | 2 +-
.../odata-cache-filter-functional-tests.js | 32 +--
odatajs/tests/odata-cache-fperf-tests.html | 2 +-
odatajs/tests/odata-cache-fperf-tests.js | 4 +-
odatajs/tests/odata-cache-functional-tests.html | 2 +-
odatajs/tests/odata-cache-functional-tests.js | 26 +-
...odata-metadata-awareness-functional-tests.js | 2 +-
odatajs/tests/odata-qunit-tests.htm | 2 +-
.../odata-read-crossdomain-functional-tests.js | 6 +-
...cache-large-collection-functional-tests.html | 2 +-
...s-cache-large-collection-functional-tests.js | 14 +-
18 files changed, 301 insertions(+), 301 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/cache-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/cache-tests.js b/odatajs/tests/cache-tests.js
index 7e03764..3ace53f 100644
--- a/odatajs/tests/cache-tests.js
+++ b/odatajs/tests/cache-tests.js
@@ -642,13 +642,13 @@
var expectedResults = {};
if (test.backwards) {
cache.filterBack(test.index, test.count, test.predicate).then(function (results) {
- expectedResults = CacheOracle.getExpectedFilterResults(expectData, test.index, test.count, test.predicate, test.backwards);
+ expectedResults = CacheVerifier.getExpectedFilterResults(expectData, test.index, test.count, test.predicate, test.backwards);
djstest.assertAreEqualDeep(results, expectedResults, "results for " + testDescription(test));
doneAfterAllTests();
}, filterErrorCallback);
} else {
cache.filterForward(test.index, test.count, test.predicate).then(function (results) {
- expectedResults = CacheOracle.getExpectedFilterResults(expectData, test.index, test.count, test.predicate, test.backwards);
+ expectedResults = CacheVerifier.getExpectedFilterResults(expectData, test.index, test.count, test.predicate, test.backwards);
djstest.assertAreEqualDeep(results, expectedResults, "results for " + testDescription(test));
doneAfterAllTests();
}, filterErrorCallback);
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/code/jsdate.cs
----------------------------------------------------------------------
diff --git a/odatajs/tests/code/jsdate.cs b/odatajs/tests/code/jsdate.cs
index 06f995d..4439a3a 100644
--- a/odatajs/tests/code/jsdate.cs
+++ b/odatajs/tests/code/jsdate.cs
@@ -18,7 +18,7 @@
*/
/// <summary>
-/// The oracle's representation of a Javascript date object as deserialized by the library
+/// The verifiers's representation of a Javascript date object as deserialized by the library
/// </summary>
namespace DataJS.Tests
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/common/CacheOracle.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/CacheOracle.js b/odatajs/tests/common/CacheOracle.js
deleted file mode 100644
index d34d79f..0000000
--- a/odatajs/tests/common/CacheOracle.js
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-// CacheOracle.js
-// This object verifies the operation of the cache.
-// Internally it maintains a simple model of the cache implemented using a lookup array of the expected cached pages.
-
-(function (window, undefined) {
-
- var CacheOracle = function (baseUri, pageSize, total, cacheSize) {
- /** Creates a new CacheOracle
- * @param {String} baseUri - The base URI of the collection
- * @param {Integer} pageSize - The page size used in the cache
- * @param {Integer} total - The total number of items in the collection
- * @param {Integer} cacheSize - Cache size in bytes
- */
- this.baseUri = baseUri;
- this.pageSize = pageSize;
- this.total = total;
- this.cacheSize = (cacheSize !== undefined) ? cacheSize : 1024 * 1024;
- this.actualSize = 0;
- this.actualCount = 0;
- this.cachedPages = [];
- this.exactPageCount = (total % pageSize === 0);
- this.maxPage = Math.floor(total / pageSize);
- this.overflowed = this.cacheSize === 0;
- };
-
- CacheOracle.mechanisms = {
- memory: "memory",
- indexeddb: "indexeddb",
- dom: "dom",
- best: "best"
- };
-
- CacheOracle.isMechanismAvailable = function (mechanism) {
- /** Determines if the specified local storage mechanism is available
- * @param mechanism - The name of the mechanism
- * @returns Whether the mechanism is available
- */
- switch (mechanism) {
- case CacheOracle.mechanisms.indexeddb:
- if (window.msIndexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.indexedDB) {
- return true;
- }
- else {
- return false;
- }
- break;
- case CacheOracle.mechanisms.dom:
- if (window.localStorage) {
- return true;
- }
- else {
- return false;
- }
- break;
- case CacheOracle.mechanisms.memory:
- case CacheOracle.mechanisms.best:
- case undefined:
- return true;
- default:
- return false;
- }
- }
-
- CacheOracle.prototype.clear = function () {
- /** Clears the cache in the oracle
- */
- this.cachedPages = [];
- this.actualSize = 0;
- this.actualCount = 0;
- this.overflowed = this.cacheSize === 0;
- }
-
- CacheOracle.prototype.verifyRequests = function (requests, responses, index, count, description, backwards, isPrefetch) {
- /** Verifies the HTTP requests for a single data request, and updates the oracle with cached pages
- * @param {Array} requests - The sequence of request objects (from OData.defaultHttpClient)
- * @param {Array} responses - The sequence of response objects (from OData.defaultHttpClient)
- * @param {Integer} index - The starting index of the read
- * @param {Integer} count - The count of items in the read
- * @param {String} description - The description of the requests being verified
- * @param {Boolean} backwards - Whether or not filterBack is being verified
- * @param {Boolean} isPrefetch - Whether the requests being verified come from the prefetcher
- */
- var that = this;
-
- index = (index < 0 ? 0 : index);
- var pageIndex = function (index) {
- /** Returns the page index that the given item index belongs to
- * @param {Integer} index - The item index
- * @returns The page index
- */
- return Math.floor(index / that.pageSize);
- };
-
- var estimateSize = function (obj) {
- /** Estimates the size of an object in bytes.
- * @param {Object} obj - Object to determine the size of.
- * @returns {Number} Estimated size of the object in bytes.
- */
-
- var size = 0;
- var type = typeof obj;
-
- if (type === "object" && obj) {
- for (var name in obj) {
- size += name.length * 2 + estimateSize(obj[name]);
- }
- } else if (type === "string") {
- size = obj.length * 2;
- } else {
- size = 8;
- }
- return size;
- };
-
- var expectedUris = [];
- var responseIndex = 0;
- if (count >= 0) {
- var minPage = pageIndex(index);
- var maxPage = Math.min(pageIndex(index + count - 1), pageIndex(this.total));
-
- // In the case that the index is outside the range of the collection the minPage will be greater than the maxPage
- maxPage = Math.max(minPage, maxPage);
-
- if (!(isPrefetch && !this.exactPageCount && minPage > this.maxPage)) {
- for (var page = minPage; page <= maxPage && this.actualCount <= this.total && !(isPrefetch && this.overflowed); page++) {
- if (!this.cachedPages[page]) {
-
- expectedUris.push(that.baseUri + "?$skip=" + page * this.pageSize + "&$top=" + (this.pageSize));
-
- var actualPageSize = 0;
- var actualPageCount = 0;
- if (responses[responseIndex] && responses[responseIndex].data) {
- actualPageSize += estimateSize(responses[responseIndex].data);
- actualPageCount += responses[responseIndex].data.value.length;
- // Handle server paging skipToken requests
- while (responses[responseIndex].data["@odata.nextLink"]) {
- var nextLink = responses[responseIndex].data["@odata.nextLink"];
- if (nextLink) {
- var index = that.baseUri.indexOf(".svc/", 0);
- if (index != -1) {
- nextLink = that.baseUri.substring(0, index + 5) + nextLink;
- }
- }
-
- expectedUris.push(nextLink);
- responseIndex++;
- actualPageSize += estimateSize(responses[responseIndex].data);
- actualPageCount += responses[responseIndex].data.value.length;
- }
-
- actualPageSize += 24; // 24 byte overhead for the pages (i)ndex, and (c)ount fields
- }
-
- responseIndex++;
-
- this.overflowed = this.cacheSize >= 0 && this.actualSize + actualPageSize > this.cacheSize;
- if (!this.overflowed) {
- this.cachedPages[page] = true;
- this.actualSize += actualPageSize;
- this.actualCount += actualPageCount;
- }
- }
- }
- }
- }
-
- if (backwards) {
- expectedUris.reverse();
- }
-
- var actualUris = $.map(requests, function (r) { return r.requestUri; });
- djstest.assertAreEqualDeep(actualUris, expectedUris, description);
- };
-
- CacheOracle.getExpectedFilterResults = function (data, filterIndex, filterCount, predicate, backwards) {
- /** Verifies the cache filter returns the correct data
- * @param {Array} collection - Array of items in the collection
- * @param {Integer} filterIndex - The index value
- * @param {Integer} filterCount - The count value
- * @param {Function} predicate - Predicate to be applied in filter, takes an item
- * @param {Boolean} backwards - Whether or not filterBackwards is being verified
- */
- if (!data || !data.value) {
- return data;
- }
-
- var value = [];
- if (filterCount !== 0) {
- // Convert [item0, item1, ...] into [{ index: 0, item: item0 }, { index: 1, item: item1 }, ...]
- var indexedCollection = $.map(data.value, function (item, index) {
- return { index: index, item: item };
- });
-
- var grepPredicate = function (element, index) {
- return predicate(element.item);
- };
-
- var index = filterIndex < 0 ? 0 : filterIndex;
- var count = filterCount < 0 ? indexedCollection.length : filterCount;
-
- value = backwards ?
- // Slice up to 'index', filter, then slice 'count' number of items from the end
- $.grep(indexedCollection.slice(0, index + 1), grepPredicate).slice(-count) :
- // Slice from 'index' to the end, filter, then slice 'count' number of items from the beginning
- $.grep(indexedCollection.slice(index), grepPredicate).slice(0, count);
- }
-
- var expectedResults = {};
- for (var property in data) {
- if (property == "value") {
- expectedResults[property] = value;
- } else {
- expectedResults[property] = data[property];
- }
- }
-
- return expectedResults;
- };
-
- window.CacheOracle = CacheOracle;
-
-})(this);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/common/CacheVerifier.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/CacheVerifier.js b/odatajs/tests/common/CacheVerifier.js
new file mode 100644
index 0000000..1e9f0d4
--- /dev/null
+++ b/odatajs/tests/common/CacheVerifier.js
@@ -0,0 +1,241 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// CacheVerifier.js
+// This object verifies the operation of the cache.
+// Internally it maintains a simple model of the cache implemented using a lookup array of the expected cached pages.
+
+(function (window, undefined) {
+
+ var CacheVerifier = function (baseUri, pageSize, total, cacheSize) {
+ /** Creates a new CacheVerifier
+ * @param {String} baseUri - The base URI of the collection
+ * @param {Integer} pageSize - The page size used in the cache
+ * @param {Integer} total - The total number of items in the collection
+ * @param {Integer} cacheSize - Cache size in bytes
+ */
+ this.baseUri = baseUri;
+ this.pageSize = pageSize;
+ this.total = total;
+ this.cacheSize = (cacheSize !== undefined) ? cacheSize : 1024 * 1024;
+ this.actualSize = 0;
+ this.actualCount = 0;
+ this.cachedPages = [];
+ this.exactPageCount = (total % pageSize === 0);
+ this.maxPage = Math.floor(total / pageSize);
+ this.overflowed = this.cacheSize === 0;
+ };
+
+ CacheVerifier.mechanisms = {
+ memory: "memory",
+ indexeddb: "indexeddb",
+ dom: "dom",
+ best: "best"
+ };
+
+ CacheVerifier.isMechanismAvailable = function (mechanism) {
+ /** Determines if the specified local storage mechanism is available
+ * @param mechanism - The name of the mechanism
+ * @returns Whether the mechanism is available
+ */
+ switch (mechanism) {
+ case CacheVerifier.mechanisms.indexeddb:
+ if (window.msIndexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.indexedDB) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ break;
+ case CacheVerifier.mechanisms.dom:
+ if (window.localStorage) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ break;
+ case CacheVerifier.mechanisms.memory:
+ case CacheVerifier.mechanisms.best:
+ case undefined:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ CacheVerifier.prototype.clear = function () {
+ /** Clears the cache in the verifier
+ */
+ this.cachedPages = [];
+ this.actualSize = 0;
+ this.actualCount = 0;
+ this.overflowed = this.cacheSize === 0;
+ }
+
+ CacheVerifier.prototype.verifyRequests = function (requests, responses, index, count, description, backwards, isPrefetch) {
+ /** Verifies the HTTP requests for a single data request, and updates the verifier with cached pages
+ * @param {Array} requests - The sequence of request objects (from OData.defaultHttpClient)
+ * @param {Array} responses - The sequence of response objects (from OData.defaultHttpClient)
+ * @param {Integer} index - The starting index of the read
+ * @param {Integer} count - The count of items in the read
+ * @param {String} description - The description of the requests being verified
+ * @param {Boolean} backwards - Whether or not filterBack is being verified
+ * @param {Boolean} isPrefetch - Whether the requests being verified come from the prefetcher
+ */
+ var that = this;
+
+ index = (index < 0 ? 0 : index);
+ var pageIndex = function (index) {
+ /** Returns the page index that the given item index belongs to
+ * @param {Integer} index - The item index
+ * @returns The page index
+ */
+ return Math.floor(index / that.pageSize);
+ };
+
+ var estimateSize = function (obj) {
+ /** Estimates the size of an object in bytes.
+ * @param {Object} obj - Object to determine the size of.
+ * @returns {Number} Estimated size of the object in bytes.
+ */
+
+ var size = 0;
+ var type = typeof obj;
+
+ if (type === "object" && obj) {
+ for (var name in obj) {
+ size += name.length * 2 + estimateSize(obj[name]);
+ }
+ } else if (type === "string") {
+ size = obj.length * 2;
+ } else {
+ size = 8;
+ }
+ return size;
+ };
+
+ var expectedUris = [];
+ var responseIndex = 0;
+ if (count >= 0) {
+ var minPage = pageIndex(index);
+ var maxPage = Math.min(pageIndex(index + count - 1), pageIndex(this.total));
+
+ // In the case that the index is outside the range of the collection the minPage will be greater than the maxPage
+ maxPage = Math.max(minPage, maxPage);
+
+ if (!(isPrefetch && !this.exactPageCount && minPage > this.maxPage)) {
+ for (var page = minPage; page <= maxPage && this.actualCount <= this.total && !(isPrefetch && this.overflowed); page++) {
+ if (!this.cachedPages[page]) {
+
+ expectedUris.push(that.baseUri + "?$skip=" + page * this.pageSize + "&$top=" + (this.pageSize));
+
+ var actualPageSize = 0;
+ var actualPageCount = 0;
+ if (responses[responseIndex] && responses[responseIndex].data) {
+ actualPageSize += estimateSize(responses[responseIndex].data);
+ actualPageCount += responses[responseIndex].data.value.length;
+ // Handle server paging skipToken requests
+ while (responses[responseIndex].data["@odata.nextLink"]) {
+ var nextLink = responses[responseIndex].data["@odata.nextLink"];
+ if (nextLink) {
+ var index = that.baseUri.indexOf(".svc/", 0);
+ if (index != -1) {
+ nextLink = that.baseUri.substring(0, index + 5) + nextLink;
+ }
+ }
+
+ expectedUris.push(nextLink);
+ responseIndex++;
+ actualPageSize += estimateSize(responses[responseIndex].data);
+ actualPageCount += responses[responseIndex].data.value.length;
+ }
+
+ actualPageSize += 24; // 24 byte overhead for the pages (i)ndex, and (c)ount fields
+ }
+
+ responseIndex++;
+
+ this.overflowed = this.cacheSize >= 0 && this.actualSize + actualPageSize > this.cacheSize;
+ if (!this.overflowed) {
+ this.cachedPages[page] = true;
+ this.actualSize += actualPageSize;
+ this.actualCount += actualPageCount;
+ }
+ }
+ }
+ }
+ }
+
+ if (backwards) {
+ expectedUris.reverse();
+ }
+
+ var actualUris = $.map(requests, function (r) { return r.requestUri; });
+ djstest.assertAreEqualDeep(actualUris, expectedUris, description);
+ };
+
+ CacheVerifier.getExpectedFilterResults = function (data, filterIndex, filterCount, predicate, backwards) {
+ /** Verifies the cache filter returns the correct data
+ * @param {Array} collection - Array of items in the collection
+ * @param {Integer} filterIndex - The index value
+ * @param {Integer} filterCount - The count value
+ * @param {Function} predicate - Predicate to be applied in filter, takes an item
+ * @param {Boolean} backwards - Whether or not filterBackwards is being verified
+ */
+ if (!data || !data.value) {
+ return data;
+ }
+
+ var value = [];
+ if (filterCount !== 0) {
+ // Convert [item0, item1, ...] into [{ index: 0, item: item0 }, { index: 1, item: item1 }, ...]
+ var indexedCollection = $.map(data.value, function (item, index) {
+ return { index: index, item: item };
+ });
+
+ var grepPredicate = function (element, index) {
+ return predicate(element.item);
+ };
+
+ var index = filterIndex < 0 ? 0 : filterIndex;
+ var count = filterCount < 0 ? indexedCollection.length : filterCount;
+
+ value = backwards ?
+ // Slice up to 'index', filter, then slice 'count' number of items from the end
+ $.grep(indexedCollection.slice(0, index + 1), grepPredicate).slice(-count) :
+ // Slice from 'index' to the end, filter, then slice 'count' number of items from the beginning
+ $.grep(indexedCollection.slice(index), grepPredicate).slice(0, count);
+ }
+
+ var expectedResults = {};
+ for (var property in data) {
+ if (property == "value") {
+ expectedResults[property] = value;
+ } else {
+ expectedResults[property] = data[property];
+ }
+ }
+
+ return expectedResults;
+ };
+
+ window.CacheVerifier = CacheVerifier;
+
+})(this);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/common/ODataVerifyReader.svc
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/ODataVerifyReader.svc b/odatajs/tests/common/ODataVerifyReader.svc
index 101cf36..6b71acf 100644
--- a/odatajs/tests/common/ODataVerifyReader.svc
+++ b/odatajs/tests/common/ODataVerifyReader.svc
@@ -42,7 +42,7 @@ namespace DataJS.Tests
using System.Web.Script.Serialization;
/// <summary>
- /// Oracle for the OData.read library function
+ /// Verifier for the OData.read library function
/// </summary>
[ServiceContract]
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/common/odataVerifyReader.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/common/odataVerifyReader.js b/odatajs/tests/common/odataVerifyReader.js
index 4e25568..bad1e51 100644
--- a/odatajs/tests/common/odataVerifyReader.js
+++ b/odatajs/tests/common/odataVerifyReader.js
@@ -18,7 +18,7 @@
*/
-// Client for the odata.read oracle service
+// Client for the odata.read verifier service
(function (window, undefined) {
var jsonMime = "application/json";
@@ -31,7 +31,7 @@
* @param {String} mimeType - The MIME media type in the Accept header
*/
var readMethod = getReadMethod(mimeType);
- oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, function (data) {
+ verifyRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, function (data) {
success(data);
});
};
@@ -43,7 +43,7 @@
* @param {String} mimeType - The MIME media type in the Accept header
*/
var readMethod = getReadMethod(mimeType);
- oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, success);
+ verifyRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, recognizeDates, success);
};
var readLinksEntry = function (url, success) {
@@ -75,7 +75,7 @@
* @param {String} url - The URL to read the metadata from
* @param {Function} success - The success callback function
*/
- oracleRequest("GET", "ReadMetadata", typeof url === "string" ? { url: url} : url, null, null, success);
+ verifyRequest("GET", "ReadMetadata", typeof url === "string" ? { url: url} : url, null, null, success);
};
var readServiceDocument = function (url, success, mimeType) {
@@ -85,7 +85,7 @@
* @param {String} mimeType - The MIME type being tested
*/
var readMethod = getReadMethod(mimeType);
- oracleRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, null, success);
+ verifyRequest("GET", readMethod, typeof url === "string" ? { url: url} : url, mimeType, null, success);
};
var readJson = function (url, success) {
@@ -147,10 +147,10 @@
}
};
- var oracleRequest = function (method, endpoint, data, mimeType, recognizeDates, success) {
- /** Requests a JSON object from the oracle service, removing WCF-specific artifacts
+ var verifyRequest = function (method, endpoint, data, mimeType, recognizeDates, success) {
+ /** Requests a JSON object from the verifier service, removing WCF-specific artifacts
* @param {String} method - The HTTP method (GET or POST)
- * @param {String} endpoint - The oracle endpoint
+ * @param {String} endpoint - The verifier endpoint
* @param {Object} data - The data to send with the request
* @param {Function} reviver - The reviver function to run on each deserialized object
* @param {Function} success - Success callback
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/endpoints/CustomDataService.svc
----------------------------------------------------------------------
diff --git a/odatajs/tests/endpoints/CustomDataService.svc b/odatajs/tests/endpoints/CustomDataService.svc
index 67fcfd0..cfeb963 100644
--- a/odatajs/tests/endpoints/CustomDataService.svc
+++ b/odatajs/tests/endpoints/CustomDataService.svc
@@ -49,7 +49,7 @@ namespace DataJS.Tests
Name = "Item " + i
}).ToArray();
- // This uses the same URI template as OData so that the CacheOracle can be reused
+ // This uses the same URI template as OData so that the CacheVerifier can be reused
[OperationContract]
[WebGet(UriTemplate = "ReadRange?$skip={skip}&$top={top}")]
public Stream ReadRange(int skip, int top)
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-cache-filter-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-filter-functional-tests.html b/odatajs/tests/odata-cache-filter-functional-tests.html
index 6e25f80..35fbd08 100644
--- a/odatajs/tests/odata-cache-filter-functional-tests.html
+++ b/odatajs/tests/odata-cache-filter-functional-tests.html
@@ -38,7 +38,7 @@
<script type="text/javascript" src="../build/odatajs-4.0.0-beta-01.js"></script>
<script type="text/javascript" src="common/common.js"></script>
<script type="text/javascript" src="common/djstest.js"></script>
- <script type="text/javascript" src="common/CacheOracle.js"></script>
+ <script type="text/javascript" src="common/CacheVerifier.js"></script>
<script type="text/javascript" src="common/ObservableHttpClient.js"></script>
<script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="odata-cache-filter-functional-tests.js"></script>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-cache-filter-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-filter-functional-tests.js b/odatajs/tests/odata-cache-filter-functional-tests.js
index c9024d2..5b344b8 100644
--- a/odatajs/tests/odata-cache-filter-functional-tests.js
+++ b/odatajs/tests/odata-cache-filter-functional-tests.js
@@ -142,7 +142,7 @@
};
};
- var validateFilterResultsAndRequests = function (feed, cache, index, count, predicate, finished, backwards, session, cacheOracle) {
+ var validateFilterResultsAndRequests = function (feed, cache, index, count, predicate, finished, backwards, session, cacheVerifier) {
/** Runs filter and validates the results and network requests
* @param {Object} feed - The feed being read from
* @param {Object} cache - The cache to perform the filter on
@@ -151,7 +151,7 @@
* @param {Object} predicate - Filter string to append to the feed to validate the predicate
* @param {Function} finished - Callback function called after data is verified
* @param {Object} session - Session object to validate the network requests
- * @param {Object} cacheOracle - cacheOracle object to validate the network requests
+ * @param {Object} cacheVerifier - CacheVerifier object to validate the network requests
*/
if (count < 0) {
@@ -165,10 +165,10 @@
window.ODataVerifyReader.readJsonAcrossServerPages(feed, function (expectData) {
if (backwards) {
cache.filterBack(index, count, predicate).then(function (actualResults) {
- var expectedResults = CacheOracle.getExpectedFilterResults(expectData, index, count, predicate, backwards);
+ var expectedResults = CacheVerifier.getExpectedFilterResults(expectData, index, count, predicate, backwards);
djstest.assertAreEqualDeep(actualResults, expectedResults, "results for " + "filterBack requests");
- if (session && cacheOracle) {
+ if (session && cacheVerifier) {
// If the count is not satisfied in the expected results, read to the beginning of the collection
// otherwise read to the first expected index
var firstIndex = 0;
@@ -177,17 +177,17 @@
}
// The effective count is the number of items between the first and last index
var expectedCount = index - firstIndex + 1;
- cacheOracle.verifyRequests(session.requests, session.responses, firstIndex, expectedCount, "filterBack requests", backwards);
+ cacheVerifier.verifyRequests(session.requests, session.responses, firstIndex, expectedCount, "filterBack requests", backwards);
}
finished();
});
}
else {
cache.filterForward(index, count, predicate).then(function (actualResults) {
- var expectedResults = CacheOracle.getExpectedFilterResults(expectData, index, count, predicate, backwards)
+ var expectedResults = CacheVerifier.getExpectedFilterResults(expectData, index, count, predicate, backwards)
djstest.assertAreEqualDeep(actualResults, expectedResults, "results for " + "filterForward requests");
- if (session && cacheOracle) {
+ if (session && cacheVerifier) {
if (expectedResults.value.length > 0) {
// If the count is not satisfied in the expected results, read to the end of the collection
// otherwise read to the last index
@@ -199,7 +199,7 @@
var expectedCount = itemsInCollection;
}
- cacheOracle.verifyRequests(session.requests, session.responses, index, expectedCount, "filterForward requests", backwards);
+ cacheVerifier.verifyRequests(session.requests, session.responses, index, expectedCount, "filterForward requests", backwards);
}
finished();
});
@@ -223,9 +223,9 @@
var options = { name: "cache" + new Date().valueOf(), source: params.feed, pageSize: params.pageSize, prefetchSize: params.prefetchSize };
var cache = odatajs.cache.createDataCache(options);
- var cacheOracle = new CacheOracle(params.feed, params.pageSize, itemsInCollection);
+ var cacheVerifier = new CacheVerifier(params.feed, params.pageSize, itemsInCollection);
var session = this.observableHttpClient.newSession();
- validateFilterResultsAndRequests(params.feed, cache, params.index, params.count, params.predicate, function () { djstest.destroyCacheAndDone(cache) }, params.backwards, session, cacheOracle);
+ validateFilterResultsAndRequests(params.feed, cache, params.index, params.count, params.predicate, function () { djstest.destroyCacheAndDone(cache) }, params.backwards, session, cacheVerifier);
};
var filterAfterReadRangeTest = function (params) {
@@ -233,13 +233,13 @@
var options = { name: "cache" + new Date().valueOf(), source: params.feed, pageSize: params.pageSize, prefetchSize: params.prefetchSize };
var cache = odatajs.cache.createDataCache(options);
- var cacheOracle = new CacheOracle(params.feed, params.pageSize, itemsInCollection);
+ var cacheVerifier = new CacheVerifier(params.feed, params.pageSize, itemsInCollection);
var session = this.observableHttpClient.newSession();
cache.readRange(params.skip, params.take).then(function (data) {
- cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "readRange requests");
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.skip, params.take, "readRange requests");
session.clear();
- validateFilterResultsAndRequests(params.feed, cache, params.index, params.count, params.predicate, function () { djstest.destroyCacheAndDone(cache); }, params.backwards, session, cacheOracle);
+ validateFilterResultsAndRequests(params.feed, cache, params.index, params.count, params.predicate, function () { djstest.destroyCacheAndDone(cache); }, params.backwards, session, cacheVerifier);
});
};
@@ -267,7 +267,7 @@
var options = { name: "cache" + new Date().valueOf(), source: params.feed, pageSize: params.pageSize, prefetchSize: params.prefetchSize };
var cache = odatajs.cache.createDataCache(options);
- var cacheOracle = new CacheOracle(params.feed, params.pageSize, itemsInCollection);
+ var cacheVerifier = new CacheVerifier(params.feed, params.pageSize, itemsInCollection);
var session = this.observableHttpClient.newSession();
var filterMethod = function (index, count, predicate, backwards) {
@@ -284,8 +284,8 @@
validateFilterResultsAndRequests(params.feed, cache, params.firstIndex, params.firstCount, params.predicate,
function () {
session.clear();
- validateFilterResultsAndRequests(params.feed, cache, params.secondIndex, params.secondCount, params.predicate, function () { djstest.destroyCacheAndDone(cache) }, params.backwards, session, cacheOracle);
- }, params.backwards, session, cacheOracle);
+ validateFilterResultsAndRequests(params.feed, cache, params.secondIndex, params.secondCount, params.predicate, function () { djstest.destroyCacheAndDone(cache) }, params.backwards, session, cacheVerifier);
+ }, params.backwards, session, cacheVerifier);
});
};
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-cache-fperf-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-fperf-tests.html b/odatajs/tests/odata-cache-fperf-tests.html
index c00a814..f0ecd21 100644
--- a/odatajs/tests/odata-cache-fperf-tests.html
+++ b/odatajs/tests/odata-cache-fperf-tests.html
@@ -37,7 +37,7 @@
</script>
<script type="text/javascript" src="../build/odatajs-4.0.0-beta-01.js"></script>
<script type="text/javascript" src="common/common.js"></script>
- <script type="text/javascript" src="common/CacheOracle.js"></script>
+ <script type="text/javascript" src="common/CacheVerifier.js"></script>
<script type="text/javascript" src="common/djstest.js"></script>
<script type="text/javascript" src="odata-cache-fperf-tests.js"></script>
</head>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-cache-fperf-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-fperf-tests.js b/odatajs/tests/odata-cache-fperf-tests.js
index cfb698c..31bb5f8 100644
--- a/odatajs/tests/odata-cache-fperf-tests.js
+++ b/odatajs/tests/odata-cache-fperf-tests.js
@@ -90,8 +90,8 @@
};
};
- $.each(CacheOracle.mechanisms, function (_, mechanism) {
- if (mechanism !== "best" && CacheOracle.isMechanismAvailable(mechanism)) {
+ $.each(CacheVerifier.mechanisms, function (_, mechanism) {
+ if (mechanism !== "best" && CacheVerifier.isMechanismAvailable(mechanism)) {
$.each(feeds, function (_, feed) {
djstest.addTest(cacheReadRangeWallClockTest(2, 1000, mechanism, feed.uri, 5, 0, function () {
return { index: 0, count: 5 };
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-cache-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-functional-tests.html b/odatajs/tests/odata-cache-functional-tests.html
index 0a5618b..ad328ab 100644
--- a/odatajs/tests/odata-cache-functional-tests.html
+++ b/odatajs/tests/odata-cache-functional-tests.html
@@ -38,7 +38,7 @@
<script type="text/javascript" src="../build/odatajs-4.0.0-beta-01.js"></script>
<script type="text/javascript" src="common/common.js"></script>
<script type="text/javascript" src="common/djstest.js"></script>
- <script type="text/javascript" src="common/CacheOracle.js"></script>
+ <script type="text/javascript" src="common/CacheVerifier.js"></script>
<script type="text/javascript" src="common/ObservableHttpClient.js"></script>
<script type="text/javascript" src="common/odataVerifyReader.js"></script>
<script type="text/javascript" src="odata-cache-functional-tests.js"></script>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-cache-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-cache-functional-tests.js b/odatajs/tests/odata-cache-functional-tests.js
index 4e4b4dd..c787bbf 100644
--- a/odatajs/tests/odata-cache-functional-tests.js
+++ b/odatajs/tests/odata-cache-functional-tests.js
@@ -187,9 +187,9 @@
var cache = this.createAndAddCache(options);
var session = typeof params.source === "string" ? this.observableHttpClient.newSession() : new Session(params.source);
- var cacheOracle = new CacheOracle(params.source, params.pageSize, itemsInCollection, params.cacheSize);
+ var cacheVerifier = new CacheVerifier(params.source, params.pageSize, itemsInCollection, params.cacheSize);
cache.readRange(params.skip, params.take).then(function (data) {
- cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "readRange requests");
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.skip, params.take, "readRange requests");
validateExpectedRange(cache, data, params.source, params.skip, params.take, function () {
djstest.destroyCacheAndDone(cache);
});
@@ -223,11 +223,11 @@
djstest.assertsExpected(4);
var options = { name: "cache" + new Date().valueOf(), source: params.source, pageSize: params.pageSize, prefetchSize: params.prefetchSize, cacheSize: params.cacheSize };
- var cacheOracle = new CacheOracle(params.source, params.pageSize, itemsInCollection, params.cacheSize);
+ var cacheVerifier = new CacheVerifier(params.source, params.pageSize, itemsInCollection, params.cacheSize);
var secondRead = function () {
session.clear();
cache.readRange(params.secondSkip, params.secondTake).then(function (data) {
- cacheOracle.verifyRequests(session.requests, session.responses, params.secondSkip, params.secondTake, "Second readRange requests");
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.secondSkip, params.secondTake, "Second readRange requests");
validateExpectedRange(cache, data, params.source, params.secondSkip, params.secondTake, djstest.done);
}, makeUnexpectedErrorHandler(cache));
};
@@ -235,11 +235,11 @@
var cache = this.createAndAddCache(options);
var session = typeof params.source === "string" ? this.observableHttpClient.newSession() : new Session(params.source);
cache.readRange(params.firstSkip, params.firstTake).then(function (data) {
- cacheOracle.verifyRequests(session.requests, session.responses, params.firstSkip, params.firstTake, "First readRange requests");
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.firstSkip, params.firstTake, "First readRange requests");
validateExpectedRange(cache, data, params.source, params.firstSkip, params.firstTake, function () {
if (params.destroyCacheBetweenReads === true) {
cache.clear().then(function () {
- cacheOracle.clear();
+ cacheVerifier.clear();
secondRead();
}, function (err) {
djstest.fail("Error destroying the cache: " + djstest.toString(err));
@@ -265,16 +265,16 @@
var cache = this.createAndAddCache(options);
var session = typeof params.source === "string" ? this.observableHttpClient.newSession() : new Session(params.source);
- var cacheOracle = new CacheOracle(params.source, params.pageSize, itemsInCollection, params.cacheSize);
+ var cacheVerifier = new CacheVerifier(params.source, params.pageSize, itemsInCollection, params.cacheSize);
cache.readRange(params.skip, params.take).then(function (data) {
- cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "readRange requests");
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.skip, params.take, "readRange requests");
session.clear();
}, makeUnexpectedErrorHandler(cache));
cache.onidle = function () {
var prefetchSize = params.prefetchSize < 0 ? itemsInCollection : params.prefetchSize;
- cacheOracle.verifyRequests(session.requests, session.responses, params.skip + params.take, prefetchSize, "prefetch requests", false, true);
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.skip + params.take, prefetchSize, "prefetch requests", false, true);
cache.onidle = false;
djstest.destroyCacheAndDone(cache);
};
@@ -307,8 +307,8 @@
var that = this;
var storeCleanup = [];
- $.each(CacheOracle.mechanisms, function (_, mechanism) {
- if (CacheOracle.isMechanismAvailable(mechanism)) {
+ $.each(CacheVerifier.mechanisms, function (_, mechanism) {
+ if (CacheVerifier.isMechanismAvailable(mechanism)) {
storeCleanup.push(function (done) {
if (storageMechanisms[mechanism]) {
storageMechanisms[mechanism].cleanup.call(that, done);
@@ -379,9 +379,9 @@
}
});
- $.each(CacheOracle.mechanisms, function (_, mechanism) {
+ $.each(CacheVerifier.mechanisms, function (_, mechanism) {
var parameters = { mechanism: mechanism, source: sources[1].source, take: 5, skip: 0, pageSize: 5, prefetchSize: 5 };
- if (CacheOracle.isMechanismAvailable(mechanism)) {
+ if (CacheVerifier.isMechanismAvailable(mechanism)) {
djstest.addTest(dataCacheSingleReadRangeTest, "Specified mechanism: " + parameters.mechanism + createSingleReadTestName(parameters), parameters);
}
else {
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-metadata-awareness-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-metadata-awareness-functional-tests.js b/odatajs/tests/odata-metadata-awareness-functional-tests.js
index 1f5638d..cdd2e5e 100644
--- a/odatajs/tests/odata-metadata-awareness-functional-tests.js
+++ b/odatajs/tests/odata-metadata-awareness-functional-tests.js
@@ -228,7 +228,7 @@
OData.jsonHandler.recognizeDates = params.recognizeDates;
odatajs.oData.read(foodStoreDataService + "/$metadata", function (metadata) {
odatajs.oData.read({ requestUri: specialDaysEndpoint, headers: { Accept: params.accept} }, function (data, response) {
- // Because our oracle isn't metadata aware, it is not 100% correct, so we will pass in recognizeDates = true
+ // Because our verifier isn't metadata aware, it is not 100% correct, so we will pass in recognizeDates = true
// in all cases and manually fix up the property that was incorrectly converted
window.ODataVerifyReader.readFeed(specialDaysEndpoint, function (expectedData) {
// Fix up the string property that has a "date-like" string deliberately injected
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-qunit-tests.htm
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-qunit-tests.htm b/odatajs/tests/odata-qunit-tests.htm
index 6d2de29..066f221 100644
--- a/odatajs/tests/odata-qunit-tests.htm
+++ b/odatajs/tests/odata-qunit-tests.htm
@@ -50,7 +50,7 @@
<script type="text/javascript" src="./common/djstest.js"></script>
<script type="text/javascript" src="./common/djstest-browser.js"></script>
- <script type="text/javascript" src="./common/CacheOracle.js"></script>
+ <script type="text/javascript" src="./common/CacheVerifier.js"></script>
<!--bingl: disable the failure test case. Will fix them in the next change set-->
<!-- <script type="text/javascript" src="odata-tests.js"></script>-->
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odata-read-crossdomain-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odata-read-crossdomain-functional-tests.js b/odatajs/tests/odata-read-crossdomain-functional-tests.js
index 06dcfa1..cf8b45c 100644
--- a/odatajs/tests/odata-read-crossdomain-functional-tests.js
+++ b/odatajs/tests/odata-read-crossdomain-functional-tests.js
@@ -29,7 +29,7 @@
*/
/// When using IE9 or a non-IE browser, the JSONP support in the library creates objects in a separate IFRAME,
- /// causing the constructor property to be different to that of objects created by the oracle. This function
+ /// causing the constructor property to be different to that of objects created by the verifier. This function
/// stringifies and then re-parses the object, which fixes the constructors.
if (!window.ActiveXObject || window.DOMParser) {
@@ -77,7 +77,7 @@
djstest.log("Reading data over the wire.");
odatajs.oData.read(request, function (data, response) {
- djstest.log("Verifying data over the wire from Oracle.");
+ djstest.log("Verifying data over the wire from verifiert.");
window.ODataVerifyReader.readFeed(azureOdataFeed, function (expectedData) {
data = fixConstructors(data);
djstest.assertWithoutMetadata(data, expectedData, "Response data not same as expected");
@@ -92,7 +92,7 @@
djstest.assertsExpected(1);
djstest.log("Reading data over the wire.");
odatajs.oData.read({ requestUri: endPoint, headers: { Accept: handlerAccept} }, function (data, response) {
- djstest.log("Verifying data over the wire from Oracle.");
+ djstest.log("Verifying data over the wire from verifier.");
window.ODataVerifyReader.readEntry(endPoint, function (expectedData) {
data = fixConstructors(data);
djstest.assertWithoutMetadata(data, expectedData, "Response data not same as expected");
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
----------------------------------------------------------------------
diff --git a/odatajs/tests/odatajs-cache-large-collection-functional-tests.html b/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
index 1a0056e..9415305 100644
--- a/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
+++ b/odatajs/tests/odatajs-cache-large-collection-functional-tests.html
@@ -38,7 +38,7 @@
<script type="text/javascript" src="common/djstest.js"></script>
<script type="text/javascript" src="common/djstest-browser.js"></script>
- <script type="text/javascript" src="common/CacheOracle.js"></script>
+ <script type="text/javascript" src="common/CacheVerifier.js"></script>
<script type="text/javascript" src="common/ObservableHttpClient.js"></script>
<script type="text/javascript" src="common/odataVerifyReader.js"></script>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/3fd8e711/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
----------------------------------------------------------------------
diff --git a/odatajs/tests/odatajs-cache-large-collection-functional-tests.js b/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
index a9b37e5..6a18d2d 100644
--- a/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
+++ b/odatajs/tests/odatajs-cache-large-collection-functional-tests.js
@@ -60,8 +60,8 @@
var that = this;
var storeCleanup = [];
- $.each(CacheOracle.mechanisms, function(_, mechanism) {
- if (CacheOracle.isMechanismAvailable(mechanism)) {
+ $.each(CacheVerifier.mechanisms, function(_, mechanism) {
+ if (CacheVerifier.isMechanismAvailable(mechanism)) {
storeCleanup.push(function(done) {
if (storageMechanisms[mechanism]) {
storageMechanisms[mechanism].cleanup.call(that, done);
@@ -118,7 +118,7 @@
});
$.each(["dom", "indexeddb"], function (_, mechanism) {
- if (CacheOracle.isMechanismAvailable(mechanism)) {
+ if (CacheVerifier.isMechanismAvailable(mechanism)) {
$.each([-1, 10 * 1024 * 1024, 1024 * 10248], function (_, cacheSize) {
var prefetchParameters = { mechanism: mechanism, feed: largeCollectionFeed, skip: 0, take: 5, pageSize: 1024, prefetchSize: -1, cacheSize: cacheSize };
djstest.addTest(function (params) {
@@ -138,12 +138,12 @@
djstest.done();
};
- var cacheOracle = new CacheOracle(params.feed, params.pageSize, itemsInCollection);
+ var cacheVerifier = new CacheVerifier(params.feed, params.pageSize, itemsInCollection);
var session = this.observableHttpClient.newSession();
cache.readRange(params.skip, params.take).then(function (data) {
var expectedRangeUrl = params.feed + "?$skip=" + params.skip + "&$top=" + params.take;
- cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "largeCollection requests with prefetch", false, true);
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.skip, params.take, "largeCollection requests with prefetch", false, true);
window.ODataVerifyReader.readJsonAcrossServerPages(expectedRangeUrl, function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify response data");
});
@@ -164,12 +164,12 @@
var cache = odatajs.cache.createDataCache(options);
this.caches.push({ name: options.name, cache: cache });
- var cacheOracle = new CacheOracle(params.feed, params.pageSize, itemsInCollection);
+ var cacheVerifier = new CacheVerifier(params.feed, params.pageSize, itemsInCollection);
var session = this.observableHttpClient.newSession();
cache.readRange(params.skip, params.take).then(function (data) {
var expectedRangeUrl = params.feed + "?$skip=" + params.skip + "&$top=" + params.take;
- cacheOracle.verifyRequests(session.requests, session.responses, params.skip, params.take, "largeCollection requests without prefetch", false, false);
+ cacheVerifier.verifyRequests(session.requests, session.responses, params.skip, params.take, "largeCollection requests without prefetch", false, false);
window.ODataVerifyReader.readJsonAcrossServerPages(expectedRangeUrl, function (expectedData) {
djstest.assertAreEqualDeep(data, expectedData, "Verify response data");
djstest.done();