aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-05-19 12:01:16 -0500
committerrogerk <devnull@localhost>2011-05-19 12:01:16 -0500
commitf1816beebe7f68a6e9380b964d93c1dee91fb277 (patch)
treec03f8e2d549a7ed71e243a1437085b9d7c976f42 /src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
parent68d831e3a48ea3a81b3791a24219bc3406b962b8 (diff)
downloadprotobuf-f1816beebe7f68a6e9380b964d93c1dee91fb277.tar.gz
protobuf-f1816beebe7f68a6e9380b964d93c1dee91fb277.tar.bz2
protobuf-f1816beebe7f68a6e9380b964d93c1dee91fb277.zip
- Added CSharpServiceType NONE to skip service generation.
- Defaulted service_generator_type to NONE - Added /protos/extest/unittest_generic_services.proto to test services - Migrated unit tests to use the new generic services for testing
Diffstat (limited to 'src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs')
-rw-r--r--src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs88
1 files changed, 4 insertions, 84 deletions
diff --git a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
index bf77ccba..8d7c97a1 100644
--- a/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
+++ b/src/ProtocolBuffers.Test/TestProtos/UnitTestNoGenericServicesProtoFile.cs
@@ -293,90 +293,10 @@ namespace Google.ProtocolBuffers.TestProtos.NoGenericService {
#endregion
#region Services
- public abstract class TestService : pb::IService {
- public abstract void Foo(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage> done);
-
- public static pbd::ServiceDescriptor Descriptor {
- get { return UnitTestNoGenericServicesProtoFile.Descriptor.Services[0]; }
- }
- public pbd::ServiceDescriptor DescriptorForType {
- get { return Descriptor; }
- }
-
- public void CallMethod(
- pbd::MethodDescriptor method,
- pb::IRpcController controller,
- pb::IMessage request,
- global::System.Action<pb::IMessage> done) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.CallMethod() given method descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage) request,
- pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage>(
- done));
- return;
- default:
- throw new global::System.InvalidOperationException("Can't get here.");
- }
- }
-
- public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.GetRequestPrototype() given method descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- return global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance;
- default:
- throw new global::System.InvalidOperationException("Can't get here.");
- }
- }
-
- public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
- if (method.Service != Descriptor) {
- throw new global::System.ArgumentException(
- "Service.GetResponsePrototype() given method descriptor for wrong service type.");
- }
- switch(method.Index) {
- case 0:
- return global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance;
- default:
- throw new global::System.InvalidOperationException("Can't get here.");
- }
- }
-
- public static Stub CreateStub(pb::IRpcChannel channel) {
- return new Stub(channel);
- }
-
- public class Stub : global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestService {
- internal Stub(pb::IRpcChannel channel) {
- this.channel = channel;
- }
-
- private readonly pb::IRpcChannel channel;
-
- public pb::IRpcChannel Channel {
- get { return channel; }
- }
-
- public override void Foo(
- pb::IRpcController controller,
- global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage request,
- global::System.Action<global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage> done) {
- channel.CallMethod(Descriptor.Methods[0],
- controller, request, global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance,
- pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage, global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.Builder>(done, global::Google.ProtocolBuffers.TestProtos.NoGenericService.TestMessage.DefaultInstance));
- }
- }
- }
+ /*
+ * Service generation is now disabled by default, use the following option to enable:
+ * option (google.protobuf.csharp_file_options).service_generator_type = GENERIC;
+ */
#endregion
}