[ 
https://issues.apache.org/jira/browse/AVRO-1423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13859601#comment-13859601
 ] 

S S commented on AVRO-1423:
---------------------------

Also, the test project doesn't have any tests to catch any such failures. The 
code gen unit test doesn't have any "messages" in it's test schema and the 
protocol unit tests (which have "messages" in their schema) don't verify the 
code-gen - they only check if it's JSON'd ok or not. 

> Avrogen doesn't create the RPC methods from .avrp files
> -------------------------------------------------------
>
>                 Key: AVRO-1423
>                 URL: https://issues.apache.org/jira/browse/AVRO-1423
>             Project: Avro
>          Issue Type: Bug
>          Components: csharp
>    Affects Versions: 1.7.5
>            Reporter: S S
>            Priority: Blocker
>
> 1. Get the .avpr file from 
> https://github.com/phunt/avro-rpc-quickstart/blob/master/src/main/avro/mail.avpr
> 2. use the csharp avrogen.exe (eg: 
> release-1.7.5\lang\csharp\build\codegen\Release\avrogen.exe ) to produce the 
> csharp code-gen files as  {code} avrogen.exe -p mail.avpr . {code}
> 3. Review the generated .cs file - no RPC methods found (you should have a 
> {code} public String send (Message message)  { ... }  {code} method in that 
> code-gen'd .cs file; current code-gen copy-pasted below)
> {code}
> // 
> ------------------------------------------------------------------------------
> // <auto-generated>
> //    Generated by avrogen.exe, version 0.9.0.0
> //    Changes to this file may cause incorrect behavior and will be lost if 
> code
> //    is regenerated
> // </auto-generated>
> // 
> ------------------------------------------------------------------------------
> namespace example.proto
> {
>       using System;
>       using System.Collections.Generic;
>       using System.Text;
>       using Avro;
>       using Avro.Specific;
>       
>       public partial class Message : ISpecificRecord
>       {
>               public static Schema _SCHEMA = 
> Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"Message\",\"namespace\":\"example.proto\",\"fields\":[{\"name\":\""
>  +
>                               
> "to\",\"type\":\"string\"},{\"name\":\"from\",\"type\":\"string\"},{\"name\":\"body\",\"type\":\"stri"
>  +
>                               "ng\"}]}");
>               private string _to;
>               private string _from;
>               private string _body;
>               public virtual Schema Schema
>               {
>                       get
>                       {
>                               return Message._SCHEMA;
>                       }
>               }
>               public string to
>               {
>                       get
>                       {
>                               return this._to;
>                       }
>                       set
>                       {
>                               this._to = value;
>                       }
>               }
>               public string from
>               {
>                       get
>                       {
>                               return this._from;
>                       }
>                       set
>                       {
>                               this._from = value;
>                       }
>               }
>               public string body
>               {
>                       get
>                       {
>                               return this._body;
>                       }
>                       set
>                       {
>                               this._body = value;
>                       }
>               }
>               public virtual object Get(int fieldPos)
>               {
>                       switch (fieldPos)
>                       {
>                       case 0: return this.to;
>                       case 1: return this.from;
>                       case 2: return this.body;
>                       default: throw new AvroRuntimeException("Bad index " + 
> fieldPos + " in Get()");
>                       };
>               }
>               public virtual void Put(int fieldPos, object fieldValue)
>               {
>                       switch (fieldPos)
>                       {
>                       case 0: this.to = (System.String)fieldValue; break;
>                       case 1: this.from = (System.String)fieldValue; break;
>                       case 2: this.body = (System.String)fieldValue; break;
>                       default: throw new AvroRuntimeException("Bad index " + 
> fieldPos + " in Put()");
>                       };
>               }
>       }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to