You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by bi...@apache.org on 2014/05/16 04:26:38 UTC

[10/11] git commit: [OLINGO-289] Upgrade the datajs version to 1.1.3 and check in some missing test cases

[OLINGO-289] Upgrade the datajs version to 1.1.3 and check in some missing test cases


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/commit/9aa185d4
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/tree/9aa185d4
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/diff/9aa185d4

Branch: refs/heads/master
Commit: 9aa185d4947f2bf6df892754fbf7b7a0caafcc95
Parents: d169d36
Author: Bing Li <bi...@apache.org>
Authored: Fri May 16 09:57:31 2014 +0800
Committer: Bing Li <bi...@apache.org>
Committed: Fri May 16 09:57:31 2014 +0800

----------------------------------------------------------------------
 BuildTools/djsbuildver.cmd                      |    2 +-
 JSLib/JSLib.csproj                              |  318 ++-
 JSLib/packages.config                           |   12 +
 JSLib/tests/cache-tests.js                      | 1200 +++++++++
 JSLib/tests/common/Instrument.js                |   48 +
 JSLib/tests/common/Instrument.svc               |   71 +
 JSLib/tests/common/gpo-ie8-tour-disable.reg     |  Bin 0 -> 384 bytes
 JSLib/tests/common/mockHttpClient.js            |  107 +
 JSLib/tests/common/mockXMLHttpRequest.js        |  192 ++
 JSLib/tests/common/observablehttpclient.js      |    3 +-
 JSLib/tests/common/rx.js                        |    6 +
 ...cache-large-collection-functional-tests.html |   53 +
 ...s-cache-large-collection-functional-tests.js |  170 ++
 JSLib/tests/datajs-cache-long-haul-tests.html   |  192 ++
 JSLib/tests/datajs-startup-perf-test.html       |   89 +
 JSLib/tests/endpoints/BasicAuthDataService.svc  |  108 +
 JSLib/tests/endpoints/CustomAnnotations.xml     |  102 +
 JSLib/tests/endpoints/CustomDataService.svc     |   61 +
 JSLib/tests/endpoints/EpmDataService.svc        |  357 +++
 JSLib/tests/endpoints/ErrorDataService.svc      |   56 +
 .../tests/endpoints/LargeCollectionService.svc  |   95 +
 JSLib/tests/odata-batch-functional-tests.html   |   43 +
 JSLib/tests/odata-batch-functional-tests.js     |  272 ++
 JSLib/tests/odata-batch-tests.js                |  649 +++++
 .../odata-cache-filter-functional-tests.html    |   56 +
 .../odata-cache-filter-functional-tests.js      |  433 +++
 JSLib/tests/odata-cache-fperf-tests.html        |   54 +
 JSLib/tests/odata-cache-fperf-tests.js          |  105 +
 JSLib/tests/odata-cache-functional-tests.html   |   56 +
 JSLib/tests/odata-cache-functional-tests.js     |  613 +++++
 .../tests/odata-cache-rx-functional-tests.html  |   54 +
 JSLib/tests/odata-cache-rx-functional-tests.js  |   76 +
 JSLib/tests/odata-fuzz.html                     |  561 ++++
 JSLib/tests/odata-handler-tests.js              |  314 +++
 JSLib/tests/odata-json-light-tests.js           | 2480 ++++++++++++++++++
 JSLib/tests/odata-json-tests.js                 |  641 +++++
 JSLib/tests/odata-links-functional-tests.html   |   44 +
 JSLib/tests/odata-links-functional-tests.js     |  230 ++
 ...ata-metadata-awareness-functional-tests.html |   43 +
 ...odata-metadata-awareness-functional-tests.js |  227 ++
 JSLib/tests/odata-metadata-tests.js             |  606 +++++
 JSLib/tests/odata-net-tests.js                  |  286 ++
 JSLib/tests/odata-perf-tests.html               |   45 +
 JSLib/tests/odata-perf-tests.js                 |  228 ++
 ...odata-read-crossdomain-functional-tests.html |   53 +
 .../odata-read-crossdomain-functional-tests.js  |  139 +
 JSLib/tests/odata-read-functional-tests.html    |   45 +
 JSLib/tests/odata-read-functional-tests.js      |  621 +++++
 JSLib/tests/odata-request-functional-tests.html |   44 +
 JSLib/tests/odata-request-functional-tests.js   |  409 +++
 JSLib/tests/odata-roundtrip-functional-tests.js |  374 +++
 JSLib/tests/odata-tests.js                      |  306 +++
 JSLib/tests/odata-xml-tests.js                  |  387 +++
 JSLib/tests/store-indexeddb-tests.js            |  246 ++
 JSLib/tests/store-tests.js                      |  684 +++++
 JSLib/tests/test-manager.html                   |   88 +
 56 files changed, 14622 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/BuildTools/djsbuildver.cmd
----------------------------------------------------------------------
diff --git a/BuildTools/djsbuildver.cmd b/BuildTools/djsbuildver.cmd
index 279e499..9dad376 100644
--- a/BuildTools/djsbuildver.cmd
+++ b/BuildTools/djsbuildver.cmd
@@ -13,4 +13,4 @@ rem WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFR
 rem COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
 rem ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-set DJSVER=1.1.2
\ No newline at end of file
+set DJSVER=1.1.3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/JSLib.csproj
----------------------------------------------------------------------
diff --git a/JSLib/JSLib.csproj b/JSLib/JSLib.csproj
index bff96ae..6686e79 100644
--- a/JSLib/JSLib.csproj
+++ b/JSLib/JSLib.csproj
@@ -1,131 +1,189 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-	<PropertyGroup>
-		<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-		<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-		<ProductVersion>
-		</ProductVersion>
-		<SchemaVersion>2.0</SchemaVersion>
-		<ProjectGuid>{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}</ProjectGuid>
-		<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
-		<OutputType>Library</OutputType>
-		<AppDesignerFolder>Properties</AppDesignerFolder>
-		<RootNamespace>JSLib</RootNamespace>
-		<AssemblyName>JSLib</AssemblyName>
-		<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-		<UseIISExpress>false</UseIISExpress>
-	</PropertyGroup>
-	<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-		<DebugSymbols>true</DebugSymbols>
-		<DebugType>full</DebugType>
-		<Optimize>false</Optimize>
-		<OutputPath>bin\</OutputPath>
-		<DefineConstants>DEBUG;TRACE</DefineConstants>
-		<ErrorReport>prompt</ErrorReport>
-		<WarningLevel>4</WarningLevel>
-	</PropertyGroup>
-	<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-		<DebugType>pdbonly</DebugType>
-		<Optimize>true</Optimize>
-		<OutputPath>bin\</OutputPath>
-		<DefineConstants>TRACE</DefineConstants>
-		<ErrorReport>prompt</ErrorReport>
-		<WarningLevel>4</WarningLevel>
-	</PropertyGroup>
-	<ItemGroup>
-		<!-- Product code. -->
-		<Content Include="src\cache-source.js"/>
-		<Content Include="src\odata-gml.js"/>
-		<Content Include="src\utils.js"/>
-		<Content Include="src\odata-json-light.js"/>
-		<Content Include="src\datajs.js"/>
-		<Content Include="src\cache.js"/>
-		<Content Include="src\deferred.js"/>
-		<Content Include="src\odata.js"/>
-		<Content Include="src\odata-batch.js"/>
-		<Content Include="src\odata-handler.js"/>
-		<Content Include="src\odata-utils.js"/>
-		<Content Include="src\odata-xml.js"/>
-		<Content Include="src\odata-metadata.js"/>
-		<Content Include="src\odata-json.js"/>
-		<Content Include="src\odata-atom.js"/>
-		<Content Include="src\odata-net.js"/>
-		<Content Include="src\store-dom.js"/>
-		<Content Include="src\store-indexeddb.js"/>
-		<Content Include="src\store-memory.js"/>
-		<Content Include="src\store.js"/>
-		<Content Include="src\xml.js"/>
-		<Content Include="tests\common\djstest.js"/>
-		<Content Include="tests\common\ODataReadOracle.js"/>
-		<Content Include="tests\common\ODataReadOracle.svc"/>
-		<Content Include="tests\common\TestLogger.svc"/>
-		<Content Include="tests\common\TestSynchronizerClient.js"/>
-		<Content Include="tests\endpoints\FoodStoreDataServiceV3.svc"/>
-		<Content Include="tests\endpoints\FoodStoreDataService.svc"/>
-		<Content Include="tests\endpoints\FoodStoreDataServiceV2.svc"/>
-		<Content Include="tests\endpoints\web.config"/>
-		<Content Include="tests\odata-atom-tests.js"/>
-		<Content Include="tests\odata-qunit-tests.htm"/>
-		<Content Include="tests\run-tests.wsf"/>
-		<Content Include="tests\test-list.js"/>
-		<!-- Configuration file for the web project. -->
-		<Content Include="Web.config"/>
-	</ItemGroup>
-	<ItemGroup>
-		<Compile Include="tests\code\AtomReader.cs"/>
-		<Compile Include="tests\code\CsdlReader.cs"/>
-		<Compile Include="tests\code\JsDate.cs"/>
-		<Compile Include="tests\code\JsonObject.cs"/>
-		<Compile Include="tests\code\ReaderUtils.cs"/>
-		<Compile Include="tests\code\ReflectionDataContext.cs"/>
-	</ItemGroup>
-	<ItemGroup>
-	</ItemGroup>
-	<ItemGroup>
-		<Reference Include="Microsoft.Data.Edm, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.Edm.5.1.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
-		</Reference>
-		<Reference Include="Microsoft.Data.OData, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.OData.5.1.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
-		</Reference>
-		<Reference Include="Microsoft.Data.Services, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.Services.5.1.0\lib\net40\Microsoft.Data.Services.dll</HintPath>
-		</Reference>
-		<Reference Include="Microsoft.Data.Services.Client, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\Microsoft.Data.Services.Client.5.1.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
-		</Reference>
-		<Reference Include="System"/>
-		<Reference Include="System.Net"/>
-		<Reference Include="System.Runtime.Serialization"/>
-		<Reference Include="System.ServiceModel"/>
-		<Reference Include="System.ServiceModel.Activation"/>
-		<Reference Include="System.ServiceModel.Web"/>
-		<Reference Include="System.Spatial, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-			<HintPath>packages\System.Spatial.5.1.0\lib\net40\System.Spatial.dll</HintPath>
-		</Reference>
-		<Reference Include="System.Web.Extensions"/>
-		<Reference Include="System.Xml"/>
-		<Reference Include="System.Xml.Linq"/>
-	</ItemGroup>
-	<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"/>
-	<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"/>
-	<ProjectExtensions>
-		<VisualStudio>
-			<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
-				<WebProjectProperties>
-					<UseIIS>False</UseIIS>
-					<AutoAssignPort>True</AutoAssignPort>
-					<DevelopmentServerPort>10092</DevelopmentServerPort>
-					<DevelopmentServerVPath>/</DevelopmentServerVPath>
-					<IISUrl>
-					</IISUrl>
-					<NTLMAuthentication>False</NTLMAuthentication>
-					<UseCustomServer>False</UseCustomServer>
-					<CustomServerUrl>
-					</CustomServerUrl>
-					<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
-				</WebProjectProperties>
-			</FlavorProperties>
-		</VisualStudio>
-	</ProjectExtensions>
-</Project>
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}</ProjectGuid>
+    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>JSLib</RootNamespace>
+    <AssemblyName>JSLib</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <UseIISExpress>false</UseIISExpress>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <!-- Product code. -->
+    <Content Include="src\cache-source.js" />
+    <Content Include="src\odata-gml.js" />
+    <Content Include="src\utils.js" />
+    <Content Include="src\odata-json-light.js" />
+    <Content Include="src\datajs.js" />
+    <Content Include="src\cache.js" />
+    <Content Include="src\deferred.js" />
+    <Content Include="src\odata.js" />
+    <Content Include="src\odata-batch.js" />
+    <Content Include="src\odata-handler.js" />
+    <Content Include="src\odata-utils.js" />
+    <Content Include="src\odata-xml.js" />
+    <Content Include="src\odata-metadata.js" />
+    <Content Include="src\odata-json.js" />
+    <Content Include="src\odata-atom.js" />
+    <Content Include="src\odata-net.js" />
+    <Content Include="src\store-dom.js" />
+    <Content Include="src\store-indexeddb.js" />
+    <Content Include="src\store-memory.js" />
+    <Content Include="src\store.js" />
+    <Content Include="src\xml.js" />
+    <Content Include="tests\cache-tests.js" />
+    <Content Include="tests\common\CacheOracle.js" />
+    <Content Include="tests\common\Instrument.svc" />
+    <Content Include="tests\common\Instrument.js" />
+    <Content Include="tests\common\mockXMLHttpRequest.js" />
+    <Content Include="tests\common\mockHttpClient.js" />
+    <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\rx.js" />
+    <Content Include="tests\common\TestLogger.svc" />
+    <Content Include="tests\common\TestSynchronizerClient.js" />
+    <Content Include="tests\odata-json-light-tests.js" />
+    <Content Include="tests\datajs-startup-perf-test.html" />
+    <Content Include="tests\endpoints\BasicAuthDataService.svc" />
+    <Content Include="tests\endpoints\FoodStoreDataServiceV3.svc" />
+    <Content Include="tests\endpoints\CustomAnnotations.xml" />
+    <Content Include="tests\endpoints\CustomDataService.svc" />
+    <Content Include="tests\endpoints\EpmDataService.svc" />
+    <Content Include="tests\endpoints\ErrorDataService.svc" />
+    <Content Include="tests\endpoints\FoodStoreDataService.svc" />
+    <Content Include="tests\endpoints\FoodStoreDataServiceV2.svc" />
+    <Content Include="tests\endpoints\LargeCollectionService.svc" />
+    <Content Include="tests\endpoints\web.config" />
+    <Content Include="tests\datajs-cache-large-collection-functional-tests.html" />
+    <Content Include="tests\datajs-cache-large-collection-functional-tests.js" />
+    <Content Include="tests\datajs-cache-long-haul-tests.html" />
+    <Content Include="tests\odata-atom-tests.js" />
+    <Content Include="tests\odata-batch-functional-tests.html" />
+    <Content Include="tests\odata-batch-functional-tests.js" />
+    <Content Include="tests\odata-batch-tests.js" />
+    <Content Include="tests\odata-cache-filter-functional-tests.html" />
+    <Content Include="tests\odata-cache-filter-functional-tests.js" />
+    <Content Include="tests\odata-cache-fperf-tests.html" />
+    <Content Include="tests\odata-cache-fperf-tests.js" />
+    <Content Include="tests\odata-cache-functional-tests.html" />
+    <Content Include="tests\odata-cache-functional-tests.js" />
+    <Content Include="tests\odata-cache-rx-functional-tests.html" />
+    <Content Include="tests\odata-cache-rx-functional-tests.js" />
+    <Content Include="tests\odata-fuzz.html" />
+    <Content Include="tests\odata-metadata-tests.js" />
+    <Content Include="tests\odata-handler-tests.js" />
+    <Content Include="tests\odata-json-tests.js" />
+    <Content Include="tests\odata-links-functional-tests.html" />
+    <Content Include="tests\odata-links-functional-tests.js" />
+    <Content Include="tests\odata-metadata-awareness-functional-tests.html" />
+    <Content Include="tests\odata-metadata-awareness-functional-tests.js" />
+    <Content Include="tests\odata-net-tests.js" />
+    <Content Include="tests\odata-perf-tests.html" />
+    <Content Include="tests\odata-perf-tests.js" />
+    <Content Include="tests\odata-read-crossdomain-functional-tests.html" />
+    <Content Include="tests\odata-read-crossdomain-functional-tests.js" />
+    <Content Include="tests\odata-read-functional-tests.html" />
+    <Content Include="tests\odata-request-functional-tests.html" />
+    <Content Include="tests\odata-request-functional-tests.js" />
+    <Content Include="tests\odata-read-functional-tests.js" />
+    <Content Include="tests\odata-qunit-tests.htm" />
+    <Content Include="tests\odata-tests.js" />
+    <Content Include="tests\odata-xml-tests.js" />
+    <Content Include="tests\run-tests.wsf" />
+    <Content Include="tests\store-indexeddb-tests.js" />
+    <Content Include="tests\store-tests.js" />
+    <Content Include="tests\test-list.js" />
+    <Content Include="tests\test-manager.html" />
+    <!-- Configuration file for the web project. -->
+    <Content Include="Web.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="tests\code\AtomReader.cs" />
+    <Compile Include="tests\code\CsdlReader.cs" />
+    <Compile Include="tests\code\JsDate.cs" />
+    <Compile Include="tests\code\JsonObject.cs" />
+    <Compile Include="tests\code\ReaderUtils.cs" />
+    <Compile Include="tests\code\ReflectionDataContext.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Data.Edm, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.Data.Edm.5.1.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Data.OData, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.Data.OData.5.1.0\lib\net40\Microsoft.Data.OData.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Data.Services, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.Data.Services.5.1.0\lib\net40\Microsoft.Data.Services.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Data.Services.Client, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.Data.Services.Client.5.1.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Net" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.ServiceModel" />
+    <Reference Include="System.ServiceModel.Activation" />
+    <Reference Include="System.ServiceModel.Web" />
+    <Reference Include="System.Spatial, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\System.Spatial.5.1.0\lib\net40\System.Spatial.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.Linq" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <UseIIS>False</UseIIS>
+          <AutoAssignPort>True</AutoAssignPort>
+          <DevelopmentServerPort>10092</DevelopmentServerPort>
+          <DevelopmentServerVPath>/</DevelopmentServerVPath>
+          <IISUrl>
+          </IISUrl>
+          <NTLMAuthentication>False</NTLMAuthentication>
+          <UseCustomServer>False</UseCustomServer>
+          <CustomServerUrl>
+          </CustomServerUrl>
+          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+        </WebProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/packages.config
----------------------------------------------------------------------
diff --git a/JSLib/packages.config b/JSLib/packages.config
new file mode 100644
index 0000000..cf6560b
--- /dev/null
+++ b/JSLib/packages.config
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Microsoft.Data.Edm" version="5.1.0-rc2" targetFramework="net40" />
+  <package id="Microsoft.Data.Edm" version="5.1.0" targetFramework="net40" />
+  <package id="Microsoft.Data.OData" version="5.1.0-rc2" targetFramework="net40" />
+  <package id="Microsoft.Data.OData" version="5.1.0" targetFramework="net40" />
+  <package id="Microsoft.Data.Services" version="5.1.0-rc2" targetFramework="net40" />
+  <package id="Microsoft.Data.Services" version="5.1.0" targetFramework="net40" />
+  <package id="Microsoft.Data.Services.Client" version="5.1.0-rc2" targetFramework="net40" />
+  <package id="Microsoft.Data.Services.Client" version="5.1.0" targetFramework="net40" />
+  <package id="System.Spatial" version="5.1.0" targetFramework="net40" />
+</packages>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/tests/cache-tests.js
----------------------------------------------------------------------
diff --git a/JSLib/tests/cache-tests.js b/JSLib/tests/cache-tests.js
new file mode 100644
index 0000000..c3dcd83
--- /dev/null
+++ b/JSLib/tests/cache-tests.js
@@ -0,0 +1,1200 @@
+/// <reference path="../src/datajs.js" />
+/// <reference path="../src/odata-utils.js" />
+/// <reference path="../src/cache.js" />
+/// <reference path="common/djstest.js" />
+
+// Copyright (c) Microsoft Open Technologies, Inc.  All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal  in the Software without restriction, including without limitation the rights  to use, copy,
+// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+// WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// cache-tests.js
+
+(function (window, undefined) {
+
+    module("Unit");
+    var foodsFeed = "./endpoints/FoodStoreDataServiceV2.svc/Foods";
+    var collectionSize = 16;
+
+    var thenFailTest = function (err) {
+        if (err && err.message) {
+            djstest.fail(err.message);
+        } else {
+            djstest.fail("unexepected promise failure");
+        }
+
+        djstest.done();
+    };
+
+    djstest.addTest(function dataCacheCountTest() {
+        var cache = datajs.createDataCache({ name: "cache", source: foodsFeed });
+        cache.count().then(function (count) {
+            djstest.assertAreEqual(count, collectionSize, "expected count for Foods");
+            djstest.destroyCacheAndDone(cache);
+        }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheCountOnLocalTest() {
+        var cache = datajs.createDataCache({ name: "cache", source: foodsFeed, pageSize: collectionSize + 10, mechanism: "memory" });
+        cache.readRange(0, collectionSize + 10).then(function (data) {
+            var expectedCount = data.length;
+            cache.count().then(function (count) {
+                djstest.assertAreEqual(count, expectedCount, "expected count for expectedCount");
+                djstest.destroyCacheAndDone(cache);
+            }, thenFailTest);
+        }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheCountFailTest() {
+        // V1 server won't support count.
+        var cache = datajs.createDataCache({ name: "cache", source: "./endpoints/FoodStoreDataService.svc/Foods" });
+        cache.count().then(thenFailTest, function () {
+            djstest.pass("Count on V1 server failed as expected.");
+            djstest.destroyCacheAndDone(cache);
+        });
+    });
+
+    djstest.addTest(function dataCacheCountAbortTest() {
+        // Abort before completion.
+        var cache = datajs.createDataCache({ name: "cache", source: foodsFeed });
+        var item = cache.count().then(thenFailTest, function (err) {
+            djstest.assertAreEqual(true, err.canceled, "err.aborted is true");
+            djstest.destroyCacheAndDone(cache);
+        }).cancel();
+    });
+
+    var createNewCache = function (options) {
+
+        var thenSuccess = null;
+
+        var resolved = false;
+        var rejected = false;
+
+        var args = null;
+
+        this.then = function (success) {
+            if (resolved) {
+                success.apply(null, args);
+            } else if (!rejected) {
+                thenSuccess = success;
+            }
+        };
+
+        var resolve = function (/*args*/) {
+            resolved = true;
+            args = arguments;
+            if (thenSuccess) {
+                thenSuccess.apply(null, arguments);
+            }
+        };
+
+        var cache = datajs.createDataCache(options);
+        cache.clear().then(function () {
+            var newCache = datajs.createDataCache(options);
+            resolve(newCache);
+        }, function (err) {
+            rejected = true;
+            thenFailTest(err);
+        });
+
+        return this;
+    };
+
+    djstest.addTest(function dataCacheReadRangeSingleTest() {
+        // Read a new range.
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 1).
+                    then(function (data) {
+                        djstest.assertAreEqual(data.length, 1, "single item was read.");
+                        djstest.assertAreEqual(data[0].FoodID, 0, "food id is 0.");
+                        djstest.done();
+                    }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangeExactPageTest() {
+        // Read exactly one page.
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 2).
+                    then(function (data) {
+                        djstest.assertAreEqual(data.length, 2, "single item was read.");
+                        djstest.assertAreEqual(data[0].FoodID, 0, "first food id is 0.");
+                        djstest.assertAreEqual(data[1].FoodID, 1, "second food id is 1.");
+                        djstest.done();
+                    }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangeMultiplePageTest() {
+        // Read multiple pages.
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 3).
+                    then(function (data) {
+                        djstest.assertAreEqual(data.length, 3, "single item was read.");
+                        djstest.assertAreEqual(data[0].FoodID, 0, "first food id is 0.");
+                        djstest.assertAreEqual(data[1].FoodID, 1, "second food id is 1.");
+                        djstest.assertAreEqual(data[2].FoodID, 2, "third food id is 2.");
+                        djstest.done();
+                    }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangeSyncDelaysTest() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        var counter = 0;
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 1).
+                    then(function (data) {
+                        djstest.assertAreEqual(counter, 0, "counter is zero for first set of results");
+                        djstest.assertAreEqual(cache.stats.netReads, 1, "one request made to fulfill the readRange");
+                        counter++;
+                        cache.readRange(0, 1).
+                            then(function (data) {
+                                djstest.assertAreEqual(counter, 2, "counter is two because even sync results are delayed)");
+                                djstest.assertAreEqual(cache.stats.netReads, 1, "no additional requests since requested data is in cache");
+                                djstest.done();
+                            }, thenFailTest);
+                        djstest.assertAreEqual(counter, 1, "counter is one because readRange hasn't run (even if results are cached)");
+                        counter++;
+                    }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangesWithDestroyTest() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2, prefetchSize: 0 };
+        var counter = 0;
+        createNewCache(options).then(function (cache) {
+            cache.readRange(0, 1).then(function (data) {
+                djstest.assertAreEqual(cache.stats.netReads, 1, "one request made to fulfill the readRange");
+                cache.clear().then(function () {
+                    djstest.assertAreEqual(cache.stats.netReads, 0, "stats cleared in destroy");
+                    cache.readRange(0, 1).then(function (data) {
+                        djstest.assertAreEqual(cache.stats.netReads, 1, "request made after destroy to fulfill the readRange");
+                        djstest.done();
+                    }, thenFailTest);
+                }, thenFailTest);
+            }, thenFailTest);
+        }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadSimultaneousTest() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        var counter = 0;
+        var theCache;
+        var checkDataAndCount = function (data) {
+            djstest.assertAreEqual(data.length, 1, "Single item returned");
+            djstest.assertAreEqual(data[0].FoodID, 0, "FoodId is set to zero for first item");
+            djstest.assertAreEqual(theCache.stats.netReads, 1, "single theCache.stats.netReads");
+            djstest.assert(theCache.stats.prefetches <= 1, "theCache.stats.prefetches <= 1 - no repetitions");
+            counter++;
+            if (counter === 3) {
+                djstest.done();
+            }
+        };
+
+        createNewCache(options).
+            then(function (cache) {
+                theCache = cache;
+                cache.readRange(0, 1).then(checkDataAndCount, thenFailTest);
+                cache.readRange(0, 1).then(checkDataAndCount, thenFailTest);
+                cache.readRange(0, 1).then(checkDataAndCount, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheMultipleClearTest() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        var counter = 0;
+        var checkCount = function (data) {
+            djstest.assert(true, "clear then was called");
+            counter++;
+            if (counter === 3) {
+                djstest.done();
+            }
+        };
+
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 1).then(function () {
+                    cache.clear().then(checkCount, thenFailTest);
+                    cache.clear().then(checkCount, thenFailTest);
+                    cache.clear().then(checkCount, thenFailTest);
+                }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheOnIdleIsFired() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2, prefetchSize: 0 };
+
+        createNewCache(options).
+            then(function (cache) {
+                var counter = 0;
+                var clearSucceeded = false;
+
+                var thenFailThisTest = function (err) {
+                    if (err && err.message) {
+                        djstest.fail(err.message);
+                    } else {
+                        djstest.fail("unexepected promise failure");
+                    }
+                };
+
+                cache.onidle = function () {
+                    counter++;
+                    djstest.assertAreEqual(counter, 1, "onidle was called 1 times");
+                    djstest.assert(clearSucceeded, "onidle was called after destroy");
+                    djstest.done();
+                };
+
+                cache.readRange(0, 1).then(null, thenFailThisTest);
+                cache.readRange(0, 1).then(null, thenFailThisTest);
+                cache.readRange(3, 4).then(function () {
+                    cache.readRange(5, 6).then(function () {
+                        cache.clear().then(function () {
+                            clearSucceeded = true;
+                        }, thenFailThisTest);
+                    }, thenFailThisTest);
+                }, thenFailThisTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheOnIdleFiresOnErrorTest() {
+
+        var errorResponse = false;
+        var httpClient = {
+            request: function (request, success, error) {
+                var response = { statusCode: 200, headers: { "Content-Type": "application/json", "DataServiceVersion": "1.0" }, body: JSON.stringify({ d: [1, 2] }) };
+                if (!errorResponse) {
+                    errorResponse = true;
+                    setTimeout(function () {
+                        success(response);
+                    }, 0);
+                } else {
+                    response.statusCode = 500;
+                    response.body = "bad response";
+                    setTimeout(function () {
+                        error({ message: "HTTP request failed", request: request, response: response });
+                    }, 0);
+                }
+            }
+        };
+
+        var options = { name: "cache", source: foodsFeed, pageSize: 2, prefetchSize: 0, httpClient: httpClient };
+
+        createNewCache(options).
+            then(function (cache) {
+                var counter = 0;
+                var errorHandlerCalled = false;
+
+                var thenFailThisTest = function (err) {
+                    if (err && err.message) {
+                        if (errorResponse) {
+                            djstest.assertAreEqual(err.message, "HTTP request failed", "Error is the expected one");
+                            errorHandlerCalled = true;
+                        } else {
+                            djstest.fail(err.message);
+                        }
+                    } else {
+                        djstest.fail("unexepected promise failure");
+                    }
+                };
+
+                cache.onidle = function () {
+                    counter++;
+                    djstest.assertAreEqual(counter, 1, "onidle was called");
+                    djstest.assert(errorHandlerCalled, "error handler was called before onidle");
+                    cache.onidle = null;
+                    cache.clear().then(function () {
+                        djstest.done();
+                    }, thenFailTest);
+                };
+                cache.readRange(0, 2).then(function () {
+                    cache.readRange(2, 4).then(function () {
+                        djstest.fail("unexpected readRange success");
+                    }, thenFailThisTest);
+                }, thenFailThisTest);
+            }, thenFailTest);
+    });
+
+
+    djstest.addTest(function dataCacheOdataSourceNormalizedURITest() {
+        var requestsMade = 0;
+        var httpClient = {
+            request: function (request, success, error) {
+                var response = { statusCode: 200, headers: { "Content-Type": "application/json", "DataServiceVersion": "1.0" }, body: JSON.stringify({ d: [1, 2] }) };
+                if (requestsMade === 0) {
+                    djstest.pass("Cache made first request for data from the source");
+                    requestsMade++;
+                } else {
+                    // In memory storage will make a second request from the new cache since two caches with the same name will coexist
+                    if (window.mozIndexedDB || window.localStorage || requestsMade > 1) {
+                        djstest.fail("Unexpected request to the source");
+                    } else {
+                        djstest.pass("In memory cache requested the data from the source");
+                    }
+                }
+                setTimeout(function () {
+                    success(response);
+                }, 0);
+            }
+        };
+
+        var options = { name: "cache", source: "http://exampleuri.com/my service.svc", pageSize: 2, prefetchSize: 0, httpClient: httpClient };
+
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 2).then(function () {
+                    options.source = "HtTp://ExampleURI.cOm/my%20service.svc";
+                    var newCache = datajs.createDataCache(options);
+                    newCache.readRange(0, 2).then(function (data) {
+                        djstest.assertAreEqualDeep(data, [1, 2], "Got the expected data from the new cache instance");
+                        newCache.clear().then(function () {
+                            djstest.done();
+                        }, thenFailTest);
+                    }, thenFailTest);
+                }, thenFailTest);
+            }, thenFailTest);
+    });
+
+
+    djstest.addTest(function dataCachePrefetchAllTest() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2, prefetchSize: -1 };
+        var counter = 0;
+        var theCache;
+
+        var callback = function () {
+            counter++;
+            if (counter === 2) {
+                djstest.assertAreEqual(1, theCache.stats.netReads, "single page to satisfy read (" + theCache.stats.netReads + ")");
+                djstest.assert(theCache.stats.prefetches > 1, "theCache.stats.prefetches(" + theCache.stats.prefetches + ") > 1 - multiple prefetches");
+                djstest.done();
+            }
+        };
+
+        var checkDataAndCount = function (data) {
+            djstest.assertAreEqual(data.length, 1, "Single item returned");
+            djstest.assertAreEqual(data[0].FoodID, 0, "FoodId is set to zero for first item");
+            djstest.assertAreEqual(1, theCache.stats.netReads, "single theCache.stats.netReads");
+            djstest.assert(theCache.stats.prefetches <= 1, "theCache.stats.prefetches <= 1 - no repetitions");
+            callback();
+        };
+
+        createNewCache(options).
+            then(function (cache) {
+                theCache = cache;
+                cache.readRange(0, 1).then(checkDataAndCount, thenFailTest);
+                cache.onidle = function () {
+                    djstest.log("onidle fired");
+                    callback();
+                };
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangeTakeMoreThanCollectionCountTest() {
+        // Read multiple pages.
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        createNewCache(options).
+            then(function (cache) {
+                cache.count().then(function (count) {
+                    cache.readRange(0, count + 1).
+                        then(function (data) {
+                            djstest.assertAreEqual(data.length, count, "all items in the collection were read.");
+                            cache.readRange(2, count + 1).
+                                then(function (data) {
+                                    djstest.assertAreEqual(data.length, count - 2, "all requested in the collection were read.");
+                                    djstest.assertAreEqual(data[0].FoodID, 2, "first read food id is 2.");
+                                    djstest.done();
+                                }, thenFailTest);
+                        }, thenFailTest);
+                }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangeSkipMoreThanCollectionCountTest() {
+        // Read multiple pages.
+        var options = { name: "cache", source: foodsFeed, pageSize: 2 };
+        createNewCache(options).
+            then(function (cache) {
+                cache.count().then(function (count) {
+                    cache.readRange(count + 1, 5).
+                        then(function (data) {
+                            djstest.assertAreEqual(data.length, 0, "no items were read.");
+                            djstest.done();
+                        }, thenFailTest);
+                }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheReadRangeTakeMoreThanPrefetchSizeTest() {
+        // Read multiple pages.
+        var options = { name: "cache", source: foodsFeed, pageSize: 2, prefetchSize: 1 };
+        createNewCache(options).
+            then(function (cache) {
+                cache.readRange(0, 4).
+                        then(function (data) {
+                            djstest.assertAreEqual(data.length, 4, "all requested in the collection were read.");
+                            djstest.assertAreEqual(data[0].FoodID, 0, "first food id is 0.");
+                            djstest.assertAreEqual(data[1].FoodID, 1, "second food id is 1.");
+                            djstest.assertAreEqual(data[2].FoodID, 2, "third food id is 2.");
+                            djstest.assertAreEqual(data[3].FoodID, 3, "third food id is 3.");
+                            djstest.done();
+                        }, thenFailTest);
+            }, thenFailTest);
+    });
+
+    djstest.addTest(function dataCacheRangeInvalidIndexAndCount() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 2, prefetchSize: 1 };
+        var counter = 0;
+
+        var thenFailSuccess = function () {
+            djstest.fail("Call to success was unexpected");
+            counter++;
+            if (counter === tests.length) {
+                djstest.done();
+            }
+        };
+
+        var thenFailError = function () {
+            djstest.fail("Call to error was unexpected");
+            counter++;
+            if (counter === tests.length) {
+                djstest.done();
+            }
+        };
+
+        var invalidValues = [-5, -1, null, undefined, NaN, Infinity, "5", "this is not a number"];
+        var tests = [];
+        $.each(invalidValues, function (_, value) {
+            tests.push({ i: value, c: 0 });
+            tests.push({ i: 0, c: value });
+            tests.push({ i: value, c: value });
+        });
+
+        createNewCache(options).
+            then(function (cache) {
+                var i, len;
+                for (i = 0, len = tests.length; i < len; i++) {
+                    var test = tests[i];
+                    try {
+                        cache.readRange(test.i, test.c).then(thenFailSuccess, thenFailTest);
+                    } catch (err) {
+                        djstest.pass("Expected exception was thrown: " + err.message);
+                        counter++;
+                    }
+                }
+                if (counter === tests.length) {
+                    djstest.done();
+                }
+            });
+    });
+
+
+    djstest.addTest(function cacheOptionsForCountTest() {
+        var httpClient = {
+            request: function (r, success, error) {
+                window.setTimeout(function () {
+                    success({ data: "10" });
+                }, 1);
+                return null;
+            }
+        };
+        var cache = datajs.createDataCache({
+            name: "mem", mechanism: "memory", source: "http://www.example.org/service/",
+            httpClient: httpClient
+        });
+        cache.count().then(function (count) {
+            djstest.assertAreEqual(count, 10, "count value");
+            djstest.done();
+        }, djstest.failAndDoneCallback("failed to get count"));
+    });
+
+    djstest.addTest(function dataCacheDestoryStopsThePrefetcherTest() {
+        var oldHttpClientRequest = OData.defaultHttpClient.request;
+        var prefetchCount = 0;
+        var theCache;
+
+        OData.defaultHttpClient.request = function (request, success, error) {
+            prefetchCount++;
+            djstest.assert(prefetchCount <= 3, "Expected prefetch request");
+            if (prefetchCount === 3) {
+                theCache.clear().then(function () {
+                    djstest.assertAreEqual(prefetchCount, 3, "cache.clear() stopped the prefetcher");
+                    djstest.done();
+                    OData.defaultHttpClient.request = oldHttpClientRequest;
+                }, thenFailTest);
+                return {
+                    abort: function () { }
+                };
+            }
+            return oldHttpClientRequest(request, success, error);
+        };
+
+        try {
+            var options = { name: "cache", source: foodsFeed, pageSize: 1, prefetchSize: -1 };
+            createNewCache(options).then(function (cache) {
+                theCache = cache;
+                cache.readRange(0, 0).then(null, thenFailTest);
+            });
+        } catch (e) {
+            OData.defaultHttpClient.request = oldHttpClientRequest;
+            djstest.fail("Exception thrown,  prefetchSize: " + tests[count] + " error:  " + e.message);
+            djstest.done();
+        }
+    });
+
+    djstest.addTest(function dataCacheFilterTest() {
+        var options = { name: "cache", source: foodsFeed, pageSize: 3, prefetchSize: -1 };
+        var counter = 0;
+
+        var singleItemPredicate = function (data) {
+            return data.FoodID === 2;
+        };
+
+        var multipleItemPredicate = function (data) {
+            return data.FoodID % 2 === 1;
+        };
+
+        var noItemPredicate = function (data) {
+            return data.Name === "something i would never eat";
+        };
+
+        var allItemPredicate = function (data) {
+            return data.FoodID >= 0;
+        };
+
+        var doneAfterAllTests = function () {
+            counter++;
+            if (counter === tests.length) {
+                djstest.done();
+            }
+        };
+
+        var last = collectionSize - 1;
+        var tests = [
+            { index: 0, count: -5, predicate: singleItemPredicate },    // Single match in entire collection
+            {index: 2, count: 1, predicate: singleItemPredicate },     // Single match, single count
+            {index: 3, count: 1, predicate: singleItemPredicate },     // Single match skipped, i.e. no matches
+            {index: 0, count: -1, predicate: multipleItemPredicate },  // Multiple matches in entire collection
+            {index: 0, count: 5, predicate: multipleItemPredicate },   // Multiple matches, take partial
+            {index: 3, count: 5, predicate: multipleItemPredicate },   // Multiple matches, skip/take partial
+            {index: 7, count: 10, predicate: multipleItemPredicate },  // Multiple matches, skip partial, take past end of collection
+            {index: 13, count: 4, predicate: allItemPredicate },       // All items match, skip/take partial
+            {index: 0, count: 20, predicate: noItemPredicate },        // No matches
+            {index: 0, count: 0, predicate: allItemPredicate },        // Zero count
+            {index: -5, count: 1, predicate: allItemPredicate },       // Negative index
+            {index: last + 1, count: 1, predicate: allItemPredicate }, // Index past end of collection
+
+            {index: last, count: -5, predicate: singleItemPredicate, backwards: true },        // Single match in entire collection
+            {index: 2, count: 1, predicate: singleItemPredicate, backwards: true },            // Single match, single count
+            {index: 1, count: 1, predicate: singleItemPredicate, backwards: true },            // Single match skipped, i.e. no matches
+            {index: last, count: -1, predicate: multipleItemPredicate, backwards: true },      // Multiple matches in entire collection
+            {index: last, count: 6, predicate: multipleItemPredicate, backwards: true },       // Multiple matches, take partial
+            {index: last - 3, count: 5, predicate: multipleItemPredicate, backwards: true },   // Multiple matches, skip/take partial
+            {index: 13, count: 10, predicate: multipleItemPredicate, backwards: true },        // Multiple matches, skip partial, take past end of collection
+            {index: 4, count: 13, predicate: allItemPredicate, backwards: true },              // All items match, skip/take partial
+            {index: last, count: 20, predicate: noItemPredicate, backwards: true },            // No matches
+            {index: 0, count: 0, predicate: allItemPredicate, backwards: true },               // Zero count
+            {index: -5, count: 1, predicate: allItemPredicate, backwards: true },              // Negative index
+            {index: last + 1, count: 1, predicate: allItemPredicate, backwards: true },        // Index past end of collection
+
+            {index: "foo", count: 1, predicate: singleItemPredicate, exception: { message: "'index' must be a valid number.", index: NaN} },
+            { index: 0, count: "foo", predicate: multipleItemPredicate, exception: { message: "'count' must be a valid number.", count: NaN} }
+        ];
+
+        var testDescription = function (test) {
+            return "filter [" + test.index + ", " + test.count + " " + (test.backwards ? "back" : "forward") + "] for predicate " + test.predicate;
+        }
+
+        var filterErrorCallback = function (err) {
+            if (err && err.message) {
+                djstest.fail(err.message);
+            } else {
+                djstest.fail("unexpected promise failure");
+            }
+            doneAfterAllTests();
+        };
+
+        var removeSafariExceptionProperties = function (err) {
+            /// <summary>Removes Safari-specific properties from an exception object</summary>
+            /// <params name="err" type="Exception">The exception object to operate on</param>
+            /// <returns type="Exception">The original exception object with the Safari-specific properties removed</returns>
+            var safariProperties = ["line", "expressionBeginOffset", "expressionEndOffset", "sourceId", "sourceURL"];
+
+            var result = {};
+            $.each(err, function (property, value) {
+                if ($.inArray(property, safariProperties) === -1) {
+                    result[property] = value;
+                }
+            });
+
+            return result;
+        };
+
+        ODataReadOracle.readJsonAcrossServerPages(foodsFeed, function (collection) {
+            $.each(tests, function (_, test) {
+                createNewCache(options).then(function (cache) {
+                    try {
+                        var expectedResults = {};
+                        if (test.backwards) {
+                            cache.filterBack(test.index, test.count, test.predicate).then(function (results) {
+                                expectedResults = CacheOracle.getExpectedFilterResults(collection, 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(collection, test.index, test.count, test.predicate, test.backwards);
+                                djstest.assertAreEqualDeep(results, expectedResults, "results for " + testDescription(test));
+                                doneAfterAllTests();
+                            }, filterErrorCallback);
+                        }
+
+                        if (test.exception) {
+                            djstest.fail("expected exception for " + testDescription(test));
+                            doneAfterAllTests();
+                        }
+                    } catch (err) {
+                        if (test.exception) {
+                            djstest.assertAreEqualDeep(removeSafariExceptionProperties(err), test.exception, "exception for " + testDescription(test));
+                        } else {
+                            djstest.fail("unexpected exception for " + testDescription(test) + ": " + djstest.toString(err));
+                        }
+                        doneAfterAllTests();
+                    }
+                }, thenFailTest);
+            });
+        });
+    });
+
+    djstest.addTest(function createDataCacheTest() {
+        var cache;
+
+        // Verify the defaults.
+        cache = datajs.createDataCache({ name: "name", source: "src" });
+
+        djstest.assertAreEqual(cache.onidle, undefined, "onidle is undefined");
+
+        // Verify specific values.
+        cache = datajs.createDataCache({ name: "name", source: "src", cacheSize: 1, pageSize: 2, prefetchSize: 3, idle: 123 });
+
+        djstest.assertAreEqual(cache.onidle, 123, "onidle is as specified");
+
+        // Verify 0 pageSize 
+        djstest.expectException(function () {
+            datajs.createDataCache({ name: "name", source: "src", cacheSize: 1, pageSize: 0, prefetchSize: 3, idle: 123 });
+        }, "zero pageSize");
+
+        // Verify negative pageSize
+        djstest.expectException(function () {
+            datajs.createDataCache({ name: "name", source: "src", cacheSize: 1, pageSize: -2, prefetchSize: 3, idle: 123 });
+        }, "negative pageSize");
+
+        // Verify NaN pageSize
+        djstest.expectException(function () {
+            cache = datajs.createDataCache({ name: "name", source: "src", cacheSize: 1, pageSize: "2", prefetchSize: 3, idle: 123 });
+        }, "NaN pageSize");
+
+        // Verify NaN cacheSize
+        djstest.expectException(function () {
+            cache = datajs.createDataCache({ name: "name", source: "src", cacheSize: "1", pageSize: 2, prefetchSize: 3, idle: 123 });
+        }, "NaN cacheSize");
+
+        // Verify NaN prefetchSize
+        djstest.expectException(function () {
+            cache = datajs.createDataCache({ name: "name", source: "src", cacheSize: 1, pageSize: 2, prefetchSize: "3", idle: 123 });
+        }, "NaN prefetchSize");
+
+        // Verify undefined name 
+        djstest.expectException(function () {
+            datajs.createDataCache({ source: "src", cacheSize: 1, pageSize: 1, prefetchSize: 3, idle: 123 });
+        }, "undefined name");
+
+        // Verify null name 
+        djstest.expectException(function () {
+            datajs.createDataCache({ name: null, source: "src", cacheSize: 1, pageSize: 1, prefetchSize: 3, idle: 123 });
+        }, "null name");
+
+        // Verify undefined source 
+        djstest.expectException(function () {
+            datajs.createDataCache({ name: "name", cacheSize: 1, pageSize: 1, prefetchSize: 3, idle: 123 });
+        }, "undefined source");
+
+        djstest.done();
+    });
+
+    djstest.addTest(function createDataCacheWithSourceTest() {
+        var cacheSource = {
+            count: function (success) {
+                djstest.pass("cacheSource.count was called");
+                success(0);
+            },
+
+            read: function (index, count, success, error) {
+                djstest.assertAreEqual(index, 0, "index is the expected one");
+                djstest.assertAreEqual(count, 10, "test is the expected one");
+                djstest.assert(success, "success is defined");
+                djstest.assert(error, "error is defined");
+                djstest.pass("cacheSource.read was called");
+
+                setTimeout(function () {
+                    success([]);
+                }, 0);
+            }
+        };
+
+        var cache = datajs.createDataCache({ name: "name", source: cacheSource, mechanism: "memory", pageSize: 10 });
+        cache.count().then(function () {
+            cache.readRange(0, 5).then(function () {
+                djstest.done();
+            }, thenFailTest);
+        }, thenFailTest);
+    });
+
+    djstest.addTest(function cacheInitializationFailTest() {
+        // Tests various failure modes for cache initialization.
+        var failures = ["read-settings", "write-settings", "v2"];
+        var failureIndex = 0;
+
+        var originalStore = datajs.createStore;
+        var restoreStore = function () {
+            datajs.createStore = originalStore;
+        };
+
+        var storeError = { message: "cacheInitializationFailTest error" };
+        datajs.createStore = function (name, mechanism) {
+            return {
+                addOrUpdate: function (key, value, successCallback, errorCallback) {
+                    if (failures[failureIndex] === "write-settings") {
+                        window.setTimeout(function () { errorCallback(storeError); }, 2);
+                    } else {
+                        djstest.fail("Error unaccounted for in addOrUpdate for " + failures[failureIndex]);
+                        window.setTimeout(function () { errorCallback(storeError); }, 2);
+                    }
+                },
+                read: function (key, successCallback, errorCallback) {
+                    if (failures[failureIndex] === "read-settings") {
+                        window.setTimeout(function () { errorCallback(storeError); }, 2);
+                    } else if (failures[failureIndex] === "v2") {
+                        window.setTimeout(function () {
+                            successCallback("K", { version: "2.0" });
+                        }, 2);
+                    } else if (failures[failureIndex] === "write-settings") {
+                        window.setTimeout(function () { successCallback(null, null); }, 2);
+                    } else {
+                        djstest.fail("Error unaccounted for read in " + failures[failureIndex]);
+                        window.setTimeout(function () { errorCallback(storeError); }, 2);
+                    }
+                }
+            };
+        };
+
+        var nextFailure = function () {
+            djstest.log("Failure mode: " + failures[failureIndex]);
+            var cache = datajs.createDataCache({ name: "name", source: "foo", mechanism: "memory", pageSize: 10 });
+            try {
+                // The first readRange should succeed, because the data cache isn't really initialized at this time.
+                cache.readRange(1, 2).then(djstest.failAndDoneCallback("No function should succeed"), function (err) {
+                    djstest.expectException(function () {
+                        cache.readRange(1, 2);
+                    }, "readRange after store is invalidated");
+
+                    djstest.expectException(function () {
+                        cache.count();
+                    }, "count after store is invalidated");
+
+                    djstest.expectException(function () {
+                        cache.clear();
+                    }, "clear after store is invalidated");
+
+                    djstest.expectException(function () {
+                        cache.filterForward(1, 2);
+                    }, "filterForward after store is invalidated");
+
+                    djstest.expectException(function () {
+                        cache.filterBack(1, 2);
+                    }, "filterBack after store is invalidated");
+
+                    djstest.expectException(function () {
+                        cache.toObservable();
+                    }, "toObservable after store is invalidated");
+
+                    failureIndex++;
+                    if (failureIndex === failures.length) {
+                        restoreStore();
+                        djstest.done();
+                    } else {
+                        nextFailure();
+                    }
+                });
+            } catch (outerError) {
+                djstest.fail("Unexpected failure for first .readRange: " + window.JSON.stringify(outerError));
+                restoreStore();
+                djstest.done();
+            }
+        };
+
+        nextFailure();
+    });
+
+    djstest.addTest(function createDataCacheWithSourceCallsErrorTest() {
+        var cacheSource = {
+            count: function () {
+                djstest.fail("cacheSource.count was called");
+            },
+
+            read: function (index, count, success, error) {
+                setTimeout(function () {
+                    error({ message: "source error" });
+                }, 0);
+            }
+        };
+
+        var cache = datajs.createDataCache({ name: "name", source: cacheSource, mechanism: "memory", pageSize: 10 });
+        cache.readRange(0, 5).then(function () {
+            djstest.fail("unexpected call to then success");
+            djstest.done();
+        }, function (err) {
+            djstest.assertAreEqual(err.message, "source error", "got the expected error");
+            djstest.done();
+        });
+    });
+
+    djstest.addTest(function toObservableMissingTest() {
+        createNewCache({ name: "cache", source: "http://temp.org" }).then(function (cache) {
+            var hiddenRx = window.Rx;
+            try {
+                window.Rx = null;
+                var error = null;
+                try {
+                    cache.ToObservable();
+                } catch (err) {
+                    error = err;
+                }
+
+                djstest.assert(error !== null, "error !== null");
+            } finally {
+                window.Rx = hiddenRx;
+            }
+
+            djstest.assert(error !== null, "error !== null");
+            djstest.destroyCacheAndDone(cache);
+        });
+    });
+
+    djstest.addTest(function toObservableSinglePageTest() {
+        createNewCache({ name: "cache", source: foodsFeed }).then(function (cache) {
+            var lastId = -1;
+            cache.ToObservable().Subscribe(function (item) {
+                djstest.assert(lastId < item.FoodID, "lastId < item.FoodID");
+                lastId = item.FoodID;
+            }, thenFailTest, function () {
+                djstest.assert(lastId !== -1, "lastId !== -1");
+                djstest.done();
+            });
+        });
+    });
+
+    djstest.addTest(function toObservableCaseSinglePageTest() {
+        createNewCache({ name: "cache", source: foodsFeed }).then(function (cache) {
+            var lastId = -1;
+            cache.toObservable().Subscribe(function (item) {
+                djstest.assert(lastId < item.FoodID, "lastId < item.FoodID");
+                lastId = item.FoodID;
+            }, thenFailTest, function () {
+                djstest.assert(lastId !== -1, "lastId !== -1");
+                djstest.done();
+            });
+        });
+    });
+
+    djstest.addTest(function toObservableMultiplePageTest() {
+        createNewCache({ name: "cache", source: foodsFeed, pageSize: 2 }).then(function (cache) {
+            var lastId = -1;
+            var callCount = 0;
+            cache.toObservable().Subscribe(function (item) {
+                djstest.assert(lastId < item.FoodID, "lastId < item.FoodID");
+                lastId = item.FoodID;
+                callCount += 1;
+            }, thenFailTest, function () {
+                djstest.assert(lastId !== -1, "lastId !== -1");
+                djstest.assert(callCount > 1, "callCount > 1");
+                djstest.done();
+            });
+        });
+    });
+
+    djstest.addTest(function toObservableEarlyDisposeTest() {
+        createNewCache({ name: "cache", source: foodsFeed, pageSize: 2 }).then(function (cache) {
+            var lastId = -1;
+            var callCount = 0;
+            var complete = false;
+            var observer = cache.toObservable().Subscribe(function (item) {
+                djstest.assert(complete === false, "complete === false");
+                djstest.assert(lastId < item.FoodID, "lastId < item.FoodID");
+                lastId = item.FoodID;
+                callCount += 1;
+                complete = true;
+                observer.Dispose();
+                djstest.done();
+            }, thenFailTest);
+        });
+    });
+
+    djstest.addTest(function toObservableFailureTest() {
+        createNewCache({ name: "cache", source: foodsFeed, pageSize: 2 }).then(function (cache) {
+            var lastId = -1;
+            var complete = false;
+            window.MockHttpClient.clear().addResponse("*", { statusCode: 500, body: "server error" });
+            window.MockHttpClient.async = true;
+            var savedClient = OData.defaultHttpClient;
+            OData.defaultHttpClient = window.MockHttpClient;
+            cache.toObservable().Subscribe(function (item) {
+                OData.defaultHttpClient = savedClient;
+                djstest.fail("Unexpected call to OnNext");
+            }, function (err) {
+                djstest.assert(complete === false, "complete === false");
+                djstest.assert(err, "err defined");
+                OData.defaultHttpClient = savedClient;
+                complete = true;
+                djstest.done();
+            }, function (complete) {
+                djstest.fail("Unexpected call to complete. Error handler should be called.");
+                OData.defaultHttpClient = savedClient;
+                complete = true;
+                djstest.done();
+            });
+        });
+    });
+
+    // DATAJS INTERNAL START
+
+    djstest.addTest(function createDeferredTest() {
+        // Verify basic use of deferred object.
+        var deferred = datajs.createDeferred();
+        deferred.then(function (val1, val2) {
+            djstest.assertAreEqual(val1, 1, "val1 is as specified");
+            djstest.assertAreEqual(val2, 2, "val2 is as specified");
+            djstest.done();
+        });
+        deferred.resolve(1, 2);
+    });
+
+    djstest.addTest(function deferredThenTest() {
+        // Verify then registration and chaining.
+        var deferred = datajs.createDeferred();
+        deferred.then(function (val1, val2) {
+            djstest.assertAreEqual(val1, 1, "val1 is as specified");
+            djstest.assertAreEqual(val2, 2, "val2 is as specified");
+            return "foo";
+        }).then(function (foo) {
+            // See Compatibility Note B in DjsDeferred remarks.
+            djstest.assert(foo !== "foo", "argument for chained 'then' is *not* result of previous call");
+            djstest.assert(foo === 1, "argument for chained 'then' is same as for previous call");
+
+            var other = datajs.createDeferred();
+            other.then(null, function (err, msg) {
+                djstest.assertAreEqual("error", err, "err is as specified");
+                djstest.assertAreEqual("message", msg, "msg is as specified");
+
+            }).then(null, function (err, msg) {
+                djstest.log("chained errors are called");
+
+                djstest.assertAreEqual("error", err, "err is as specified");
+                djstest.assertAreEqual("message", msg, "msg is as specified");
+
+                var multiple = datajs.createDeferred();
+                var count = 0;
+
+                // See Compatibility Note A in DjsDeferred remarks.
+                multiple.then(function () {
+                    djstest.assertAreEqual(count, 0, "first base registration fires as #0");
+                    count++;
+                }).then(function () {
+                    djstest.assertAreEqual(count, 1, "first chained registration fires as #1");
+                    count++;
+                });
+
+                multiple.then(function () {
+                    djstest.assertAreEqual(count, 2, "second base registration fires as #2");
+                    count++;
+                }).then(function () {
+                    djstest.assertAreEqual(count, 3, "second chained registration fires as #3");
+                    djstest.done();
+                });
+
+                multiple.resolve();
+            });
+            other.reject("error", "message");
+        });
+
+        deferred.resolve(1, 2);
+    });
+
+    djstest.addTest(function deferredResolveTest() {
+        // Resolve with no arguments.
+        var deferred = datajs.createDeferred();
+        deferred.then(function (arg) {
+            djstest.assertAreEqual(arg, undefined, "resolve with no args shows up as undefined");
+
+            // Resolve with no callbacks.
+            var other = datajs.createDeferred();
+            other.resolve();
+            djstest.done();
+        });
+
+        deferred.resolve();
+    });
+
+    djstest.addTest(function deferredRejectTest() {
+        // Resolve with no arguments.   
+        var deferred = datajs.createDeferred();
+        deferred.then(null, function (arg) {
+            djstest.assertAreEqual(arg, undefined, "reject with no args shows up as undefined");
+
+            // Resolve with no callbacks.
+            var other = datajs.createDeferred();
+            other.reject();
+            djstest.done();
+        });
+
+        deferred.reject();
+    });
+
+    djstest.addTest(function estimateSizeTest() {
+        var tests = [
+            { i: null, e: 8 },
+            { i: undefined, e: 8 },
+            { i: 0, e: 8 },
+            { i: "abc", e: 6 },
+            { i: [1, 2, 3], e: 30 },
+            { i: { a1: null, a2: undefined, a3: 5, a4: "ab", a5: { b1: 5, b2: 6} }, e: 72 },
+            { i: {}, e: 0 }
+        ];
+
+        var i, len;
+        for (i = 0, len = tests.length; i < len; i++) {
+            var test = tests[i];
+            djstest.assertAreEqual(datajs.estimateSize(test.i), test.e);
+        }
+        djstest.done();
+    });
+
+    djstest.addTest(function cacheOptionsTunnelTest() {
+        var mockClient = window.MockHttpClient;
+        var doneCalled = false;
+
+        mockClient.clear().setAsync(true).addRequestVerifier("*", function (theRequest) {
+            if (!doneCalled) {
+                doneCalled = true;
+                djstest.assertAreEqual(theRequest.user, "the-user", "theRequest.user");
+                djstest.assertAreEqual(theRequest.password, "the-password", "theRequest.password");
+                djstest.assertAreEqual(theRequest.enableJsonpCallback, false, "theRequest.enableJsonpCallback");
+                djstest.assertAreEqual(theRequest.callbackParameterName, "p", "callbackParameterName");
+                djstest.done();
+            }
+        });
+
+        var cache = datajs.createDataCache({
+            name: "cacheOptionsTunnel",
+            source: "http://foo-bar/",
+            user: "the-user",
+            password: "the-password",
+            enableJsonpCallback: false,
+            callbackParameterName: "p",
+            httpClient: mockClient
+        });
+
+        cache.readRange(0, 10).then(function (arr) {
+            djstest.fail("unexpected callback into readRange in test cacheOptionsTunnelTest");
+            if (!doneCalled) {
+                doneCalled = true;
+                djstest.done();
+            }
+        });
+    });
+
+    djstest.addTest(function dataCacheHandlesFullStoreTest() {
+
+        var TestStore = function (name) {
+            var that = new window.datajs.MemoryStore(name);
+            that.addOrUpdate = function (key, value, success, error) {
+                if (key === "__settings") {
+                    window.setTimeout(function () {
+                        success(key, value);
+                    }, 0);
+                } else {
+                    window.setTimeout(function () {
+                        error({ name: "QUOTA_EXCEEDED_ERR" });
+                    }, 0);
+                }
+            };
+            return that;
+        };
+
+        TestStore.create = function (name) {
+            return new TestStore(name);
+        }
+
+        TestStore.isSupported = function () {
+            return true;
+        }
+
+        var cacheSource = {
+            identifier: "testSource",
+            count: function (success) {
+                djstest.fail("cacheSource.count was called");
+                success(5);
+            },
+            read: function (index, count, success, error) {
+                djstest.assertAreEqual(index, 0, "index is the expected one");
+                djstest.assertAreEqual(count, 5, "test is the expected one");
+
+                setTimeout(function () {
+                    success([1, 2, 3, 4, 5]);
+                }, 0);
+            }
+        };
+
+        var originalCreateStore = window.datajs.createStore;
+
+        window.datajs.createStore = function (name, mechanism) {
+            return TestStore(name);
+        };
+
+        try {
+            var cache = datajs.createDataCache({
+                name: "cache",
+                pageSize: 5,
+                prefetchSize: 0,
+                source: cacheSource,
+                mechanism: "teststore"
+            });
+        } finally {
+            window.datajs.createStore = originalCreateStore;
+        }
+
+        cache.readRange(0, 5).then(function (data) {
+            djstest.assertAreEqual(data.length, 5, "5 items were read.");
+            cache.readRange(0, 5).then(function (data) {
+                djstest.assertAreEqual(data.length, 5, "5 items were read.");
+                djstest.done();
+            }, thenFailTest);
+        }, thenFailTest);
+    });
+
+    // DATAJS INTERNAL END
+})(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/tests/common/Instrument.js
----------------------------------------------------------------------
diff --git a/JSLib/tests/common/Instrument.js b/JSLib/tests/common/Instrument.js
new file mode 100644
index 0000000..acbb2b0
--- /dev/null
+++ b/JSLib/tests/common/Instrument.js
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Open Technologies, Inc.  All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 
+// files (the "Software"), to deal  in the Software without restriction, including without limitation the rights  to use, copy,
+// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+// WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// Instrument.js
+// Instrumentation utilities
+
+(function (window, undefined) {
+
+    var warmedUp = false;
+    var getBrowserMemorySize = function (success) {
+        /// <summary>Gets the memory size (in bytes) of the browser process</summary>
+        /// <param name="success" type="Function">The success callback</param>
+        var makeRequest = function (success) {
+            $.get("./common/Instrument.svc/GetBrowserMemorySize", function (data) {
+                success(parseInt(data));
+            }, "text");
+        };
+
+        if (window.CollectGarbage) {
+            window.CollectGarbage();
+        }
+
+        if (!warmedUp) {
+            // Make a dummy request to warm it up
+            makeRequest(function () {
+                warmedUp = true;
+                makeRequest(success);
+            });
+        } else {
+            makeRequest(success);
+        }
+    }
+
+    window.Instrument = {
+        getBrowserMemorySize: getBrowserMemorySize
+    };
+
+})(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/tests/common/Instrument.svc
----------------------------------------------------------------------
diff --git a/JSLib/tests/common/Instrument.svc b/JSLib/tests/common/Instrument.svc
new file mode 100644
index 0000000..3d14b16
--- /dev/null
+++ b/JSLib/tests/common/Instrument.svc
@@ -0,0 +1,71 @@
+<%@ ServiceHost Language="C#" Debug="true" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory"
+    Service="DataJS.Tests.Instrument" %>
+
+// Copyright (c) Microsoft Open Technologies, Inc.  All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 
+// files (the "Software"), to deal  in the Software without restriction, including without limitation the rights  to use, copy,
+// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 
+// Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+// WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+namespace DataJS.Tests
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Diagnostics;
+    using System.IO;
+    using System.Linq;
+    using System.Runtime.Serialization;
+    using System.ServiceModel;
+    using System.ServiceModel.Activation;
+    using System.ServiceModel.Syndication;
+    using System.ServiceModel.Web;
+    using System.Text;
+
+    /// <summary>
+    /// Instrumentation utilities
+    /// </summary>
+    [ServiceContract]
+    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
+    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
+    public class Instrument
+    {
+        static readonly Dictionary<string, string> userAgents = new Dictionary<string,string>
+        {
+            { "MSIE", "iexplore" },
+            { "Firefox", "firefox" },
+            { "Chrome", "chrome" },
+            { "Safari", "safari" }
+        };
+        
+        /// <summary>
+        /// Gets the memory size used by the browser
+        /// </summary>
+        /// <returns>The memory size used by the browser (in bytes), or zero if browser is not supported</returns>
+        [OperationContract]
+        [WebGet]
+        public Stream GetBrowserMemorySize()
+        {
+            string userAgentString = WebOperationContext.Current.IncomingRequest.UserAgent;
+            string userAgentKey = Instrument.userAgents.Keys.FirstOrDefault(ua => userAgentString.Contains(ua));
+
+            if (userAgentKey != null)
+            {
+                string processName = userAgents[userAgentKey];
+                long totalMemory = Process.GetProcessesByName(processName).Select(p => p.WorkingSet64).Sum();
+                
+                return new MemoryStream(Encoding.UTF8.GetBytes(totalMemory.ToString()));
+            }
+            else
+            {
+                return new MemoryStream(Encoding.UTF8.GetBytes("0"));
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/tests/common/gpo-ie8-tour-disable.reg
----------------------------------------------------------------------
diff --git a/JSLib/tests/common/gpo-ie8-tour-disable.reg b/JSLib/tests/common/gpo-ie8-tour-disable.reg
new file mode 100644
index 0000000..52dfd99
Binary files /dev/null and b/JSLib/tests/common/gpo-ie8-tour-disable.reg differ

http://git-wip-us.apache.org/repos/asf/olingo-odata3-js/blob/9aa185d4/JSLib/tests/common/mockHttpClient.js
----------------------------------------------------------------------
diff --git a/JSLib/tests/common/mockHttpClient.js b/JSLib/tests/common/mockHttpClient.js
new file mode 100644
index 0000000..de2a69c
--- /dev/null
+++ b/JSLib/tests/common/mockHttpClient.js
@@ -0,0 +1,107 @@
+//mockHttpClient.js
+//this object allows for associating a uri with a requestVerfier and mock responses that will be sent back to the client of the httpStack.  
+//It can be used to replace OData's httpClient for testing purposes.
+//
+//RequestVerifiers
+//
+//    A request verifier is a function associated to a particular URI that will be executed by the mockHttpClient when it receives a request with the matching URI.
+//    the callback receives as its only parameter the request object passed to the mockHttpClient.
+//
+//    To register a request verifier, simply do 
+//        
+//            MockHttpClient.addRequestVerifier("http://someUri", function(request) {
+//                djstest.assertAreEqual(request.requestUri,"http://someUri");
+//            }
+//
+//Responses
+//    Mock responses can be associated with a particular URI.  When the MockHttpClient receives a request with a URI mapped to a response, then it will, 
+//    depending on the response status code invoke either the success or the error callbacks. 
+//
+//    To register a response,
+//       
+//           MockHttpClient.addResponse("http://someUri", {status: 200, body:"some body"});
+//
+//Exceptions
+//    MockHttpClient will throw an exception if it receives a request to a URI that is not mapped to either a request verifier or a response.
+//
+
+(function (window, undefined) {
+    if (!window.MockHttpClient) {
+        window.MockHttpClient = {};
+    }
+
+    var httpClient = window.MockHttpClient;
+
+    var responses = {};
+    var requestVerifiers = {};
+
+    httpClient.addRequestVerifier = function (uri, verifier) {
+        requestVerifiers[uri] = verifier;
+        return this;
+    };
+
+    httpClient.addResponse = function (uri, response) {
+        responses[uri] = response;
+        return this;
+    };
+
+    httpClient.async = false;
+
+    httpClient.clear = function () {
+        /// <summary>Clears all registered responses and verifiers.</summary>
+        /// <returns>this client.</returns>
+        responses = {};
+        requestVerifiers = {};
+        this.async = false;
+        return this;
+    };
+
+    httpClient.request = function (request, success, error) {
+        var uri = request.requestUri;
+        var verifier = requestVerifiers[uri];
+        var response = responses[uri];
+
+        if (verifier === undefined) {
+            verifier = requestVerifiers["*"];
+        }
+
+        if (response === undefined) {
+            response = responses["*"];
+        }
+
+        if (!verifier && !response) {
+            throw { message: "neither verifier or response defined for uri: " + uri };
+        }
+
+        if (verifier) {
+            verifier(request);
+        }
+
+        if (response) {
+            response.requestUri = uri;
+            if (response.statusCode >= 200 && response.statusCode <= 299) {
+                if (this.async) {
+                    setTimeout(function () {
+                        success(response);
+                    });
+                } else {
+                    success(response);
+                }
+            } else {
+                if (this.async) {
+                    setTimeout(function () {
+                        error({ message: "failed test response", request: request, response: response });
+                    });
+                }
+                else {
+                    error({ message: "failed test response", request: request, response: response });
+                }
+            }
+        }
+    };
+
+    httpClient.setAsync = function (value) {
+        this.async = value;
+        return this;
+    };
+})(this);