public void ConstructorTest() { DcaLogCollector collector = new DcaLogCollector(null); Assert.IsTrue(collector.DcaFileShares.Length > 0); Assert.IsNotNull(collector.LogIndex); }
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); }
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(); }
public void GetPropertyNameTest() { string propertyName = DcaLogCollector.GetPropertyName(() => this.LogIndex.FabricLogDirectory); Assert.AreEqual("FabricLogDirectory", propertyName); }