예제 #1
0
        public void VerifyCreateQueryProcessInfoWithAttributes()
        {
            string             fromtime    = "01/02/2003 00:00:00";
            string             totime      = "23/02/2006 23:14:05";
            IntegrationRequest request     = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
            IntegrationSummary lastSummary = new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
            IntegrationResult  from        = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);

            from.StartTime = DateTime.ParseExact(fromtime, PlasticSCM.DATEFORMAT, System.Globalization.CultureInfo.InvariantCulture);
            IntegrationResult to = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);

            to.StartTime = DateTime.ParseExact(totime, PlasticSCM.DATEFORMAT, System.Globalization.CultureInfo.InvariantCulture);

            PlasticSCM plasticscm = new PlasticSCM();

            NetReflector.Read(PLASTICSCM_XML, plasticscm);
            string query = string.Format(
                @"c:\plastic\client\cm.exe find revision where branch = 'br:/main' and revno != 'CO' "
                + "and date between '{0}' and '{1}' on repository 'mainrep' ", fromtime, totime);
            string dateformat = string.Format(System.Globalization.CultureInfo.CurrentCulture, "--dateformat=\"{0}\" ", PlasticSCM.DATEFORMAT);
            string format     = string.Format(System.Globalization.CultureInfo.CurrentCulture, "--format=\"{0}\"", PlasticSCM.FORMAT);

            ProcessInfo info = plasticscm.CreateQueryProcessInfo(from, to);

            Assert.AreEqual(query + dateformat + format, info.FileName + " " + info.Arguments);
        }
예제 #2
0
        public void VerifyDefaults()
        {
            PlasticSCM plasticscm = new PlasticSCM();

            Assert.AreEqual("cm", plasticscm.Executable);
            Assert.AreEqual(string.Empty, plasticscm.Repository);
            Assert.AreEqual(string.Empty, plasticscm.Branch);
            Assert.AreEqual(false, plasticscm.Forced);
            Assert.AreEqual(false, plasticscm.LabelOnSuccess);
            Assert.AreEqual("ccver-", plasticscm.LabelPrefix);
            Assert.AreEqual(string.Empty, plasticscm.WorkingDirectory);
        }
예제 #3
0
        public void VerifyNewGetSourceProcessInfoWithAttribtues()
        {
            IntegrationRequest request     = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
            IntegrationSummary lastSummary = new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
            IntegrationResult  result      = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);

            PlasticSCM plasticscm = new PlasticSCM();

            NetReflector.Read(PLASTICSCM_XML, plasticscm);
            string      expected = @"c:\plastic\client\cm.exe update c:\workspace --forced";
            ProcessInfo info     = plasticscm.NewGetSourceProcessInfo(result);

            Assert.AreEqual(expected, info.FileName + " " + info.Arguments);
        }
예제 #4
0
        public void VerifyValuesSetByNetReflector()
        {
            PlasticSCM plasticscm = new PlasticSCM();

            NetReflector.Read(PLASTICSCM_XML, plasticscm);

            Assert.AreEqual(@"c:\plastic\client\cm.exe", plasticscm.Executable);
            Assert.AreEqual("mainrep", plasticscm.Repository);
            Assert.AreEqual("br:/main", plasticscm.Branch);
            Assert.AreEqual(true, plasticscm.Forced);
            Assert.AreEqual(true, plasticscm.LabelOnSuccess);
            Assert.AreEqual("BL", plasticscm.LabelPrefix);
            Assert.AreEqual(@"c:\workspace", plasticscm.WorkingDirectory);
        }
예제 #5
0
        public void ShouldFailToConfigureWithoutRequiredAttributes()
        {
            const string PLASTICSCM_ERR2_XML =
                @"<sourceControl type=""plasticscm"">
				<repository>mainrep</repository>
                <workingDirectory>c:\workspace</workingDirectory>
                <forced>true</forced>
			</sourceControl>"            ;

            PlasticSCM plasticscm = new PlasticSCM();

            Assert.That(delegate { NetReflector.Read(PLASTICSCM_ERR2_XML, plasticscm); },
                        Throws.TypeOf <NetReflectorException>());
        }
예제 #6
0
        public void VerifyGoToBranchProcessInfoBasic()
        {
            IntegrationRequest request     = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
            IntegrationSummary lastSummary =
                new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
            IntegrationResult result = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);

            PlasticSCM plasticscm = new PlasticSCM();

            NetReflector.Read(PLASTICSCM_XML, plasticscm);
            string      expected = @"c:\plastic\client\cm.exe stb br:/main -repository=mainrep --noupdate";
            ProcessInfo info     = plasticscm.GoToBranchProcessInfo(result);

            Assert.AreEqual(expected, info.FileName + " " + info.Arguments);
        }
예제 #7
0
        public void VerifyLabelProcessInfoBasic()
        {
            IntegrationRequest request     = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
            IntegrationSummary lastSummary = new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
            IntegrationResult  result      = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);

            result.Label = "1";

            PlasticSCM plasticscm = new PlasticSCM();

            NetReflector.Read(PLASTICSCM_BASIC_XML, plasticscm);
            string      expected = @"cm label -R lb:ccver-1 .";
            ProcessInfo info     = plasticscm.LabelProcessInfo(result);

            Assert.AreEqual(expected, info.FileName + " " + info.Arguments);
        }
예제 #8
0
 MultilinerBotConfiguration(
     string server,
     string repository,
     string mergeToBranchesAttrName,
     string branchPrefix,
     string userApiKey,
     PlasticSCM plastic,
     IssueTracker issues,
     ContinuousIntegration ci,
     List <Notifier> notifiers)
 {
     Server     = server;
     Repository = repository;
     MergeToBranchesAttrName = mergeToBranchesAttrName;
     BranchPrefix            = branchPrefix;
     UserApiKey = userApiKey;
     Plastic    = plastic;
     Issues     = issues;
     CI         = ci;
     Notifiers  = notifiers;
 }
예제 #9
0
 TrunkBotConfiguration(
     string server,
     string repository,
     string trunkBranch,
     string branchPrefix,
     string userApiKey,
     PlasticSCM plastic,
     IssueTracker issues,
     ContinuousIntegration ci,
     Notifier notifications)
 {
     Server        = server;
     Repository    = repository;
     TrunkBranch   = trunkBranch;
     BranchPrefix  = branchPrefix;
     UserApiKey    = userApiKey;
     Plastic       = plastic;
     Issues        = issues;
     CI            = ci;
     Notifications = notifications;
 }
예제 #10
0
        public void ShouldConfigureWithBasicXml()
        {
            PlasticSCM plasticscm = new PlasticSCM();

            NetReflector.Read(PLASTICSCM_BASIC_XML, plasticscm);
        }