Пример #1
0
        public void Should_be_possible_to_collect_a_file_item_for_unix_systems()
        {
            var fileCollector = new FileCollector() { LsCommand = CreateFakeLsCommand(true, false) };
            var fileItemToCollect = CreateFakeUnixFileItem(false);

            var collectedItem = new FileObjectCollector(fileCollector).CollectDataForSystemItem(fileItemToCollect);

            ItemTypeChecker.DoBasicAssertForCollectedItems(collectedItem, 1, TypeOfUnixFileItem, true);
        }
Пример #2
0
        protected override void ConfigureObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                var sshCommandRunner = ((SSHConnectionProvider)ConnectionProvider).SshCommandLineRunner;
                var newFileCollector = new FileCollector() { LsCommand = new LsCommand(sshCommandRunner) };

                base.ObjectCollector = new FileObjectCollector(newFileCollector);

                if (base.ItemTypeGenerator == null)
                {
                    var fileContentProvider = new FileContentCollector(sshCommandRunner);
                    var unixFileProvider = new UnixFileProvider(fileContentProvider, newFileCollector);
                    base.ItemTypeGenerator = new FileItemTypeGenerator()
                    {
                        SystemDataSource = ObjectCollector,
                        FileProvider = unixFileProvider
                    };
                }
            }
        }
Пример #3
0
 public UnixFileProvider(FileContentCollector unixFileContentCollector, FileCollector unixFileCollector)
 {
     this.UnixFileContentCollector = unixFileContentCollector;
     this.UnixFileCollector = unixFileCollector;
 }
Пример #4
0
 public FileObjectCollector(FileCollector filesCollector)
 {
     this.FilesCollector = filesCollector;
 }
Пример #5
0
        protected override void ConfigureObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                var sshExec = ((SSHConnectionProvider)ConnectionProvider).SSHExec;
                var newSSHProvider = new SSHProvider(sshExec);
                var newFileContentCollector =  new FileContentCollector(newSSHProvider);
                var newFileCollector = new FileCollector() { LsCommand = new LsCommand(sshExec) };
                var newUnixFileProvider = new UnixFileProvider(newFileContentCollector, newFileCollector);

                base.ObjectCollector =
                    new TextFileContentObjectCollector()
                    {
                        FileContentProvider = newUnixFileProvider,
                        TargetInfo = this.TargetInfo
                    };

                base.ItemTypeGenerator =
                    new TemporaryItemTypeGenerator()
                    {
                        ObjectCollector = base.ObjectCollector,
                        TargetInfo  = this.TargetInfo
                    };
            }
        }