You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/08/27 10:38:13 UTC
[3/3] git commit: add end-to-end test for V3 & V4 running side by
side.
add end-to-end test for V3 & V4 running side by side.
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/478d9416
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/478d9416
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/478d9416
Branch: refs/heads/master
Commit: 478d94168daf9661c3fc9a7079b092347c5306fc
Parents: 7cbe0da
Author: challenh <ch...@microsoft.com>
Authored: Wed Aug 27 16:37:21 2014 +0800
Committer: challenh <ch...@microsoft.com>
Committed: Wed Aug 27 16:37:21 2014 +0800
----------------------------------------------------------------------
datajs/JSLib.csproj | 2 +-
datajs/tests/e2etest/Test.html | 44 +
datajs/tests/e2etest/chh.js | 8373 ----------------------
datajs/tests/e2etest/datajs-1.1.2.js | 10577 ----------------------------
4 files changed, 45 insertions(+), 18951 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/478d9416/datajs/JSLib.csproj
----------------------------------------------------------------------
diff --git a/datajs/JSLib.csproj b/datajs/JSLib.csproj
index eb682b6..c2c3906 100644
--- a/datajs/JSLib.csproj
+++ b/datajs/JSLib.csproj
@@ -71,6 +71,7 @@
<Content Include="tests\common\rx.js" />
<Content Include="tests\common\TestLogger.svc" />
<Content Include="tests\common\TestSynchronizerClient.js" />
+ <Content Include="tests\e2etest\Test.html" />
<Content Include="tests\odata-json-light-tests.js" />
<Content Include="tests\datajs-startup-perf-test.html" />
<Content Include="tests\endpoints\BasicAuthDataService.svc" />
@@ -161,7 +162,6 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
- <ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/478d9416/datajs/tests/e2etest/Test.html
----------------------------------------------------------------------
diff --git a/datajs/tests/e2etest/Test.html b/datajs/tests/e2etest/Test.html
new file mode 100644
index 0000000..265c1da
--- /dev/null
+++ b/datajs/tests/e2etest/Test.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>odatajs side-by-side test (V3 & V4)</title>
+ <script type="text/javascript" src="../../demo/scripts/datajs-1.1.2.js"></script>
+ <script type="text/javascript" src="../../build/datajs-2.0.0.js"></script>
+</head>
+<body>
+ <h3>
+ Test V3 and V4 running side by side...</h3>
+ <div id="msg">
+ </div>
+ <script type="text/javascript">
+
+ var headers = { "Content-Type": "application/json", Accept: "application/json" };
+ var request = {
+ requestUri: "../endpoints/FoodStoreDataServiceV4.svc/Foods",
+ method: "GET",
+ headers: headers,
+ data: null
+ };
+
+ OData.request(request, function (data, response) {
+ document.getElementById('msg').innerHTML += ("<div>datajs V3 testing failed.</div>");
+ }, function (err) {
+ if ((err.response.statusCode == '200') && (err.response.body.indexOf('}', err.response.body.length - 1) == err.response.body.length - 1) && err.response.headers['Content-Type'] == "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8") {
+ document.getElementById('msg').innerHTML += ("<div>datajs V3 testing pass!</div>");
+ } else {
+ document.getElementById('msg').innerHTML += ("<div>datajs V3 testing failed.</div>");
+ }
+ });
+
+ odatajs.oData.request(request, function (data, response) {
+ if ((response.statusCode == '200') && (response.body.indexOf('}', response.body.length - 1) == response.body.length - 1) && response.headers['Content-Type'] == "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8") {
+ document.getElementById('msg').innerHTML += ("<div>odatajs V4 testing pass!</div>");
+ } else {
+ document.getElementById('msg').innerHTML += ("<div>odatajs V4 testing failed.</div>");
+ }
+ }, function (err) {
+ document.getElementById('msg').innerHTML += ("<div>odatajs V4 testing failed.</div>");
+ });
+ </script>
+</body>
+</html>