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"); }
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 }
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 }
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")); }
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); }
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); }
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); }
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); }
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 }
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); }
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); }
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"); }
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")); }