Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small fixes + Localized Templates... + add modified jbehave keywords
- Loading branch information
Showing
20 changed files
with
433 additions
and
43 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story sample" | ||
id="org.technbolts.jbehave.story.sample1_en" | ||
autoinsert="true" | ||
name="sample1">${Scenario} trader is not alerted below threshold | ||
|
||
${Given} a stock of symbol ${symbol} and a threshold of ${threshold:10.0f} | ||
${When} the stock is traded at ${value:5.0} | ||
${Then} the alert status should be ${status:OFF} | ||
</template> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story sample with narrative and two scenario" | ||
id="org.technbolts.jbehave.story.sample2_en" | ||
autoinsert="true" | ||
name="sample2">A story is a collection of scenarios | ||
|
||
${Narrative} | ||
${InOrderTo} communicate effectively to the business some functionality | ||
${AsA} development team | ||
${IWantTo} use Behaviour-Driven Development | ||
|
||
${Scenario} A scenario is a collection of executable steps of different type | ||
|
||
${Given} step represents a precondition to an event | ||
${When} step represents the occurrence of the event | ||
${Then} step represents the outcome of the event | ||
|
||
${Scenario} Another scenario exploring different combination of events | ||
|
||
${Given} a precondition | ||
${When} a negative event occurs | ||
${Then} a the outcome should be captured | ||
</template> | ||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story sample" | ||
id="org.technbolts.jbehave.story.sample1_fr" | ||
autoinsert="true" | ||
name="sample1">${Scenario} trader is not alerted below threshold | ||
|
||
${Given} a stock of symbol ${symbol} and a threshold of ${threshold:10.0f} | ||
${When} the stock is traded at ${value:5.0} | ||
${Then} the alert status should be ${status:OFF} | ||
</template> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story sample with narrative and two scenario" | ||
id="org.technbolts.jbehave.story.sample2_fr" | ||
autoinsert="true" | ||
name="sample2">A story is a collection of scenarios | ||
|
||
${Narrative} | ||
${InOrderTo} communicate effectively to the business some functionality | ||
${AsA} un development team | ||
${IWantTo} use Behaviour-Driven Development | ||
|
||
${Scenario} A scenario is a collection of executable steps of different type | ||
|
||
${Given} step represents a precondition to an event | ||
${When) step represents the occurrence of the event | ||
${Then} step represents the outcome of the event | ||
|
||
${Scenario} Another scenario exploring different combination of events | ||
|
||
${Given} a precondition | ||
${When} a negative event occurs | ||
${Then} a the outcome should be captured | ||
</template> | ||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story sample" | ||
id="org.technbolts.jbehave.story.sample1_fr_FR_Traditional" | ||
autoinsert="true" | ||
name="sample1">${Scenario} un trader n'est pas alerté en-dessous d'un certain seuil | ||
|
||
${Given} un stock d'action ${symbol} et un seuil de ${threshold:10.0f} | ||
${When} le stock est vendu à ${value:5.0} | ||
${Then} l'alerte doit être ${status:OFF} | ||
</template> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story sample with narrative and two scenario" | ||
id="org.technbolts.jbehave.story.sample2_fr_FR_Traditional" | ||
autoinsert="true" | ||
name="sample2">Un histoire est une collection de scénario | ||
|
||
${Narrative} | ||
${InOrderTo} communiquer de manière efficace avec le métier sur des fonctionalités | ||
${AsA} que membre de l'équipe de développement | ||
${IWantTo} utiliser le Behaviour-Driven Development | ||
|
||
${Scenario} Un scénario est une collection d'étapes executables de différents types | ||
|
||
${Given} que une étape représente une précondition à un événement ou une action | ||
${When} l'étape représentant cet évènement se produit | ||
${Then} cette étape représente le résultat attendu | ||
|
||
${Scenario} Un autre scénario explorant différentes combinaison d'évènements. | ||
|
||
${Given} une précondition | ||
${When} un évènement négatif se produit | ||
${Then} le résultat attendu doit être capturé | ||
</template> | ||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Story preamble" | ||
id="org.technbolts.jbehave.story.preamble_shared" | ||
autoinsert="true" | ||
name="preamble">${Narrative} | ||
${InOrderTo} ${inOrderTo} | ||
${AsA} ${asA} | ||
${IWantTo} ${iWantTo} | ||
</template> | ||
<template | ||
context="org.technbolts.jbehave.story" | ||
description="Simple scenario" | ||
id="org.technbolts.jbehave.story.scenario_shared" | ||
autoinsert="true" | ||
name="scenario"> | ||
${Scenario} ${scenarioTitle} | ||
|
||
${Given} ${given} | ||
${And} ${givenAnd} | ||
${When} ${when} | ||
${And} ${whenAnd} | ||
${Then} ${then} | ||
</template> | ||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Meta=Meta: | ||
MetaProperty=@ | ||
Narrative=Narrative\: | ||
InOrderTo=Afin de | ||
AsA=En tant que | ||
IWantTo=Je veux | ||
Scenario=Sc\u00E9nario\: | ||
GivenStories=Etant donn\u00E9 les Histoires\: | ||
ExamplesTable=Exemples\: | ||
ExamplesTableRow=Exemple\: | ||
ExamplesTableHeaderSeparator=| | ||
ExamplesTableValueSeparator=| | ||
ExamplesTableIgnorableSeparator=|-- | ||
Given=Etant donn\u00E9 | ||
When=Quand | ||
Then=Alors | ||
And=Et | ||
Ignorable=!-- | ||
Pending=EN SUSPENS | ||
NotPerformed=NON EX\u00C9CUT\u00C9 | ||
Failed=ECHEC | ||
DryRun=EX\u00C9CUTION SIMUL\u00C9E | ||
StoryCancelled=HISTORIE ANNUL\u00C9E | ||
Duration=DUR\u00C9E | ||
OutcomeDescription=D\u00E9scription | ||
OutcomeValue=Valeur | ||
OutcomeMatcher=Matcher | ||
OutcomeVerified=V\u00E9rifi\u00E9 | ||
Yes=Oui | ||
No=Non |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/org/technbolts/jbehave/eclipse/editors/story/completion/JBehaveTemplateContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.technbolts.jbehave.eclipse.editors.story.completion; | ||
|
||
import org.eclipse.jface.text.BadLocationException; | ||
import org.eclipse.jface.text.IDocument; | ||
import org.eclipse.jface.text.templates.DocumentTemplateContext; | ||
import org.eclipse.jface.text.templates.Template; | ||
import org.eclipse.jface.text.templates.TemplateBuffer; | ||
import org.eclipse.jface.text.templates.TemplateContextType; | ||
import org.eclipse.jface.text.templates.TemplateException; | ||
import org.eclipse.jface.text.templates.TemplateTranslator; | ||
import org.technbolts.jbehave.eclipse.JBehaveProject; | ||
|
||
public class JBehaveTemplateContext extends DocumentTemplateContext { | ||
|
||
private final JBehaveProject project; | ||
|
||
public JBehaveTemplateContext(final TemplateContextType contextType, | ||
final JBehaveProject project, | ||
final IDocument document, | ||
final int offset, | ||
final int length) { | ||
super(contextType, document, offset, length); | ||
this.project = project; | ||
} | ||
|
||
@Override | ||
public boolean canEvaluate(Template template) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException { | ||
if (!canEvaluate(template)) { | ||
return null; | ||
} | ||
final TemplateTranslator translator = new TemplateTranslator(); | ||
final TemplateBuffer buffer = translator.translate(template); | ||
|
||
getContextType().resolve(buffer, this); | ||
|
||
return buffer; | ||
} | ||
|
||
public JBehaveProject getProject() { | ||
return project; | ||
} | ||
|
||
} |
Oops, something went wrong.