From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../thrift/lib/csharp/test/JSON/JSONTest.csproj | 85 +++++++++ .../thrift/lib/csharp/test/JSON/Program.cs | 95 ++++++++++ .../csharp/test/JSON/Properties/AssemblyInfo.cs | 55 ++++++ .../thrift/lib/csharp/test/JSON/app.config | 21 +++ .../test/Multiplex/Client/Multiplex.Test.Client.cs | 82 +++++++++ .../test/Multiplex/Client/MultiplexClient.csproj | 148 +++++++++++++++ .../Multiplex/Client/Properties/AssemblyInfo.cs | 55 ++++++ .../thrift/lib/csharp/test/Multiplex/Makefile.am | 63 +++++++ .../csharp/test/Multiplex/Multiplex.Test.Common.cs | 40 +++++ .../test/Multiplex/Server/Multiplex.Test.Server.cs | 107 +++++++++++ .../test/Multiplex/Server/MultiplexServer.csproj | 148 +++++++++++++++ .../Multiplex/Server/Properties/AssemblyInfo.cs | 55 ++++++ .../test/ThriftMVCTest/App_Start/FilterConfig.cs | 31 ++++ .../test/ThriftMVCTest/App_Start/RouteConfig.cs | 39 ++++ .../csharp/test/ThriftMVCTest/AsyncHttpHandler.cs | 32 ++++ .../ThriftMVCTest/Controllers/HomeController.cs | 70 ++++++++ .../lib/csharp/test/ThriftMVCTest/Global.asax | 19 ++ .../lib/csharp/test/ThriftMVCTest/Global.asax.cs | 34 ++++ .../test/ThriftMVCTest/Properties/AssemblyInfo.cs | 53 ++++++ .../csharp/test/ThriftMVCTest/SecondServiceImpl.cs | 37 ++++ .../csharp/test/ThriftMVCTest/SyncHttpHandler.cs | 32 ++++ .../csharp/test/ThriftMVCTest/ThriftMVCTest.csproj | 200 +++++++++++++++++++++ .../test/ThriftMVCTest/Views/Home/Index.cshtml | 25 +++ .../test/ThriftMVCTest/Views/Shared/_Layout.cshtml | 30 ++++ .../lib/csharp/test/ThriftMVCTest/Views/Web.config | 60 +++++++ .../test/ThriftMVCTest/Views/_ViewStart.cshtml | 22 +++ .../lib/csharp/test/ThriftMVCTest/Web.Debug.config | 45 +++++ .../csharp/test/ThriftMVCTest/Web.Release.config | 46 +++++ .../lib/csharp/test/ThriftMVCTest/Web.config | 92 ++++++++++ .../lib/csharp/test/ThriftMVCTest/favicon.ico | Bin 0 -> 32038 bytes .../lib/csharp/test/ThriftMVCTest/packages.config | 25 +++ 31 files changed, 1846 insertions(+) create mode 100644 src/jaegertracing/thrift/lib/csharp/test/JSON/JSONTest.csproj create mode 100644 src/jaegertracing/thrift/lib/csharp/test/JSON/Program.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/JSON/Properties/AssemblyInfo.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/JSON/app.config create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Multiplex.Test.Client.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Makefile.am create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Multiplex.Test.Common.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj create mode 100644 src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/FilterConfig.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/App_Start/RouteConfig.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/AsyncHttpHandler.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Controllers/HomeController.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Global.asax.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SecondServiceImpl.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/SyncHttpHandler.cs create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/ThriftMVCTest.csproj create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Home/Index.cshtml create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Shared/_Layout.cshtml create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/Web.config create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Views/_ViewStart.cshtml create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Debug.config create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.Release.config create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/Web.config create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/favicon.ico create mode 100644 src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/packages.config (limited to 'src/jaegertracing/thrift/lib/csharp/test') diff --git a/src/jaegertracing/thrift/lib/csharp/test/JSON/JSONTest.csproj b/src/jaegertracing/thrift/lib/csharp/test/JSON/JSONTest.csproj new file mode 100644 index 000000000..f07d43eec --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/JSON/JSONTest.csproj @@ -0,0 +1,85 @@ + + + + + Debug + x86 + 8.0.30703 + 2.0 + {E37A0034-DCBF-4886-A0DA-25A03D12D975} + Exe + Properties + JSONTest + JSONTest + v4.0 + + + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {499EB63C-D74C-47E8-AE48-A2FC94538E9D} + Thrift + + + + + \ No newline at end of file diff --git a/src/jaegertracing/thrift/lib/csharp/test/JSON/Program.cs b/src/jaegertracing/thrift/lib/csharp/test/JSON/Program.cs new file mode 100644 index 000000000..f61388ae7 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/JSON/Program.cs @@ -0,0 +1,95 @@ +/** + * 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.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using Thrift.Protocol; +using Thrift.Transport; + +namespace JSONTest +{ + class Program + { + static void Main(string[] args) + { + TestThrift2365(); // JSON binary decodes too much data + TestThrift2336(); // hex encoding using \uXXXX where 0xXXXX > 0xFF + TestThrift3403(); // JSON escaped unicode surrogate pair support. + } + + + public static void TestThrift2365() + { + var rnd = new Random(); + for (var len = 0; len < 10; ++len) + { + byte[] dataWritten = new byte[len]; + rnd.NextBytes(dataWritten); + + Stream stm = new MemoryStream(); + TTransport trans = new TStreamTransport(null, stm); + TProtocol prot = new TJSONProtocol(trans); + prot.WriteBinary(dataWritten); + + stm.Position = 0; + trans = new TStreamTransport(stm, null); + prot = new TJSONProtocol(trans); + byte[] dataRead = prot.ReadBinary(); + + Debug.Assert(dataRead.Length == dataWritten.Length); + for (var i = 0; i < dataRead.Length; ++i) + Debug.Assert(dataRead[i] == dataWritten[i]); + } + } + + + public static void TestThrift2336() + { + const string RUSSIAN_TEXT = "\u0420\u0443\u0441\u0441\u043a\u043e\u0435 \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435"; + const string RUSSIAN_JSON = "\"\\u0420\\u0443\\u0441\\u0441\\u043a\\u043e\\u0435 \\u041d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435\""; + + // prepare buffer with JSON data + byte[] rawBytes = new byte[RUSSIAN_JSON.Length]; + for (var i = 0; i < RUSSIAN_JSON.Length; ++i) + rawBytes[i] = (byte)(RUSSIAN_JSON[i] & (char)0xFF); // only low bytes + + // parse and check + var stm = new MemoryStream(rawBytes); + var trans = new TStreamTransport(stm, null); + var prot = new TJSONProtocol(trans); + Debug.Assert(prot.ReadString() == RUSSIAN_TEXT, "reading JSON with hex-encoded chars > 8 bit"); + } + + public static void TestThrift3403() + { + string GCLEF_TEXT = "\ud834\udd1e"; + const string GCLEF_JSON = "\"\\ud834\\udd1e\""; + + // parse and check + var stm = new MemoryStream(Encoding.UTF8.GetBytes(GCLEF_JSON)); + var trans = new TStreamTransport(stm, null); + var prot = new TJSONProtocol(trans); + Debug.Assert(prot.ReadString() == GCLEF_TEXT, "reading JSON with surrogate pair hex-encoded chars"); + } + } +} diff --git a/src/jaegertracing/thrift/lib/csharp/test/JSON/Properties/AssemblyInfo.cs b/src/jaegertracing/thrift/lib/csharp/test/JSON/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..fdff4a1a5 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/JSON/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +/* + * 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.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("JSONTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("The Apache Software Foundation")] +[assembly: AssemblyProduct("Thrift")] +[assembly: AssemblyCopyright("The Apache Software Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("2b2e7d56-3e65-4368-92d7-e34d56b7105e")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/jaegertracing/thrift/lib/csharp/test/JSON/app.config b/src/jaegertracing/thrift/lib/csharp/test/JSON/app.config new file mode 100644 index 000000000..9c1919d4f --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/JSON/app.config @@ -0,0 +1,21 @@ + + + + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Multiplex.Test.Client.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Multiplex.Test.Client.cs new file mode 100644 index 000000000..c810a0891 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Multiplex.Test.Client.cs @@ -0,0 +1,82 @@ +/* + * 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.Collections.Generic; +using Thrift.Collections; +using Thrift.Transport; +using Thrift.Protocol; +using Thrift.Server; +using Thrift; +using Test.Multiplex; + +namespace Test.Multiplex.Client +{ + public class TestClient + { + static void Execute(int port) + { + try + { + TTransport trans; + trans = new TSocket("localhost", port); + trans = new TFramedTransport(trans); + trans.Open(); + + TProtocol Protocol = new TBinaryProtocol(trans, true, true); + + TMultiplexedProtocol multiplex; + + multiplex = new TMultiplexedProtocol(Protocol, Constants.NAME_BENCHMARKSERVICE); + BenchmarkService.Iface bench = new BenchmarkService.Client(multiplex); + + multiplex = new TMultiplexedProtocol(Protocol, Constants.NAME_AGGR); + Aggr.Iface aggr = new Aggr.Client(multiplex); + + for (sbyte i = 1; 10 >= i; ++i) + { + aggr.addValue(bench.fibonacci(i)); + } + + foreach (int k in aggr.getValues()) + { + Console.Write(k.ToString() + " "); + Console.WriteLine(""); + } + trans.Close(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + static void Main(string[] args) + { + int port = 9090; + if (args.Length > 0) + { + port = ushort.Parse(args[0]); + } + Execute(port); + Console.WriteLine("done."); + } + } +} + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj new file mode 100644 index 000000000..09d20f503 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj @@ -0,0 +1,148 @@ + + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {5E91DA17-E548-415F-8C9F-9E84EDF8EE06} + Exe + Properties + MultiplexClient + MultiplexClient + v3.5 + 512 + false + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 0.13.0.0 + false + true + + + true + full + false + ..\bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + ..\bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + Multiplex.Test.Common.cs + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + true + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + {499EB63C-D74C-47E8-AE48-A2FC94538E9D} + Thrift + + + + + + rmdir /s /q "$(ProjectDir)gen-csharp" +del /f /q "$(ProjectDir)ThriftImpl.dll" +SET OUTPUT_DIR=$(ProjectDir) + +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\..\contrib\async-test\aggr.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\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 + +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\..\lib\rb\benchmark\Benchmark.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\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 + + + + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..0b65c1e52 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +/* + * 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.CompilerServices; +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("MultiplexClient")] +[assembly: AssemblyDescription("")] +[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("66FC61E5-420B-4b56-8012-D6D6CE22537F")] + +// 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("1.0.*")] +[assembly: AssemblyVersion("0.13.0.0")] +[assembly: AssemblyFileVersion("0.13.0.0")] diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Makefile.am b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Makefile.am new file mode 100644 index 000000000..9c1f1b8b7 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Makefile.am @@ -0,0 +1,63 @@ +# +# 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. +# + +GENERATED = \ + gen-csharp/Aggr.cs \ + gen-csharp/BenchmarkService.cs \ + gen-csharp/Error.cs + +BUILT_SOURCES = $(GENERATED) + +THRIFT = $(top_builddir)/compiler/cpp/thrift + +gen-csharp/Aggr.cs: $(top_srcdir)/contrib/async-test/aggr.thrift + $(THRIFT) --gen csharp $< + +gen-csharp/BenchmarkService.cs gen-csharp/Error.cs: $(top_srcdir)/lib/rb/benchmark/Benchmark.thrift + $(THRIFT) --gen csharp $< + +ThriftImpl.dll: Multiplex.Test.Common.cs $(GENERATED) ../../Thrift.dll + $(CSC) $(CSC_DEFINES) -t:library -out:./ThriftImpl.dll -reference:../../Thrift.dll $(GENERATED) $< + +MultiplexClient.exe: Client/Multiplex.Test.Client.cs ThriftImpl.dll + $(CSC) $(CSC_DEFINES) -out:$@ -reference:../../Thrift.dll -reference:ThriftImpl.dll $< + +MultiplexServer.exe: Server/Multiplex.Test.Server.cs ThriftImpl.dll + $(CSC) $(CSC_DEFINES) -out:$@ -reference:../../Thrift.dll -reference:ThriftImpl.dll $< + +CLEANFILES = \ + MultiplexClient.exe \ + MultiplexServer.exe \ + ThriftImpl.dll + +DISTCLEANFILES = \ + Makefile.in + +clean-local: + $(RM) -rf gen-csharp + +dist-hook: + $(RM) -r $(distdir)/gen-csharp/ + +TESTPORT = 9501 +check-local: MultiplexServer.exe MultiplexClient.exe + echo $(TESTPORT) + MONO_PATH=../../ timeout 10 mono MultiplexServer.exe $(TESTPORT) & + sleep 1 + MONO_PATH=../../ mono MultiplexClient.exe $(TESTPORT) diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Multiplex.Test.Common.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Multiplex.Test.Common.cs new file mode 100644 index 000000000..a687852d9 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Multiplex.Test.Common.cs @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Distributed under the Thrift Software License +// +// See accompanying file LICENSE or visit the Thrift site at: +// http://developers.facebook.com/thrift/ +using System; +using System.Collections.Generic; +using Thrift.Collections; +using Thrift.Transport; +using Thrift.Protocol; +using Thrift.Server; + +namespace Test.Multiplex +{ + public class Constants + { + public const string NAME_BENCHMARKSERVICE = "BenchmarkService"; + public const string NAME_AGGR = "Aggr"; + } +} + + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs new file mode 100644 index 000000000..9786189bb --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Multiplex.Test.Server.cs @@ -0,0 +1,107 @@ +/* + * 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.Collections.Generic; +using Thrift.Collections; +using Thrift.Transport; +using Thrift.Protocol; +using Thrift.Server; +using Thrift; +using Test.Multiplex; + +namespace Test.Multiplex.Server +{ + public class TestServer + { + class BenchmarkServiceImpl : BenchmarkService.Iface + { + public int fibonacci(sbyte n) + { + int prev, next, result; + prev = 0; + result = 1; + while (n > 0) + { + next = result + prev; + prev = result; + result = next; + --n; + } + return result; + } + } + + class AggrServiceImpl : Aggr.Iface + { + List values = new List(); + + public void addValue(int value) + { + values.Add(value); + } + + public List getValues() + { + return values; + } + } + + static void Execute(int port) + { + try + { + // create protocol factory, default to BinaryProtocol + TProtocolFactory ProtocolFactory = new TBinaryProtocol.Factory(true,true); + TServerTransport servertrans = new TServerSocket(port, 0, false); + TTransportFactory TransportFactory = new TFramedTransport.Factory(); + + BenchmarkService.Iface benchHandler = new BenchmarkServiceImpl(); + TProcessor benchProcessor = new BenchmarkService.Processor(benchHandler); + + Aggr.Iface aggrHandler = new AggrServiceImpl(); + TProcessor aggrProcessor = new Aggr.Processor(aggrHandler); + + TMultiplexedProcessor multiplex = new TMultiplexedProcessor(); + multiplex.RegisterProcessor(Constants.NAME_BENCHMARKSERVICE, benchProcessor); + multiplex.RegisterProcessor(Constants.NAME_AGGR, aggrProcessor); + + TServer ServerEngine = new TSimpleServer(multiplex, servertrans, TransportFactory, ProtocolFactory); + + Console.WriteLine("Starting the server ..."); + ServerEngine.Serve(); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + } + } + + static void Main(string[] args) + { + int port = 9090; + if (args.Length > 0) + { + port = ushort.Parse(args[0]); + } + Execute(port); + } + } +} + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj new file mode 100644 index 000000000..23d325362 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj @@ -0,0 +1,148 @@ + + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {D592BDF3-0DCE-48FB-890F-E4AE1D9CE7CD} + Exe + Properties + MultiplexServer + MultiplexServer + v3.5 + 512 + false + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 0.13.0.0 + false + true + + + true + full + false + ..\bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + ..\bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + Multiplex.Test.Common.cs + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + true + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + {499EB63C-D74C-47E8-AE48-A2FC94538E9D} + Thrift + + + + + + rmdir /s /q "$(ProjectDir)gen-csharp" +del /f /q "$(ProjectDir)ThriftImpl.dll" +SET OUTPUT_DIR=$(ProjectDir) + +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\..\contrib\async-test\aggr.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\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 + +SET THRIFT_FILE=$(ProjectDir)\..\..\..\..\..\lib\rb\benchmark\Benchmark.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\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 + + + + diff --git a/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..2b8a6af23 --- /dev/null +++ b/src/jaegertracing/thrift/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +/* + * 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.CompilerServices; +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("MultiplexServer")] +[assembly: AssemblyDescription("")] +[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("F2F436C1-3D4F-411a-ADC3-B98848476A8E")] + +// 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("1.0.*")] +[assembly: AssemblyVersion("0.13.0.0")] +[assembly: AssemblyFileVersion("0.13.0.0")] 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 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#" %> + 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 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 @@ + + + + + + Debug + AnyCPU + + + 2.0 + {891B4487-C7BA-427E-BBC8-4C596C229A10} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + ThriftMVCTest + ThriftMVCTest + v4.5 + false + true + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + True + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + + + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + + + True + ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + + + True + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + + + .\ThriftImpl.dll + + + + + + + + + + Global.asax + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + Designer + + + + + {ebce35da-cf6a-42bc-a357-a9c09b534299} + Thrift.45 + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + True + True + 57482 + / + http://localhost:57482/ + False + False + + + False + + + + + + 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" + + + \ 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"; +} + +

@Html.ActionLink("Test Thrift Async Service", "TestThriftAsync")

+

@Html.ActionLink("Test Thrift Sync Service", "TestThriftSync")

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. +*@ + + + + + + + Thrift ASP.NET Test + + + @RenderBody() + + 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 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + 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 @@ + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 000000000..a3a799985 Binary files /dev/null and b/src/jaegertracing/thrift/lib/csharp/test/ThriftMVCTest/favicon.ico differ 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 @@ + + + + + + + + \ No newline at end of file -- cgit v1.2.3