コード例 #1
0
    private void Start()
    {
        DialogueDBAdmin.DeleteDatabase("F****r.db");
        DialogueDBAdmin.CreateUniDialogueDB("F****r.db");
        //SQLiteConnection _connection = new SQLiteConnection("Assets/StreamingAssets/F****r.db", SQLiteOpenFlags.ReadWrite);
        DialogueDBConnection _connection = new DialogueDBConnection("F****r.db", SQLiteOpenFlags.ReadWrite);
        DialogueDBManager    _dbManager  = new DialogueDBManager(_connection);

        ConversationEntry con1 = new ConversationEntry("asd1", -1);
        ConversationEntry con2 = new ConversationEntry("asd2", -1);
        ConversationEntry con3 = new ConversationEntry("asd3", -1);
        ConversationEntry con4 = new ConversationEntry("asd4", -1);
        ConversationEntry con5 = new ConversationEntry("asd5", -1);

        ContentEntry coe1 = new ContentEntry("fff1", "ccc1", -1);
        ContentEntry coe2 = new ContentEntry("fff2", "ccc2", -1);
        ContentEntry coe3 = new ContentEntry("fff3", "ccc3", -1);
        ContentEntry coe4 = new ContentEntry("fff4", "ccc4", -1);
        ContentEntry coe5 = new ContentEntry("fff5", "ccc5", -1);

        ExecutionEntry exe1 = new ExecutionEntry("eee1", -1);
        ExecutionEntry exe2 = new ExecutionEntry("eee2", -1);
        ExecutionEntry exe3 = new ExecutionEntry("eee3", -1);
        ExecutionEntry exe4 = new ExecutionEntry("eee4", -1);
        ExecutionEntry exe5 = new ExecutionEntry("eee5", -1);

        ConditionEntry cod1 = new ConditionEntry("ddd1", -1, -1);
        ConditionEntry cod2 = new ConditionEntry("ddd2", -1, -1);
        ConditionEntry cod3 = new ConditionEntry("ddd3", -1, -1);
        ConditionEntry cod4 = new ConditionEntry("ddd4", -1, -1);
        ConditionEntry cod5 = new ConditionEntry("ddd5", -1, -1);

        _dbManager.InsertEntry(con1);
        _dbManager.InsertEntry(con2);
        _dbManager.InsertEntry(con3);
        _dbManager.InsertEntry(con4);
        _dbManager.InsertEntry(con5);
        _dbManager.InsertEntry(coe1);
        _dbManager.InsertEntry(coe2);
        _dbManager.InsertEntry(coe3);
        _dbManager.InsertEntry(coe4);
        _dbManager.InsertEntry(coe5);
        _dbManager.InsertEntry(exe1);
        _dbManager.InsertEntry(exe2);
        _dbManager.InsertEntry(exe3);
        _dbManager.InsertEntry(exe4);
        _dbManager.InsertEntry(exe5);
        _dbManager.InsertEntry(cod1);
        _dbManager.InsertEntry(cod2);
        _dbManager.InsertEntry(cod3);
        _dbManager.InsertEntry(cod4);
        _dbManager.InsertEntry(cod5);

        List <ExecutionEntry> list = _connection.Query <ExecutionEntry>("SELECT *, MAX(ID) FROM ExecutionEntry;");

        foreach (ExecutionEntry ee in list)
        {
            Debug.Log(ee.ExecutionCode);
        }
    }
コード例 #2
0
        public void AddEntry([NotNull] string name, double value, [NotNull] CalcLocation location, VariableAction variableAction,
                             [NotNull] TimeStep timeStep, StrGuid variableGuid)
        {
            var ee = new ExecutionEntry(name, value, location, variableAction,
                                        timeStep, variableGuid);

            _entries.Add(ee);
        }
コード例 #3
0
 private void AddExectionEntry(ExecutionEntry ee, ExecutionListEntity master)
 {
     FillExecutionEntry(ee);
     master.ExecutionEntry.Add(exEntry);
 }
コード例 #4
0
        private void FillExecutionEntry(ExecutionEntry ee)
        {
            DateTime dts, dte;
            exEntry = new ExecutionEntryEntity();
            exEntry.Naam = ee.Name;
            exEntry.NodePath = ee.NodePath;
            if (ee.ActualLog == null)
            {
                exEntry.Status = NOTRUNSTATUS;
                return;
            }

            string tijds = ee.ActualLog.StartTime;
            string tijde = ee.ActualLog.EndTime;
            if (DateTime.TryParse(ee.ActualLog.StartTime, out dts))
                tijds = dts.ToString();
            if (DateTime.TryParse(ee.ActualLog.StartTime, out dte))
                tijde = dte.ToString();

            List<KeyValuePair> kv = new List<KeyValuePair>();

            exEntry.Status = ee.ActualLog.Result.ToString();
            if (ee.ActualLog.LogDetails == null)
            {
                exEntry.Info = new List<string>();
                exEntry.Info.Add(ee.ActualLog.LogInfo);
                return;
            }

            XDocument xdoc = XDocument.Parse(ee.ActualLog.LogDetails.CompressedLogAsString);

            // Alleen de waarde van het "Detail" attribuut selecteren waarvan het attribuut Detail gevuld is met een mogelijk bestand.
            IEnumerable<String> files = xdoc.Root.Descendants("XmlObject").Attributes("Detail").Where(at => at.Value.Contains(".txt")).Select(at => at.Value);
            // En dat moeten er dan ook 2 zijn...
            if (files.Count() == 2)
            {
                resultFolder = new DirectoryInfo(Path.Combine(folder.FullName,RESULTFILESFOLDER, exEntry.Naam, dts.ToString("yyyy-MM-dd")));
                exEntry.RequestFile = files.Single(f => f.Contains("request", StringComparison.OrdinalIgnoreCase));
                exEntry.ResponseFile = files.Single(f => f.Contains("response", StringComparison.OrdinalIgnoreCase));
                DateTime starttijd = Convert.ToDateTime( ee.ActualLog.ExecutionLog.StartTime);

                // Map aanmaken voor draaidatum als deze nog niet bestaat
                if (Directory.Exists(resultFolder.FullName) == false)
                    Directory.CreateDirectory(resultFolder.FullName);

                if (File.Exists(exEntry.RequestFile))
                {
                    File.Copy(exEntry.RequestFile, Path.Combine(resultFolder.FullName, starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_request.txt"), true);
                    exEntry.RequestFile = RESULTFILESFOLDER + "/" + exEntry.Naam +"/" +resultFolder.Name + "/" + starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_request.txt";
                }
                else { exEntry.RequestFile = String.Empty; }

                if (File.Exists(exEntry.ResponseFile))
                {
                    File.Copy(exEntry.ResponseFile, Path.Combine(resultFolder.FullName, starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_response.txt"), true);
                    exEntry.ResponseFile = RESULTFILESFOLDER + "/" + exEntry.Naam +"/" +resultFolder.Name + "/" + starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_response.txt";
                }
                else { exEntry.ResponseFile = String.Empty; }
            }

            String ResultInfo = ee.ActualLog.LogDetails.AggregatedDescription;
            exEntry.Info =  new List<string>(ResultInfo.Split(new String[] {Environment.NewLine },StringSplitOptions.RemoveEmptyEntries));

            kv.Add(new KeyValuePair { Key = "Starttijd", Value = tijds });
            kv.Add(new KeyValuePair { Key = "Eindttijd", Value = tijde });
            kv.Add(new KeyValuePair { Key = "Doorlooptijd", Value = Math.Round(ee.ActualLog.Duration).ToString() + " ms"  });
            exEntry.Parameters = kv;
        }
コード例 #5
0
ファイル: SubmitDefect.cs プロジェクト: tomvanwijk/ToscaAddin
 private static void SetTFSProject(ExecutionEntry ee)
 {
     IObjectWithConfiguration iObj = ee;
     string[] configurationParameters = TestConfiguration.GetTestConfigurationParameterNames(iObj);
     int index = Array.IndexOf(configurationParameters, DefectTrackerSettings.Default.ToscaTFSProject);
     if (index != -1)
     {
         string configurationValue = TestConfiguration.GetTestConfigurationParameterValue(iObj, DefectTrackerSettings.Default.ToscaTFSProject);
         DefectTrackerSettings.Default.TFSproject = configurationValue;
         DefectTrackerSettings.Default.Save();
     }
 }
コード例 #6
0
ファイル: SubmitDefect.cs プロジェクト: tomvanwijk/ToscaAddin
 private static Defect SetDefect(ExecutionEntry ee, List<string> attachment)
 {
     Defect defect = new Defect();
     defect.title = ee.ActualLog.Name;
     defect.symptom = ee.ActualLog.AggregatedDescription;
     defect.howFound = ee.ActualLog.NodePath;
     defect.attachmentList = attachment;
     return defect;
 }
コード例 #7
0
ファイル: SubmitDefect.cs プロジェクト: tomvanwijk/ToscaAddin
 private static Defect SetDefect(ExecutionEntry ee)
 {
     Defect defect = new Defect();
     defect.title = ee.ActualLog.Name;
     defect.symptom = ee.ActualLog.AggregatedDescription;
     defect.howFound = ee.ActualLog.NodePath;
     return defect;
 }
コード例 #8
0
        static async Task RunAsync(TCObject objectToExecuteOn)
        {
            HttpClient client = new HttpClient();

            System.Net.ServicePointManager.ServerCertificateValidationCallback +=
                delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
                         System.Security.Cryptography.X509Certificates.X509Chain chain,
                         System.Net.Security.SslPolicyErrors sslPolicyErrors)
            {
                return(true);
            };



            //assign BaseUrl into http client
            client.BaseAddress = new Uri(ZUtil.BASE_URL);
            //client.DefaultRequestHeaders.Accept.Clear();
            //client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            var RELATIVE_PATH = "flex/services/rest/latest/execution/create";


            String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(ZUtil.USER + ":" + ZUtil.PASSWORD));

            client.DefaultRequestHeaders.Add("Authorization", "Basic " + encoded);

            ExecutionListItem    executionListItem    = (ExecutionListItem)objectToExecuteOn;
            ExecutionList        executionEntryList   = executionListItem.ExecutionList;
            ExecutionEntryFolder executionEntryFolder = (ExecutionEntryFolder)executionEntryList.Items.First();
            List <Object>        testCase             = new List <Object>();

            string execStatus = "-1";

            for (int i = 0; i < executionEntryFolder.Items.Count(); i++)
            {
                ExecutionEntry  execItem   = (ExecutionEntry)executionEntryFolder.Items.ElementAt(i);
                ExecutionResult execResult = execItem.ActualResult;
                if (execResult.Equals("Passed"))
                {
                    execStatus = "1";
                }
                else
                {
                    execStatus = "2";
                }
                List <Object> testSteps    = new List <Object>();
                TestCase      testCaseItem = (TestCase)execItem.TestCase;
                for (int j = 0; j < testCaseItem.Items.Count(); j++)
                {
                    TestStep ts    = (TestStep)testCaseItem.Items.ElementAt(j);
                    var      tsObj = new { name = ts.DisplayedName };
                    testSteps.Add(tsObj);
                }
                var tc = new
                {
                    name            = execItem.DisplayedName,
                    executionResult = execStatus,
                    testSteps       = testSteps.ToArray()
                };
                testCase.Add(tc);
            }
            var jsonContent = new
            {
                testCases     = testCase.ToArray(),
                executionName = executionListItem.DisplayedName,
                releaseId     = "1",
                folderName    = executionListItem.DisplayedName
            };


            try
            {
                HttpResponseMessage response = await client.PostAsync(ZUtil.CONTEXT_PATH + RELATIVE_PATH,
                                                                      new StringContent(JsonConvert.SerializeObject(jsonContent).ToString(),
                                                                                        Encoding.UTF8, ZUtil.CONTENT_TYPE_JSON));

                response.EnsureSuccessStatusCode();

                //write response in console
                // Console.WriteLine(response);

                // Deserialize the updated product from the response body.
                string result = await response.Content.ReadAsStringAsync();

                //write Response in console
                //Console.WriteLine(result);

                //response.Dispose();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
コード例 #9
0
        private void FillExecutionEntry(ExecutionEntry ee)
        {
            DateTime dts, dte;

            exEntry          = new ExecutionEntryEntity();
            exEntry.Naam     = ee.Name;
            exEntry.NodePath = ee.NodePath;
            if (ee.ActualLog == null)
            {
                exEntry.Status = NOTRUNSTATUS;
                return;
            }

            string tijds = ee.ActualLog.StartTime;
            string tijde = ee.ActualLog.EndTime;

            if (DateTime.TryParse(ee.ActualLog.StartTime, out dts))
            {
                tijds = dts.ToString();
            }
            if (DateTime.TryParse(ee.ActualLog.StartTime, out dte))
            {
                tijde = dte.ToString();
            }

            List <KeyValuePair> kv = new List <KeyValuePair>();

            exEntry.Status = ee.ActualLog.Result.ToString();
            if (ee.ActualLog.LogDetails == null)
            {
                exEntry.Info = new List <string>();
                exEntry.Info.Add(ee.ActualLog.LogInfo);
                return;
            }


            XDocument xdoc = XDocument.Parse(ee.ActualLog.LogDetails.CompressedLogAsString);

            // Alleen de waarde van het "Detail" attribuut selecteren waarvan het attribuut Detail gevuld is met een mogelijk bestand.
            IEnumerable <String> files = xdoc.Root.Descendants("XmlObject").Attributes("Detail").Where(at => at.Value.Contains(".txt")).Select(at => at.Value);

            // En dat moeten er dan ook 2 zijn...
            if (files.Count() == 2)
            {
                resultFolder         = new DirectoryInfo(Path.Combine(folder.FullName, RESULTFILESFOLDER, exEntry.Naam, dts.ToString("yyyy-MM-dd")));
                exEntry.RequestFile  = files.Single(f => f.Contains("request", StringComparison.OrdinalIgnoreCase));
                exEntry.ResponseFile = files.Single(f => f.Contains("response", StringComparison.OrdinalIgnoreCase));
                DateTime starttijd = Convert.ToDateTime(ee.ActualLog.ExecutionLog.StartTime);

                // Map aanmaken voor draaidatum als deze nog niet bestaat
                if (Directory.Exists(resultFolder.FullName) == false)
                {
                    Directory.CreateDirectory(resultFolder.FullName);
                }

                if (File.Exists(exEntry.RequestFile))
                {
                    File.Copy(exEntry.RequestFile, Path.Combine(resultFolder.FullName, starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_request.txt"), true);
                    exEntry.RequestFile = RESULTFILESFOLDER + "/" + exEntry.Naam + "/" + resultFolder.Name + "/" + starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_request.txt";
                }
                else
                {
                    exEntry.RequestFile = String.Empty;
                }

                if (File.Exists(exEntry.ResponseFile))
                {
                    File.Copy(exEntry.ResponseFile, Path.Combine(resultFolder.FullName, starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_response.txt"), true);
                    exEntry.ResponseFile = RESULTFILESFOLDER + "/" + exEntry.Naam + "/" + resultFolder.Name + "/" + starttijd.ToString("yyyyMMdd_HHmmss-") + exEntry.Naam + "_response.txt";
                }
                else
                {
                    exEntry.ResponseFile = String.Empty;
                }
            }

            String ResultInfo = ee.ActualLog.LogDetails.AggregatedDescription;

            exEntry.Info = new List <string>(ResultInfo.Split(new String[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries));

            kv.Add(new KeyValuePair {
                Key = "Starttijd", Value = tijds
            });
            kv.Add(new KeyValuePair {
                Key = "Eindttijd", Value = tijde
            });
            kv.Add(new KeyValuePair {
                Key = "Doorlooptijd", Value = Math.Round(ee.ActualLog.Duration).ToString() + " ms"
            });
            exEntry.Parameters = kv;
        }
コード例 #10
0
 private void AddExectionEntry(ExecutionEntry ee, ExecutionEntryFolderEntity master)
 {
     FillExecutionEntry(ee);
     master.ExecutionEntryList.Add(exEntry);
 }