public static void createO2AssessmentFromTraces(IO2AssessmentSave o2AssessmentSave,string fileToCreate, List<IO2Trace> traces) { var o2Assessment = new O2Assessment(); foreach (IO2Trace trace in traces) o2Assessment.o2Findings.Add(createO2FindingFromTrace(trace)); o2Assessment.save(o2AssessmentSave, fileToCreate); }
public void createOneO2AssessmentPerUniqueTracesSignature() { Assert.IsTrue(File.Exists(testOzasmtFile), "testOzasmtFile didn't exist"); Directory.CreateDirectory(pathToSaveFilesCreated); Assert.IsTrue(Directory.Exists(pathToSaveFilesCreated), "pathToSaveFilesCreated could not be created"); Files.deleteFilesFromDirThatMatchPattern(pathToSaveFilesCreated, "*.ozasmt"); Dictionary<String, List<IO2Trace>> allTraces = OzasmtUtils.getDictionaryWithO2AllSubTraces(o2AssessmentLoad,testOzasmtFile); DI.log.info("there are {0} traces", allTraces.Count); DI.log.info("going to save traces here : {0}", pathToSaveFilesCreated); DI.log.info("before there are {0} *.ozasnt files ", Files.getFilesFromDir(pathToSaveFilesCreated, "*.ozasmt").Count); foreach (string signature in allTraces.Keys) { //var fileName = (signature != "") ? signature : "_EmptySignature"; string fileName = signature.Replace(':', '_').Replace('<', '_').Replace('>', '_'); o2AssessmentSave = new O2AssessmentSave_OunceV6(); OzasmtNew.createO2AssessmentFromTraces(o2AssessmentSave,Path.Combine(pathToSaveFilesCreated, fileName + ".ozasmt"), allTraces[signature]); } DI.log.info("after build there are {0} *.ozasnt files ", Files.getFilesFromDir(pathToSaveFilesCreated, "*.ozasmt").Count); // for now delete all files so that we don't keep them on disk Files.deleteFilesFromDirThatMatchPattern(pathToSaveFilesCreated, "*.ozasmt"); DI.log.info("after delete there are {0} *.ozasnt files ", Files.getFilesFromDir(pathToSaveFilesCreated, "*.ozasmt").Count); Files.deleteFolder(pathToSaveFilesCreated); Assert.That(!Directory.Exists(pathToSaveFilesCreated), " pathToSaveFilesCreated still exists"); //log.info("going to save traces here : {0}", pathToSaveFilesCreated); Assert.Ignore("Todo: reload all files again , " + "Compress them into 1 file , " + "Compare with original file and see if they match"); }
public static void createO2AssessmentFromTraces(IO2AssessmentSave o2AssessmentSave, string fileToCreate, List <IO2Trace> traces) { var o2Assessment = new O2Assessment(); foreach (IO2Trace trace in traces) { o2Assessment.o2Findings.Add(createO2FindingFromTrace(trace)); } o2Assessment.save(o2AssessmentSave, fileToCreate); }
public void createOneO2AssessmentPerUniqueTracesSignature() { Assert.IsTrue(File.Exists(testOzasmtFile), "testOzasmtFile didn't exist"); Directory.CreateDirectory(pathToSaveFilesCreated); Assert.IsTrue(Directory.Exists(pathToSaveFilesCreated), "pathToSaveFilesCreated could not be created"); Files.deleteFilesFromDirThatMatchPattern(pathToSaveFilesCreated, "*.ozasmt"); Dictionary <String, List <IO2Trace> > allTraces = OzasmtUtils.getDictionaryWithO2AllSubTraces(o2AssessmentLoad, testOzasmtFile); DI.log.info("there are {0} traces", allTraces.Count); DI.log.info("going to save traces here : {0}", pathToSaveFilesCreated); DI.log.info("before there are {0} *.ozasnt files ", Files.getFilesFromDir(pathToSaveFilesCreated, "*.ozasmt").Count); foreach (string signature in allTraces.Keys) { //var fileName = (signature != "") ? signature : "_EmptySignature"; string fileName = signature.Replace(':', '_').Replace('<', '_').Replace('>', '_'); o2AssessmentSave = new O2AssessmentSave_OunceV6(); OzasmtNew.createO2AssessmentFromTraces(o2AssessmentSave, Path.Combine(pathToSaveFilesCreated, fileName + ".ozasmt"), allTraces[signature]); } DI.log.info("after build there are {0} *.ozasnt files ", Files.getFilesFromDir(pathToSaveFilesCreated, "*.ozasmt").Count); // for now delete all files so that we don't keep them on disk Files.deleteFilesFromDirThatMatchPattern(pathToSaveFilesCreated, "*.ozasmt"); DI.log.info("after delete there are {0} *.ozasnt files ", Files.getFilesFromDir(pathToSaveFilesCreated, "*.ozasmt").Count); Files.deleteFolder(pathToSaveFilesCreated); Assert.That(!Directory.Exists(pathToSaveFilesCreated), " pathToSaveFilesCreated still exists"); //log.info("going to save traces here : {0}", pathToSaveFilesCreated); Assert.Ignore("Todo: reload all files again , " + "Compress them into 1 file , " + "Compare with original file and see if they match"); }
/*public static void addO2AssessmentLoadEngine(IO2AssessmentLoad o2AssessmentLoad) * { * o2AssessmentLoadEngines.Add(o2AssessmentLoad); * }*/ public static void addO2AssessmentSaveEngine_static(IO2AssessmentSave _o2AssessmentSave) { o2AssessmentSave = _o2AssessmentSave; }
public virtual bool save(IO2AssessmentSave o2AssessmentSave, string sPathToSaveAssessment) { return o2AssessmentSave.save(name, o2Findings, sPathToSaveAssessment); }
public virtual string save(IO2AssessmentSave o2AssessmentSave) { return o2AssessmentSave.save(o2Findings); }
/*public static void addO2AssessmentLoadEngine(IO2AssessmentLoad o2AssessmentLoad) { o2AssessmentLoadEngines.Add(o2AssessmentLoad); }*/ public static void addO2AssessmentSaveEngine_static(IO2AssessmentSave _o2AssessmentSave) { o2AssessmentSave = _o2AssessmentSave; }
public virtual bool save(IO2AssessmentSave o2AssessmentSave, string sPathToSaveAssessment) { return(o2AssessmentSave.save(name, o2Findings, sPathToSaveAssessment)); }
public virtual string save(IO2AssessmentSave o2AssessmentSave) { return(o2AssessmentSave.save(o2Findings)); }