Ejemplo n.º 1
0
        public static SvnResultsBase SvnCheckout(this ICakeContext context,
                                                 string repositorypath,
                                                 string localPath)
        {
            SvnResultsBase results = new SvnResultsBase();
            SvnCheckout    task    = new SvnCheckout(context)
            {
                RepositoryPath = repositorypath,
                LocalPath      = localPath
            };

            string actualCommand  = GetToolTaskCommand(task);
            string actualCommand2 = GetToolTaskToolPath(task);

            var bOk = task.Execute();

            if (task.ExitCode != 0)
            {
                //-- fail
            }
            results.RepositoryPath = task.RepositoryPath ?? "";
            results.Revision       = task.Revision;
            results.StandardOutput = task.StandardOutput ?? "";
            results.StandardError  = task.StandardError ?? "";
            results.ExitCode       = task.ExitCode;

            return(results);
        }
Ejemplo n.º 2
0
        protected void CheckoutProject(IBuildEngine engine, string path)
        {
            SvnCheckout task = new SvnCheckout();
            task.RepositoryPath = path;
            task.RepositoryUrl = RepositoryURL;
            task.BuildEngine = engine;

            task.Execute();
        }
        public void TestCheckoutHeadWithSSL()
        {
            MockRepository repository = new MockRepository();
            IBuildEngine engine = repository.StrictMock<IBuildEngine>();

            SvnCheckout task = new SvnCheckout();
            task.Username = "******";
            task.RepositoryPath = string.Format(RepositoryPathTemplate, DateTime.Now.Ticks);
            task.RepositoryUrl = "https://karma-test-repository.googlecode.com/svn/";
            task.BuildEngine = engine;

            bool success = task.Execute();

            Assert.That(success, Is.True);
            Assert.That(task.CheckedRevision, Is.Not.EqualTo(0));
        }
Ejemplo n.º 4
0
        public void SvnCheckoutRemote()
        {
            SvnCheckout checkout = new SvnCheckout();

            checkout.BuildEngine = new MockBuild();

            Assert.IsNotNull(checkout);

            checkout.LocalPath      = Path.Combine(testDirectory, @"MSBuildTasksCheckout");
            checkout.RepositoryPath =
                "http://msbuildtasks.tigris.org/svn/msbuildtasks/trunk/Source/MSBuild.Community.Tasks.Tests/Subversion";
            checkout.Username = "******";
            checkout.Password = "******";
            bool result = checkout.Execute();

            Assert.IsTrue(result);
            Assert.IsTrue(checkout.Revision > 0);
        }
Ejemplo n.º 5
0
        public void SvnCheckoutRemoteCommandLine()
        {
            SvnCheckout checkout   = new SvnCheckout();
            string      localPath  = Path.Combine(testDirectory, @"MSBuildTasksCheckout");
            string      remotePath =
                "http://msbuildtasks.tigris.org/svn/msbuildtasks/trunk/Source/MSBuild.Community.Tasks.Tests/Subversion";

            checkout.LocalPath      = localPath;
            checkout.RepositoryPath = remotePath;
            checkout.Username       = "******";
            checkout.Password       = "******";

            string expectedCommand =
                String.Format(
                    "checkout \"{0}\" \"{1}\" --username guest --password guest1 --non-interactive --no-auth-cache",
                    remotePath, localPath);
            string actualCommand = TaskUtility.GetToolTaskCommand(checkout);

            Assert.AreEqual(expectedCommand, actualCommand);
        }
Ejemplo n.º 6
0
        public void SvnCheckoutLocal()
        {
            string        repoPath = "e:/svn/repo/Test";
            DirectoryInfo dirInfo  = new DirectoryInfo(repoPath);

            if (!dirInfo.Exists)
            {
                Assert.Ignore("Repository path '{0}' does not exist", repoPath);
            }
            var         context  = new Cake.VersionReader.Tests.Fakes.FakeCakeContext();
            SvnCheckout checkout = new SvnCheckout(context.CakeContext);

            checkout.BuildEngine = new MockBuild();

            Assert.IsNotNull(checkout);

            checkout.LocalPath      = Path.Combine(testDirectory, @"TestCheckout");
            checkout.RepositoryPath = "file:///" + repoPath + "/trunk";
            bool result = checkout.Execute();

            Assert.IsTrue(result);
            Assert.IsTrue(checkout.Revision > 0);
        }
        public void TestInvalidUrl()
        {
            MockRepository repository = new MockRepository();
            IBuildEngine engine = repository.StrictMock<IBuildEngine>();

            SvnCheckout task = new SvnCheckout();
            task.Username = "******";
            task.RepositoryPath = string.Format(RepositoryPathTemplate, DateTime.Now.Ticks);
            task.RepositoryUrl = "someurl";
            task.BuildEngine = engine;

            task.Execute();
        }