示例#1
0
        public void ConstructorTest()
        {
            DcaLogCollector collector = new DcaLogCollector(null);

            Assert.IsTrue(collector.DcaFileShares.Length > 0);
            Assert.IsNotNull(collector.LogIndex);
        }
示例#2
0
        public void ConstructPackagePathTest()
        {
            string result = DcaLogCollector.ConstructPackagePath("11", "22");

            Assert.AreEqual("11//22", result);

            result = DcaLogCollector.ConstructPackagePath("11", "22", "33");
            Assert.AreEqual("11//22//33", result);
        }
示例#3
0
        public void TryGetDcaFileShareLocationTest()
        {
            TestUtility.TestProlog();

            string traceLogPath = Utility.GenerateProgramFilePath(Program.Config.WorkingDirectoryPath, ".log");

            using (TraceLogger traceLogger = new TraceLogger(traceLogPath))
            {
                DcaLogCollector collector = new DcaLogCollector(traceLogger);

                string fileShareLocation;
                string manifestXml = this.TryGetClusterManifest();
                Assert.IsTrue(collector.TryGetDcaFileShareLocation(manifestXml, "ns:ClusterManifest/ns:FabricSettings/ns:Section[@Name='FileShareWinFabEtw']", out fileShareLocation));
                Assert.IsFalse(string.IsNullOrWhiteSpace(fileShareLocation));

                Assert.IsTrue(collector.TryGetDcaFileShareLocation(manifestXml, "ns:ClusterManifest/ns:FabricSettings/ns:Section[@Name='FileShareWinFabPerfCtr']", out fileShareLocation));
                Assert.IsFalse(string.IsNullOrWhiteSpace(fileShareLocation));
            }

            File.Delete(traceLogPath);

            TestUtility.TestEpilog();
        }
示例#4
0
        public void GetPropertyNameTest()
        {
            string propertyName = DcaLogCollector.GetPropertyName(() => this.LogIndex.FabricLogDirectory);

            Assert.AreEqual("FabricLogDirectory", propertyName);
        }