3 * Copyright (C) 2010 Alcatel-Lucent
5 * This file is part of FusionForge.
7 * FusionForge is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License,
10 * or (at your option) any later version.
12 * FusionForge is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with FusionForge; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 * Standard Alcatel-Lucent disclaimer for contributing to open source
26 * "The test suite ("Contribution") has not been tested and/or
27 * validated for release as or in products, combinations with products or
28 * other commercial use. Any use of the Contribution is entirely made at
29 * the user's own responsibility and the user can not rely on any features,
30 * functionalities or performances Alcatel-Lucent has attributed to the
33 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
34 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
36 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
37 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
38 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
39 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
41 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
45 require_once dirname(dirname(__FILE__)).'/Testing/SeleniumGforge.php';
47 class SvnCommit2Tracker extends FForge_SeleniumTestCase
49 function testSvnCommit2Tracker()
53 * Activate SCM & commit plugin.
55 * Verify that commit email has been correctly send/stored.
57 $this->populateStandardTemplate('trackers');
59 $this->activatePlugin('svntracker');
60 $this->login('admin');
63 $this->clickAndWait("link=ProjectA");
64 $this->clickAndWait("link=Admin");
65 $this->clickAndWait("link=Tools");
66 $this->click("use_scm");
67 $this->click("use_svntracker");
68 $this->clickAndWait("submit");
71 $this->clickAndWait("link=ProjectA");
72 $this->clickAndWait("link=Tracker");
73 $this->clickAndWait("link=Bugs");
74 $this->clickAndWait("link=Submit New");
75 $this->click("summary");
76 $this->type("summary", "Bug Summary1");
77 $this->type("details", "Description1");
78 $this->clickAndWait("submit");
80 // Run the svn create to get the repository with the hooks.
81 $this->cron("cronjobs/create_scm_repos.php");
84 $url = URL."svn/projecta/";
86 // Try accessing the svn repository using admin rights
87 // => Should be allowed.
88 system("rm -fr /tmp/svn.test");
89 mkdir("/tmp/svn.test");
91 system("cd /tmp/svn.test; $svn --username admin --password myadmin co $url >/dev/null", $ret);
92 $this->assertEquals($ret, 0);
94 system("echo 'this is a simple text' > /tmp/svn.test/projecta/mytext.txt");
96 system("cd /tmp/svn.test/projecta; $svn add mytext.txt >/dev/null", $ret);
97 $this->assertEquals($ret, 0);
99 system("cd /tmp/svn.test/projecta; $svn --username admin --password myadmin ci -m 'Fixed [#1] added mytext' >/dev/null", $ret);
100 $this->assertEquals($ret, 0);
102 system("echo 'with a new line' >> /tmp/svn.test/projecta/mytext.txt");
104 system("cd /tmp/svn.test/projecta; $svn --username admin --password myadmin ci -m 'Improved [#1] updated mytext' >/dev/null", $ret);
105 $this->assertEquals($ret, 0);
107 system("rm -fr /tmp/svn.test");
109 $this->clickAndWait("link=Bug Summary1");
110 $this->assertTextPresent("added mytext");