<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Anubhava's Tech Blog</title>
	<atom:link href="http://anubhava.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://anubhava.wordpress.com</link>
	<description>Generic Fixture, just a better FitNesse Fixture</description>
	<lastBuildDate>Mon, 16 Nov 2009 10:48:39 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Use of variables, arrays and complex types in Generic Fixture by Aristotelis</title>
		<link>http://anubhava.wordpress.com/2008/04/11/use-of-variables-arrays-and-complex-types-in-generic-fixture/#comment-120</link>
		<dc:creator>Aristotelis</dc:creator>
		<pubDate>Mon, 16 Nov 2009 10:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/28/use-of-variables-arrays-and-complex-types-in-generic-fixture/#comment-120</guid>
		<description>Hi Anubhava,

We came across a probable bug. 
When we pass an array as the last variable of the function called by the interpreted dsl, and the last member of the array is empty, gives an error..

Unfortunately we are not sure of how to recreate a simple executable example, so here is a pseudo-example from our code just to transmit the idea:


!&#124; DSL Adapter &#124;
&#124; create ship with name: &#124; % &#124; effect date: &#124; % &#124; setUp &#124; shipFieldSetMapper , array: Name\, ShipTypeEffectDate\, DeathDate\, ShipStatusType , array:{1}\, {2}\, \, &#124;

&#124; Generic Fixture 	&#124; objcomp= &#124;
&#124; create ship with name: &#124; Ship 35 &#124; effect date: &#124; 16/11/1994 &#124;

The error received is:
java.lang.IllegalArgumentException: Field names must be same length as values: names=[Name, ShipTypeEffectDate, DeathDate, ShipStatusType], values=[Ship 35, 16/11/1994, ]

As you can notice the last empty element of the array is missing (it should have been &quot;[Ship 35, 16/11/1994, , ]&quot; instead).



Furthermore in some other cases when we pass many parameters (33 or more..) we get some funny errors where it seems that the string substitutions are getting mixed up... Is there a limitation in the length of the string or the number of parameters, or the number of arguments in the arrays?

thanks in advance,
Aristotelis</description>
		<content:encoded><![CDATA[<p>Hi Anubhava,</p>
<p>We came across a probable bug.<br />
When we pass an array as the last variable of the function called by the interpreted dsl, and the last member of the array is empty, gives an error..</p>
<p>Unfortunately we are not sure of how to recreate a simple executable example, so here is a pseudo-example from our code just to transmit the idea:</p>
<p>!| DSL Adapter |<br />
| create ship with name: | % | effect date: | % | setUp | shipFieldSetMapper , array: Name\, ShipTypeEffectDate\, DeathDate\, ShipStatusType , array:{1}\, {2}\, \, |</p>
<p>| Generic Fixture 	| objcomp= |<br />
| create ship with name: | Ship 35 | effect date: | 16/11/1994 |</p>
<p>The error received is:<br />
java.lang.IllegalArgumentException: Field names must be same length as values: names=[Name, ShipTypeEffectDate, DeathDate, ShipStatusType], values=[Ship 35, 16/11/1994, ]</p>
<p>As you can notice the last empty element of the array is missing (it should have been &#8220;[Ship 35, 16/11/1994, , ]&#8221; instead).</p>
<p>Furthermore in some other cases when we pass many parameters (33 or more..) we get some funny errors where it seems that the string substitutions are getting mixed up&#8230; Is there a limitation in the length of the string or the number of parameters, or the number of arguments in the arrays?</p>
<p>thanks in advance,<br />
Aristotelis</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by anubhava</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-114</link>
		<dc:creator>anubhava</dc:creator>
		<pubDate>Wed, 28 Oct 2009 16:34:13 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-114</guid>
		<description>Hi Aristotelis,

Sorry for the goof up. Please download the jar again from the link above.

Thanks,
Anubhava</description>
		<content:encoded><![CDATA[<p>Hi Aristotelis,</p>
<p>Sorry for the goof up. Please download the jar again from the link above.</p>
<p>Thanks,<br />
Anubhava</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by Aristotelis</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-113</link>
		<dc:creator>Aristotelis</dc:creator>
		<pubDate>Wed, 28 Oct 2009 10:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-113</guid>
		<description>Hello Anubhava,

Thank you very much for your promptness and help.
We got the new jar but before we could confirm that the blanks work ok we got another strange error.
Our calls using getEval or waitForCondition started failing.
When we looked at the log of selenium control window we spotted &#039;null&#039;s appearing where they shouldn&#039;t...

Example:
the dsl call:
window.document.evaluate( &quot;.....&quot;\, window.document\, null\, XPathResult.NUMBER_TYPE\, null ).numberValue

was interpreted (sent to selenium) as:
window.document.evaluate( &quot;.....&quot;, window.document, , nullXPathResult.NUMBER_TYPE, )null.numberValue

instead of (normal):
window.document.evaluate( &quot;.....&quot;, window.document, null, XPathResult.NUMBER_TYPE, null).numberValue

which ofcourse gave origin to a selenium syntax error (and &#039;broke&#039; almost all of our test narratives..)

Please help,
thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hello Anubhava,</p>
<p>Thank you very much for your promptness and help.<br />
We got the new jar but before we could confirm that the blanks work ok we got another strange error.<br />
Our calls using getEval or waitForCondition started failing.<br />
When we looked at the log of selenium control window we spotted &#8216;null&#8217;s appearing where they shouldn&#8217;t&#8230;</p>
<p>Example:<br />
the dsl call:<br />
window.document.evaluate( &#8220;&#8230;..&#8221;\, window.document\, null\, XPathResult.NUMBER_TYPE\, null ).numberValue</p>
<p>was interpreted (sent to selenium) as:<br />
window.document.evaluate( &#8220;&#8230;..&#8221;, window.document, , nullXPathResult.NUMBER_TYPE, )null.numberValue</p>
<p>instead of (normal):<br />
window.document.evaluate( &#8220;&#8230;..&#8221;, window.document, null, XPathResult.NUMBER_TYPE, null).numberValue</p>
<p>which ofcourse gave origin to a selenium syntax error (and &#8216;broke&#8217; almost all of our test narratives..)</p>
<p>Please help,<br />
thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by anubhava</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-112</link>
		<dc:creator>anubhava</dc:creator>
		<pubDate>Wed, 28 Oct 2009 02:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-112</guid>
		<description>Dear Aristotelis,

Well these special symbols (blank, null) were intended to be used independently and not in full expressions i.e 
&#124; someMethod &#124; blank &#124; 
instead of your usage: 
&#124; getEval &#124; &quot;blank&quot; == &quot;&quot; &#124;

But since you asked I have made a change in the code to support your requirements. Please download the latest jar file from this link: http://sourceforge.net/projects/genericfixture/files/genericfixture/genericfixture_v1/genericfixture.jar/download

And run your scripts as is and it should work fine.

Cheers,
Anubhava</description>
		<content:encoded><![CDATA[<p>Dear Aristotelis,</p>
<p>Well these special symbols (blank, null) were intended to be used independently and not in full expressions i.e<br />
| someMethod | blank |<br />
instead of your usage:<br />
| getEval | &#8220;blank&#8221; == &#8220;&#8221; |</p>
<p>But since you asked I have made a change in the code to support your requirements. Please download the latest jar file from this link: <a href="http://sourceforge.net/projects/genericfixture/files/genericfixture/genericfixture_v1/genericfixture.jar/download" rel="nofollow">http://sourceforge.net/projects/genericfixture/files/genericfixture/genericfixture_v1/genericfixture.jar/download</a></p>
<p>And run your scripts as is and it should work fine.</p>
<p>Cheers,<br />
Anubhava</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by Aristotelis</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-111</link>
		<dc:creator>Aristotelis</dc:creator>
		<pubDate>Tue, 27 Oct 2009 10:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-111</guid>
		<description>Dear Anubhava,

We seem to have another problem with the use of blank. This time when used with javascript calls (e.g. getEval of Selenium RC).
Example:

The test below FAILS:

!&#124; DSL Adapter &#124;
&#124; compare &#124; % &#124; to empty string &#124; getEval &#124; &quot;{1}&quot;==&quot;&quot; &#124; 
!&#124; Generic Fixture &#124; ${sel} &#124;
&#124; compare &#124; blank &#124; to empty string &#124; &#124; true &#124;



While the test below succeeds:
(a previously filled-in text input has its content deleted)

!&#124; Generic Fixture &#124; ${sel} &#124;
&#124; user types &#124; blank &#124; into field with id &#124; description &#124;
!&#124; Generic Fixture &#124; ${sel} &#124;
&#124; get value from field &#124; description &#124; &#124; blank &#124;


So it seems to be related with the JS type or the getEval call itself..

Thanks in advance,
Aristotelis.</description>
		<content:encoded><![CDATA[<p>Dear Anubhava,</p>
<p>We seem to have another problem with the use of blank. This time when used with javascript calls (e.g. getEval of Selenium RC).<br />
Example:</p>
<p>The test below FAILS:</p>
<p>!| DSL Adapter |<br />
| compare | % | to empty string | getEval | &#8220;{1}&#8221;==&#8221;" |<br />
!| Generic Fixture | ${sel} |<br />
| compare | blank | to empty string | | true |</p>
<p>While the test below succeeds:<br />
(a previously filled-in text input has its content deleted)</p>
<p>!| Generic Fixture | ${sel} |<br />
| user types | blank | into field with id | description |<br />
!| Generic Fixture | ${sel} |<br />
| get value from field | description | | blank |</p>
<p>So it seems to be related with the JS type or the getEval call itself..</p>
<p>Thanks in advance,<br />
Aristotelis.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by anubhava</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-110</link>
		<dc:creator>anubhava</dc:creator>
		<pubDate>Thu, 01 Oct 2009 22:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-110</guid>
		<description>Dear Aristotelis,

Your assessment is right because Generic Fixture was translating these symbols (null, blank etc) before calling DSL and that&#039;s why DSL was not matching for you. I have made a small change in the code.

New genericfixture.jar has been uploaded to the sourceforge repository. Please download the latest jar file for your test. It should fix the problem for you.

cheers,
Anubhava</description>
		<content:encoded><![CDATA[<p>Dear Aristotelis,</p>
<p>Your assessment is right because Generic Fixture was translating these symbols (null, blank etc) before calling DSL and that&#8217;s why DSL was not matching for you. I have made a small change in the code.</p>
<p>New genericfixture.jar has been uploaded to the sourceforge repository. Please download the latest jar file for your test. It should fix the problem for you.</p>
<p>cheers,<br />
Anubhava</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by Aristotelis</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-109</link>
		<dc:creator>Aristotelis</dc:creator>
		<pubDate>Thu, 01 Oct 2009 17:45:02 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-109</guid>
		<description>Hi Anubhava,

Thanks for your explanation.

We have a problem in using the blank. 
We  confirm that everytime we use it to pass a blank string the DSL mapping fails (&quot;could not be found matching given parameters&quot; error).

Could this be because of the code of Generic Fixture?

Can you pass blank (or otherwise an empty string) in a DSL call?

Example:
!&#124; Generic Fixture &#124; ${sel} &#124;
&#124; user types &#124; blank &#124; into field &#124; firstname &#124;

Error given:
java.lang.NoSuchMethodException: Method [com.thoughtworks.selenium.DefaultSelenium.userTypes()] could not be found matching given parameters

Thanks again,
Aristotelis.</description>
		<content:encoded><![CDATA[<p>Hi Anubhava,</p>
<p>Thanks for your explanation.</p>
<p>We have a problem in using the blank.<br />
We  confirm that everytime we use it to pass a blank string the DSL mapping fails (&#8220;could not be found matching given parameters&#8221; error).</p>
<p>Could this be because of the code of Generic Fixture?</p>
<p>Can you pass blank (or otherwise an empty string) in a DSL call?</p>
<p>Example:<br />
!| Generic Fixture | ${sel} |<br />
| user types | blank | into field | firstname |</p>
<p>Error given:<br />
java.lang.NoSuchMethodException: Method [com.thoughtworks.selenium.DefaultSelenium.userTypes()] could not be found matching given parameters</p>
<p>Thanks again,<br />
Aristotelis.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Use of variables, arrays and complex types in Generic Fixture by anubhava</title>
		<link>http://anubhava.wordpress.com/2008/04/11/use-of-variables-arrays-and-complex-types-in-generic-fixture/#comment-108</link>
		<dc:creator>anubhava</dc:creator>
		<pubDate>Tue, 29 Sep 2009 21:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/28/use-of-variables-arrays-and-complex-types-in-generic-fixture/#comment-108</guid>
		<description>Hi Michael,

Thanks for the nice words. 

Now regarding if, for, while, etc: I was initially using fit.decorator&#039;s loop fixture for looping support but since fit.decorator didn&#039;t have support of variables I had to modify it locally.

As a much better support of these constructs (if, for, while, etc) I have actually integrated bean shell interpreter via GenericFixture and DSLAdapter. I have yet to publish a Blog post on examples and how-to&#039;. 
But in summary:
1. Get bsh.jar and put it in FitNesse&#039;s classpath, using !path directive.
2. Then use a DSL like this anywhere in your scripts:
&lt;code&gt;!&#124; DSL Adapter &#124;
&#124; check if array &#124; % &#124; has &#124; % &#124; GenericFixture.bsh &#124; boolean has=false; if (java.util.Arrays.binarySearch({1}, &quot;{2}&quot;) &gt; 0) has=true; return has; &#124;
&#124; check if &#124; % &#124; is between &#124; % &#124; and &#124; % &#124; GenericFixture.bsh &#124; return {1} &gt; {2} &amp;&amp; {1} &lt;= {3}; &#124;&lt;/code&gt;
3. And finally call this DSL script like:
&lt;code&gt;&#124; check if &#124; someVar &#124; is between &#124; 4 &#124; and &#124; 7 &#124; &#124; true &#124;
&#124; check if array &#124; arr &#124; has &#124; indeed &#124; &#124; true &#124;&lt;/code&gt;

I know it wont&#039;s be very clear from this comment so please pardon me till I create a proper Blog post with full working examples and detailed instructions.

Cheers,
Anubhava

&lt;em&gt;PS; However as a matter of practice I don&#039;t recommend writing a complex test script with all kind ifs, whiles, dos etc. It makes it harder to maintain and less readable. I would rather create a helper class and do complex looping, branching, calculations inside that and then call helper class methods via Generic Fixture.
&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>Thanks for the nice words. </p>
<p>Now regarding if, for, while, etc: I was initially using fit.decorator&#8217;s loop fixture for looping support but since fit.decorator didn&#8217;t have support of variables I had to modify it locally.</p>
<p>As a much better support of these constructs (if, for, while, etc) I have actually integrated bean shell interpreter via GenericFixture and DSLAdapter. I have yet to publish a Blog post on examples and how-to&#8217;.<br />
But in summary:<br />
1. Get bsh.jar and put it in FitNesse&#8217;s classpath, using !path directive.<br />
2. Then use a DSL like this anywhere in your scripts:<br />
<code>!| DSL Adapter |<br />
| check if array | % | has | % | GenericFixture.bsh | boolean has=false; if (java.util.Arrays.binarySearch({1}, "{2}") &gt; 0) has=true; return has; |<br />
| check if | % | is between | % | and | % | GenericFixture.bsh | return {1} &gt; {2} &amp;&amp; {1} &lt;= {3}; |</code><br />
3. And finally call this DSL script like:<br />
<code>| check if | someVar | is between | 4 | and | 7 | | true |<br />
| check if array | arr | has | indeed | | true |</code></p>
<p>I know it wont&#39;s be very clear from this comment so please pardon me till I create a proper Blog post with full working examples and detailed instructions.</p>
<p>Cheers,<br />
Anubhava</p>
<p><em>PS; However as a matter of practice I don&#8217;t recommend writing a complex test script with all kind ifs, whiles, dos etc. It makes it harder to maintain and less readable. I would rather create a helper class and do complex looping, branching, calculations inside that and then call helper class methods via Generic Fixture.<br />
</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by anubhava</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-107</link>
		<dc:creator>anubhava</dc:creator>
		<pubDate>Tue, 29 Sep 2009 21:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-107</guid>
		<description>Dear Aristotelis,

What do you mean by empty variable? Is your variable of java.lang.String type and you want to pass a blank (&quot;&quot;) string? If that is the case you can simply use keyword &lt;strong&gt;blank&lt;/strong&gt; in your script. (Please make sure it is &lt;strong&gt;blank&lt;/strong&gt; in lowercase).

Otherwise a variable can be of any object type and a &lt;strong&gt;null&lt;/strong&gt; can be passed in its place (please make sure it is &lt;strong&gt;null&lt;/strong&gt; in lowercase).

However just by omitting a value altogether as in your example is not going to work, that is FitNesse behaviour.

Thanks,
Anubhava</description>
		<content:encoded><![CDATA[<p>Dear Aristotelis,</p>
<p>What do you mean by empty variable? Is your variable of java.lang.String type and you want to pass a blank (&#8220;&#8221;) string? If that is the case you can simply use keyword <strong>blank</strong> in your script. (Please make sure it is <strong>blank</strong> in lowercase).</p>
<p>Otherwise a variable can be of any object type and a <strong>null</strong> can be passed in its place (please make sure it is <strong>null</strong> in lowercase).</p>
<p>However just by omitting a value altogether as in your example is not going to work, that is FitNesse behaviour.</p>
<p>Thanks,<br />
Anubhava</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introducing Generic Fixture for FitNesse by Aristotelis</title>
		<link>http://anubhava.wordpress.com/2008/02/09/introducing-generic-fixture-for-fitnesse/#comment-106</link>
		<dc:creator>Aristotelis</dc:creator>
		<pubDate>Tue, 29 Sep 2009 14:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://anubhava.wordpress.com/2008/01/15/introducing-generic-fixture-for-fitnesse/#comment-106</guid>
		<description>Dear Anubhava, 

Thanks for the answer! It would take us ages to pinpoint that issue! Once again, though, we look for your guidance:

We have created some rather long DSL calls and we have been getting errors of the type:

java.lang.NoSuchMethodException: Method [eu.europa.blahblah.gfplugin.FixtureContext.thisIsAFriendlyNameThatShouldBeReplacedByTheFunctionName:()] could not be found matching given parameters

obviously, the DSL mapping and replacements did not take place.

We think we have narrowed down the problem down to a surprising fact: the DSL mapping fails when a variable is passed emtpy. E.g.:

&#124; Generic Fixture &#124; ourdb= &#124;
&#124; friendly name with parameter &#124; &#124; and parameter &#124;&#124; doing sth&#124;
gives an error while the following does not:
&#124; Generic Fixture &#124; ourdb= &#124;
&#124; friendly name with parameter &#124;a&#124; and parameter &#124; a &#124; doing sth&#124;

Is this normal? Are we doing sth wrong?

Thanks in advance,
Aristotelis.</description>
		<content:encoded><![CDATA[<p>Dear Anubhava, </p>
<p>Thanks for the answer! It would take us ages to pinpoint that issue! Once again, though, we look for your guidance:</p>
<p>We have created some rather long DSL calls and we have been getting errors of the type:</p>
<p>java.lang.NoSuchMethodException: Method [eu.europa.blahblah.gfplugin.FixtureContext.thisIsAFriendlyNameThatShouldBeReplacedByTheFunctionName:()] could not be found matching given parameters</p>
<p>obviously, the DSL mapping and replacements did not take place.</p>
<p>We think we have narrowed down the problem down to a surprising fact: the DSL mapping fails when a variable is passed emtpy. E.g.:</p>
<p>| Generic Fixture | ourdb= |<br />
| friendly name with parameter | | and parameter || doing sth|<br />
gives an error while the following does not:<br />
| Generic Fixture | ourdb= |<br />
| friendly name with parameter |a| and parameter | a | doing sth|</p>
<p>Is this normal? Are we doing sth wrong?</p>
<p>Thanks in advance,<br />
Aristotelis.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
