public void Run(Boolean interactive)
 {
     bootstrapper.Start(new String[] { inputFile, readerName, writerName, outputPath });
     if (interactive)
     {
         Console.ReadKey();
     }
 }
예제 #2
0
파일: Program.cs 프로젝트: yazici/Vipr
        private static void Main(string[] args)
        {
            var bootstrapper = new Bootstrapper();

            try
            {
                bootstrapper.Start(args);
            }
            catch (Exception ex)
            {
                LogManager.GetLogger("VIPR").Error(ex);
            }
        }
예제 #3
0
        private static void Main(string[] args)
        {
            var bootstrapper = new Bootstrapper();

            bootstrapper.Start(args);
        }
예제 #4
0
        public void When_a_custom_reader_is_specified_then_it_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var commandLine = String.Format("{0} --reader=TestReaderWriter", metadataUri);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                bootstrapper.OdcmReader.GetType().Should().Be(typeof (TestReaderWriter.TestReaderWriter));

                bootstrapper.OdcmWriter.GetType().Should().Be(typeof(Vipr.Writer.CSharp.CSharpWriter));

                if(Directory.Exists(FileSystem.DEFAULT_OUTPUT_DIRECTORY)) Directory.Delete(FileSystem.DEFAULT_OUTPUT_DIRECTORY, true);
            });
        }
예제 #5
0
        public void When_empty_string_outputPath_is_specified_then_current_working_dir_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var outputPath = String.Empty;

                var commandLine = String.Format("{0} --outputPath={1}", metadataUri, outputPath);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                var filePath = Path.Combine(outputPath, FileSystem.CSHARP_WRITER_OUTPUT);

                File.Exists(filePath).Should().BeTrue("Because one expected output file was found in the specified output directory.");
                //Path.GetFullPath(outputPath).Should().BeEquivalentTo(Path.GetFullPath(_workingDirectory),
                //        "Because empty string means current working directory.");

                // if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true);
                if (File.Exists(filePath)) File.Delete(filePath);
            });
        }
예제 #6
0
        public void When_two_level_outputPath_is_specified_then_it_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var outputPath = Path.Combine(Any.Word(), Any.Word());

                var commandLine = String.Format("{0} --outputPath={1}", metadataUri, outputPath);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                var filePath = Path.Combine(outputPath, FileSystem.CSHARP_WRITER_OUTPUT);

                File.Exists(filePath).Should().BeTrue("Because one expected output file was found in the specified output directory.");

                if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true);
            });
        }
예제 #7
0
        public void When_custom_outputPath_is_not_specified_then_defaults_are_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var commandLine = String.Format("{0}", metadataUri);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                var pathToOneExpectedOutputFile = Path.Combine(FileSystem.DEFAULT_OUTPUT_DIRECTORY, FileSystem.CSHARP_WRITER_OUTPUT);

                File.Exists(pathToOneExpectedOutputFile).Should().BeTrue("Because one expected output file was created in default output directory.");

                if (Directory.Exists(FileSystem.DEFAULT_OUTPUT_DIRECTORY)) Directory.Delete(FileSystem.DEFAULT_OUTPUT_DIRECTORY, true);
            });
        }
예제 #8
0
        public void When_a_custom_writer_is_specified_then_it_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var commandLine = String.Format("{0} --writer=TestReaderWriter", metadataUri);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                bootstrapper.OdcmReader.GetType().Should().Be(typeof (Vipr.Reader.OData.v4.OdcmReader));

                bootstrapper.OdcmWriter.GetType().Should().Be(typeof (TestReaderWriter.TestReaderWriter));
            });
        }