| Index: third_party/grpc/examples/csharp/route_guide/RouteGuideServer/Program.cs
|
| diff --git a/third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs b/third_party/grpc/examples/csharp/route_guide/RouteGuideServer/Program.cs
|
| similarity index 63%
|
| copy from third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs
|
| copy to third_party/grpc/examples/csharp/route_guide/RouteGuideServer/Program.cs
|
| index 8dfad8b331c1622d9325af438a1eaa6e1c5c25fd..55a87d1656fbfba0c53cce3888bca340c4454123 100644
|
| --- a/third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs
|
| +++ b/third_party/grpc/examples/csharp/route_guide/RouteGuideServer/Program.cs
|
| @@ -1,7 +1,5 @@
|
| -#region Copyright notice and license
|
| -// Protocol Buffers - Google's data interchange format
|
| -// Copyright 2015 Google Inc. All rights reserved.
|
| -// https://developers.google.com/protocol-buffers/
|
| +// Copyright 2015, Google Inc.
|
| +// All rights reserved.
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -28,28 +26,36 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| -#endregion
|
| -
|
| +
|
| +using Grpc.Core;
|
| using System;
|
| -using System.Reflection;
|
| -using Google.Protobuf.TestProtos;
|
| -using NUnit.Framework;
|
| +using System.Collections.Generic;
|
| +using System.Linq;
|
| +using System.Text;
|
| +using System.Threading.Tasks;
|
|
|
| -namespace Google.Protobuf
|
| +namespace Routeguide
|
| {
|
| - public class DeprecatedMemberTest
|
| + class Program
|
| {
|
| - private static void AssertIsDeprecated(MemberInfo member)
|
| + static void Main(string[] args)
|
| {
|
| - Assert.NotNull(member);
|
| - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member);
|
| - }
|
| + const int Port = 50052;
|
|
|
| - [Test]
|
| - public void TestDepreatedPrimitiveValue()
|
| - {
|
| - AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty("DeprecatedInt32"));
|
| - }
|
| + var features = RouteGuideUtil.ParseFeatures(RouteGuideUtil.DefaultFeaturesFile);
|
|
|
| + Server server = new Server
|
| + {
|
| + Services = { RouteGuide.BindService(new RouteGuideImpl(features)) },
|
| + Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) }
|
| + };
|
| + server.Start();
|
| +
|
| + Console.WriteLine("RouteGuide server listening on port " + Port);
|
| + Console.WriteLine("Press any key to stop the server...");
|
| + Console.ReadKey();
|
| +
|
| + server.ShutdownAsync().Wait();
|
| + }
|
| }
|
| }
|
|
|