public ValidateResult Validate(ValidateRequest validateRequest)
        {
            try
            {
                _avaLog.Debug("AddressSvc.Validate");

                Utilities.VerifyRequestObject(validateRequest);

                _avaLog.Debug("Copying address into proxy object");
                ProxyValidateRequest proxyRequest = new ProxyValidateRequest();
                validateRequest.CopyTo(proxyRequest);
                //Record time take for address validation
                Perf monitor = new Perf();
                monitor.Start();

                ProxyValidateResult svcResult = (ProxyValidateResult)base.InvokeService(typeof(ProxyAddressSvc), MethodBase.GetCurrentMethod().Name, new object[] { proxyRequest });

                monitor.Stop(this, ref svcResult);
                _avaLog.Debug("Copying address from proxy object");
                ValidateResult localResult = new ValidateResult();
                localResult.CopyFrom(svcResult);

                return(localResult);
            }
            catch (Exception ex)
            {
                return(ValidateResult.CastFromBaseResult(ExceptionManager.HandleException(ex)));
            }
        }
Exemplo n.º 2
0
        public ProxyGetTaxResult GetTax(ProxyGetTaxRequest GetTaxRequest)
        {
            AvaLogger _avaLog = AvaLogger.GetLogger();
            Perf      monitor = new Perf();

            monitor.Start();

            object[] results = this.Invoke("GetTax", new object[] {
                GetTaxRequest
            });

            monitor.Stop();
            _avaLog.Debug("GetTax (webservice method): " + monitor.ElapsedSeconds(3).ToString());

            return((ProxyGetTaxResult)(results[0]));
        }
Exemplo n.º 3
0
        public void NewickFileTest()
        {
            // parse
            Perf.Start("Parsing...");
            string filepath = @"TestData\PhylogeneticTree\tree.txt";

            NewickParser parser           = new NewickParser();
            Tree         phylogeneticTree = parser.Parse(filepath);

            Perf.End();

            string outpath = @"TestData\PhylogeneticTree\out.txt";

            Perf.Start("Formatting...");
            NewickFormatter formatter = new NewickFormatter();

            formatter.Format(phylogeneticTree, outpath);
            Perf.End();
            Assert.AreEqual(true, FileCompare(filepath, outpath));
        }
Exemplo n.º 4
0
        public void NewickStringTest()
        {
            StringBuilder input = new StringBuilder("(A:0.1,B:0.2,(C:0.3,D:0.4):0.5);");

            // parse
            Perf.Start("Parsing...");
            using (NewickParser parser = new NewickParser())
            {
                Tree phylogeneticTree = parser.Parse(input);

                Perf.End();

                Perf.Start("Formatting...");
                NewickFormatter formatter = new NewickFormatter();

                string output = formatter.FormatString(phylogeneticTree);
                Perf.End();
                Assert.AreEqual(input.ToString(), output);
            }
        }