Example #1
0
        static void Main(string[] args)
        {
            var repositoryFactory = new FileSystemRepositoryFactory(args.First());

            var printerOutputDir = args.LastOrDefault() ?? Assembly.GetExecutingAssembly().Location;
            var printerFactory   = new JsonPrinterFactory(printerOutputDir);

            var managerFactory = new ManagerFactory(printerFactory, repositoryFactory);
        }
Example #2
0
        public void LogWarningToFile()
        {
            string message = "TEST MESSAGE";

            var repo         = new FileSystemRepositoryFactory().CreateRepository();
            var errorFactory = new WarningEntityFactory(message);

            var stringResult = repo.WriteLog(errorFactory);

            var result = this.DeserializeJsonObject <WarningLogEntity>(stringResult);

            Assert.Equal(result.Type, "WARNING");
            Assert.Equal(result.Message, message);
        }
Example #3
0
        public Dictionary <string, IEnumerable <Scored> > Validation()
        {
            EnsureGoInstance(out var configuration, out var container);
            //string root = @"C:\Users\Y.Jiang\Documents\ssctestcase";
            string pathToSessionData = @SessionPath;
            string enableFileSystem  = Path.Combine(pathToSessionData, "temp");
            Dictionary <string, IEnumerable <Scored> > results = new Dictionary <string, IEnumerable <Scored> >();
            // Create a Model

            BulkAutoclassValidationModel simpleModel = new BulkAutoclassValidationModel(configuration, container);

            // Load Session Info and Set Session
            simpleModel.OpenExistingSession(pathToSessionData);
            // It seems if the follow is not added, the filesystem factory cannot be loaded
            var getFactory = FileSystemRepositoryFactory.BuildConnectionString(enableFileSystem);
            var session    = simpleModel.Session;

            simpleModel.SetSessionName(session.DescriptiveName);
            simpleModel.SetGenericDocumentCachePath(session.GenericDocumentCachePath);
            simpleModel.FillGenericDocumentCache();
            simpleModel.SetC3Model(session.ModelPath);
            results = simpleModel.ValidateAutoclassify(() => false);
            return(results);
        }
Example #4
0
        private Dictionary <string, IEnumerable <Scored> > AutoclassifyProcess()
        {
            EnsureGoInstance(out var configuration, out var container);
            string root = @"C:\temp";
            var    pathToGenericDocumentCache = new DirectoryInfo(Path.Combine(root, "DocCache"));
            var    pathToSessionData          = Path.Combine(root, "Session");
            var    pathToResultsData          = new DirectoryInfo(Path.Combine(root, "Results"));
            var    bulkModel = new WpfBulkModel(configuration, container);

            bulkModel.OpenExistingSession(SessionPath);
            var _session          = bulkModel.Session;
            var pathToC3Model     = _session.ModelPath;
            var connectionStrings = _session.DatasourceConnectionStrings;

            bulkModel.Reset();

            var simpleModel = new SimpleModel(configuration, container);

            simpleModel.SetSessionName("TestSession");
            simpleModel.SetSessionPath(pathToSessionData);
            simpleModel.SetResultsPath(pathToResultsData);
            simpleModel.SetGenericDocumentCachePath(pathToGenericDocumentCache, TextMode.Codify, true);
            foreach (var connectionString in connectionStrings)
            {
                string separatingString = "RootPath=";
                int    startIndex       = connectionString.Key.IndexOf(separatingString) + separatingString.Length + 1;
                var    pathInConnection = connectionString.Key.Substring(startIndex, connectionString.Key.Length - startIndex - 1);
                simpleModel.AddDatasource(FileSystemRepositoryFactory.BuildConnectionString(pathInConnection), "");
            }
            simpleModel.FillGenericDocumentCache();
            simpleModel.SetC3Model(pathToC3Model);
            simpleModel.Autoclassify(() => false);
            var results = simpleModel.ReResult;

            return(results);
        }