Mauro,

For the record, this is how I got it to work:

protected Configuration getConfiguration() {
    Map<String, String> defaultKeywords = LocalizedKeywords.defaultKeywords();
    defaultKeywords.put(Keywords.EXAMPLES_TABLE_VALUE_SEPARATOR, "!");
    defaultKeywords.put(Keywords.EXAMPLES_TABLE_HEADER_SEPARATOR, "|");
    RegexStoryParser storyParser = new RegexStoryParser(keywords);
    Configuration configuration = super.getConfiguration();             
    configuration.useStoryParser(storyParser);
    return configuration;
}

At first, I just created a new Keywords object and called
configuration.useKeywords but didn't work. I did some code digging and
found that the keywords are used by the story parser, so I created a
RegexStoryParser with my new keywords. Please, advise if there is a
better solution.

Anyway, I don't like this approach too much because I have to use this
separator for all scenarios in the story. I would like to set a
separator just for this scenario, maybe using a notation similar to
the trim option. For example:

{valueSeparator=!,headerSeparator=%}

What do you think?

Thanks!
Edgardo

On Tue, Feb 15, 2011 at 10:12 AM, Mauro Talevi
<[email protected]> wrote:
> You're right, it used to be there but then the examples got updated to
> use the keywords properties in core.
>
> You can refer to the LocalizedKeywordsBehaviour for an example of
> creating a Keywords instance with custom properties.
>
> Cheers
>
> On 15/02/2011 12:56, Edgardo Hames wrote:
>> Hi Mauro,
>>
>> Thanks for your response. I found the reference to the examples in the
>> documentation, but couldn't find the properties file in the example
>> code. Today I found it in the jbehave code. I'll give it a try and let
>> you know if I have any trouble.
>>
>> Best regards,
>> Edgardo
>>
>> On Mon, Feb 14, 2011 at 6:03 PM, Mauro Talevi
>> <[email protected]> wrote:
>>> Hi
>>>
>>> the value is configurable via the keywords properties file. Look at the 
>>> trader-i18n example which configures the use of different keyword bundles.
>>>
>>> If you have problems we can add an example for this use case.
>>>
>>> Cheers
>>>
>>> On 14 Feb 2011, at 21:02, Edgardo Hames <[email protected]> wrote:
>>>
>>>> Hi!
>>>>
>>>> I'm using Jbehave 3.1.2 in my project and I ran into a problem when
>>>> the value of my example contains a pipe (|): I get and
>>>> IndexOutOfBoundException. The documentation for ExamplesTable[0]  says
>>>> any value can be used for header and value separator (I tried to use !
>>>> for the column separator but finds a single column and yields same
>>>> exception). This value seems to be ignored. I also found that this
>>>> feature is implemented [1] but cannot get it to work.
>>>>
>>>> How do I change the column separator just for this single story?
>>>>
>>>> Thanks,
>>>> Edgardo
>>>>
>>>> [0] 
>>>> http://jbehave.org/reference/stable/javadoc/core/org/jbehave/core/model/ExamplesTable.html
>>>> [1] http://jira.codehaus.org/browse/JBEHAVE-255
>>>>
>>>> --
>>>> "A slow sort of country!" said the Queen. "Now, here, you see, it
>>>> takes all the running you can do, to keep in the same place. If you
>>>> want to get somewhere else, you must run at least twice as fast as
>>>> that!"
>>>> -- Lewis Carroll
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
>
>



-- 
"A slow sort of country!" said the Queen. "Now, here, you see, it
takes all the running you can do, to keep in the same place. If you
want to get somewhere else, you must run at least twice as fast as
that!"
-- Lewis Carroll

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

    http://xircles.codehaus.org/manage_email


Reply via email to