Esempio n. 1
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);
                    }
                }
            }
        }
Esempio n. 2
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());
                }
            }
        }