Ejemplo n.º 1
0
        /// <summary>
        /// Validate Cancel submitted job by passing job id.
        /// <param name="nodeName">different alphabet node name</param>
        /// </summary>
        void ValidateCancelSubmittedJob(
            string nodeName,
            RequestType type)
        {
            // Gets the search query parameter and their values.
            string alphabetName = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.AlphabetNameNode);
            string querySequence = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string email = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.EmailAdress);
            string queryProgramValue = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string expect = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.Expectparameter);
            string emailNotify = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.EmailNotifyParameterNode);
            string jobName = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.JobNameParameterNode);
            string expectValue = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.ExpectNode);
            string emailNotifyValue = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.EmailNotifyNode);
            string jobNameValue = _utilityObj._xmlUtil.GetTextValue(
                nodeName, Constants.JobNameNode);

            // Set Blast Parameters
            BlastParameters queryParams = new BlastParameters();

            IBlastServiceHandler service          = new BioHPCBlastHandler();
            ConfigParameters     configParameters = new ConfigParameters();

            configParameters.EmailAddress    = email;
            configParameters.Password        = String.Empty;
            configParameters.UseBrowserProxy = true;
            service.Configuration            = configParameters;

            // Add mandatory parameter values to search query parameters.
            queryParams.Add(queryDatabaseParameter, queryDatabaseValue);
            queryParams.Add(queryProgramParameter, queryProgramValue);
            queryParams.Add(expect, expectValue);
            queryParams.Add(emailNotify, emailNotifyValue);
            queryParams.Add(jobName, jobNameValue);

            Dictionary <string, object> testCaseParms = new Dictionary <string, object>();

            testCaseParms.Add(Constants.BlastParmsConst, queryParams);
            testCaseParms.Add(Constants.QuerySeqString, querySequence);
            testCaseParms.Add(Constants.AlphabetString, alphabetName);
            testCaseParms.Add(Constants.EmailString, email);

            TestCaseParameters parameters    = null;
            object             resultsObject = null;

            // Create a request without passing sequence.
            switch (type)
            {
            case RequestType.DnaStrSubmit:
                parameters = new TestCaseParameters(
                    Constants.BioHPCCancelRequestUsingDnaSeq,
                    null, GetRequestIdentifier, testCaseParms);
                resultsObject = _TestCaseSimulator.Simulate(parameters).Result;
                break;

            case RequestType.ProteinStrSubmit:
                parameters = new TestCaseParameters(
                    Constants.BioHPCRequestIdentifierForProteinSeqTest,
                    null, GetRequestIdentifier, testCaseParms);
                resultsObject = _TestCaseSimulator.Simulate(parameters).Result;
                break;

            case RequestType.DnalstSubmit:
                parameters = new TestCaseParameters(
                    Constants.BioHPCRequestIdentifierForDnaSeqTest,
                    null, GetRequestIdentifierUsingSeqList, testCaseParms);
                resultsObject = _TestCaseSimulator.Simulate(parameters).Result;
                break;

            case RequestType.ProteinlstSubmit:
                parameters = new TestCaseParameters(
                    Constants.BioHPCCancelRequestUsingProteinSeq,
                    null, GetRequestIdentifierUsingSeqList, testCaseParms);
                resultsObject = _TestCaseSimulator.Simulate(parameters).Result;
                break;
            }

            // Cancel subitted job.
            bool result = service.CancelRequest(resultsObject as string);

            // validate the cancelled job.
            Assert.IsTrue(result);

            Console.WriteLine(string.Concat(
                                  "BioHPC Blast Bvt : Submitted job cancelled was successfully. ",
                                  queryProgramValue));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Validate Cancel submitted job by passing job id.
        /// <param name="nodeName">different alphabet node name</param>
        /// </summary>
        void ValidateCancelSubmittedJob(
            string nodeName,
            RequestType type)
        {
            // Gets the search query parameter and their values.
            string alphabetName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.AlphabetNameNode);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string email = Constants.EmailForWS; ;
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string expect = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.Expectparameter);
            string emailNotify = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.EmailNotifyParameterNode);
            string jobName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.JobNameParameterNode);
            string expectValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ExpectNode);
            string emailNotifyValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.EmailNotifyNode);
            string jobNameValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.JobNameNode);

            // Set Blast Parameters
            Sequence seq = new Sequence(Utility.GetAlphabet(alphabetName),
                querySequence);

            IBlastServiceHandler service = new BioHPCBlastHandler();
            ConfigParameters configParameters = new ConfigParameters();
            configParameters.EmailAddress = email;
            configParameters.Password = String.Empty;
            configParameters.UseBrowserProxy = true;
            service.Configuration = configParameters;

            BlastParameters searchParams = new BlastParameters();

            // Set Request parameters.
            searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
            searchParams.Add(queryProgramParameter, queryProgramValue);
            searchParams.Add(expect, expectValue);
            searchParams.Add(emailNotify, emailNotifyValue);
            searchParams.Add(jobName, jobNameValue);

            string reqId = String.Empty;

            // Waiting for the any previous request to get completed.
            Thread.Sleep(150000);

            // Create a request without passing sequence.
            switch (type)
            {
                case RequestType.StrSubmit:
                    reqId = service.SubmitRequest(seq, searchParams);
                    break;
                case RequestType.LstSubmit:
                    IList<ISequence> lstSeq = new List<ISequence>();
                    lstSeq.Add(seq);
                    reqId = service.SubmitRequest(lstSeq, searchParams);
                    break;
            }

            // Cancel subitted job.
            bool result = service.CancelRequest(reqId);

            // validate the cancelled job.
            Assert.IsTrue(result);

            Console.WriteLine(string.Concat(
                "BioHPC Blast Bvt : Submitted job cancelled was successfully. ",
                queryProgramValue));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Validate Cancel submitted job by passing job id.
        /// <param name="nodeName">different alphabet node name</param>
        /// </summary>
        void ValidateCancelSubmittedJob(
            string nodeName,
            RequestType type)
        {
            // Gets the search query parameter and their values.
            string alphabetName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.AlphabetNameNode);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string email             = Constants.EmailForWS;;
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string expect = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.Expectparameter);
            string emailNotify = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.EmailNotifyParameterNode);
            string jobName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.JobNameParameterNode);
            string expectValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ExpectNode);
            string emailNotifyValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.EmailNotifyNode);
            string jobNameValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.JobNameNode);

            // Set Blast Parameters
            Sequence seq = new Sequence(Utility.GetAlphabet(alphabetName),
                                        querySequence);

            IBlastServiceHandler service          = new BioHPCBlastHandler();
            ConfigParameters     configParameters = new ConfigParameters();

            configParameters.EmailAddress    = email;
            configParameters.Password        = String.Empty;
            configParameters.UseBrowserProxy = true;
            service.Configuration            = configParameters;

            BlastParameters searchParams = new BlastParameters();

            // Set Request parameters.
            searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
            searchParams.Add(queryProgramParameter, queryProgramValue);
            searchParams.Add(expect, expectValue);
            searchParams.Add(emailNotify, emailNotifyValue);
            searchParams.Add(jobName, jobNameValue);

            string reqId = String.Empty;

            // Waiting for the any previous request to get completed.
            Thread.Sleep(150000);

            // Create a request without passing sequence.
            switch (type)
            {
            case RequestType.StrSubmit:
                reqId = service.SubmitRequest(seq, searchParams);
                break;

            case RequestType.LstSubmit:
                IList <ISequence> lstSeq = new List <ISequence>();
                lstSeq.Add(seq);
                reqId = service.SubmitRequest(lstSeq, searchParams);
                break;
            }

            // Cancel subitted job.
            bool result = service.CancelRequest(reqId);

            // validate the cancelled job.
            Assert.IsTrue(result);

            Console.WriteLine(string.Concat(
                                  "BioHPC Blast Bvt : Submitted job cancelled was successfully. ",
                                  queryProgramValue));
        }
Ejemplo n.º 4
0
        public void ValidateProcessRequestThread()
        {
            // Gets the search query parameter and their values.
            string alphabetName = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.AlphabetNameNode);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.DatabaseValue);
            string email = Constants.EmailForWS;
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.ProgramParameter);
            string expect = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.Expectparameter);
            string emailNotify = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.EmailNotifyParameterNode);
            string jobName = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.JobNameParameterNode);
            string expectValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.ExpectNode);
            string emailNotifyValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.EmailNotifyNode);
            string jobNameValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.JobNameNode);

            // Set Blast Parameters
            Sequence seq = new Sequence(Utility.GetAlphabet(alphabetName),
                querySequence);
                BioHPCBlastHandler service = new BioHPCBlastHandler();
            try
            {
                ConfigParameters configParameters = new ConfigParameters();
                configParameters.EmailAddress = email;
                configParameters.Password = String.Empty;
                configParameters.UseBrowserProxy = true;
                service.Configuration = configParameters;

                service.RequestCompleted += new EventHandler<BlastRequestCompletedEventArgs>(service_RequestCompleted);

                BlastParameters searchParams = new BlastParameters();

                // Set Request parameters.
                searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
                searchParams.Add(queryProgramParameter, queryProgramValue);
                searchParams.Add(expect, expectValue);
                searchParams.Add(emailNotify, emailNotifyValue);
                searchParams.Add(jobName, jobNameValue);

                string reqId = String.Empty;

                // Waiting for the any previous request to get completed.
                Thread.Sleep(150000);

                // Create a request without passing sequence.
                reqId = service.SubmitRequest(seq, searchParams);

                // Cancel subitted job.
                bool result = service.CancelRequest(reqId);

                // validate the cancelled job.
                Assert.IsTrue(result);
            }
            finally
            {
                if (service != null)
                    service.Dispose();
            }
        }
Ejemplo n.º 5
0
        public void ValidateProcessRequestThread()
        {
            // Gets the search query parameter and their values.
            string alphabetName = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.AlphabetNameNode);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.DatabaseValue);
            string email             = Constants.EmailForWS;
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.ProgramParameter);
            string expect = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.Expectparameter);
            string emailNotify = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.EmailNotifyParameterNode);
            string jobName = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.JobNameParameterNode);
            string expectValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.ExpectNode);
            string emailNotifyValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.EmailNotifyNode);
            string jobNameValue = utilityObj.xmlUtil.GetTextValue(
                Constants.BioHPCAsynchronousResultsNode, Constants.JobNameNode);

            // Set Blast Parameters
            Sequence seq = new Sequence(Utility.GetAlphabet(alphabetName),
                                        querySequence);
            BioHPCBlastHandler service = new BioHPCBlastHandler();

            try
            {
                ConfigParameters configParameters = new ConfigParameters();
                configParameters.EmailAddress    = email;
                configParameters.Password        = String.Empty;
                configParameters.UseBrowserProxy = true;
                service.Configuration            = configParameters;

                service.RequestCompleted += new EventHandler <BlastRequestCompletedEventArgs>(service_RequestCompleted);

                BlastParameters searchParams = new BlastParameters();

                // Set Request parameters.
                searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
                searchParams.Add(queryProgramParameter, queryProgramValue);
                searchParams.Add(expect, expectValue);
                searchParams.Add(emailNotify, emailNotifyValue);
                searchParams.Add(jobName, jobNameValue);

                string reqId = String.Empty;

                // Waiting for the any previous request to get completed.
                Thread.Sleep(150000);

                // Create a request without passing sequence.
                reqId = service.SubmitRequest(seq, searchParams);

                // Cancel subitted job.
                bool result = service.CancelRequest(reqId);

                // validate the cancelled job.
                Assert.IsTrue(result);
            }
            finally
            {
                if (service != null)
                {
                    service.Dispose();
                }
            }
        }