return _instance;
}
- private TSettings() {
- IsManual = false;
- }
+ private TSettings()
+ {
+ IsManual = false;
+ }
public void SetDefaultTCDelay(int defaultTCDelay)
{
#region testkit-stub api
// [Hyukin.Kwon-code]: session_id for communication with testkit-stub
private static bool _isSlaveMode = false;
- private static int _session_id ;
+ private static int _session_id;
private static string _server = "http://127.0.0.1:8000";
- // private static string _proxy = "http://10.112.1.184:8080/";
+ // private static string _proxy = "http://10.112.1.184:8080/";
public static bool IsLastTC = false;
private static string _testcase_id;
public void ConnectTestkitStub()
{
+ TLogger.Write("############### ConnectTestkitStub ###############");
Random rnd = new Random();
_session_id = rnd.Next(1000, 9999);
_server = "http://127.0.0.1:8000";
private bool SyncSessionIdRequest()
{
+ TLogger.Write("############### In SyncSessionIdRequest ###############");
Console.WriteLine("[TUnitTest] - " + "In SyncSessionIdRequest");
string result = RequestGET("init_session_id", _session_id);
private bool CheckServer()
{
+ TLogger.Write("############### In CheckServer ###############");
Console.WriteLine("[TUnitTest] - " + "In CheckServer");
string result = RequestGET("check_server");
private string RequestGET(string key)
{
+ TLogger.Write("############### In RequestGET ###############");
Console.WriteLine("[TUnitTest] - " + "In RequestGET");
string result = null;
string url = _server + "/" + key;
Console.WriteLine("[TUnitTest] - " + "RequestGET url : " + url);
+ TLogger.Write("############### RequestGET url ###############");
try
{
StreamReader reader = new StreamReader(stream);
result = reader.ReadToEnd();
Console.WriteLine("[TUnitTest] - " + "RequestGET Result : " + result);
+ TLogger.Write("############### RequestGET Result : " + result + " ###############");
stream.Dispose();
response.Dispose();
}
private string RequestGET(string key, int sessionId)
{
+ TLogger.Write("############### In RequestGET ###############");
Console.WriteLine("[TUnitTest] - " + "In RequestGET");
string result = null;
string url = _server + "/" + key + "?session_id=" + _session_id;
Console.WriteLine("[TUnitTest] - " + "RequestGET url : " + url);
+ TLogger.Write("############### RequestGET url : " + url + " ###############");
try
{
Console.WriteLine("[TUnitTest] - " + "In AskNextStepRequest");
string result = RequestGET("ask_next_step", _session_id);
+ TLogger.Write("############### In AskNextStepRequest ###############");
if (result == null)
return false;
Console.WriteLine("[TUnitTest] - " + "In AutoTestTaskRequest");
string result = RequestGET("auto_test_task", _session_id);
+ TLogger.Write("############### In AutoTestTaskRequest ###############");
+ TLogger.Write("");
+ TLogger.Write("");
+ TLogger.Write("");
if (result == null)
return "";
{
Console.WriteLine("[TUnitTest] - " + "In RequestPOST");
string result = null;
+ TLogger.Write("############### In RequestPOST ###############");
string url = _server + "/" + key;
json = json + "&session_id=" + _session_id;
if (proxy != null)
{
- Console.WriteLine("[TUnitTest] - Proxy is NOT null. Is ByPassed : "+proxy.IsBypassed(new Uri(url)));
+ Console.WriteLine("[TUnitTest] - Proxy is NOT null. Is ByPassed : " + proxy.IsBypassed(new Uri(url)));
}
else
{
return result;
}
- public void SubmitManualResult()
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Manual test execution done.");
-
- if (_isSlaveMode == true)
- {
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Submit result to inform manual execution done.");
- RequestGET("generate_xml");
- }
- }
-
- #if TIZEN
- public void NextStepRequest()
- {
- if (AskNextStepRequest())
- {
- CheckExecutionProgressRequest();
- }
- if (AskNextStepRequest())
- {
- Testcase_ID = AutoTestTaskRequest();
- }
- }
-
- public SingleTestDoneEventArgs GetSingleTestDoneEventArgs() {
- SingleTestDoneEventArgs singleTestArgs = new SingleTestDoneEventArgs();
- singleTestArgs.Name = Testcase_ID;
- singleTestArgs.Result = TCResult;
- singleTestArgs.Message = TCMessage;
+ public void SubmitManualResult()
+ {
+ TLogger.Write("############### SubmitManualResult ###############");
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Manual test execution done.");
+
+ if (_isSlaveMode == true)
+ {
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Submit result to inform manual execution done.");
+ RequestGET("generate_xml");
+ }
+ }
+
+#if TIZEN
+ public void NextStepRequest()
+ {
+ TLogger.Write("############### NextStepRequest ###############");
+ if (AskNextStepRequest())
+ {
+ CheckExecutionProgressRequest();
+ }
+ if (AskNextStepRequest())
+ {
+ Testcase_ID = AutoTestTaskRequest();
+ }
+ }
+
+ public SingleTestDoneEventArgs GetSingleTestDoneEventArgs()
+ {
+ SingleTestDoneEventArgs singleTestArgs = new SingleTestDoneEventArgs();
+ singleTestArgs.Name = Testcase_ID;
+ singleTestArgs.Result = TCResult;
+ singleTestArgs.Message = TCMessage;
return singleTestArgs;
- }
+ }
public bool IsSlaveMode
{
get { return _isSlaveMode; }
}
- public bool IsManual
- {
- get;
- set;
- }
+ public bool IsManual
+ {
+ get;
+ set;
+ }
public string Testcase_ID
{
}
- public string TCResult {
- get;
- set;
- }
+ public string TCResult
+ {
+ get;
+ set;
+ }
- public string TCMessage {
- get;
- set;
- }
+ public string TCMessage
+ {
+ get;
+ set;
+ }
- #endif
+#endif
#endregion
}
- public class SingleTestDoneEventArgs : EventArgs
- {
- public string Name { get; set; }
- public string Result { get; set; }
- public string Message { get; set; }
- }
+ public class SingleTestDoneEventArgs : EventArgs
+ {
+ public string Name { get; set; }
+ public string Result { get; set; }
+ public string Message { get; set; }
+ }
}