<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>进化的测试 &#187; TestLink</title>
	<atom:link href="http://magustest.com/blog/tag/testlink/feed/" rel="self" type="application/rss+xml" />
	<link>http://magustest.com/blog</link>
	<description>软件测试，自动化测试，白盒测试，Python</description>
	<lastBuildDate>Thu, 17 May 2012 14:19:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>TestLink和BugZilla集成中的一些问题</title>
		<link>http://magustest.com/blog/softwaretesting/testlink-bugzilla-bugtracking/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testlink-bugzilla-bugtracking</link>
		<comments>http://magustest.com/blog/softwaretesting/testlink-bugzilla-bugtracking/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 07:23:05 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[软件测试]]></category>
		<category><![CDATA[BugZilla]]></category>
		<category><![CDATA[TestLink]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=750</guid>
		<description><![CDATA[前两天有个朋友写信给我问一个testlink和bugzilla集成的问题，从他信里面的描述得出，他已经成功把这两个系统集成好了，但是有一些功能用不了，例如不能显示bugzilla里面的id、状态、标题信息等。其实原因是testlink的作者只实现了bugzilla集成的部分接口，其他的接口是要我们自己来写的。大家可以浏览一下testlink安装目录下的/lib/bugtracking，里面有好些文件，其中文件int_bugtracking.php是testlink和其他所有bug tracking系统（bugzilla, jira, mantis等）做集成的基类。还有一个文件叫int_bugzilla.php，这个文件就是testlink和bugzilla集成的代码，里面定义了一个类：bugzillaInterface，它是bugtrackingInterface的子类，并且在类bugzillaInterface里面重写了一部分方法，这也是为什么如果我们自己不修改代码的话，只能用到部分功能（例如只能连接，但却不能显示相关的信息）。 假如说，现在想在testlink关联bugzilla的一个bug之前，验证一下bug id是否存在，就要在int_bugzilla.php里面重写checkBugID_existence方法。 $query = &#34;SELECT bug_id FROM {$this-&#62;dbSchema}.bugs WHERE bug_id='&#34; . $id.&#34;'&#34;; $query_results = $this-&#62;dbConnection-&#62;exec_query&#40;$query&#41;; if &#40;$query_results &#38;&#38; &#40;$this-&#62;dbConnection-&#62;num_rows&#40;$query_results&#41; == 1&#41;&#41; &#123; return true; &#125; return false; 如果要自己补充这个int_bugzilla.php的时候，需要一点php的知识，并且对bugzilla数据库有所了解，以前公司的同事告诉我用php的一个神器，vardump。你懂的。 Related posts: TestLink不能连接BugZilla的解决办法
Related posts:<ol>
<li><a href='http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/' rel='bookmark' title='TestLink不能连接BugZilla的解决办法'>TestLink不能连接BugZilla的解决办法</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>前两天有个朋友写信给我问一个testlink和bugzilla集成的问题，从他信里面的描述得出，他已经成功把这两个系统集成好了，但是有一些功能用不了，例如不能显示bugzilla里面的id、状态、标题信息等。其实原因是testlink的作者只实现了bugzilla集成的部分接口，其他的接口是要我们自己来写的。大家可以浏览一下testlink安装目录下的/lib/bugtracking，里面有好些文件，其中文件int_bugtracking.php是testlink和其他所有bug tracking系统（bugzilla, jira, mantis等）做集成的基类。还有一个文件叫int_bugzilla.php，这个文件就是testlink和bugzilla集成的代码，里面定义了一个类：bugzillaInterface，它是bugtrackingInterface的子类，并且在类bugzillaInterface里面重写了一部分方法，这也是为什么如果我们自己不修改代码的话，只能用到部分功能（例如只能连接，但却不能显示相关的信息）。</p>
<p>假如说，现在想在testlink关联bugzilla的一个bug之前，验证一下bug id是否存在，就要在int_bugzilla.php里面重写checkBugID_existence方法。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT bug_id FROM <span style="color: #006699; font-weight: bold;">{$this-&gt;dbSchema}</span>.bugs WHERE bug_id='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$query_results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbConnection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_results</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbConnection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_results</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span></pre></div></div>

<p>如果要自己补充这个int_bugzilla.php的时候，需要一点php的知识，并且对bugzilla数据库有所了解，以前公司的同事告诉我用php的一个神器，vardump。你懂的。</p>
<p>Related posts:<ol>
<li><a href='http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/' rel='bookmark' title='TestLink不能连接BugZilla的解决办法'>TestLink不能连接BugZilla的解决办法</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/testlink-bugzilla-bugtracking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TestLink不能连接BugZilla的解决办法</title>
		<link>http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testlink-integrate-bugzilla-failed</link>
		<comments>http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 15:57:04 +0000</pubDate>
		<dc:creator>magus</dc:creator>
				<category><![CDATA[软件测试]]></category>
		<category><![CDATA[BugZilla]]></category>
		<category><![CDATA[TestLink]]></category>

		<guid isPermaLink="false">http://magustest.com/blog/?p=652</guid>
		<description><![CDATA[TestLink是一个基于Web的PHP开源测试管理系统，虽然用起来跟QC那些商业软件比起来不是那么爽，但是由于是开源、免费，所以越来越多的公司在用TestLink。BugZilla作为老牌的bug管理工具，同样有着很大的用户群。 TestLink有一个BugTracking的接口模块，可以使得TestLink可以与其他BugTracking系统集成。在集成的过程中发现TestLink提示错误：Bug ID does not exist on BTS（中文的话是&#8217;bug的ID在BTS中不存在！&#8217;），找到TestLink的代码文件bugAdd.php，找到下面这段代码块 if&#40;$args-&#62;bug_id != &#34;&#34;&#41; &#123; $msg = lang_get&#40;&#34;error_wrong_BugID_format&#34;&#41;; if &#40;$g_bugInterface-&#62;checkBugID&#40;$args-&#62;bug_id&#41;&#41; &#123; $msg = lang_get&#40;&#34;error_bug_does_not_exist_on_bts&#34;&#41;; // 问题在这里 if &#40;$g_bugInterface-&#62;checkBugID_existence&#40;$args-&#62;bug_id&#41;&#41; &#123; if &#40;write_execution_bug&#40;$db,$args-&#62;exec_id, $args-&#62;bug_id&#41;&#41; &#123; $msg = lang_get&#40;&#34;bug_added&#34;&#41;; logAuditEvent&#40;TLS&#40;&#34;audit_executionbug_added&#34;,$args-&#62;bug_id&#41;,&#34;CREATE&#34;,$args-&#62;exec_id,&#34;executions&#34;&#41;; &#125; &#125; &#125; &#125; 问题出在$g_bugInterface->checkBugID_existence($args->bug_id)这个方法中。在、TestLink的int_bugzilla.php文件中，并没有overload这个checkBugID_existence的方法，所以这个方法就会按照int_bugtracking.php中的默认实现，返回false。TestLink就会出现error_bug_does_not_exist_on_bts这个ERROR 解决这个问题很简单，就是在int_bugzilla.php中自己实现checkBugID_existence方法，简单的实现如下： function checkBugID_existence&#40;$id&#41; &#123; $status_ok = 0; //关键是下面这个Query bug id的语句，大家自己看看数据库是哪个表，根据实际情况自己修改 $query = &#34;SELECT bug_id FROM bugs <a href='http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/' class='excerpt-more'>[...]</a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>TestLink是一个基于Web的PHP开源测试管理系统，虽然用起来跟QC那些商业软件比起来不是那么爽，但是由于是开源、免费，所以越来越多的公司在用TestLink。BugZilla作为老牌的bug管理工具，同样有着很大的用户群。</p>
<p>TestLink有一个BugTracking的接口模块，可以使得TestLink可以与其他BugTracking系统集成。在集成的过程中发现TestLink提示错误：Bug ID does not exist on BTS（中文的话是&#8217;bug的ID在BTS中不存在！&#8217;），找到TestLink的代码文件bugAdd.php，找到下面这段代码块</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> lang_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;error_wrong_BugID_format&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$g_bugInterface</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">checkBugID</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> lang_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;error_bug_does_not_exist_on_bts&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// 问题在这里</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$g_bugInterface</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">checkBugID_existence</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span> 	  
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>write_execution_bug<span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span><span style="color: #339933;">,</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> lang_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;bug_added&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				logAuditEvent<span style="color: #009900;">&#40;</span>TLS<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;audit_executionbug_added&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bug_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;CREATE&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$args</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_id</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;executions&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>问题出在$g_bugInterface->checkBugID_existence($args->bug_id)这个方法中。在、TestLink的int_bugzilla.php文件中，并没有overload这个checkBugID_existence的方法，所以这个方法就会按照int_bugtracking.php中的默认实现，返回false。TestLink就会出现error_bug_does_not_exist_on_bts这个ERROR</p>
<p>解决这个问题很简单，就是在int_bugzilla.php中自己实现checkBugID_existence方法，简单的实现如下：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> checkBugID_existence<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$status_ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//关键是下面这个Query bug id的语句，大家自己看看数据库是哪个表，根据实际情况自己修改	</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT bug_id FROM bugs WHERE bug_id='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbConnection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">exec_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbConnection</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$status_ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>    
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$status_ok</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>OK。在int_bugzilla.php文件中添加了 checkBugID_existence() 方法后，就可以从TestLink中直接把BugZilla里面的BUG ID和某个测试关联起来了。</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://magustest.com/blog/softwaretesting/testlink-integrate-bugzilla-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

