Ejemplo n.º 1
0
        public void TestTerminateAndWait02()
        {
            //testing ----- valid state
            OPCLoggerWriteQuene oPCLoggerWriteQuene         = new OPCLoggerWriteQuene();
            Accessor            oPCLoggerWriteQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerWriteQuene);

            oPCLoggerWriteQueneAccessor.SetField("m_thread", System.Threading.Thread.CurrentThread);
            //Test Procedure Call
            oPCLoggerWriteQuene.TerminateAndWait();
            //Post Condition Check
            Assert.IsTrue((bool)oPCLoggerWriteQueneAccessor.GetField("m_terminate"));
        }
Ejemplo n.º 2
0
        public void TestTerminateAndWait01()
        {
            //Testing -- exception thrown by join method for thread NotinStart state
            OPCLoggerWriteQuene oPCLoggerWriteQuene         = new OPCLoggerWriteQuene();
            Accessor            oPCLoggerWriteQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerWriteQuene);

            System.Threading.ThreadStart ss   = new System.Threading.ThreadStart(threadProc);
            System.Threading.Thread      thr1 = new System.Threading.Thread(ss);
            oPCLoggerWriteQueneAccessor.SetField("m_thread", thr1);
            //Test Procedure Call
            oPCLoggerWriteQuene.TerminateAndWait();
            //Post Condition Check
            Assert.IsTrue((bool)oPCLoggerWriteQueneAccessor.GetField("m_terminate"));
        }