protected override void ConfigureObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                var connectionScope = ((FileConnectionProvider)FileConnectionProvider).ConnectionScope;
                var newWmiDataProvider = new WmiDataProvider(connectionScope);
                var newFileProvider = new WindowsFileProvider(TargetInfo) { WmiDataProvider = newWmiDataProvider };

                ObjectCollector = new TextFileContentObjectCollector() { FileContentProvider = newFileProvider, TargetInfo = TargetInfo };
                FileDataSource = new FileObjectCollector() { WmiDataProvider = newWmiDataProvider };
            }

            if (base.ItemTypeGenerator == null)
            {
                var newFileProvider =
                    new WindowsFileProvider(this.TargetInfo)
                    {
                        WmiDataProvider =
                            WmiDataProviderFactory
                                .CreateWmiDataProviderForFileSearching(this.TargetInfo)
                    };

                var newOperationEvaluator =
                    new TextFileContentEntityOperationEvaluator(ObjectCollector, newFileProvider, FamilyEnumeration.windows);

                ItemTypeGenerator = new TextFileContentItemTypeGenerator()
                {
                    OperationEvaluator = newOperationEvaluator
                };
            }
        }
 public TextFileContentObjectCollectorTests()
 {
     this.ObjectCollector =
         GetTextFileContentObjectCollectorWithMockBehavior(
             new string[] { "Line 1", "Line 2", "Line 3", "Line N", "" });
 }
 public TextFileContentEntityOperationEvaluator(BaseObjectCollector systemDataSource, IFileProvider fileDataSource, FamilyEnumeration platform)
 {
     this.TextFileContentDataSource = systemDataSource;
     this.PathOperatorEvaluator = new PathOperatorEvaluator(fileDataSource, platform);
 }
示例#4
0
        /// <summary>
        /// This is a temporary code in order to keep unit tests and oval interpreter prototype compatible.
        /// This method should be replace by dependency injection pattern.
        /// </summary>
        protected override void ConfigureObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                var newWmiProvider = this.CreateWmiProviderFromProberConnection();
                base.ObjectCollector = new FileEffectiveRightsObjectCollector() { WmiDataProvider = newWmiProvider };
                this.FileSystemDataSource = new FileObjectCollector() { WmiDataProvider = newWmiProvider };
            }

            if (base.ItemTypeGenerator == null)
                base.ItemTypeGenerator = new FileEffectiveRightsItemTypeGenerator() { SystemDataSource = base.ObjectCollector, FileDataSource = FileSystemDataSource };
        }
 public RegistryEntityOperationEvaluator(BaseObjectCollector systemDataSource, WmiDataProvider wmiDataProvider)
 {
     this.systemDataSource = systemDataSource;
     this.wmiDataProvider = wmiDataProvider;
 }
示例#6
0
        private void CreateObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                base.ObjectCollector = new FileContentSystemDataSource(TargetInfo.GetAddress());

                var wmiConnectionScope =
                this.FileDataSource = new FileObjectCollector() { WmiDataProvider = CreateWmiDataProvider() };
            }
        }
 public FileContentEntityOperationEvaluator(BaseObjectCollector systemDataSource, IFileProvider fileProvider)
 {
     this.systemDataSource = systemDataSource;
     pathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows);
 }
 public FileEffectiveRightsOperationEvaluator(BaseObjectCollector sytemDataSource, IFileProvider fileProvider)
 {
     this.systemDataSource = sytemDataSource;
     this.pathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows);
 }