예제 #1
0
        public void TestCheckSampleGroupFlag02()
        {
            // Testing -- SampleGrp config Changed and valid setup for re initializations.
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            oPCLoggerQueneAccessor.Call("CheckSampleGroupFlag");
        }
예제 #2
0
        public void TestCheckSampleGroupFlag01()
        {
            //Testing --- SampleGrp Config Variable changed and throws exception in removeOPCItems and intialization
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            //Test Procedure Call
            oPCLoggerQueneAccessor.Call("CheckSampleGroupFlag");
            //Post Condition Check
        }
예제 #3
0
        public void TestTerminateAndWait02()
        {
            //Testing -- normal flow
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            oPCLoggerQueneAccessor.SetField("m_thread", System.Threading.Thread.CurrentThread);
            //Test Procedure Call
            oPCLoggerQuene.TerminateAndWait();
            //Post Condition Call
        }
예제 #4
0
        public void TestsetServiceRunning01()
        {
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            bool           flag = false;

            //Test Procedure Call
            oPCLoggerQuene.setServiceRunning(flag);
            //Post Condition Check
            Assert.AreEqual(flag, oPCLoggerQueneAccessor.GetField("m_serviceStarted"));
        }
예제 #5
0
        public void TestCheckOPCConnection02()
        {
            // Test ---- OPC Server is Connected
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            //Test Procedure Call
            bool b = (bool)oPCLoggerQueneAccessor.Call("CheckOPCConnection");

            //Post Condition Check
            Assert.IsTrue(b);
        }
예제 #6
0
        public void TestGetOPCValue04()
        {
            //Testing --- DataPoint value returned is other type than boolean and numeric
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            string         dataPointname          = "SampleDP1";
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            //Test Procedure Call
            string str = (string)oPCLoggerQueneAccessor.Call("GetOPCValue", dataPointname);

            //Post Condition Check
            Assert.AreEqual("0", str);
        }
예제 #7
0
        public void TestGetOPCValue01()
        {
            //Testing --- DataPoint not connected to OPC Server Proxy
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            string         dataPointname          = "SampleDP1";
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            //Test Procedure Call
            string str = (string)oPCLoggerQueneAccessor.Call("GetOPCValue", dataPointname);

            //Post Condition Check
            Assert.AreEqual("", str);
        }
예제 #8
0
        public void TestCanLogDataPT01()
        {
            //Testing --- NextSampleTime is null ... first time logging the datapoint
            OPCLoggerQuene  oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            OPCDPGrpDetails opcDPGrp               = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            Accessor        oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            //Test Procedure Call
            bool b = (bool)oPCLoggerQueneAccessor.Call("CanLogDataPT", opcDPGrp);

            //Post Condition Check
            Assert.IsTrue(b);
        }
예제 #9
0
        public void TestTerminateAndWait01()
        {
            //Testing -- thread with not started state --- throws exception
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            System.Threading.ThreadStart ss   = new System.Threading.ThreadStart(threadProc);
            System.Threading.Thread      thr1 = new System.Threading.Thread(ss);
            oPCLoggerQueneAccessor.SetField("m_thread", thr1);
            //Test Procedure Call
            oPCLoggerQuene.TerminateAndWait();
            //Post Condition Call
        }
예제 #10
0
        public void TestCheckOracleConnection02()
        {
            // testing ---- exception is passed
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            string         exceptionString        = "Database Connection Failure testing";
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            oPCLoggerQueneAccessor.Call("CheckOracleConnection", exceptionString);

            //test2 --- exception passed but flag already set.
            oPCLoggerQueneAccessor.SetField("m_dbDisconnected", true);
            oPCLoggerQueneAccessor.Call("CheckOracleConnection", exceptionString);
        }
예제 #11
0
        public void TestCanLogDataPT03()
        {
            //testing -- current time is less than next sample time of datapoint
            OPCLoggerQuene  oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            OPCDPGrpDetails opcDPGrp               = OPCDPGrpDetailsFactory.CreateOPCDPGrpDetails01();
            Accessor        oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            opcDPGrp.NextSampleTime = DateTime.Now;
            //Test Procedure Call
            bool b = (bool)oPCLoggerQueneAccessor.Call("CanLogDataPT", opcDPGrp);

            //Post Condition Check
            Assert.IsFalse(b);
        }
예제 #12
0
        public void TestTestOracleConnection01()
        {
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);
            bool           b = (bool)oPCLoggerQueneAccessor.Call("TestOracleConnection");

            //Test 2 --- databse connection failed again
            oPCLoggerQueneAccessor.SetField("m_dbDisconnected", true);
            b = (bool)oPCLoggerQueneAccessor.Call("TestOracleConnection");

            //Test3 -- Database connection OK
            oPCLoggerQueneAccessor.SetField("m_dbDisconnected", true);
            b = (bool)oPCLoggerQueneAccessor.Call("TestOracleConnection");
        }
예제 #13
0
        public void TestCheckOracleConnection01()
        {
            //testing ---- exception throw for null exception string
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene01();
            string         exceptionString        = null;
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            //Test Procedure Call
            oPCLoggerQueneAccessor.Call("CheckOracleConnection", exceptionString);
            //Post Condition Check
            Assert.IsFalse((bool)oPCLoggerQueneAccessor.GetField("m_dbDisconnected"));


            //testing ---- no exception passed
            exceptionString = "";
            //Test Procedure Call
            oPCLoggerQueneAccessor.Call("CheckOracleConnection", exceptionString);
            //Post Condition Check
            Assert.IsFalse((bool)oPCLoggerQueneAccessor.GetField("m_dbDisconnected"));
        }