Exemplo n.º 1
0
        protected virtual void VerificationFinished()
        {
            try
            {
                if (Utility.Utilities.IsValidLicenseAvailable == Utility.Utilities.LicenseType.Evaluation ||
                    Utility.Utilities.IsValidLicenseAvailable == Utility.Utilities.LicenseType.Invalid)
                {
                    if (mAssertion.VerificationOutput.NoOfStates > Utility.Utilities.LicenseBoundedStateNumber)
                    {
                        mListener.updateResFinishedVerify();
                        mListener.updateStatusLabel(Resources.Verification_Completed);
                        mAssertion.Clear();

                        //remove the events
                        mAssertion.Action       -= mListener.onAction;
                        mAssertion.Cancelled    -= Verification_Cancelled;
                        mAssertion.ReturnResult -= VerificationFinished;
                        mAssertion.Failed       -= MC_Failed;

                        mListener.enableAllControls();
                        mTimer.Stop();
                        return;
                    }
                }

                mListener.onAction(mAssertion.GetVerificationStatistics());
                mListener.onResult(mAssertion.VerificationOutput.VerificationResult);
                mListener.updateStatusLabel(Resources.Generating_Result);

                mAssertion.ReturnResult -= VerificationFinished;
                mAssertion.ReturnResult += VerificationResult;
                mAssertion.VerificationOutput.GenerateCounterExample = mListener.generateCounterExample();
                mAssertion.VerificationMode = false;
                mAssertion.Start();
            }
            catch (Exception ex)
            {
                mAssertion.Clear();

                //remove the events
                mAssertion.Action                  -= mListener.onAction;
                mAssertion.Cancelled               -= Verification_Cancelled;
                mAssertion.ReturnResult            -= VerificationFinished;
                mAssertion.Failed                  -= MC_Failed;
                mSpec.AssertionDatabase[mCurAssert] = mAssertion;

                Common.Utility.Utilities.LogException(ex, mSpec);
            }

            // Add by Minh
            //mListener.RnderingOutputTextbox();
            mSpec.UnLockSharedData();
            mSpec.UnLockSpecificationData();
        }
Exemplo n.º 2
0
 public static bool UnLockSharedData(SpecificationBase specification)
 {
     //try to lock the data and operations.
     if (ShareDataLock != null && ShareDataLock == specification)
     {
         lock (ShareDataLock)
         {
             specification.UnLockSpecificationData();
             ShareDataLock = null;
         }
         return(true);
     }
     return(false);
 }