Пример #1
0
        public static SortedDictionary <string, bool> GetActionDefs(IXConnection ixConn, List <string> jsTexts, string package)
        {
            String parentId = "ARCPATH[(E10E1000-E100-E100-E100-E10E10E10E00)]:/Business Solutions/" + package + "/Action definitions";

            if (package.Equals(""))
            {
                parentId = "ARCPATH[(E10E1000-E100-E100-E100-E10E10E10E00)]:/Business Solutions/_global/Action definitions";
            }
            List <Sord> sordActionDefInfo = RepoUtils.FindChildren(parentId, ixConn, true);
            SortedDictionary <string, bool> dicActionDefs = new SortedDictionary <string, bool>();

            foreach (Sord s in sordActionDefInfo)
            {
                string   actionDef = s.name;
                string[] rf        = actionDef.Split('.');
                actionDef = rf[rf.Length - 1];
                actionDef = "actions." + actionDef;

                if (!dicActionDefs.ContainsKey(actionDef))
                {
                    bool match = Unittests.Match(ixConn, actionDef, package, jsTexts);
                    dicActionDefs.Add(actionDef, match);
                }
            }
            ;
            return(dicActionDefs);
        }
Пример #2
0
        public static SortedDictionary <string, bool> GetRules(IXConnection ixConn, List <string> jsTexts, string package)
        {
            String parentId = "ARCPATH[(E10E1000-E100-E100-E100-E10E10E10E00)]:/Business Solutions/" + package + "/ELOas Base/Direct";

            if (package.Equals(""))
            {
                parentId = "ARCPATH[(E10E1000-E100-E100-E100-E10E10E10E00)]:/ELOas Base/Direct";
            }

            List <Sord> sordRuleInfo = RepoUtils.FindChildren(parentId, ixConn, true);
            SortedDictionary <string, bool> dicRules = new SortedDictionary <string, bool>();

            foreach (Sord s in sordRuleInfo)
            {
                string   objId    = s.id + "";
                EditInfo editInfo = ixConn.Ix.checkoutDoc(objId, null, EditInfoC.mbSordDoc, LockC.NO);
                if (editInfo.document.docs.Length > 0)
                {
                    DocVersion dv          = editInfo.document.docs[0];
                    string     url         = dv.url;
                    Stream     inputStream = ixConn.Download(url, 0, -1);
                    string     xmlText     = new StreamReader(inputStream, Encoding.UTF8).ReadToEnd();

                    try
                    {
                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml(xmlText);
                        string rulesetname = "";
                        foreach (XmlNode nameNode in doc.SelectNodes("ruleset/base/name"))
                        {
                            foreach (XmlNode subNode in nameNode.ChildNodes)
                            {
                                switch (subNode.Name)
                                {
                                case "#text":
                                    rulesetname = subNode.InnerText;
                                    break;
                                }
                            }
                        }
                        if (!dicRules.ContainsKey(rulesetname))
                        {
                            bool match = Unittests.Match(ixConn, rulesetname, package, jsTexts);
                            dicRules.Add(rulesetname, match);
                        }
                    }
                    catch (XmlException e)
                    {
                        Debug.WriteLine("Exception: {0}", e.Message);
                    }
                }
            }
            ;
            return(dicRules);
        }
Пример #3
0
 private void btnUnittest_Click(object sender, RoutedEventArgs e)
 {
     if (profiles.Count > 0)
     {
         string actvalue = cboProfile.SelectedValue.ToString();
         if (profiles.ContainsKey(actvalue))
         {
             Unittests.ShowReportMatchUnittest(profiles[actvalue].ixConf);
         }
     }
 }
Пример #4
0
        public static SortedDictionary <string, bool> GetRFs(IXConnection ixConn, List <string> jsTexts, string package)
        {
            String parentId = "ARCPATH[(E10E1000-E100-E100-E100-E10E10E10E00)]:/Business Solutions/" + package + "/IndexServer Scripting Base";

            if (package.Equals(""))
            {
                parentId = "ARCPATH[(E10E1000-E100-E100-E100-E10E10E10E00)]:/IndexServer Scripting Base/_ALL/business_solutions";
            }
            List <Sord> sordRFInfo = RepoUtils.FindChildren(parentId, ixConn, true);
            SortedDictionary <string, bool> dicRFs = new SortedDictionary <string, bool>();

            foreach (Sord s in sordRFInfo)
            {
                string   objId    = s.id + "";
                EditInfo editInfo = ixConn.Ix.checkoutDoc(objId, null, EditInfoC.mbSordDoc, LockC.NO);
                if (editInfo.document.docs.Length > 0)
                {
                    DocVersion dv          = editInfo.document.docs[0];
                    string     url         = dv.url;
                    Stream     inputStream = ixConn.Download(url, 0, -1);
                    string     jsText      = new StreamReader(inputStream, Encoding.UTF8).ReadToEnd();
                    string[]   jsLines     = jsText.Split('\n');
                    foreach (string line in jsLines)
                    {
                        if (line.Contains("function RF_"))
                        {
                            string[] rf      = line.Split();
                            string   rfName  = rf[1];
                            string[] rfNames = rfName.Split('(');
                            rfName = rfNames[0];
                            if (!rfName.Equals("*"))
                            {
                                if (!dicRFs.ContainsKey(rfName))
                                {
                                    bool match = Unittests.Match(ixConn, rfName, package, jsTexts);
                                    dicRFs.Add(rfName, match);
                                }
                            }
                        }
                    }
                }
            }
            ;
            return(dicRFs);
        }
Пример #5
0
        public static void ShowUnittestsApp(KonfigurationIx ixConf)
        {
            try
            {
                IXConnFactory connFact = new IXConnFactory(ixConf.ixUrl, "Show Unittests", "1.0");
                IXConnection  ixConn   = connFact.Create(ixConf.user, ixConf.pwd, null, null);

                string ticket = ixConn.LoginResult.clientInfo.ticket;
                string ixUrl  = ixConn.EndpointUrl;
                string appUrl = ixUrl.Replace("ix-", "wf-");
                appUrl = appUrl.Replace("/ix", "/apps/app");
                appUrl = appUrl + "/";
                Dictionary <string, string> dicApp = Unittests.GetUnittestApp(ixConn);
                appUrl = appUrl + dicApp["configApp"];
                appUrl = appUrl + "/?lang=de";
                appUrl = appUrl + "&ciId=" + dicApp["configApp"];
                appUrl = appUrl + "&ticket=" + ticket;
                appUrl = appUrl + "&timezone=Europe%2FBerlin";
                Http.OpenUrl(appUrl);
            }
            catch (byps.BException e)
            {
                if (e.Source != null)
                {
                    MessageBox.Show("Falsche Verbindungsdaten zu ELO \n" + e.Message, "ELO Connection", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                    Debug.WriteLine("byps.BException message: {0}", e.Message);
                }
            }
            catch (System.Net.WebException e)
            {
                if (e.Source != null)
                {
                    MessageBox.Show("Indexserver-Verbindung ungültig \n User: "******"\n IxUrl: " + ixConf.ixUrl, "ELO Connection", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                    Debug.WriteLine("System.Net.WebException message: {0}", e.Message);
                }
            }
        }