Thanks, Cristiano :-)

In effect, I've found table parameters quite useful of late. Took it one step further to make it easier to use:

http://jira.codehaus.org/browse/JBEHAVE-209

Added documentation page:

http://jbehave.org/reference/latest/table-parameters.html

Note how the steps implementation with TableExamples parameters is slightly simplified and clearer in its intent:

https://svn.codehaus.org/jbehave/trunk/core/examples/trader/src/main/java/org/jbehave/examples/trader/TraderSteps.java

Cheers

Cristiano Gavião wrote:
Hey Mauro.... congrats !!!

Very very nice feature (one more....)



Mauro Talevi escreveu:
Christopher,

here's a fully-working example that illustrates use of examples table in parsing multi-line input:

https://svn.codehaus.org/jbehave/trunk/core/examples/trader/src/main/java/org/jbehave/examples/trader/scenarios/wildcard_search.scenario

Check out the

https://svn.codehaus.org/jbehave/trunk/core/examples/trader/src/main/java/org/jbehave/examples/trader/TraderSteps.java

for the implementation, in particular the method

List<Trader> parseTraders(String tradersTable)

Cheers

Christopher Gardner wrote:
Do you mind positing a quick scenario file with an example of this?

Also, after thinking about this today, the situation I had in mind was
in this vein

Given these users
|name|rank|
|Larry|Stooge 3|
|Moe|Stooge 1|
|Curly|Stooge 2|

When I execute this wildcard search "%y"

Then I see
|Larry|Stooge 3|
|Curly|Stooge 2|

How might I represent this in a JBehave scenario file as well an ExamplesTable?

On Tue, Nov 24, 2009 at 11:25 AM, Mauro Talevi
<[email protected]> wrote:
Hi Christopher,


yes, that is the intended scope of Scenario Examples.

But you can also use the ExamplesTable to parse your tabular input for
internal implementation in a step method.

@When("I do something with a table $tableContent")
public void doSomethingWithATable(String tableContent){
 ExamplesTable table = new ExamplesTable(tableContent);
 // use table to retrieve contents by row
}

The difference here is that you can use the entire table content in the same scenario step, and not one line per scenario execution as when using the
Examples: keyword.

I've been meaning to had this use case to the docs, just have not got around
to it.  In one of my current projects, we've found it quite useful in
cutting down files and making scenarios more expressive.

NOTE: if you are using Windows, you may still be bitten by the regex issue for long table with repeated values, especially at start of the the lines. Workaround, is to put the columns with most varying values as much to the
left as possible.

Cheers

Christopher Gardner wrote:
It looks like just using the Examples approach should suffice.

On Tue, Nov 24, 2009 at 8:05 AM, Christopher Gardner
<[email protected]> wrote:
Is there a way to get the effect of cucumber's multiline step feature
in JBehave?

http://wiki.github.com/aslakhellesoy/cucumber/multiline-step-arguments

This would be useful to set up data to test search functionality
without having to resort to an external file.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to