Пример #1
0
        public override void run()
        {
            int compid = Convert.ToInt32(compId);



            Console.WriteLine("Computing action " + action_id + " of port " + port_id + " of component " + compid
                              + " whose handleid informed is " + handleId);
            ITaskBindingKind v = (ITaskBindingKind)Certifier.services.getPort(port_id);


            //Certifier.verify_actions.TryGetValue(compid, out v);
            //v.invoke (IVerify.VERIFY_PERFORM);
            v.invoke(action_id);
            IActionFutureSet future_iteration = null;

            IActionFuture future_conclusive = null;

            //v.invoke (IVerify.VERIFY_CONCLUSIVE, out future_conclusive);
            v.invoke("verify_conclusive", out future_conclusive);
            future_iteration = future_conclusive.createSet();

            IActionFuture future_inconclusive = null;

            //v.invoke (IVerify.VERIFY_INCONCLUSIVE, out future_inconclusive);
            v.invoke("verify_inconclusive", out future_inconclusive);
            future_iteration.addAction(future_inconclusive);

            IActionFuture r = future_iteration.waitAny();

            result = r == future_conclusive ? CerificationResult.Conclusive : CerificationResult.Inconclusive;
        }
        private CerificationResult perform_certify(string orchestration)
        {
            CertifierOrchestrationParser parser = new CertifierOrchestrationParser();

            //parser.readOrchestrationXML(CertifierConstants.ORCHESTRATION_FILE_TEST);
            parser.readOrchestrationXML(Orchestration);
            CertifierConsoleLogger.write(parser.getOrchestration().toString());

            variables.Add("formal_properties", formal_properties);
            CerificationResult result = CerificationResult.Conclusive;

            parser.getOrchestration().run();             //


            Console.WriteLine("iterating remaining start threads");
            foreach (KeyValuePair <String, LogicActionInstantiate> entry in InstantiateActions)
            {
                if (entry.Value._thread != null)
                {
                    entry.Value._thread.Join();
                }
            }
            foreach (KeyValuePair <String, LogicActionCompute> entry in ComputeActions)
            {
                if (entry.Value._thread != null)
                {
                    entry.Value._thread.Join();
                    if (entry.Value.result == CerificationResult.Inconclusive)
                    {
                        result = CerificationResult.Inconclusive;
                    }
                }
            }
            return(result);
        }
        public override void main()
        {
            services = Services;

            Stopwatch sw = new Stopwatch();

            sw.Start();

            setData();
            CerificationResult result = perform_certify(Orchestration);

            sw.Stop();

            Console.WriteLine("Tempo total de verificação={0} : INCONCLUSIVE ? {1}", sw.Elapsed, result == CerificationResult.Inconclusive);
        }