Exemplo n.º 1
0
        public void AvrServiceViewChartTest()
        {
            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                var receiver = new AvrCacheReceiver(wrapper);
                AvrPivotViewModel view;
                long layoutId = LayoutFormSave();
                using (new StopwathTransaction("++++ GetView ++++"))
                {
                    view = receiver.GetCachedView("xxx", layoutId, "ru");
                }
                Assert.IsNotNull(view);
                Assert.IsNotNull(view.ViewData);
                Assert.IsNotNull(view.ViewHeader);

                ChartExportDTO chartBytes;
                using (new StopwathTransaction("++++ GetChart ++++"))
                {
                    var tableModel = new ChartTableModel(layoutId, "ru", ExportChartToJpgTests.CreateChartData(), null, DBChartType.chrBar,
                                                         null,
                                                         1000, 750);

                    chartBytes = receiver.ExportChartToJpg(tableModel);
                }
                Assert.IsNotNull(chartBytes);
                Assert.IsNotNull(chartBytes.JpgBytes);
                Assert.IsTrue(chartBytes.JpgBytes.Length > 0);
                ExportTests.AssertJpeg(chartBytes.JpgBytes);
                //File.WriteAllBytes("filexx.jpg", chartBytes);
            }
        }
Exemplo n.º 2
0
 private bool ValidateAvrService()
 {
     if (TabControlMain.TabPages.IndexOf(TabPageAVRService) < 0)
     {
         return(true);
     }
     try
     {
         using (var wrapper = new AvrServiceClientWrapper(txtAvrServiceUrl.Text))
         {
             wrapper.GetServiceVersion();
             AppConfigWriter.Instance.SetItem("AVRServiceHostURL", txtAvrServiceUrl.Text);
             AppConfigWriter.Instance.Save();
         }
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex);
         if (!WinUtils.ConfirmMessage(EidssMessages.Get("msgIncorrectAvrServiceUrl")))
         {
             TabControlMain.SelectedTabPage = TabPageAVRService;
             txtAvrServiceUrl.Select();
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 3
0
 public void AvrServiceHelperCheckAvrServiceAccessTest()
 {
     using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
     {
         AvrServiceAccessability access = AvrServiceAccessability.Check(wrapper);
         Assert.IsTrue(access.IsOk);
     }
 }
Exemplo n.º 4
0
        public void AvrServiceViewSaveInvalidateTest()
        {
            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                var receiver = new AvrCacheReceiver(wrapper);
                AvrPivotViewModel view;
                long layoutId = LayoutFormSave();
                using (new StopwathTransaction("++++ GetView ++++"))
                {
                    view = receiver.GetCachedView("xxx", layoutId, "ru");
                }
                Assert.IsNotNull(view);
                Assert.IsNotNull(view.ViewData);
                Assert.IsNotNull(view.ViewHeader);

                using (new StopwathTransaction("++++ InvalidateView ++++"))
                {
                    wrapper.InvalidateViewCache(layoutId);
                }
            }
        }
Exemplo n.º 5
0
        public void AvrServiceArchiveTest()
        {
            const long humQueryId = 49539640000000;

            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                var          receiver = new AvrCacheReceiver(wrapper);
                AvrDataTable dataTable;
                using (new StopwathTransaction("++++ Hum - GetCachedQueryTable - en 1"))
                {
                    CachedQueryResult result = receiver.GetCachedQueryTable(humQueryId, "en", true,
                                                                            string.Empty, new LayoutSilentValidatorWaiter());
                    Assert.IsNotNull(result);
                    dataTable = result.QueryTable;
                }
                Assert.IsNotNull(dataTable);

                Assert.AreEqual(m_HumanFieldCount * 2, dataTable.Columns.Count);
                Assert.IsTrue(1500 * 2 < dataTable.Rows.Count);
            }
        }
Exemplo n.º 6
0
        public void AvrServiceGetHeaderAndBodyTest()
        {
            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                const long   queryId = 49539640000000;
                const string lang    = "en";
                using (new StopwathTransaction("InvalidatePivotCache - 1"))
                {
                    wrapper.InvalidateQueryCacheForLanguage(queryId, lang);
                }
                using (new StopwathTransaction("InvalidatePivotCache - 2"))
                {
                    wrapper.InvalidateQueryCacheForLanguage(queryId, lang);
                }
                using (new StopwathTransaction("GetCachedQueryTableHeader - 1"))
                {
                    wrapper.GetCachedQueryTableHeader(queryId, lang, false);
                }
                using (new StopwathTransaction("GetCachedQueryTableHeader - 2"))
                {
                    wrapper.GetCachedQueryTableHeader(queryId, lang, false);
                }
                QueryTableHeaderDTO headerDTO;
                using (new StopwathTransaction("GetCachedQueryTableHeader - 3"))
                {
                    headerDTO = wrapper.GetCachedQueryTableHeader(queryId, lang, false);
                }

                for (int i = 0; i < headerDTO.PacketCount; i++)
                {
                    using (new StopwathTransaction("Get packet #" + i))
                    {
                        wrapper.GetCachedQueryTablePacket(headerDTO.QueryCacheId, i, headerDTO.PacketCount);
                    }
                }
            }
        }
Exemplo n.º 7
0
        public void AvrServiceFullProcessTest()
        {
            const long humQueryId = 49539640000000;
            const long vetQueryId = 49542020000000;

            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                AvrDataTable dataTable;
                using (new StopwathTransaction("++++ Hum - GetCachedQueryTable - en 1"))
                {
                    var receiver = new AvrCacheReceiver(wrapper);
                    receiver.GetCachedQueryTable(humQueryId, "en", false, string.Empty, new LayoutSilentValidatorWaiter());
                }
                using (new StopwathTransaction("++++ Hum - GetCachedQueryTable - ru"))
                {
                    var receiver = new AvrCacheReceiver(wrapper);
                    receiver.GetCachedQueryTable(humQueryId, "ru", false, string.Empty, new LayoutSilentValidatorWaiter());
                }
                using (new StopwathTransaction("++++ Hum - GetCachedQueryTable - en 2"))
                {
                    var receiver             = new AvrCacheReceiver(wrapper);
                    CachedQueryResult result = receiver.GetCachedQueryTable(humQueryId, "en", false, string.Empty,
                                                                            new LayoutSilentValidatorWaiter());
                    Assert.IsNotNull(result);
                    dataTable = result.QueryTable;
                }

                Assert.IsNotNull(dataTable);

                Assert.AreEqual(m_HumanFieldCount * 2, dataTable.Columns.Count);
                Assert.IsTrue(1500 < dataTable.Rows.Count);

                using (new StopwathTransaction("++++ Vet - InvalidateQueryCache - en"))
                {
                    wrapper.InvalidateQueryCacheForLanguage(vetQueryId, "en");
                }
                using (new StopwathTransaction("++++ Vet - GetCachedQueryTable - en 1"))
                {
                    var receiver = new AvrCacheReceiver(wrapper);
                    receiver.GetCachedQueryTable(vetQueryId, "en", false, string.Empty, new LayoutSilentValidatorWaiter());
                }
                using (new StopwathTransaction("++++ Vet - GetCachedQueryTable - en 2"))
                {
                    var receiver             = new AvrCacheReceiver(wrapper);
                    CachedQueryResult result = receiver.GetCachedQueryTable(vetQueryId, "en", false, string.Empty,
                                                                            new LayoutSilentValidatorWaiter());
                    Assert.IsNotNull(result);
                    dataTable = result.QueryTable;
                }
                Assert.IsNotNull(dataTable);
                Assert.AreEqual(m_VetFieldCount * 2, dataTable.Columns.Count);
                Assert.IsTrue(1000 < dataTable.Rows.Count);
            }

            using (var wrapper = new AvrServiceClientWrapper(m_HostKeeper.CurrentServiceHostURL))
            {
                using (new StopwathTransaction("++++ Hum - new Client - GetCachedQueryTable - en 1"))
                {
                    var receiver = new AvrCacheReceiver(wrapper);
                    receiver.GetCachedQueryTable(humQueryId, "en", false, string.Empty, new LayoutSilentValidatorWaiter());
                }

                using (new StopwathTransaction("++++ Hum - new Client -  GetCachedQueryTable - en 2"))
                {
                    var receiver = new AvrCacheReceiver(wrapper);
                    receiver.GetCachedQueryTable(humQueryId, "en", false, string.Empty, new LayoutSilentValidatorWaiter());
                }
            }
        }