コード例 #1
0
        private void ExportToDisk_Connection()
        {
            // Save configuration
            this.Save_SourceConfiguration();

            IReportServerReader    reader             = null;
            DataSourceItemExporter dataSourceExporter = null;
            FolderItemExporter     folderExporter     = null;
            ReportItemExporter     reportExporter     = null;

            // Test the source connection
            this.TestSourceConnection(true);

            string version = this.GetSourceServerVersion();

            reader = this.mKernel.Get <IReportServerReader>(version);

            dataSourceExporter = this.mKernel.Get <DataSourceItemExporter>();
            folderExporter     = this.mKernel.Get <FolderItemExporter>();
            reportExporter     = this.mKernel.Get <ReportItemExporter>();

            this.PerformExportToDisk(this.txtSrcPath.Text,
                                     this.txtExportDiskFolderName.Text,
                                     reader,
                                     folderExporter,
                                     reportExporter,
                                     dataSourceExporter);
        }
コード例 #2
0
        private void ExportToZip_Connection()
        {
            // Save configuration
            this.Save_SourceConfiguration();

            IReportServerReader    reader             = null;
            DataSourceItemExporter dataSourceExporter = null;
            FolderItemExporter     folderExporter     = null;
            ReportItemExporter     reportExporter     = null;
            IBundler    zipBundler = null;
            IFileSystem fileSystem = null;

            // Test the source connection
            this.TestSourceConnection(true);

            string version = this.GetSourceServerVersion();

            reader = this.mKernel.Get <IReportServerReader>(version);

            dataSourceExporter = this.mKernel.Get <DataSourceItemExporter>();
            folderExporter     = this.mKernel.Get <FolderItemExporter>();
            reportExporter     = this.mKernel.Get <ReportItemExporter>();

            zipBundler = this.mKernel.Get <IBundler>();
            fileSystem = this.mKernel.Get <IFileSystem>();

            this.PerformExportToZip(this.txtSrcPath.Text,
                                    this.txtExportZipFilename.Text,
                                    reader,
                                    folderExporter,
                                    reportExporter,
                                    dataSourceExporter,
                                    zipBundler,
                                    fileSystem);
        }
コード例 #3
0
        public void Constructor_Succeed()
        {
            var logger = new MockLogger();

            FolderItemExporter dataSourceExporter = new FolderItemExporter(exportWriterMock.Object, logger);

            Assert.NotNull(dataSourceExporter);
        }
コード例 #4
0
        public ExportDiskForm(string sourceRootPath,
                              string destinationPath,
                              IReportServerReader reader,
                              FolderItemExporter folderExporter,
                              ReportItemExporter reportExporter,
                              DataSourceItemExporter dataSourceExporter,
                              ILoggerFactory loggerFactory)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
            {
                throw new ArgumentException("sourceRootPath");
            }

            if (string.IsNullOrEmpty(destinationPath))
            {
                throw new ArgumentException("destinationPath");
            }

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            if (folderExporter == null)
            {
                throw new ArgumentNullException("folderExporter");
            }

            if (reportExporter == null)
            {
                throw new ArgumentNullException("reportExporter");
            }

            if (dataSourceExporter == null)
            {
                throw new ArgumentNullException("dataSourceExporter");
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException("loggerFactory");
            }

            InitializeComponent();

            this.mSourceRootPath        = sourceRootPath;
            this.mExportDestinationPath = destinationPath;
            this.mReportServerReader    = reader;
            this.mFolderExporter        = folderExporter;
            this.mReportExporter        = reportExporter;
            this.mDataSourceExporter    = dataSourceExporter;
            this.mLoggerFactory         = loggerFactory;

            this.mLogger      = mLoggerFactory.GetCurrentClassLogger();
            this.mSummaryForm = new SummaryForm();
        }
コード例 #5
0
        public void Constructor_NullIExportWriter()
        {
            ArgumentNullException ex = Assert.Throws<ArgumentNullException>(
                delegate
                {
                    FolderItemExporter dataSourceExporter = new FolderItemExporter(null);
                });

            Assert.That(ex.Message, Is.EqualTo("Value cannot be null.\r\nParameter name: exportWriter"));
        }
コード例 #6
0
ファイル: ExportZipForm.cs プロジェクト: jpann/SSRSMigrate
        public ExportZipForm(string sourceRootPath,
            string destinationFilename,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter,
            IBundler zipBundler,
            ILoggerFactory loggerFactory,
            IFileSystem fileSystem)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
                throw new ArgumentException("sourceRootPath");

            if (string.IsNullOrEmpty(destinationFilename))
                throw new ArgumentException("destinationFilename");

            if (reader == null)
                throw new ArgumentNullException("reader");

            if (folderExporter == null)
                throw new ArgumentNullException("folderExporter");

            if (reportExporter == null)
                throw new ArgumentNullException("reportExporter");

            if (dataSourceExporter == null)
                throw new ArgumentNullException("dataSourceExporter");

            if (zipBundler == null)
                throw new ArgumentNullException("zipBundler");

            if (loggerFactory == null)
                throw new ArgumentNullException("loggerFactory");

            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            InitializeComponent();

            this.mSourceRootPath = sourceRootPath;
            this.mExportDestinationFilename = destinationFilename;
            this.mReportServerReader = reader;
            this.mFolderExporter = folderExporter;
            this.mReportExporter = reportExporter;
            this.mDataSourceExporter = dataSourceExporter;
            this.mZipBundler = zipBundler;
            this.mLoggerFactory = loggerFactory;
            this.mFileSystem = fileSystem;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();

            this.mExportOutputTempDirectory = this.GetTemporaryExportOutputFolder("SSRSMigrate_ExportZip");
            this.CreateExportOutputFolder(this.mExportOutputTempDirectory);
            this.mSummaryForm = new SummaryForm();
        }
コード例 #7
0
        public void Constructor_NullIExportWriter()
        {
            var logger = new MockLogger();

            ArgumentNullException ex = Assert.Throws <ArgumentNullException>(
                delegate
            {
                FolderItemExporter dataSourceExporter = new FolderItemExporter(null, logger);
            });

            Assert.That(ex.Message, Is.EqualTo("Value cannot be null.\r\nParameter name: exportWriter"));
        }
コード例 #8
0
        public void TestFixtureSetUp()
        {
            EnvironmentSetup();
            outputPath = GetOutPutPath();
            SetupExpectedValues();

            // Create the IItemExporter objects
            reportExporter     = TestKernel.Instance.Get <ReportItemExporter>();
            dataSourceExporter = TestKernel.Instance.Get <DataSourceItemExporter>();
            folderExporter     = TestKernel.Instance.Get <FolderItemExporter>();

            reader = TestKernel.Instance.Get <IReportServerReader>("2005-SRC");
        }
コード例 #9
0
        private void PerformExportToDisk(string sourceRootPath,
                                         string destinationPath,
                                         IReportServerReader reader,
                                         FolderItemExporter folderExporter,
                                         ReportItemExporter reportExporter,
                                         DataSourceItemExporter dataSourceExporter)
        {
            ExportDiskForm exportDiskForm = new ExportDiskForm(sourceRootPath,
                                                               destinationPath,
                                                               reader,
                                                               folderExporter,
                                                               reportExporter,
                                                               dataSourceExporter,
                                                               this.mLoggerFactory);

            exportDiskForm.DebugForm = this.mDebugForm;
            exportDiskForm.Show();
        }
コード例 #10
0
ファイル: ExportDiskForm.cs プロジェクト: jpann/SSRSMigrate
        public ExportDiskForm(string sourceRootPath,
            string destinationPath,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter,
            ILoggerFactory loggerFactory)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
                throw new ArgumentException("sourceRootPath");

            if (string.IsNullOrEmpty(destinationPath))
                throw new ArgumentException("destinationPath");

            if (reader == null)
                throw new ArgumentNullException("reader");

            if (folderExporter == null)
                throw new ArgumentNullException("folderExporter");

            if (reportExporter == null)
                throw new ArgumentNullException("reportExporter");

            if (dataSourceExporter == null)
                throw new ArgumentNullException("dataSourceExporter");

            if (loggerFactory == null)
                throw new ArgumentNullException("loggerFactory");

            InitializeComponent();

            this.mSourceRootPath = sourceRootPath;
            this.mExportDestinationPath = destinationPath;
            this.mReportServerReader = reader;
            this.mFolderExporter = folderExporter;
            this.mReportExporter = reportExporter;
            this.mDataSourceExporter = dataSourceExporter;
            this.mLoggerFactory = loggerFactory;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();
            this.mSummaryForm = new SummaryForm();
        }
コード例 #11
0
        public void TestFixtureSetUp()
        {
            expectedFolderItem = new FolderItem()
            {
                Name = "Reports",
                Path = "/SSRSMigrate_AW_Tests/Reports",
            };

            exportWriterMock = new Mock <IExportWriter>();

            var logger = new MockLogger();

            exportWriterMock.Setup(e => e.Save(It.IsAny <string>(), It.IsAny <string>(), true));

            // Mock IExporter.Save where the directory exists but overwrite = false
            exportWriterMock.Setup(e => e.Save(expectedFolderItemFileName, false))
            .Throws(new IOException(string.Format("Directory '{0}' already exists.", expectedFolderItemFileName)));

            exporter = new FolderItemExporter(exportWriterMock.Object, logger);
        }
コード例 #12
0
        private void PerformExportToZip(string sourceRootPath,
                                        string destinationFilename,
                                        IReportServerReader reader,
                                        FolderItemExporter folderExporter,
                                        ReportItemExporter reportExporter,
                                        DataSourceItemExporter dataSourceExporter,
                                        IBundler zipBunder,
                                        IFileSystem fileSystem)
        {
            ExportZipForm exportZipForm = new ExportZipForm(
                sourceRootPath,
                destinationFilename,
                reader,
                folderExporter,
                reportExporter,
                dataSourceExporter,
                zipBunder,
                this.mLoggerFactory,
                fileSystem);

            exportZipForm.DebugForm = this.mDebugForm;
            exportZipForm.Show();
        }
コード例 #13
0
        public void TestFixtureSetUp()
        {
            EnvironmentSetup();

            var settings = new NinjectSettings()
            {
                LoadExtensions = false
            };

            kernel = new StandardKernel(
                settings,
                new Log4NetModule(),
                new DependencyModule());

            exporter = kernel.Get <FolderItemExporter>();

            folderItems = new List <FolderItem>()
            {
                new FolderItem()
                {
                    Name = "Reports",
                    Path = "/SSRSMigrate_AW_Tests/Reports",
                },
                new FolderItem()
                {
                    Name = "Sub Folder",
                    Path = "/SSRSMigrate_AW_Tests/Reports/Sub Folder",
                },
                new FolderItem()
                {
                    Name = "Data Sources",
                    Path = "/SSRSMigrate_AW_Tests/Data Sources",
                }
            };

            outputPath = GetOutPutPath();
        }
コード例 #14
0
ファイル: ConnectInfoForm.cs プロジェクト: jpann/SSRSMigrate
        private void PerformExportToZip(string sourceRootPath,
            string destinationFilename,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter,
            IBundler zipBunder,
            IFileSystem fileSystem)
        {
            ExportZipForm exportZipForm = new ExportZipForm(
                sourceRootPath,
                destinationFilename,
                reader,
                folderExporter,
                reportExporter,
                dataSourceExporter,
                zipBunder,
                this.mLoggerFactory,
                fileSystem);

            exportZipForm.DebugForm = this.mDebugForm;
            exportZipForm.Show();
        }
コード例 #15
0
ファイル: ConnectInfoForm.cs プロジェクト: jpann/SSRSMigrate
        private void PerformExportToDisk(string sourceRootPath,
            string destinationPath,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter)
        {
            ExportDiskForm exportDiskForm = new ExportDiskForm(sourceRootPath,
                destinationPath,
                reader,
                folderExporter,
                reportExporter,
                dataSourceExporter,
                this.mLoggerFactory);

            exportDiskForm.DebugForm = this.mDebugForm;
            exportDiskForm.Show();
        }
コード例 #16
0
        public void TestFixtureSetUp()
        {
            EnvironmentSetup();

            var settings = new NinjectSettings()
            {
                LoadExtensions = false
            };

            kernel = new StandardKernel(
                settings,
                new Log4NetModule(),
                new DependencyModule());

            exporter = kernel.Get<FolderItemExporter>();

            folderItems = new List<FolderItem>()
            {
                new FolderItem()
                {
                    Name = "Reports",
                    Path = "/SSRSMigrate_AW_Tests/Reports",
                },
                new FolderItem()
                {
                    Name = "Sub Folder",
                    Path = "/SSRSMigrate_AW_Tests/Reports/Sub Folder",
                },
                new FolderItem()
                {
                    Name = "Data Sources",
                    Path = "/SSRSMigrate_AW_Tests/Data Sources",
                }
            };

            outputPath = GetOutPutPath();
        }
コード例 #17
0
        public ExportZipForm(string sourceRootPath,
                             string destinationFilename,
                             IReportServerReader reader,
                             FolderItemExporter folderExporter,
                             ReportItemExporter reportExporter,
                             DataSourceItemExporter dataSourceExporter,
                             IBundler zipBundler,
                             ILoggerFactory loggerFactory,
                             IFileSystem fileSystem)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
            {
                throw new ArgumentException("sourceRootPath");
            }

            if (string.IsNullOrEmpty(destinationFilename))
            {
                throw new ArgumentException("destinationFilename");
            }

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            if (folderExporter == null)
            {
                throw new ArgumentNullException("folderExporter");
            }

            if (reportExporter == null)
            {
                throw new ArgumentNullException("reportExporter");
            }

            if (dataSourceExporter == null)
            {
                throw new ArgumentNullException("dataSourceExporter");
            }

            if (zipBundler == null)
            {
                throw new ArgumentNullException("zipBundler");
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException("loggerFactory");
            }

            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            InitializeComponent();

            this.mSourceRootPath            = sourceRootPath;
            this.mExportDestinationFilename = destinationFilename;
            this.mReportServerReader        = reader;
            this.mFolderExporter            = folderExporter;
            this.mReportExporter            = reportExporter;
            this.mDataSourceExporter        = dataSourceExporter;
            this.mZipBundler    = zipBundler;
            this.mLoggerFactory = loggerFactory;
            this.mFileSystem    = fileSystem;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();

            this.mExportOutputTempDirectory = this.GetTemporaryExportOutputFolder("SSRSMigrate_ExportZip");
            this.CreateExportOutputFolder(this.mExportOutputTempDirectory);
            this.mSummaryForm = new SummaryForm();
        }
コード例 #18
0
        public void Constructor_Succeed()
        {
            FolderItemExporter dataSourceExporter = new FolderItemExporter(exportWriterMock.Object);

            Assert.NotNull(dataSourceExporter);
        }
コード例 #19
0
        public void TestFixtureSetUp()
        {
            expectedFolderItem = new FolderItem()
                {
                    Name = "Reports",
                    Path = "/SSRSMigrate_AW_Tests/Reports",
                };

            exportWriterMock = new Mock<IExportWriter>();

            exportWriterMock.Setup(e => e.Save(It.IsAny<string>(), It.IsAny<string>(), true));

            // Mock IExporter.Save where the directory exists but overwrite = false
            exportWriterMock.Setup(e => e.Save(expectedFolderItemFileName, false))
                .Throws(new IOException(string.Format("Directory '{0}' already exists.", expectedFolderItemFileName)));

            exporter = new FolderItemExporter(exportWriterMock.Object);
        }
コード例 #20
0
        public void TestFixtureSetUp()
        {
            EnvironmentSetup();
            outputPath = GetOutPutPath();
            SetupExpectedValues();

            // Create the IItemExporter objects
            reportExporter = TestKernel.Instance.Get<ReportItemExporter>();
            dataSourceExporter = TestKernel.Instance.Get<DataSourceItemExporter>();
            folderExporter = TestKernel.Instance.Get<FolderItemExporter>();

            reader = TestKernel.Instance.Get<IReportServerReader>("2005-SRC");
        }