[OLINGO-442] Check testcases/Cleanup Code/fix jsdoc
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/5bff25da Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/tree/5bff25da Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/diff/5bff25da Branch: refs/heads/master Commit: 5bff25daf35519d0fffeb57c89cfcf15127ef66e Parents: f758de2 Author: Sven Kobler <[email protected]> Authored: Thu Feb 26 12:54:48 2015 +0100 Committer: Sven Kobler <[email protected]> Committed: Thu Feb 26 12:54:48 2015 +0100 ---------------------------------------------------------------------- Gruntfile.js | 4 +- JSLib.csproj | 210 ++ JSLib.sln | 19 + JSLib/JSLib.csproj | 187 -- JSLib/JSLib.sln | 20 - JSLib/Web.config | 34 - JSLib/packages.config | 8 - Web.config | 53 + demo/tester.html | 2 +- grunt-config/release-config.js | 12 +- package.json | 2 + src/lib/cache.js | 31 +- src/lib/cache/source.js | 4 +- src/lib/deferred.js | 3 +- src/lib/odata.js | 6 +- src/lib/odata/batch.js | 48 +- src/lib/odata/handler.js | 8 +- src/lib/odata/json.js | 1023 ++++---- src/lib/odata/metadata.js | 6 +- src/lib/odata/net-browser.js | 26 +- src/lib/odata/net.js | 35 +- src/lib/odata/odatautils.js | 62 +- src/lib/store.js | 13 +- src/lib/store/dom.js | 28 +- src/lib/store/indexeddb.js | 4 +- src/lib/store/memory.js | 29 +- src/lib/utils.js | 7 +- src/lib/xml.js | 45 +- test/mocha.opts | 5 +- test/test-demo-scenario.js | 1803 ++++++++++++-- test/test-odata-json.js | 2225 +++++++++++++++--- test/test-utils.js | 3 +- test/test.js | 36 - tests/cache-tests.js | 9 +- tests/common/CacheVerifier.js | 22 +- tests/common/Instrument.js | 2 +- tests/common/ObservableHttpClient.js | 2 +- tests/common/TestSynchronizerClient.js | 10 +- tests/common/djstest-browser-ext.js | 150 ++ tests/common/djstest-browser.js | 150 -- tests/common/djstest.js | 13 +- tests/common/odataVerifyReader.js | 2 +- tests/e2etest/Test.html | 2 +- tests/info.txt | 23 + tests/odata-batch-functional-tests.html | 3 +- tests/odata-batch-functional-tests.js | 15 +- tests/odata-cache-filter-functional-tests.html | 3 +- tests/odata-cache-filter-functional-tests.js | 27 +- tests/odata-cache-fperf-tests.html | 3 +- tests/odata-cache-functional-tests.html | 3 +- tests/odata-cache-functional-tests.js | 21 +- tests/odata-cache-rx-functional-tests.html | 3 +- tests/odata-cache-rx-functional-tests.js | 13 +- tests/odata-fuzz.html | 26 +- tests/odata-handler-tests.js | 2 +- tests/odata-json-light-tests.js | 24 +- tests/odata-json-parse-tests.html | 5 +- tests/odata-json-parse-tests.js | 4 +- tests/odata-json-tests.js | 14 +- tests/odata-links-functional-tests.html | 3 +- ...ata-metadata-awareness-functional-tests.html | 3 +- ...odata-metadata-awareness-functional-tests.js | 30 +- tests/odata-net-tests.js | 4 +- tests/odata-perf-tests.html | 3 +- tests/odata-perf-tests.js | 5 +- tests/odata-qunit-tests.htm | 4 +- ...odata-read-crossdomain-functional-tests.html | 3 +- tests/odata-read-functional-tests.html | 3 +- tests/odata-read-functional-tests.js | 8 +- tests/odata-request-functional-tests.html | 5 +- tests/odata-request-functional-tests.js | 4 +- tests/odata-roundtrip-functional-tests.js | 8 +- tests/odata-tests.js | 13 +- ...cache-large-collection-functional-tests.html | 4 +- tests/odatajs-cache-long-haul-tests.html | 15 +- tests/odatajs-startup-perf-test.html | 3 +- tests/store-indexeddb-tests.js | 2 +- tests/store-tests.js | 7 +- tests/test-manager.html | 2 +- 79 files changed, 4838 insertions(+), 1843 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/Gruntfile.js ---------------------------------------------------------------------- diff --git a/Gruntfile.js b/Gruntfile.js index 56dfeee..fe8bf8d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -55,11 +55,11 @@ module.exports = function(grunt) { "jsdoc" : { "src" : { src: ["src/**/*.js"], - options: { destination: "_build/doc-src", verbose : false } + options: { destination: "_build/doc-src", verbose : true, debug : true, pedantic : true } }, "test" : { src: ["tests/**/*.js"], - options: { destination: "_build/doc-test", verbose : false } + options: { destination: "_build/doc-test", verbose : true, debug : true, pedantic : true } } }, "nugetpack" : { // create nuget pagckage http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/JSLib.csproj ---------------------------------------------------------------------- diff --git a/JSLib.csproj b/JSLib.csproj new file mode 100644 index 0000000..805ba8c --- /dev/null +++ b/JSLib.csproj @@ -0,0 +1,210 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * 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. + */--> +<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> + <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> + <Content Include="src\index.js" /> + <Content Include="src\banner.txt" /> + <Content Include="src\lib\cache.js" /> + <Content Include="src\lib\odatajs.js" /> + <Content Include="src\lib\odata.js" /> + <Content Include="src\lib\store.js" /> + <Content Include="src\lib\cache\source.js" /> + <Content Include="src\lib\odatajs\deferred.js" /> + <Content Include="src\lib\odatajs\utils.js" /> + <Content Include="src\lib\odatajs\xml.js" /> + <Content Include="src\lib\odata\batch.js" /> + <Content Include="src\lib\odata\handler.js" /> + <Content Include="src\lib\odata\json.js" /> + <Content Include="src\lib\odata\metadata.js" /> + <Content Include="src\lib\odata\net.js" /> + <Content Include="src\lib\odata\utils.js" /> + <Content Include="src\lib\store\dom.js" /> + <Content Include="src\lib\store\indexeddb.js" /> + <Content Include="src\lib\store\memory.js" /> + <Content Include="tests\cache-tests.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" /> + <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\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" /> + <Content Include="tests\e2etest\Test.html" /> + <Content Include="tests\odata-json-light-tests.js" /> + <Content Include="tests\odatajs-startup-perf-test.html" /> + <Content Include="tests\endpoints\BasicAuthDataService.svc" /> + <Content Include="tests\endpoints\FoodStoreDataServiceV4.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\LargeCollectionService.svc" /> + <Content Include="tests\endpoints\web.config" /> + <Content Include="tests\odatajs-cache-large-collection-functional-tests.html" /> + <Content Include="tests\odatajs-cache-large-collection-functional-tests.js" /> + <Content Include="tests\odatajs-cache-long-haul-tests.html" /> + <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"> + <SubType>Designer</SubType> + </Content> + </ItemGroup> + <ItemGroup> + <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.OData.Client, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\special-packages\Microsoft.OData.Client.6.5.0\lib\net40\Microsoft.OData.Client.dll</HintPath> + </Reference> + <Reference Include="Microsoft.OData.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\special-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, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\special-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.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\special-packages\Microsoft.OData.Service.6.5.0\lib\net40\Microsoft.OData.Service.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Spatial, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\special-packages\Microsoft.Spatial.6.5.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.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.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>4002</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-odata4-js/blob/5bff25da/JSLib.sln ---------------------------------------------------------------------- diff --git a/JSLib.sln b/JSLib.sln new file mode 100644 index 0000000..61927d4 --- /dev/null +++ b/JSLib.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSLib", "JSLib.csproj", "{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/JSLib/JSLib.csproj ---------------------------------------------------------------------- diff --git a/JSLib/JSLib.csproj b/JSLib/JSLib.csproj deleted file mode 100644 index 43b19fd..0000000 --- a/JSLib/JSLib.csproj +++ /dev/null @@ -1,187 +0,0 @@ -<?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> - <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\FoodStoreDataServiceV4.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\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.OData.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>packages\Microsoft.OData.Client.6.0.0-beta1\lib\net40\Microsoft.OData.Client.dll</HintPath> - </Reference> - <Reference Include="Microsoft.OData.Core"> - <HintPath>packages\Microsoft.OData.Core.6.0.0-beta1\lib\portable-net40+sl5+wp8+win8\Microsoft.OData.Core.dll</HintPath> - </Reference> - <Reference Include="Microsoft.OData.Edm"> - <HintPath>packages\Microsoft.OData.Edm.6.0.0-beta1\lib\portable-net40+sl5+wp8+win8\Microsoft.OData.Edm.dll</HintPath> - </Reference> - <Reference Include="Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>packages\Microsoft.OData.Service.6.0.0-beta1\lib\net40\Microsoft.OData.Service.dll</HintPath> - </Reference> - <Reference Include="Microsoft.Spatial"> - <HintPath>packages\Microsoft.Spatial.6.0.0-beta1\lib\portable-net40+sl5+wp8+win8\Microsoft.Spatial.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.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>46541</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-odata4-js/blob/5bff25da/JSLib/JSLib.sln ---------------------------------------------------------------------- diff --git a/JSLib/JSLib.sln b/JSLib/JSLib.sln deleted file mode 100644 index d265e52..0000000 --- a/JSLib/JSLib.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JSLib", "JSLib.csproj", "{73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73ADF1A7-613B-4679-885B-2AE4AFAA9A6A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/JSLib/Web.config ---------------------------------------------------------------------- diff --git a/JSLib/Web.config b/JSLib/Web.config deleted file mode 100644 index 2e1d265..0000000 --- a/JSLib/Web.config +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<configuration> - <system.web> - <compilation debug="true" targetFramework="4.0"> - <assemblies> - <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> - <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> - <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> - <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> - <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> - <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> - <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> - <add assembly="Microsoft.OData.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> - <add assembly="Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> - <add assembly="Microsoft.OData.Client, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> - </assemblies> - </compilation> - </system.web> - <system.webServer> - <directoryBrowse enabled="true" /> - </system.webServer> - <system.codedom> - <compilers> - <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <providerOption name="CompilerVersion" value="v4.0" /> - </compiler> - </compilers> - </system.codedom> - <system.net> - <defaultProxy> - <proxy autoDetect="True" /> - </defaultProxy> - </system.net> -</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/JSLib/packages.config ---------------------------------------------------------------------- diff --git a/JSLib/packages.config b/JSLib/packages.config deleted file mode 100644 index d2b5a9b..0000000 --- a/JSLib/packages.config +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="Microsoft.OData.Client" version="6.0.0-beta1" targetFramework="net40" /> - <package id="Microsoft.OData.Core" version="6.0.0-beta1" targetFramework="net40" /> - <package id="Microsoft.OData.Edm" version="6.0.0-beta1" targetFramework="net40" /> - <package id="Microsoft.OData.Service" version="6.0.0-beta1" targetFramework="net40" /> - <package id="Microsoft.Spatial" version="6.0.0-beta1" targetFramework="net40" /> -</packages> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/Web.config ---------------------------------------------------------------------- diff --git a/Web.config b/Web.config new file mode 100644 index 0000000..5441da1 --- /dev/null +++ b/Web.config @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * 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. + */--> +<configuration> + <system.web> + <compilation debug="true" targetFramework="4.0"> + <assemblies> + <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> + <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> + <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> + <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> + <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> + <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> + <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> + <add assembly="Microsoft.OData.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <add assembly="Microsoft.OData.Service, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <add assembly="Microsoft.OData.Client, Version=6.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + </assemblies> + </compilation> + </system.web> + <system.webServer> + <directoryBrowse enabled="true" /> + </system.webServer> + <system.codedom> + <compilers> + <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <providerOption name="CompilerVersion" value="v4.0" /> + </compiler> + </compilers> + </system.codedom> + <system.net> + <defaultProxy> + <proxy autoDetect="True" /> + </defaultProxy> + </system.net> +</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/demo/tester.html ---------------------------------------------------------------------- diff --git a/demo/tester.html b/demo/tester.html index 919810c..d779439 100644 --- a/demo/tester.html +++ b/demo/tester.html @@ -23,7 +23,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <title>datajs startup perf test</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> - <script type="text/javascript" src="./../build/lib/odatajs-latest.js"></script> + <script type="text/javascript" src="./../_build/lib/odatajs-latest.js"></script> <script type="text/javascript" src="scripts/tools.js" ></script> <style type="text/css"> .code{font-family:"Courier New",monospace;font-size:13px;line-height:18px;} http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/grunt-config/release-config.js ---------------------------------------------------------------------- diff --git a/grunt-config/release-config.js b/grunt-config/release-config.js index 8f1de84..b634962 100644 --- a/grunt-config/release-config.js +++ b/grunt-config/release-config.js @@ -53,8 +53,8 @@ module.exports = function(grunt) { destination: './_dist/<%= artifactname %>/doc', verbose : false } - }, - }, + } + } }); // copy @@ -91,10 +91,10 @@ module.exports = function(grunt) { { dot: true, expand: true, cwd: './', src: ['**'], dest: './_dist/<%= artifactname %>/sources/odatajs', filter: function(srcPath) { // no node_modules - if (srcPath === 'node_modules' || contains(srcPath, 'node_modules\\')|| contains(srcPath, 'node_modules/')) { + if (srcPath === 'node_modules' || contains(srcPath, 'node_modules')) { return false; } - if (srcPath === 'extern-tools' || contains(srcPath, 'extern-tools\\')|| contains(srcPath, 'extern-tools/')) { + if (srcPath === 'extern-tools' || contains(srcPath, 'extern-tools')) { return false; } @@ -154,7 +154,7 @@ module.exports = function(grunt) { return true; }}, ] - }, + } } }); @@ -180,7 +180,7 @@ module.exports = function(grunt) { {expand: true, cwd: './_dist/<%= artifactname %>/sources', src: ['**'], dest: '/'}, ] } - }, + } }); http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 6c782bf..e48ba0a 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "preinstall": "npm --prefix ./grunt-config/custom-tasks/rat install" }, "devDependencies": { + "chai": "^2.0.0", "grunt": "^0.4.5", "grunt-connect-proxy": "^0.1.10", "grunt-contrib-clean": "^0.6.0", @@ -42,6 +43,7 @@ "grunt-curl": "^2.0.2", "grunt-jsdoc": "^0.5.6", "grunt-nuget": "^0.1.3", + "mocha": "^2.1.0", "xmldom": "^0.1.19" } } http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/src/lib/cache.js ---------------------------------------------------------------------- diff --git a/src/lib/cache.js b/src/lib/cache.js index 9912865..3f39706 100644 --- a/src/lib/cache.js +++ b/src/lib/cache.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +'use strict'; /** @module cache */ @@ -147,7 +148,7 @@ function removeFromArray(arr, item) { /** Estimates the size of an object in bytes. * Object trees are traversed recursively * @param {Object} object - Object to determine the size of. - * @returns {Integer} Estimated size of the object in bytes. + * @returns {Number} Estimated size of the object in bytes. */ function estimateSize(object) { var size = 0; @@ -216,16 +217,7 @@ var READ_STATE_SOURCE = "source"; */ function DataCacheOperation(stateMachine, promise, isCancelable, index, count, data, pending) { - /// <field name="p" type="DjsDeferred">Promise for requested values.</field> - /// <field name="i" type="Number">Index of first item requested.</field> - /// <field name="c" type="Number">Count of items requested.</field> - /// <field name="d" type="Array">Array with the items requested by the operation.</field> - /// <field name="s" type="Array">Current state of the operation.</field> - /// <field name="canceled" type="Boolean">Whether the operation has been canceled.</field> - /// <field name="pending" type="Number">Total number of pending prefetch records.</field> - /// <field name="oncomplete" type="Function">Callback executed when the operation reaches the end state.</field> - - var stateData; + var stateData; var cacheState; var that = this; @@ -240,7 +232,7 @@ function DataCacheOperation(stateMachine, promise, isCancelable, index, count, d that.oncomplete = null; /** Transitions this operation to the cancel state and sets the canceled flag to true. - * The function is a no-op if the operation is non-cancelable.</summary> + * The function is a no-op if the operation is non-cancelable. * @method DataCacheOperation#cancel */ that.cancel = function cancel() { @@ -350,7 +342,7 @@ function DataCacheOperation(stateMachine, promise, isCancelable, index, count, d var handled = stateMachine(that, opTargetState, cacheState, data); djsassert(handled, "Bad operation state: " + opTargetState + " cacheState: " + cacheState, this); } else { - // DATAJS INTERNAL END + // DATAJS INTERNAL END stateMachine(that, opTargetState, cacheState, data); // DATAJS INTERNAL START } @@ -366,14 +358,13 @@ function DataCacheOperation(stateMachine, promise, isCancelable, index, count, d * @param {Object} state - State to transition the operation to. * @param {Object} [data] - */ - var transition = function (state, data) { + + that.transition = function (state, data) { that.s = state; stateData = data; operationStateMachine(state, cacheState, data); }; - that.transition = transition; - return that; } @@ -599,6 +590,7 @@ function DataCache(options) { throw cacheFailure; } + //return window.Rx.Observable.create(function (obs) { return new window.Rx.Observable(function (obs) { var disposed = false; var index = 0; @@ -615,10 +607,12 @@ function DataCache(options) { for (i = 0, len = data.value.length; i < len; i++) { // The wrapper automatically checks for Dispose // on the observer, so we don't need to check it here. + //obs.next(data.value[i]); obs.onNext(data.value[i]); } if (data.value.length < pageSize) { + //obs.completed(); obs.onCompleted(); } else { index += pageSize; @@ -670,7 +664,7 @@ function DataCache(options) { /** Updates the cache's state and signals all pending operations of the change. * @method DataCache~changeState * @param {Object} newState - New cache state. - * This method is a no-op if the cache's current state and the new state are the same.</remarks> + * This method is a no-op if the cache's current state and the new state are the same. */ var changeState = function (newState) { @@ -719,7 +713,7 @@ function DataCache(options) { /** Removes an operation from the caches queues and changes the cache state to idle. * @method DataCache~dequeueOperation * @param {DataCacheOperation} operation - Operation to dequeue. - * This method is used as a handler for the operation's oncomplete event.</remarks> + * This method is used as a handler for the operation's oncomplete event. */ var dequeueOperation = function (operation) { @@ -1014,7 +1008,6 @@ function DataCache(options) { /** Creates a function that handles a store error. * @method DataCache~storeFailureCallback * @param {DjsDeferred} deferred - Deferred object to resolve. - * @param {String} message - Message text. * @returns {Function} Function to use as error callback. * This function will specifically handle problems when interacting with the store. http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/src/lib/cache/source.js ---------------------------------------------------------------------- diff --git a/src/lib/cache/source.js b/src/lib/cache/source.js index af878c6..08dea0a 100644 --- a/src/lib/cache/source.js +++ b/src/lib/cache/source.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +'use strict'; /** @module cache/source */ @@ -100,8 +101,7 @@ function findQueryOptionStart(uri, name) { * @returns {Object} Object with an abort method. */ function queryForData (uri, options, success, error) { - var request = queryForDataInternal(uri, options, {}, success, error); - return request; + return queryForDataInternal(uri, options, {}, success, error); } /** Gets data from an OData service taking into consideration server side paging. http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/src/lib/deferred.js ---------------------------------------------------------------------- diff --git a/src/lib/deferred.js b/src/lib/deferred.js index 7d5fd68..ffc2431 100644 --- a/src/lib/deferred.js +++ b/src/lib/deferred.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +'use strict'; /** @module datajs/deferred */ @@ -177,7 +178,7 @@ function createDeferred() { } else { return new DjsDeferred(); } -}; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/src/lib/odata.js ---------------------------------------------------------------------- diff --git a/src/lib/odata.js b/src/lib/odata.js index 7ea728b..6f18c01 100644 --- a/src/lib/odata.js +++ b/src/lib/odata.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +'use strict'; /** @module odata */ @@ -165,7 +166,7 @@ exports.request = function (request, success, error, handler, httpClient, metada }; /** Parses the csdl metadata to DataJS metatdata format. This method can be used when the metadata is retrieved using something other than DataJS - * @param {string} csdlMetadata - A string that represents the entire csdl metadata. + * @param {string} csdlMetadataDocument - A string that represents the entire csdl metadata. * @returns {Object} An object that has the representation of the metadata in Datajs format. */ exports.parseMetadata = function (csdlMetadataDocument) { @@ -175,4 +176,5 @@ exports.parseMetadata = function (csdlMetadataDocument) { // Configure the batch handler to use the default handler for the batch parts. exports.batch.batchHandler.partHandler = exports.defaultHandler; -exports.metadataHandler = odataMetadata.metadataHandler; \ No newline at end of file +exports.metadataHandler = odataMetadata.metadataHandler; +exports.jsonHandler = odataJson.jsonHandler; http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/src/lib/odata/batch.js ---------------------------------------------------------------------- diff --git a/src/lib/odata/batch.js b/src/lib/odata/batch.js index c71fc31..d33ac53 100644 --- a/src/lib/odata/batch.js +++ b/src/lib/odata/batch.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +'use strict'; /** @module odata/batch */ @@ -36,19 +37,14 @@ var normalizeHeaders = odataUtils.normalizeHeaders; var prepareRequest = odataUtils.prepareRequest; - - - // Imports - - // CONTENT START var batchMediaType = "multipart/mixed"; var responseStatusRegex = /^HTTP\/1\.\d (\d{3}) (.*)$/i; var responseHeaderRegex = /^([^()<>@,;:\\"\/[\]?={} \t]+)\s?:\s?(.*)/; -/* Calculates a random 16 bit number and returns it in hexadecimal format. +/** Calculates a random 16 bit number and returns it in hexadecimal format. * @returns {String} A 16-bit number in hex format. */ function hex16() { @@ -56,7 +52,7 @@ function hex16() { return Math.floor((1 + Math.random()) * 0x10000).toString(16).substr(1); } -/* Creates a string that can be used as a multipart request boundary. +/** Creates a string that can be used as a multipart request boundary. * @param {String} [prefix] - * @returns {String} Boundary string of the format: <prefix><hex16>-<hex16>-<hex16> */ @@ -65,7 +61,7 @@ function createBoundary(prefix) { return prefix + hex16() + "-" + hex16() + "-" + hex16(); } -/* Gets the handler for data serialization of individual requests / responses in a batch. +/** Gets the handler for data serialization of individual requests / responses in a batch. * @param context - Context used for data serialization. * @returns Handler object */ @@ -74,7 +70,7 @@ function partHandler(context) { return context.handler.partHandler; } -/* Gets the current boundary used for parsing the body of a multipart response. +/** Gets the current boundary used for parsing the body of a multipart response. * @param context - Context used for parsing a multipart response. * @returns {String} Boundary string. */ @@ -109,7 +105,7 @@ function batchSerializer(handler, data, context) { } } -/* Parses a multipart/mixed response body from from the position defined by the context. +/** Parses a multipart/mixed response body from from the position defined by the context. * @param {String} text - Body of the multipart/mixed response. * @param context - Context used for parsing. * @return Array of objects representing the individual responses. @@ -125,7 +121,7 @@ function readBatch(text, context) { // Read the batch parts var responses = []; - var partEnd; + var partEnd = null; while (partEnd !== "--" && context.position < text.length) { var partHeaders = readHeaders(text, context); @@ -173,11 +169,11 @@ function readBatch(text, context) { return responses; } -/* Parses the http headers in the text from the position defined by the context. -* @param {String} text - Text containing an http response's headers</param> -* @param context - Context used for parsing. -* @returns Object containing the headers as key value pairs. -* This function doesn't support split headers and it will stop reading when it hits two consecutive line breaks. +/** Parses the http headers in the text from the position defined by the context. + * @param {String} text - Text containing an http response's headers + * @param context - Context used for parsing. + * @returns Object containing the headers as key value pairs. + * This function doesn't support split headers and it will stop reading when it hits two consecutive line breaks. */ function readHeaders(text, context) { var headers = {}; @@ -202,7 +198,7 @@ function readHeaders(text, context) { return headers; } -/* Parses an HTTP response. +/** Parses an HTTP response. * @param {String} text -Text representing the http response. * @param context optional - Context used for parsing. * @param {String} delimiter -String used as delimiter of the multipart response parts. @@ -245,8 +241,8 @@ function readLine(text, context) { } /** Returns a substring from the position given by the context up to value defined by the str parameter and increments the position in the context. - * @param {String} text - Input string.</param> - * @param context - Context used for reading the input string.</param> + * @param {String} text - Input string. + * @param context - Context used for reading the input string. * @param {String} [str] - Substring to read up to. * @returns {String} Substring to the first ocurrence of str or the end of the input string if str is not specified. Null if the marker is not found. */ @@ -294,7 +290,7 @@ function writeBatch(data, context) { } /** Creates the delimiter that indicates that start or end of an individual request. - * @param {String} boundary Boundary string used to indicate the start of the request</param> + * @param {String} boundary Boundary string used to indicate the start of the request * @param {Boolean} close - Flag indicating that a close delimiter string should be generated * @returns {String} Delimiter string */ @@ -309,8 +305,8 @@ function writeBatchPartDelimiter(boundary, close) { /** Serializes a part of a batch request to a string. A part can be either a GET request or * a change set grouping several CUD (create, update, delete) requests. - * @param part - Request or change set object in payload representation format</param> - * @param context - Object containing context information used for the serialization</param> + * @param part - Request or change set object in payload representation format + * @param context - Object containing context information used for the serialization * @param {boolean} [nested] - * @returns {String} String representing the serialized part * A change set is an array of request objects and they cannot be nested inside other change sets. @@ -348,8 +344,8 @@ function writeBatchPart(part, context, nested) { return result; } -/* Serializes a request object to a string. - * @param request - Request object to serialize</param> +/** Serializes a request object to a string. + * @param request - Request object to serialize * @returns {String} String representing the serialized request */ function writeRequest(request) { @@ -373,5 +369,9 @@ function writeRequest(request) { /** batchHandler (see {@link module:odata/batch~batchParser}) */ exports.batchHandler = handler(batchParser, batchSerializer, batchMediaType, MAX_DATA_SERVICE_VERSION); + +/** batchSerializer (see {@link module:odata/batch~batchSerializer}) */ exports.batchSerializer = batchSerializer; + +/** writeRequest (see {@link module:odata/batch~writeRequest}) */ exports.writeRequest = writeRequest; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/5bff25da/src/lib/odata/handler.js ---------------------------------------------------------------------- diff --git a/src/lib/odata/handler.js b/src/lib/odata/handler.js index cbd09c6..4c7260a 100644 --- a/src/lib/odata/handler.js +++ b/src/lib/odata/handler.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +'use strict'; /** @module odata/handler */ @@ -54,7 +55,7 @@ function contentType(str) { /** Serializes an object with media type and properties dictionary into a string. * @param contentType - Object with media type and properties dictionary to serialize. - * @return String representation of the media type object; undefined if contentType is null or undefined.</returns> + * @return String representation of the media type object; undefined if contentType is null or undefined. */ function contentTypeToString(contentType) { if (!contentType) { @@ -74,7 +75,7 @@ function contentTypeToString(contentType) { * @param {String} dataServiceVersion - String indicating the version of the protocol to use. * @param context - Operation context. * @param handler - Handler object that is processing a resquest or response. - * @return Context object.</returns> + * @return Context object. */ function createReadWriteContext(contentType, dataServiceVersion, context, handler) { @@ -203,7 +204,7 @@ function handlerRead(handler, parseCallback, response, context) { /** Invokes the serializer associated with a handler for generating the payload of a HTTP request. * @param handler - Handler object that is processing the request. * @param {Function} serializeCallback - Serializer function that will generate the request payload. - * @param response - HTTP request whose payload is going to be generated. + * @param request - HTTP request whose payload is going to be generated. * @param context - Object used as the context for serializing the request. * @returns {Boolean} True if the handler serialized the request payload and the request.body property was set; false otherwise. */ @@ -272,7 +273,6 @@ function textSerialize(handler, data /*, context */) { exports.textHandler = handler(textParse, textSerialize, "text/plain", MAX_DATA_SERVICE_VERSION); - exports.contentType = contentType; exports.contentTypeToString = contentTypeToString; exports.handler = handler;
