diff options
Diffstat (limited to 'src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest')
19 files changed, 892 insertions, 0 deletions
diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/FilterConfig.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/FilterConfig.cs new file mode 100644 index 000000000..855184fd2 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/FilterConfig.cs @@ -0,0 +1,31 @@ +/** + * 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. + */ + +using System.Web.Mvc; + +namespace ThriftMVCTest +{ + public static class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/RouteConfig.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/RouteConfig.cs new file mode 100644 index 000000000..b4b6023d6 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/RouteConfig.cs @@ -0,0 +1,39 @@ +/** + * 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. + */ + +using System.Web.Mvc; +using System.Web.Routing; + +namespace ThriftMVCTest +{ + public static class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.thrift"); + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + name: "Default", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } + ); + } + } +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/AsyncHttpHandler.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/AsyncHttpHandler.cs new file mode 100644 index 000000000..7f26184fa --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/AsyncHttpHandler.cs @@ -0,0 +1,32 @@ +/** + * 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. + */ + +using Thrift.Transport; + +namespace ThriftMVCTest +{ + public class AsyncHttpHandler : THttpTaskAsyncHandler + { + public AsyncHttpHandler() + : base( + new Thrift.Test.SecondService.AsyncProcessor(new SecondServiceImpl())) + { + } + } +}
\ No newline at end of file diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Controllers/HomeController.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Controllers/HomeController.cs new file mode 100644 index 000000000..c9a1ec43f --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Controllers/HomeController.cs @@ -0,0 +1,70 @@ +/** + * 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. + */ + +using System; +using System.Threading.Tasks; +using System.Web.Mvc; +using Thrift.Protocol; +using Thrift.Test; +using Thrift.Transport; + +namespace ThriftMVCTest.Controllers +{ + public class HomeController : Controller + { + public ActionResult Index() + { + return View(); + } + + public async Task<ActionResult> TestThriftAsync() + { + var baseUri = new Uri(string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, + Url.Content("~"))); + + SecondService.IAsync asyncService = + new SecondService.Client(new TBinaryProtocol(new THttpClient(new Uri(baseUri, "Async.thrift")))); + + var result = await asyncService.secondtestStringAsync("TestString"); + if (result != "testString(\"TestString\")") + { + throw new Exception("The wrong result was returned"); + } + + return RedirectToAction("Index"); + } + + public ActionResult TestThriftSync() + { + var baseUri = new Uri(string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, + Url.Content("~"))); + + SecondService.ISync service = + new SecondService.Client(new TBinaryProtocol(new THttpClient(new Uri(baseUri, "Sync.thrift")))); + + var result = service.secondtestString("TestString"); + if (result != "testString(\"TestString\")") + { + throw new Exception("The wrong result was returned"); + } + + return RedirectToAction("Index"); + } + } +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax new file mode 100644 index 000000000..7bb688c7a --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax @@ -0,0 +1,19 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="ThriftMVCTest.MvcApplication" Language="C#" %> +<!-- + 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. +--> diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax.cs new file mode 100644 index 000000000..59731efb3 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax.cs @@ -0,0 +1,34 @@ +/** + * 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. + */ + +using System.Web.Mvc; +using System.Web.Routing; + +namespace ThriftMVCTest +{ + public class MvcApplication : System.Web.HttpApplication + { + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); + RouteConfig.RegisterRoutes(RouteTable.Routes); + } + } +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..b812aaf1d --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs @@ -0,0 +1,53 @@ +/** + * 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. + */ + +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ThriftMVCTest")] +[assembly: AssemblyDescription("A web project for testing the thrift ASP.NET features.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("The Apache Software Foundation")] +[assembly: AssemblyProduct("Thrift")] +[assembly: AssemblyCopyright("The Apache Software Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("366f9bd0-3c0e-48aa-b2ca-61fd4a93e427")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("0.13.0.0")] +[assembly: AssemblyFileVersion("0.13.0.0")] diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SecondServiceImpl.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SecondServiceImpl.cs new file mode 100644 index 000000000..fad301a35 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SecondServiceImpl.cs @@ -0,0 +1,37 @@ +/** + * 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. + */ + +using System.Threading.Tasks; +using Thrift.Test; + +namespace ThriftMVCTest +{ + public class SecondServiceImpl : SecondService.IAsync, SecondService.ISync + { + public Task<string> secondtestStringAsync(string thing) + { + return Task.FromResult(thing); + } + + public string secondtestString(string thing) + { + return "testString(\"" + thing + "\")"; + } + } +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SyncHttpHandler.cs b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SyncHttpHandler.cs new file mode 100644 index 000000000..4fe26624a --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SyncHttpHandler.cs @@ -0,0 +1,32 @@ +/** + * 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. + */ + +using Thrift.Transport; + +namespace ThriftMVCTest +{ + public class SyncHttpHandler : THttpHandler + { + public SyncHttpHandler() + : base( + new Thrift.Test.SecondService.Processor(new SecondServiceImpl())) + { + } + } +}
\ No newline at end of file diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/ThriftMVCTest.csproj b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/ThriftMVCTest.csproj new file mode 100644 index 000000000..0eb969a04 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/ThriftMVCTest.csproj @@ -0,0 +1,200 @@ +<?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="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion> + </ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{891B4487-C7BA-427E-BBC8-4C596C229A10}</ProjectGuid> + <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ThriftMVCTest</RootNamespace> + <AssemblyName>ThriftMVCTest</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <MvcBuildViews>false</MvcBuildViews> + <UseIISExpress>true</UseIISExpress> + <IISExpressSSLPort /> + <IISExpressAnonymousAuthentication /> + <IISExpressWindowsAuthentication /> + <IISExpressUseClassicPipelineMode /> + </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> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Web.DynamicData" /> + <Reference Include="System.Web.Entity" /> + <Reference Include="System.Web.ApplicationServices" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Core" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Web" /> + <Reference Include="System.Web.Extensions" /> + <Reference Include="System.Web.Abstractions" /> + <Reference Include="System.Web.Routing" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Configuration" /> + <Reference Include="System.Web.Services" /> + <Reference Include="System.EnterpriseServices" /> + <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath> + </Reference> + <Reference Include="System.Net.Http"> + </Reference> + <Reference Include="System.Net.Http.WebRequest"> + </Reference> + <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath> + </Reference> + <Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath> + </Reference> + <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath> + </Reference> + <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath> + </Reference> + <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath> + </Reference> + <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <Private>True</Private> + <HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath> + </Reference> + <Reference Include="ThriftImpl"> + <HintPath>.\ThriftImpl.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="App_Start\FilterConfig.cs" /> + <Compile Include="App_Start\RouteConfig.cs" /> + <Compile Include="SyncHttpHandler.cs" /> + <Compile Include="AsyncHttpHandler.cs" /> + <Compile Include="Controllers\HomeController.cs" /> + <Compile Include="Global.asax.cs"> + <DependentUpon>Global.asax</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SecondServiceImpl.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="favicon.ico" /> + <Content Include="Global.asax" /> + <Content Include="Web.config" /> + <Content Include="Web.Debug.config"> + <DependentUpon>Web.config</DependentUpon> + </Content> + <Content Include="Web.Release.config"> + <DependentUpon>Web.config</DependentUpon> + </Content> + <Content Include="Views\Web.config" /> + <Content Include="Views\_ViewStart.cshtml" /> + <Content Include="Views\Shared\_Layout.cshtml" /> + <Content Include="Views\Home\Index.cshtml" /> + </ItemGroup> + <ItemGroup> + <Folder Include="App_Data\" /> + </ItemGroup> + <ItemGroup> + <Content Include="packages.config"> + <SubType>Designer</SubType> + </Content> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\src\Thrift.45.csproj"> + <Project>{ebce35da-cf6a-42bc-a357-a9c09b534299}</Project> + <Name>Thrift.45</Name> + </ProjectReference> + </ItemGroup> + <PropertyGroup> + <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> + <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> + <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /> + </Target> + <ProjectExtensions> + <VisualStudio> + <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> + <WebProjectProperties> + <UseIIS>True</UseIIS> + <AutoAssignPort>True</AutoAssignPort> + <DevelopmentServerPort>57482</DevelopmentServerPort> + <DevelopmentServerVPath>/</DevelopmentServerVPath> + <IISUrl>http://localhost:57482/</IISUrl> + <NTLMAuthentication>False</NTLMAuthentication> + <UseCustomServer>False</UseCustomServer> + <CustomServerUrl> + </CustomServerUrl> + <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> + </WebProjectProperties> + </FlavorProperties> + </VisualStudio> + </ProjectExtensions> + <PropertyGroup> + <PreBuildEvent>rmdir /s /q "$(ProjectDir)gen-csharp" +del /f /q "$(ProjectDir)ThriftImpl.dll" +SET OUTPUT_DIR=$(ProjectDir) +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\test\ThriftTest.thrift +for %25%25I in ("%25OUTPUT_DIR%25") do set SHORT_DIR=%25%25~fsI +for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI +"$(ProjectDir)\..\..\..\..\compiler\cpp\Debug\thrift.exe" --gen csharp:async=true -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 +"$(MSBuildToolsPath)\Csc.exe" /t:library /out:"$(ProjectDir)ThriftImpl.dll" /recurse:"$(ProjectDir)gen-csharp"\* /reference:"$(ProjectDir)..\..\src\bin\Debug\Thrift45.dll"</PreBuildEvent> + </PropertyGroup> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> --> +</Project>
\ No newline at end of file diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Home/Index.cshtml b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Home/Index.cshtml new file mode 100644 index 000000000..f0ca7da20 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Home/Index.cshtml @@ -0,0 +1,25 @@ +@* + 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. +*@ + +@{ + ViewBag.Title = "Home Page"; +} + +<p>@Html.ActionLink("Test Thrift Async Service", "TestThriftAsync")</p> +<p>@Html.ActionLink("Test Thrift Sync Service", "TestThriftSync")</p> diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Shared/_Layout.cshtml b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Shared/_Layout.cshtml new file mode 100644 index 000000000..b41c99a10 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Shared/_Layout.cshtml @@ -0,0 +1,30 @@ +@* + 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. +*@ + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Thrift ASP.NET Test</title> +</head> +<body> + @RenderBody() +</body> +</html> diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Web.config b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Web.config new file mode 100644 index 000000000..3c211387a --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Web.config @@ -0,0 +1,60 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<configuration> + <configSections> + <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> + <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> + <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> + </sectionGroup> + </configSections> + + <system.web.webPages.razor> + <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> + <pages pageBaseType="System.Web.Mvc.WebViewPage"> + <namespaces> + <add namespace="System.Web.Mvc" /> + <add namespace="System.Web.Mvc.Ajax" /> + <add namespace="System.Web.Mvc.Html" /> + <add namespace="System.Web.Optimization"/> + <add namespace="System.Web.Routing" /> + <add namespace="ThriftMVCTest" /> + </namespaces> + </pages> + </system.web.webPages.razor> + + <appSettings> + <add key="webpages:Enabled" value="false" /> + </appSettings> + + <system.webServer> + <handlers> + <remove name="BlockViewHandler"/> + <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> + </handlers> + </system.webServer> + + <system.web> + <compilation> + <assemblies> + <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> + </assemblies> + </compilation> + </system.web> +</configuration> diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/_ViewStart.cshtml b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/_ViewStart.cshtml new file mode 100644 index 000000000..8cde2eeb9 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/_ViewStart.cshtml @@ -0,0 +1,22 @@ +@* + 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. +*@ + +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Debug.config b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Debug.config new file mode 100644 index 000000000..45d56d809 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Debug.config @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> + <!-- + In the example below, the "SetAttributes" transform will change the value of + "connectionString" to use "ReleaseSQLServer" only when the "Match" locator + finds an attribute "name" that has a value of "MyDB". + + <connectionStrings> + <add name="MyDB" + connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" + xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> + </connectionStrings> + --> + <system.web> + <!-- + In the example below, the "Replace" transform will replace the entire + <customErrors> section of your Web.config file. + Note that because there is only one customErrors section under the + <system.web> node, there is no need to use the "xdt:Locator" attribute. + + <customErrors defaultRedirect="GenericError.htm" + mode="RemoteOnly" xdt:Transform="Replace"> + <error statusCode="500" redirect="InternalError.htm"/> + </customErrors> + --> + </system.web> +</configuration> diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Release.config b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Release.config new file mode 100644 index 000000000..157c340ca --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Release.config @@ -0,0 +1,46 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> + <!-- + In the example below, the "SetAttributes" transform will change the value of + "connectionString" to use "ReleaseSQLServer" only when the "Match" locator + finds an attribute "name" that has a value of "MyDB". + + <connectionStrings> + <add name="MyDB" + connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" + xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> + </connectionStrings> + --> + <system.web> + <compilation xdt:Transform="RemoveAttributes(debug)" /> + <!-- + In the example below, the "Replace" transform will replace the entire + <customErrors> section of your Web.config file. + Note that because there is only one customErrors section under the + <system.web> node, there is no need to use the "xdt:Locator" attribute. + + <customErrors defaultRedirect="GenericError.htm" + mode="RemoteOnly" xdt:Transform="Replace"> + <error statusCode="500" redirect="InternalError.htm"/> + </customErrors> + --> + </system.web> +</configuration> diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.config b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.config new file mode 100644 index 000000000..9c57d117c --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.config @@ -0,0 +1,92 @@ +<?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. +--> + +<!-- + For more information on how to configure your ASP.NET application, please visit + http://go.microsoft.com/fwlink/?LinkId=301880 + --> +<configuration> + <appSettings> + <add key="webpages:Version" value="3.0.0.0" /> + <add key="webpages:Enabled" value="false" /> + <add key="ClientValidationEnabled" value="true" /> + <add key="UnobtrusiveJavaScriptEnabled" value="true" /> + <add key="owin:AutomaticAppStartup" value="false" /> + </appSettings> + <system.web> + <authentication mode="None" /> + <compilation debug="true" targetFramework="4.5" /> + <httpRuntime targetFramework="4.5" /> + </system.web> + <system.webServer> + <modules> + <remove name="FormsAuthentication" /> + </modules> + <handlers> + <add name="AsyncHttpHandler" verb="*" path="Async.thrift" type="ThriftMVCTest.AsyncHttpHandler, ThriftMVCTest" /> + <add name="SyncHttpHandler" verb="*" path="Sync.thrift" type="ThriftMVCTest.SyncHttpHandler, ThriftMVCTest" /> + </handlers> + </system.webServer> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" /> + <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> + <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/favicon.ico b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/favicon.ico Binary files differnew file mode 100644 index 000000000..a3a799985 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/favicon.ico diff --git a/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/packages.config b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/packages.config new file mode 100644 index 000000000..98c8416f5 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/packages.config @@ -0,0 +1,25 @@ +<?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. +--> +<packages> + <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" /> + <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" /> + <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" /> + <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> +</packages>
\ No newline at end of file |