http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/BasicAuthDataService.svc ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/BasicAuthDataService.svc b/JSLib/tests/endpoints/BasicAuthDataService.svc deleted file mode 100644 index 66dcb1f..0000000 --- a/JSLib/tests/endpoints/BasicAuthDataService.svc +++ /dev/null @@ -1,108 +0,0 @@ -<%@ ServiceHost Language="C#" Factory="Microsoft.OData.Service.DataServiceHostFactory, Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" - Service="DataJS.Tests.BasicAuthDataService" %> - -namespace DataJS.Tests -{ - using System; - using System.Collections.Generic; - using Microsoft.OData.Service; - using Microsoft.OData.Service.Common; - using System.Linq; - using System.ServiceModel; - using System.ServiceModel.Web; - using System.Text; - using System.Web; - - [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class BasicAuthDataService : DataService<BasicAuthDataSource> - { - const string Username = "djsUser"; - const string Password = "djsPassword"; - - // This method is called only once to initialize service-wide policies. - public static void InitializeService(DataServiceConfiguration config) - { - config.SetEntitySetAccessRule("*", EntitySetRights.All); - config.SetServiceOperationAccessRule("*", ServiceOperationRights.All); - config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V4; - config.UseVerboseErrors = true; - } - - public BasicAuthDataService() - : base() - { - this.ProcessingPipeline.ProcessingRequest += OnRequest; - } - - [WebInvoke] - public void ResetData() - { - this.CurrentDataSource.ResetData(); - } - - private static void UnauthorizedRequest(DataServiceOperationContext context) - { - context.ResponseHeaders["WWW-Authenticate"] = "Basic realm=\"DataJS.Tests\""; - throw new DataServiceException(401, "401 Unauthorized"); - } - - private void OnRequest(object sender, DataServiceProcessingPipelineEventArgs e) - { - string authHeader = e.OperationContext.RequestHeaders["Authorization"]; - - // Validate the Authorization header - if (authHeader == null || !authHeader.StartsWith("Basic")) - { - UnauthorizedRequest(e.OperationContext); - } - - // Decode the username and password from the header - string base64Credentials = authHeader.Substring(6); - string[] credentials = Encoding.ASCII.GetString(Convert.FromBase64String(base64Credentials)).Split(':'); - if (credentials.Length != 2 || !(credentials[0].Equals(Username) && credentials[1].Equals(Password))) - { - UnauthorizedRequest(e.OperationContext); - } - } - } - - public class BasicAuthDataSource : ReflectionDataContext, IUpdatable - { - private static bool dataInitialized; - - public IQueryable<Customer> Customers - { - get { return this.GetResourceSetEntities<Customer>("Customers").AsQueryable(); } - } - - public void ResetData() - { - this.ClearData(); - - IList<Customer> customers = this.GetResourceSetEntities<Customer>("Customers"); - foreach (int i in Enumerable.Range(1, 16)) - { - customers.Add(new Customer() - { - ID = i, - Name = "Customer " + i - }); - } - } - - protected override void EnsureDataIsInitialized() - { - if (!dataInitialized) - { - this.ResetData(); - dataInitialized = true; - } - } - } - - public class Customer - { - public int ID { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/CustomAnnotations.xml ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/CustomAnnotations.xml b/JSLib/tests/endpoints/CustomAnnotations.xml deleted file mode 100644 index 622769f..0000000 --- a/JSLib/tests/endpoints/CustomAnnotations.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0"> - <edmx:DataServices m:DataServiceVersion="2.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> - <Schema xmlns="http://schemas.microsoft.com/ado/2007/05/edm" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:mcns="http://MyCustomNamespace.com" - Namespace="DataJS.Tests"> - <EntityType Name="MappedEntry" mcns:MyCustomAnnotation="My custom attribute."> - <Key mcns:MyCustomAnnotation="//"> - <PropertyRef Name="ID" mcns:MyCustomAnnotation=" "/> - </Key> - <Property Name="ID" Nullable="false" Type="Edm.Int32"/> - <Property Name="UnmappedField" Nullable="true" Type="Edm.String"/> - <Property Name="Author" Nullable="false" Type="DataJS.Tests.Author" m:FC_KeepInContent_5="false" m:FC_SourcePath_5="Contributor/Name" m:FC_ContentKind_5="text" m:FC_TargetPath_5="SyndicationContributorName" m:FC_KeepInContent_4="false" m:FC_SourcePath_4="Contributor/Email" m:FC_ContentKind_4="text" m:FC_TargetPath_4="SyndicationContributorEmail" m:FC_KeepInContent_3="false" m:FC_SourcePath_3="Uri" m:FC_ContentKind_3="text" m:FC_TargetPath_3="SyndicationAuthorUri" m:FC_KeepInContent_2="false" m:FC_SourcePath_2="Name" m:FC_ContentKind_2="text" m:FC_TargetPath_2="SyndicationAuthorName" m:FC_KeepInContent_1="false" m:FC_SourcePath_1="Email" m:FC_ContentKind_1="text" m:FC_TargetPath_1="SyndicationAuthorEmail" m:FC_KeepInContent="false" m:FC_SourcePath="Contributor/Uri" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationContributorUri"/> - <Property Name="Published" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationPublished"/> - <Property Name="Rights" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationRights"/> - <Property Name="Summary" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_ContentKind="xhtml" m:FC_TargetPath="SyndicationSummary"/> - <Property Name="Title" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_ContentKind="html" m:FC_TargetPath="SyndicationTitle"/> - <Property Name="Updated" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationUpdated"/> - <Property Name="CustomElement" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="customElement" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.org/dummy"/> - <Property Name="CustomAttribute" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="customElement/@customAttribute" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.org/dummy"/> - <Property Name="NestedElement1" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="commonElement/nestedElement1" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="NestedElement2" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="commonElement/nestedElement2" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="CommonAttribute1" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="commonElement/@commonAttribute1" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="CommonAttribute2" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="commonElement/@commonAttribute2" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="Location" Nullable="false" Type="DataJS.Tests.Location" m:FC_KeepInContent_1="false" m:FC_SourcePath_1="Long" m:FC_TargetPath_1="long" m:FC_KeepInContent="false" m:FC_SourcePath="Lat" m:FC_TargetPath="lat" m:FC_NsPrefix="geo" m:FC_NsUri="http://www.georss.org/georss" m:FC_NsPrefix_1="geo" m:FC_NsUri_1="http://www.georss.org/georss"/> - </EntityType> - <ComplexType Name="Author" mcns:MyCustomAnnotation=""> - <Property Name="Email" Nullable="true" Type="Edm.String" mcns:MyCustomAnnotation=""/> - <Property Name="Name" Nullable="true" Type="Edm.String"/> - <Property Name="Uri" Nullable="true" Type="Edm.String"/> - <Property Name="Contributor" Nullable="false" Type="DataJS.Tests.Contributor"/> - </ComplexType> - <ComplexType Name="Contributor"> - <Property Name="Email" Nullable="true" Type="Edm.String" mcns:MyCustomAnnotation=" "/> - <Property Name="Name" Nullable="true" Type="Edm.String"/> - <Property Name="Uri" Nullable="true" Type="Edm.String" mcns:MyCustomAnnotation="true"/> - </ComplexType> - <ComplexType Name="Location"> - <Property Name="Lat" Nullable="false" Type="Edm.Single" mcns:MyCustomAnnotation="27"/> - <Property Name="Long" Nullable="false" Type="Edm.Single"/> - </ComplexType> - <EntityType Name="ReplicatedEntry"> - <Key> - <PropertyRef Name="ID"/> - </Key> - <Property Name="ID" Nullable="false" Type="Edm.Int32"/> - <Property Name="UnmappedField" Nullable="true" Type="Edm.String"/> - <Property Name="Author" Nullable="false" Type="DataJS.Tests.Author2" m:FC_KeepInContent_5="true" m:FC_SourcePath_5="Contributor/Uri" m:FC_ContentKind_5="text" m:FC_TargetPath_5="SyndicationContributorUri" m:FC_KeepInContent_4="true" m:FC_SourcePath_4="Contributor/Name" m:FC_ContentKind_4="text" m:FC_TargetPath_4="SyndicationContributorName" m:FC_KeepInContent_3="true" m:FC_SourcePath_3="Contributor/Email" m:FC_ContentKind_3="text" m:FC_TargetPath_3="SyndicationContributorEmail" m:FC_KeepInContent_2="true" m:FC_SourcePath_2="Uri" m:FC_ContentKind_2="text" m:FC_TargetPath_2="SyndicationAuthorUri" m:FC_KeepInContent_1="true" m:FC_SourcePath_1="Name" m:FC_ContentKind_1="text" m:FC_TargetPath_1="SyndicationAuthorName" m:FC_KeepInContent="true" m:FC_SourcePath="Email" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationAuthorEmail" mcns:MyCustomAnnotation="b>100/b>"/> - <Property Name="Published" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationPublished" mcns:MyCustomAnnotation=" . "/> - <Property Name="Rights" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationRights"/> - <Property Name="Summary" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_ContentKind="xhtml" m:FC_TargetPath="SyndicationSummary" mcns:MyCustomAnnotation="/Property"/> - <Property Name="Title" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_ContentKind="html" m:FC_TargetPath="SyndicationTitle"/> - <Property Name="Updated" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_ContentKind="text" m:FC_TargetPath="SyndicationUpdated"/> - <Property Name="CustomElement" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_TargetPath="customElement" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.org/dummy"/> - <Property Name="CustomAttribute" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_TargetPath="customElement/@customAttribute" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.org/dummy"/> - <Property Name="NestedElement1" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_TargetPath="commonElement/nestedElement1" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="NestedElement2" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_TargetPath="commonElement/nestedElement2" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="CommonAttribute1" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_TargetPath="commonElement/@commonAttribute1" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="CommonAttribute2" Nullable="true" Type="Edm.String" m:FC_KeepInContent="true" m:FC_TargetPath="commonElement/@commonAttribute2" m:FC_NsPrefix="pr" m:FC_NsUri="http://www.example.com/dummy"/> - <Property Name="Location" Nullable="false" Type="DataJS.Tests.Location2" m:FC_KeepInContent_1="true" m:FC_SourcePath_1="Long" m:FC_TargetPath_1="long" m:FC_KeepInContent="true" m:FC_SourcePath="Lat" m:FC_TargetPath="lat" m:FC_NsPrefix="geo" m:FC_NsUri="http://www.georss.org/georss" m:FC_NsPrefix_1="geo" m:FC_NsUri_1="http://www.georss.org/georss"/> - </EntityType> - <ComplexType Name="Author2"> - <Property Name="Email" Nullable="true" Type="Edm.String"/> - <Property Name="Name" Nullable="true" Type="Edm.String"/> - <Property Name="Uri" Nullable="true" Type="Edm.String"/> - <Property Name="Contributor" Nullable="false" Type="DataJS.Tests.Contributor2"/> - </ComplexType> - <ComplexType Name="Contributor2"> - <Property Name="Email" Nullable="true" Type="Edm.String"/> - <Property Name="Name" Nullable="true" Type="Edm.String"/> - <Property Name="Uri" Nullable="true" Type="Edm.String"/> - </ComplexType> - <ComplexType Name="Location2"> - <Property Name="Lat" Nullable="false" Type="Edm.Single"/> - <Property Name="Long" Nullable="false" Type="Edm.Single"/> - </ComplexType> - <EntityType Name="DerivedEntry" m:FC_KeepInContent="false" m:FC_SourcePath="MappedInDerivedField" m:FC_TargetPath="mappedField/@mappedInDerived" m:FC_NsPrefix="pre" m:FC_NsUri="http://www.example.com/dummy" BaseType="DataJS.Tests.BaseEntry"> - <Property Name="UnmappedConcreteField" Nullable="true" Type="Edm.String"/> - <Property Name="MappedConcreteField" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="mappedField/@mappedConcrete" m:FC_NsPrefix="pre" m:FC_NsUri="http://www.example.com/dummy"/> - </EntityType> - <EntityType Name="BaseEntry"> - <Key> - <PropertyRef Name="ID"/> - </Key> - <Property Name="ID" Nullable="false" Type="Edm.Int32"/> - <Property Name="UnmappedField" Nullable="true" Type="Edm.String"/> - <Property Name="MappedInDerivedField" Nullable="true" Type="Edm.String" mcns:MyCustomAnnotation="false"/> - <Property Name="MappedField" Nullable="true" Type="Edm.String" m:FC_KeepInContent="false" m:FC_TargetPath="mappedField" m:FC_NsPrefix="pre" m:FC_NsUri="http://www.example.com/dummy"/> - </EntityType> - <EntityContainer Name="EpmDataSource" m:IsDefaultEntityContainer="true" mcns:MyCustomAnnotation="0"> - <EntitySet Name="MappedEntries" EntityType="DataJS.Tests.MappedEntry"/> - <EntitySet Name="ReplicatedEntries" EntityType="DataJS.Tests.ReplicatedEntry"/> - <EntitySet Name="HierarchicalEntries" EntityType="DataJS.Tests.BaseEntry"/> - <FunctionImport Name="ResetData" m:HttpMethod="POST" mcns:MyCustomAnnotation="null"/> - </EntityContainer> - <mcns:EmptyElement></mcns:EmptyElement> - <mcns:ParentCustomElement mcns:MyCustomAnnotation="annotation" mcns:MySecondCustomAnnotation="annotation 2"> - <mcns:CustomChildElement1>Custom metadata 1.</mcns:CustomChildElement1> - <mcns:CustomChildElement2>Custom metadata 2.</mcns:CustomChildElement2> - </mcns:ParentCustomElement> - </Schema> - </edmx:DataServices> -</edmx:Edmx> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/CustomDataService.svc ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/CustomDataService.svc b/JSLib/tests/endpoints/CustomDataService.svc deleted file mode 100644 index f30a261..0000000 --- a/JSLib/tests/endpoints/CustomDataService.svc +++ /dev/null @@ -1,76 +0,0 @@ -<%@ ServiceHost Language="C#" Debug="true" Factory="System.ServiceModel.Activation.WebServiceHostFactory" - Service="DataJS.Tests.CustomDataService" %> - -// 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. - -using System.Collections; -using System.IO; - -namespace DataJS.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.ServiceModel; - using System.ServiceModel.Activation; - using System.ServiceModel.Web; - - /// <summary> - /// Custom data service that does not use OData - /// </summary> - [ServiceContract] - [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] - public class CustomDataService - { - static readonly Item[] data = Enumerable.Range(0, 16).Select(i => new Item - { - ID = i, - Name = "Item " + i - }).ToArray(); - - // This uses the same URI template as OData so that the CacheOracle can be reused - [OperationContract] - [WebGet(UriTemplate = "ReadRange?$skip={skip}&$top={top}")] - public Stream ReadRange(int skip, int top) - { - IEnumerable selectData = data.Skip(skip).Take(top); - Dictionary<string, object> result = new Dictionary<string, object>(); - List<Dictionary<string, string>> value = new List<Dictionary<string, string>>(); - foreach (Item d in selectData) - { - Dictionary<string, string> item = new Dictionary<string, string>(); - item.Add("ID", d.ID.ToString()); - item.Add("Name", d.Name); - value.Add(item); - } - - result.Add("value", value); - return ReaderUtils.ConvertDictionarytoJsonlightStream(result); - } - - [OperationContract] - [WebGet(ResponseFormat = WebMessageFormat.Json)] - public int Count() - { - return data.Count(); - } - } - - public class Item - { - public int ID { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/EpmDataService.svc ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/EpmDataService.svc b/JSLib/tests/endpoints/EpmDataService.svc deleted file mode 100644 index ba90c23..0000000 --- a/JSLib/tests/endpoints/EpmDataService.svc +++ /dev/null @@ -1,315 +0,0 @@ -<%@ ServiceHost Language="C#" Factory="Microsoft.OData.Service.DataServiceHostFactory, Microsoft.OData.Service, Version=6.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" - Service="DataJS.Tests.EpmDataService" %> - -namespace DataJS.Tests -{ - using System; - using System.Collections.Generic; - using Microsoft.OData.Service; - using Microsoft.OData.Service.Common; - using System.Linq; - using System.ServiceModel.Web; - - /// <summary> - /// A data service that uses EPM - /// </summary> - [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class EpmDataService : DataService<EpmDataSource> - { - // This method is called only once to initialize service-wide policies. - public static void InitializeService(DataServiceConfiguration config) - { - config.SetEntitySetAccessRule("*", EntitySetRights.All); - config.SetServiceOperationAccessRule("*", ServiceOperationRights.All); - config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V4; - config.UseVerboseErrors = true; - - } - - [WebInvoke] - public void ResetData() - { - this.CurrentDataSource.ResetData(); - } - } - - public class EpmDataSource : ReflectionDataContext, IUpdatable - { - private static bool dataInitialized; - - public IQueryable<MappedEntry> MappedEntries - { - get { return this.GetResourceSetEntities<MappedEntry>("MappedEntries").AsQueryable(); } - } - - public IQueryable<ReplicatedEntry> ReplicatedEntries - { - get { return this.GetResourceSetEntities<ReplicatedEntry>("ReplicatedEntries").AsQueryable(); } - } - - public IQueryable<BaseEntry> HierarchicalEntries - { - get { return this.GetResourceSetEntities<BaseEntry>("HierarchicalEntries").AsQueryable(); } - } - - public void ResetData() - { - this.ClearData(); - - MappedEntry[] mappedEntries = new MappedEntry[] - { - new MappedEntry - { - ID = 0, - UnmappedField = "Unmapped0", - Author = new Author - { - Email = "AuthorEmail0", - Name = "AuthorName0", - Uri = "http://www.example.com/AuthorUri", - Contributor = new Contributor - { - Email = "ContributorEmail0", - Name = "ContributorName0", - Uri = "http://www.example.com/ContributorUri", - }, - }, - Published = "2000-01-01T00:00:00-08:00", - Rights = "Rights0", - Summary = "<xmlElement xmlns=\"http://www.example.org/dummy\" attr=\"value0\">Summary0</xmlElement>", - Title = "Title<b>0</b>", - Updated = "2000-01-01T00:00:00-08:00", - CustomElement = "CustomElement0", - CustomAttribute = "CustomAttribute0", - NestedElement1 = "NestedElement1_0", - NestedElement2 = "NestedElement2_0", - CommonAttribute1 = "CommonAttribute1_0", - CommonAttribute2 = "CommonAttribute2_0", - Location = new Location - { - Lat = 3.14f, - Long = 2.72f - } - }, - - new MappedEntry - { - ID = 1, - UnmappedField = null, - Author = new Author - { - Email = null, - Name = string.Empty, - Uri = "http://www.example.com/AuthorUri1", - Contributor = new Contributor - { - Email = null, - Name = string.Empty, - Uri = "http://www.example.com/ContributorUri1", - }, - }, - Published = "2000-01-01T00:00:00-08:00", - Rights = null, - Summary = "", - Title = "Title<i>1</i>", - Updated = "2111-01-01T00:00:00-08:00", - CustomElement = null, - NestedElement1 = string.Empty, - NestedElement2 = "NestedElement2_1", - CustomAttribute = null, - CommonAttribute1 = string.Empty, - CommonAttribute2 = "CommonAttribute2_1", - Location = new Location - { - Lat = float.MaxValue, - Long = float.MinValue - } - }, - - new MappedEntry - { - ID = 2, - UnmappedField = "Unmapped2", - Author = new Author - { - Email = "AuthorEmail2", - Name = "AuthorName2", - Uri = "http://www.example.com/AuthorUri2", - Contributor = null - }, - Published = "2000-01-01T00:00:00-08:00", - Rights = "Rights2", - Summary = "Summary2", - Title = "Title2", - Updated = "2000-01-01T00:00:00-08:00", - CustomElement = "CustomElement2", - CustomAttribute = "CustomAttribute2", - NestedElement1 = "NestedElement1_2", - NestedElement2 = "NestedElement2_2", - CommonAttribute1 = "CommonAttribute1_2", - CommonAttribute2 = "CommonAttribute2_2", - Location = null - }, - }; - Array.ForEach(mappedEntries, (item) => this.GetResourceSetEntities<MappedEntry>("MappedEntries").Add(item)); - - Array.ForEach(mappedEntries, (item) => this.GetResourceSetEntities<ReplicatedEntry>("ReplicatedEntries").Add(new ReplicatedEntry - { - ID = item.ID, - UnmappedField = item.UnmappedField, - Author = item.Author == null ? null : new Author2 - { - Email = item.Author.Email, - Name = item.Author.Name, - Uri = item.Author.Uri, - Contributor = item.Author.Contributor == null ? null : new Contributor2 - { - Name = item.Author.Contributor.Name, - Email = item.Author.Contributor.Email, - Uri = item.Author.Contributor.Uri - }, - }, - Published = item.Published, - Rights = item.Rights, - Summary = item.Summary, - Title = item.Title, - Updated = item.Updated, - CustomElement = item.CustomElement, - CustomAttribute = item.CustomAttribute, - NestedElement1 = item.NestedElement1, - NestedElement2 = item.NestedElement2, - CommonAttribute1 = item.CommonAttribute1, - CommonAttribute2 = item.CommonAttribute2, - Location = item.Location == null ? null : new Location2 - { - Lat = item.Location.Lat, - Long = item.Location.Long - } - })); - - BaseEntry[] hierarchicalEntries = new BaseEntry[] - { - new BaseEntry - { - ID = 0, - MappedField = "MappedField0", - MappedInDerivedField = "MappedInDerivedField0", - UnmappedField = "UnmappedField0" - }, - new DerivedEntry - { - ID = 1, - MappedField = "MappedField1", - MappedInDerivedField = "MappedInDerivedField1", - UnmappedField = "UnmappedField1", - MappedConcreteField = "MappedConcreteField1", - UnmappedConcreteField = "UnmappedConcreteField1" - }, - }; - Array.ForEach(hierarchicalEntries, (item) => this.GetResourceSetEntities<BaseEntry>("HierarchicalEntries").Add(item)); - } - - protected override void EnsureDataIsInitialized() - { - if (!dataInitialized) - { - this.ResetData(); - dataInitialized = true; - } - } - } - - public class Author - { - public string Email { get; set; } - public string Name { get; set; } - public string Uri { get; set; } - public Contributor Contributor { get; set; } - } - - public class Contributor - { - public string Email { get; set; } - public string Name { get; set; } - public string Uri { get; set; } - } - - public class Location - { - public float Lat { get; set; } - public float Long { get; set; } - } - - public class Author2 - { - public string Email { get; set; } - public string Name { get; set; } - public string Uri { get; set; } - public Contributor2 Contributor { get; set; } - } - - public class Contributor2 - { - public string Email { get; set; } - public string Name { get; set; } - public string Uri { get; set; } - } - - public class Location2 - { - public float Lat { get; set; } - public float Long { get; set; } - } - - public class MappedEntry - { - public int ID { get; set; } - public string UnmappedField { get; set; } - public Author Author { get; set; } - public string Published { get; set; } - public string Rights { get; set; } - public string Summary { get; set; } - public string Title { get; set; } - public string Updated { get; set; } - public string CustomElement { get; set; } - public string CustomAttribute { get; set; } - public string NestedElement1 { get; set; } - public string NestedElement2 { get; set; } - public string CommonAttribute1 { get; set; } - public string CommonAttribute2 { get; set; } - public Location Location { get; set; } - } - - public class ReplicatedEntry - { - public int ID { get; set; } - public string UnmappedField { get; set; } - public Author2 Author { get; set; } - public string Published { get; set; } - public string Rights { get; set; } - public string Summary { get; set; } - public string Title { get; set; } - public string Updated { get; set; } - public string CustomElement { get; set; } - public string CustomAttribute { get; set; } - public string NestedElement1 { get; set; } - public string NestedElement2 { get; set; } - public string CommonAttribute1 { get; set; } - public string CommonAttribute2 { get; set; } - public Location2 Location { get; set; } - } - - public class BaseEntry - { - public int ID { get; set; } - public string UnmappedField { get; set; } - public string MappedInDerivedField { get; set; } - public string MappedField { get; set; } - } - - public class DerivedEntry : BaseEntry - { - public string UnmappedConcreteField { get; set; } - public string MappedConcreteField { get; set; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/ErrorDataService.svc ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/ErrorDataService.svc b/JSLib/tests/endpoints/ErrorDataService.svc deleted file mode 100644 index d25e30e..0000000 --- a/JSLib/tests/endpoints/ErrorDataService.svc +++ /dev/null @@ -1,56 +0,0 @@ -<%@ ServiceHost Language="C#" Factory="Microsoft.OData.Service.DataServiceHostFactory, Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" - Service="DataJS.Tests.ErrorDataService" %> - -namespace DataJS.Tests -{ - using System; - using System.Collections.Generic; - using Microsoft.OData.Service; - using Microsoft.OData.Service.Common; - using System.Linq; - - /// <summary> - /// A data service that contains in-stream errors - /// </summary> - public class ErrorDataService : DataService<ErrorDataSource> - { - // This method is called only once to initialize service-wide policies. - public static void InitializeService(DataServiceConfiguration config) - { - config.SetEntitySetAccessRule("*", EntitySetRights.All); - config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V4; - } - } - - public class ErrorDataSource - { - public IQueryable<ErrorType> Entities - { - get - { - ErrorType[] entities = new ErrorType[] - { - new ErrorType(() => 0), - new ErrorType(() => { throw new ApplicationException(); }) - }; - - return entities.AsQueryable(); - } - } - } - - public class ErrorType - { - Func<int> generateID; - - public ErrorType(Func<int> generateID) - { - this.generateID = generateID; - } - - public int ID - { - get { return this.generateID(); } - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/FoodStoreDataServiceV4.svc ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/FoodStoreDataServiceV4.svc b/JSLib/tests/endpoints/FoodStoreDataServiceV4.svc deleted file mode 100644 index 21f09cf..0000000 --- a/JSLib/tests/endpoints/FoodStoreDataServiceV4.svc +++ /dev/null @@ -1,589 +0,0 @@ -<%@ ServiceHost Language="C#" Factory="Microsoft.OData.Service.DataServiceHostFactory, Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" - Service="DataJS.Tests.V4.FoodStoreDataService" %> - -// 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.V4 -{ - using System; - using System.Collections.Generic; - using Microsoft.OData.Service; - using Microsoft.OData.Service.Common; - using Microsoft.OData.Service.Providers; - using System.Linq; - using System.ServiceModel.Web; - using System.Web; - using System.IO; - using Microsoft.Spatial; - - /// <summary> - /// Provides a service similar to FoodStoreDataService, but uses V4 and WCF Data Services 6.0.0-beta1 - /// features. - /// </summary> - [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class FoodStoreDataService : DataService<FoodContainer> - { - // This method is called only once to initialize service-wide policies. - public static void InitializeService(DataServiceConfiguration config) - { - config.SetEntitySetAccessRule("*", EntitySetRights.All); - config.SetServiceOperationAccessRule("*", ServiceOperationRights.All); - config.UseVerboseErrors = true; - // Set Foods page size to 5 for cache testing - config.SetEntitySetPageSize("Foods", 5); - // Make the Categories set paged to have a paged feed - config.SetEntitySetPageSize("Categories", 1); - } - - [WebInvoke] - public string ResetData() - { - this.CurrentDataSource.ResetData(); - return "Data Reset"; - } - - [WebGet] - public IQueryable<string> FoodsAvailable() - { - return this.CurrentDataSource.Foods.Select(food => food.Name); - } - - [WebGet] - public IQueryable<Package> PackagingTypes() - { - return this.CurrentDataSource.Foods.Select(food => food.Packaging); - } - - [WebGet] - public string UserNameAndPassword() - { - var request = WebOperationContext.Current.IncomingRequest; - string authorization = request.Headers["Authorization"]; - if (String.IsNullOrEmpty(authorization)) - { - WebOperationContext.Current.OutgoingResponse.Headers["WWW-Authenticate"] = "Basic realm=\"localhost\""; - throw new DataServiceException(401, "Access denied in UserNameAndPassword"); - } - - return authorization; - } - } - - public class FoodContainer : ReflectionDataContext, IUpdatable, IDataServiceStreamProvider2 - { - private static bool dataInitialized; - - public IQueryable<Category> Categories - { - get { return this.GetResourceSetEntities<Category>("Categories").AsQueryable(); } - } - - public IQueryable<Food> Foods - { - get { return this.GetResourceSetEntities<Food>("Foods").AsQueryable(); } - } - - public void ResetData() - { - this.ClearData(); - - var builder = SpatialImplementation.CurrentImplementation.CreateBuilder(); - builder.GeometryPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeography); - builder.GeometryPipeline.BeginGeometry(SpatialType.Collection); - builder.GeometryPipeline.BeginFigure(new GeometryPosition(5.0, 5.0)); - builder.GeometryPipeline.EndFigure(); - builder.GeometryPipeline.EndGeometry(); - - int i = 0; - Category[] categories = new Category[] - { - new Category { CategoryID = i++, Name = "Baking Supplies" }, - new Category { CategoryID = i++, Name = "Condiments" }, - new Category { CategoryID = i++, Name = "Empty Category" } - }; - Array.ForEach(categories, (category) => this.GetResourceSetEntities<Category>("Categories").Add(category)); - - i = 0; - Food[] foods = new Food[] - { - new Food() - { - FoodID = i++, - Name = "flour", - UnitPrice = .19999, - ServingSize = 1, - MeasurementUnit = "Cup", - ProteinGrams = 3, - FatGrams = 1, - CarbohydrateGrams = 20, - CaloriesPerServing = 140, - IsAvailable = true, - ExpirationDate = new DateTime(2010, 12, 25, 12, 0, 0), - ItemGUID = new Guid("27272727272727272727272727272727"), - Weight = 10f, - AvailableUnits = 1, - - Packaging = new Package(){ - Type = null, - Color = String.Empty, - NumberPerPackage = int.MaxValue, - RequiresRefridgeration = false, - PackageDimensions = new Dimensions() - { - Length = Decimal.MaxValue, - Height = Int16.MaxValue, - Width = Int64.MaxValue, - Volume = double.MaxValue, - }, - ShipDate = new DateTime(2000, 12, 29) - }, - - CookedSize = new CookedDimensions() - { - Height = 1, - Length = 2, - Width = 3, - Volume = 1 * 2 * 3 - }, - - Category = categories[0], - - AlternativeNames = new List<string>() {"ground cereal", "ground grain"}, - - Providers = new List<Provider> { - new Provider() { - Name= "Flour Provider", - Aliases = new List<string>() {"fp1", "flour provider1"}, - Details = new ProviderDetails() { - Telephone= "555-555-555", - PreferredCode = 1001 - } - }, - new Provider() { - Name= "Ground Grains", - Aliases = new List<string>() - } - }, - - SpatialData = (GeometryCollection)builder.ConstructedGeometry - }, - - new Food() - { - FoodID = i++, - Name = "sugar", - UnitPrice = .2, - ServingSize = 1, - MeasurementUnit = "tsp", - ProteinGrams = 0, - FatGrams = 0, - CarbohydrateGrams = 4, - CaloriesPerServing = 16, - IsAvailable = false, - ExpirationDate = new DateTime(2011, 12, 28), - ItemGUID = new Guid("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"), - Weight = 0.1f, - AvailableUnits = 0, - - Packaging = new Package(){ - Type = " ", - Color = "BLUE", - NumberPerPackage = int.MinValue, - RequiresRefridgeration = true, - PackageDimensions = new Dimensions(){ - Length = Decimal.MinValue, - Height = Int16.MinValue, - Width = Int64.MinValue, - Volume = double.MinValue, - }, - ShipDate = new DateTime(2000, 12, 29), - }, - - Category = categories[1], - }, - - new Food() - { - FoodID = i++, - Name = "1 Chicken Egg", - UnitPrice = 0.55, - MeasurementUnit = null, - ServingSize = 1, - ProteinGrams = 6, - FatGrams = 1, - CarbohydrateGrams = 1, - CaloriesPerServing = 70, - IsAvailable = true, - ExpirationDate = new DateTime(2000, 12, 29), - ItemGUID = new Guid("00000000000000000000000000000000"), - Weight = 0, - AvailableUnits = -128, - - Packaging = new Package(){ - Type = "18 - Carton", - Color = " brown ", - NumberPerPackage = 0, - RequiresRefridgeration = true, - PackageDimensions = null, - ShipDate = new DateTime(2000, 12, 29), - }, - - Category = null, - }, - - new Food() - { - FoodID = i++, - Name = "Brown Sugar", - UnitPrice = 1.6, - ServingSize = 1, - MeasurementUnit = "TSP.", - ProteinGrams = 0, - FatGrams = 0, - CarbohydrateGrams = 5, - CaloriesPerServing = 16, - IsAvailable = true, - ExpirationDate = new DateTime(2011, 12, 28), - ItemGUID = new Guid("0123456789abcdef0123456789abcdef"), - Weight = 4.5f, - AvailableUnits = 127, - Packaging = null, - Category = categories[1], - }, - - new PreparedFood() - { - FoodID = i++, - Name = "Cobb Salad", - UnitPrice = 1.99, - ServingSize = -1, - MeasurementUnit = "cups", - ProteinGrams = 6, - FatGrams = 1, - CarbohydrateGrams = 3, - CaloriesPerServing = 5, - IsAvailable = true, - ExpirationDate = new DateTime(2000, 12, 29), - ItemGUID = new Guid("0123456789abcdef0123456789abcdef"), - Weight = 5.674f, - AvailableUnits = 127, - Packaging = null, - Category = categories[1], - Instructions = "1.) Open 2.) Eat", - NumberOfIngredients = 4, - }, - - new PreparedFood() - { - FoodID = i++, - Name = "Lasagna", - UnitPrice = 0, - ServingSize = 8, - MeasurementUnit = " servings", - ProteinGrams = 100, - FatGrams = 4, - CarbohydrateGrams = 27, - CaloriesPerServing = 389, - IsAvailable = true, - ExpirationDate = new DateTime(1904, 2, 29), - ItemGUID = new Guid("0123456789abcdef0123456789abcdef"), - Weight = 0, - AvailableUnits = 4, - Packaging = new Package(){ - Type = "box", - Color = " 1 ", - NumberPerPackage = 1, - RequiresRefridgeration = true, - PackageDimensions = new Dimensions(){ - Length = 3, - Height = 1, - Width = 5, - Volume = 1.5, - }, - ShipDate = new DateTime(2000, 12, 29), - }, - Category = categories[0], - Instructions = "Bake in oven", - NumberOfIngredients = 15, - }, - - new Food() - { - FoodID = i++, - Name = "Chocolate" - }, - - new Food() - { - FoodID = i++, - Name = "Pizza" - }, - - new Food() - { - FoodID = i++, - Name = "Avocados" - }, - - new Food() - { - FoodID = i++, - Name = "Quinoa" - }, - - new Food() - { - FoodID = i++, - Name = "Oatmeal" - }, - - new Food() - { - FoodID = i++, - Name = "Peanut Butter" - }, - - new Food() - { - FoodID = i++, - Name = "Banana" - }, - - new Food() - { - FoodID = i++, - Name = "Yam" - }, - - new Food() - { - FoodID = i++, - Name = "Clam" - }, - - new Food() - { - FoodID = i++, - Name = "Spam" - } - }; - Array.ForEach(foods, (food) => this.GetResourceSetEntities<Food>("Foods").Add(food)); - - categories[0].Foods.Add(foods[0]); - categories[1].Foods.Add(foods[2]); - categories[1].Foods.Add(foods[3]); - } - - protected override void EnsureDataIsInitialized() - { - if (!dataInitialized) - { - this.ResetData(); - dataInitialized = true; - } - } - - public Stream GetReadStream(object entity, ResourceProperty streamProperty, string etag, bool? checkETagForEquality, DataServiceOperationContext operationContext) - { - return new MemoryStream(); - } - - public Uri GetReadStreamUri(object entity, ResourceProperty streamProperty, DataServiceOperationContext operationContext) - { - if (streamProperty.Name == "Icon") - { - return null; - } - return new Uri(operationContext.AbsoluteServiceUri, streamProperty.Name); - } - - public string GetStreamContentType(object entity, ResourceProperty streamProperty, DataServiceOperationContext operationContext) - { - if (streamProperty.Name == "Icon") - { - return "image/gif"; - } - return "image/png"; - } - - public string GetStreamETag(object entity, ResourceProperty streamProperty, DataServiceOperationContext operationContext) - { - return "W/\"123456789\""; - } - - public Stream GetWriteStream(object entity, ResourceProperty streamProperty, string etag, bool? checkETagForEquality, DataServiceOperationContext operationContext) - { - return new MemoryStream(); - } - - public void DeleteStream(object entity, DataServiceOperationContext operationContext) - { - // do nothing. - } - - public Stream GetReadStream(object entity, string etag, bool? checkETagForEquality, DataServiceOperationContext operationContext) - { - throw new NotImplementedException(); - } - - public Uri GetReadStreamUri(object entity, DataServiceOperationContext operationContext) - { - throw new NotImplementedException(); - } - - public string GetStreamContentType(object entity, DataServiceOperationContext operationContext) - { - throw new NotImplementedException(); - } - - public string GetStreamETag(object entity, DataServiceOperationContext operationContext) - { - throw new NotImplementedException(); - } - - public Stream GetWriteStream(object entity, string etag, bool? checkETagForEquality, DataServiceOperationContext operationContext) - { - throw new NotImplementedException(); - } - - public string ResolveType(string entitySetName, DataServiceOperationContext operationContext) - { - throw new NotImplementedException(); - } - - public int StreamBufferSize - { - get { return 1024; } - } - } - - /// <summary> - /// The Category class is a simple class with V1-compatible feed customizations. - /// </summary> - [DataServiceKey("CategoryID")] - [EntitySet("Categories")] - [NamedStream("Icon")] - public class Category - { - public Category() - { - this.Foods = new List<Food>(); - } - - public int CategoryID { get; set; } - public string Name { get; set; } - public List<Food> Foods { get; set; } - } - - /// <summary> - /// The Food class has a mixture of V1-compatible and incompatible feed - /// customizations (thus it's V2), and custom mappings. - /// </summary> - [DataServiceKey("FoodID")] - [EntitySet("Foods")] - [NamedStream("Picture")] - public class Food - { - private List<string> alternativeNames = new List<string>(); - private List<Provider> providers = new List<Provider>(); - - // Primitive types - public int FoodID { get; set; } - public string Name { get; set; } - public double UnitPrice { get; set; } - public Decimal ServingSize { get; set; } - public string MeasurementUnit { get; set; } - public Byte ProteinGrams { get; set; } - public Int16 FatGrams { get; set; } - public Int32 CarbohydrateGrams { get; set; } - public Int64 CaloriesPerServing { get; set; } - public Boolean IsAvailable { get; set; } - public DateTime ExpirationDate { get; set; } - public Guid ItemGUID { get; set; } - public Single Weight { get; set; } - public sbyte AvailableUnits { get; set; } - - // Complex types - public Package Packaging { get; set; } - public CookedDimensions CookedSize { get; set; } - - // Navigation properties - public Category Category { get; set; } - - // Collection properties - public List<string> AlternativeNames - { - get { return alternativeNames; } - set { alternativeNames = value; } - } - - public List<Provider> Providers - { - get { return providers; } - set { providers = value; } - } - - public GeometryCollection SpatialData - { - get; - set; - } - - } - - public class Provider - { - public string Name { get; set; } - public List<string> Aliases { get; set; } - public ProviderDetails Details { get; set; } - } - - public class ProviderDetails - { - public string Telephone { get; set; } - public int PreferredCode { get; set; } - } - - public class Package - { - public string Type { get; set; } - public string Color { get; set; } - public int NumberPerPackage { get; set; } - public Boolean RequiresRefridgeration { get; set; } - public DateTime ShipDate { get; set; } - public Dimensions PackageDimensions { get; set; } - } - - public class Dimensions - { - public Decimal Length { get; set; } - public Int16 Height { get; set; } - public Int64 Width { get; set; } - public double Volume { get; set; } - } - - public class CookedDimensions - { - public Decimal Length { get; set; } - public Int16 Height { get; set; } - public Int64 Width { get; set; } - public double Volume { get; set; } - } - - public class PreparedFood : Food - { - public string Instructions { get; set; } - public float NumberOfIngredients { get; set; } - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/LargeCollectionService.svc ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/LargeCollectionService.svc b/JSLib/tests/endpoints/LargeCollectionService.svc deleted file mode 100644 index 122d045..0000000 --- a/JSLib/tests/endpoints/LargeCollectionService.svc +++ /dev/null @@ -1,93 +0,0 @@ -<%@ ServiceHost Language="C#" Factory="Microsoft.OData.Service.DataServiceHostFactory, Microsoft.OData.Service, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" - Service="DataJS.Tests.LargeCollectionService" %> - -namespace DataJS.Tests -{ - using System; - using System.Collections.Generic; - using Microsoft.OData.Service; - using Microsoft.OData.Service.Common; - using System.Linq; - using System.ServiceModel; - using System.ServiceModel.Web; - using System.Web; - - [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class LargeCollectionService : DataService<LargeCollection> - { - // This method is called only once to initialize service-wide policies. - public static void InitializeService(DataServiceConfiguration config) - { - config.SetEntitySetAccessRule("*", EntitySetRights.All); - config.SetServiceOperationAccessRule("*", ServiceOperationRights.All); - config.UseVerboseErrors = true; - } - - [WebInvoke] - public void ResetData() - { - this.CurrentDataSource.ResetData(); - } - } - - public class LargeCollection : ReflectionDataContext, IUpdatable - { - private static bool dataInitialized; - - public IQueryable<Customer> Customers - { - get { return this.GetResourceSetEntities<Customer>("Customers").AsQueryable(); } - } - - public IQueryable<Supplier> Suppliers - { - get { return this.GetResourceSetEntities<Supplier>("Suppliers").AsQueryable(); } - } - - public void ResetData() - { - this.ClearData(); - - IList<Customer> customers = this.GetResourceSetEntities<Customer>("Customers"); - foreach (int i in Enumerable.Range(1, 2 * 1024 * 1024)) - { - customers.Add(new Customer() - { - ID = i, - Name = "Customer " + i - }); - } - - IList<Supplier> suppliers = this.GetResourceSetEntities<Supplier>("Suppliers"); - foreach (int i in Enumerable.Range(1, 5000)) - { - suppliers.Add(new Supplier() - { - ID = i, - Name = "Supplier " + i - }); - } - } - - protected override void EnsureDataIsInitialized() - { - if (!dataInitialized) - { - this.ResetData(); - dataInitialized = true; - } - } - } - - public class Customer - { - public int ID { get; set; } - public string Name { get; set; } - } - - public class Supplier - { - public int ID { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/olingo-odata4-js/blob/4621d41c/JSLib/tests/endpoints/web.config ---------------------------------------------------------------------- diff --git a/JSLib/tests/endpoints/web.config b/JSLib/tests/endpoints/web.config deleted file mode 100644 index 5836287..0000000 --- a/JSLib/tests/endpoints/web.config +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version='1.0'?> -<configuration> - <system.web> - <compilation debug='true'> - <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.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> -</configuration>
