Exemple #1
0
        /// <summary>
        /// Retrieves the extended data recorded against the specified cab file.
        /// </summary>
        /// <param name="requestData">Identifies the CAB file whose data is required.</param>
        /// <returns>Response data.</returns>
        public GetCabPackageResponse GetCabPackage(GetCabPackageRequest requestData)
        {
            if (requestData == null)
            {
                throw new ArgumentNullException("requestData");
            }

            GetCabPackageResponse resp = new GetCabPackageResponse();

            resp.Product    = requestData.Product;
            resp.File       = requestData.File;
            resp.Event      = requestData.Event;
            resp.CabPackage = StaticObjects.TheStaticObjects.TheController.GetCabPackage(requestData.ContextId,
                                                                                         requestData.Product, requestData.File, requestData.Event, requestData.Cab);
            resp.ResultData = new StackHashServiceResultData(
                StackHashServiceResult.Success, s_OperationSuccessful, null);
            return(resp);
        }
Exemple #2
0
        // Get the
        public void getCabPackage(ErrorIndexType indexType)
        {
            // Add a context.
            CreateNewStackHashContextResponse resp = m_Utils.CreateNewContext(indexType);

            String testPath = "c:\\stackhashunittests\\testindex\\";

            resp.Settings.ErrorIndexSettings.Folder = testPath;
            resp.Settings.ErrorIndexSettings.Name   = "TestIndex";
            m_Utils.SetContextSettings(resp.Settings);
            m_Utils.DeleteIndex(0); // Make sure it is empty.
            m_Utils.ActivateContext(0);

            // Create a test index with one cab file.
            StackHashTestIndexData testIndexData = new StackHashTestIndexData();

            testIndexData.NumberOfProducts   = 1;
            testIndexData.NumberOfFiles      = 1;
            testIndexData.NumberOfEvents     = 1;
            testIndexData.NumberOfEventInfos = 0;
            testIndexData.NumberOfCabs       = 1;

            m_Utils.CreateTestIndex(0, testIndexData);

            GetProductsResponse getProductsResp = m_Utils.GetProducts(0);

            Assert.AreEqual(1, getProductsResp.Products.Count());

            GetFilesResponse allFiles = m_Utils.GetFiles(0, getProductsResp.Products[0].Product);

            Assert.AreEqual(1, allFiles.Files.Count());

            GetProductEventPackageResponse allEvents = m_Utils.GetProductEventPackages(0, getProductsResp.Products[0].Product);

            Assert.AreEqual(1, allEvents.EventPackages.Count());
            Assert.AreEqual(1, allEvents.EventPackages[0].Cabs.Count);


            // Get the Cab package.
            GetCabPackageResponse cabPackageResp = m_Utils.GetCabPackage(0, getProductsResp.Products[0].Product, allFiles.Files[0], allEvents.EventPackages[0].EventData,
                                                                         allEvents.EventPackages[0].Cabs[0].Cab);

            Assert.AreEqual("c:\\stackhashunittests\\testindex\\TestIndex\\00\\00\\00\\00\\CAB_0000000001\\1-Crash 32bit-0.cab", cabPackageResp.CabPackage.FullPath);
        }