Esempio n. 1
0
 public RemoteInvokeInterceptor(
     ICallInvoker callInvoker,
     IClientAuditLoggerFactory auditLogFactory
     )
 {
     this._callInvoker        = callInvoker;
     this._AsyncCaller1       = callInvoker.GetType().GetMethod("AsyncNotify");
     this._AsyncCaller2       = callInvoker.GetType().GetMethod("AsyncRequest");
     this._auditLoggerFactory = auditLogFactory;
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="tc"></param>
        private void RunTestCase(ICallInvoker <AmpMessage> caller, TestCase tc, IMessageParser <AmpMessage> parser)
        {
            try
            {
                Console.WriteLine("--------start run testcase {0}-----------", tc.Id);
                Console.WriteLine("ServiceId: {0},MessageId:{1},Req:{2}", tc.ServiceId, tc.MessageId, tc.Json);

                RequestData rd = new RequestData();
                rd.ServiceId = tc.ServiceId;
                rd.MessageId = tc.MessageId;
                rd.Data      = new Dictionary <string, string>();
                rd.RawBody   = tc.Json;

                AmpMessage req = parser.ToMessage(rd);

                if (req == null)
                {
                    TOTAL_ERROR++;
                    Console.WriteLine("协议转换出错,请检查serviceId={0}和messageId={1}", tc.ServiceId, tc.MessageId);
                    System.Environment.Exit(1);
                    return;
                }

                AmpMessage rsp = caller.BlockingCall(req);

                if (rsp == null)
                {
                    TOTAL_ERROR++;
                    Console.WriteLine(">>----end run testcase {0} fail,no repsonse--------", tc.Id);
                }
                else
                {
                    Console.WriteLine(">>----end run testcase {0} success,response code = {1}-------", tc.Id, rsp.Code);

                    var jsonRsp = parser.ToJson(rsp);

                    if (string.IsNullOrEmpty(jsonRsp))
                    {
                        TOTAL_ERROR++;
                        Console.WriteLine(">>----end run testcase {0} fail,没有配置对应服务响应消息---------", tc.Id);
                    }
                    else
                    {
                        Console.WriteLine(">>response:{0}", jsonRsp);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("执行测试出错:" + ex.Message);
                System.Environment.Exit(1);
            }
        }
Esempio n. 3
0
 public AmpInvokeClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
 public QPaperInnerServiceClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 5
0
 public MathClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 6
0
 public UserServiceClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 7
0
 public TaskProducerServiceClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 8
0
 public APaperFacadeServiceClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of <c>ClientBase</c> class.
 /// </summary>
 /// <param name="callInvoker">The <c>CallInvoker</c> for remote call invocation.</param>
 public InvokeClientBase(ICallInvoker <TMessage> callInvoker)
 {
     this._callInvoke = callInvoker;
 }
 public TaskConsumerServiceClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 11
0
 public GreeterClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
Esempio n. 12
0
 public JobService(ILogger <JobService> logger, ICallInvoker <AmpMessage> invoker)
 {
     _logger  = logger;
     _invoker = invoker;
 }
 public SurveyGateServiceClient(ICallInvoker <AmpMessage> callInvoker) : base(callInvoker)
 {
 }
 public TransforHangfireJobService(ILogger <TransforHangfireJobService> logger, ICallInvoker <AmpMessage> invoker)
 {
     _logger  = logger;
     _invoker = invoker;
 }