Sorry, I think I got wrong project and did wrong export process...
"Living and Learning"... :-)
It was the first time that I did a svn patch, let me know if it's ok now.
it was my pleasure to contribute...
regards
Cristiano
Mauro Talevi escreveu:
Cristiano,
the annotated patterns PtTraderSteps are actually not translated in PT.
Would you mind translating them as trying to run the scenario in PT?
If you could provide it as a patch to latest trunk, I'll just apply it.
Many thanks!
Cheers
Cristiano Gavião wrote:
Hi Mauro,
Is here the Brazilian Portugue Trader Example.
Cheers
Cristiano
Mauro Talevi escreveu:
Cristiano Gavião wrote:
Hi Mauro,
I'll do this until next weekend ok?
Sure, Cristiano, whenever you have time. In the meantime, we'll
probably cut a RC for people to try out new features.
Cheers
---------------------------------------------------------------------
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
Index: src/main/java/org/jbehave/examples/trader/PtTraderSteps.java
===================================================================
--- src/main/java/org/jbehave/examples/trader/PtTraderSteps.java
(revision 0)
+++ src/main/java/org/jbehave/examples/trader/PtTraderSteps.java
(revision 0)
@@ -0,0 +1,41 @@
+package org.jbehave.examples.trader;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.jbehave.Ensure.ensureThat;
+
+import java.util.Locale;
+
+import org.jbehave.examples.trader.model.Stock;
+import org.jbehave.scenario.annotations.Given;
+import org.jbehave.scenario.annotations.Named;
+import org.jbehave.scenario.annotations.Then;
+import org.jbehave.scenario.annotations.When;
+import org.jbehave.scenario.i18n.I18nKeyWords;
+import org.jbehave.scenario.steps.Steps;
+import org.jbehave.scenario.steps.StepsConfiguration;
+
+public class PtTraderSteps extends Steps {
+
+ private Stock stock;
+
+ public PtTraderSteps(ClassLoader classLoader) {
+ // Use Brazilian Portuguese for keywords
+ super(new StepsConfiguration(new I18nKeyWords(new Locale("pt-BR"))));
+ }
+
+ @Given("há uma ação com sÃmbolo $symbol e um limite de $threshold")
+ public void aStock(@Named("symbol") String symbol, @Named("threshold")
double threshold) {
+ stock = new Stock(symbol, threshold);
+ }
+
+ @When("a ação é oferecida ao preço de $price")
+ public void stockIsTraded(@Named("price") double price) {
+ stock.tradeAt(price);
+ }
+
+ @Then("o estado de alerta é $status")
+ public void alertStatusIs(@Named("status") String status) {
+ ensureThat(stock.getStatus().name(), equalTo(status));
+ }
+
+}
Index:
src/main/java/org/jbehave/examples/trader/scenarios/PtTraderIsAlertedOfStatus.java
===================================================================
---
src/main/java/org/jbehave/examples/trader/scenarios/PtTraderIsAlertedOfStatus.java
(revision 0)
+++
src/main/java/org/jbehave/examples/trader/scenarios/PtTraderIsAlertedOfStatus.java
(revision 0)
@@ -0,0 +1,16 @@
+package org.jbehave.examples.trader.scenarios;
+
+import org.jbehave.examples.trader.PtTraderScenario;
+
+
+public class PtTraderIsAlertedOfStatus extends PtTraderScenario {
+
+ public PtTraderIsAlertedOfStatus() {
+ this(Thread.currentThread().getContextClassLoader());
+ }
+
+ public PtTraderIsAlertedOfStatus(final ClassLoader classLoader) {
+ super(classLoader);
+ }
+
+}
Index:
src/main/java/org/jbehave/examples/trader/scenarios/pt_trader_is_alerted_of_status.cenario
===================================================================
---
src/main/java/org/jbehave/examples/trader/scenarios/pt_trader_is_alerted_of_status.cenario
(revision 0)
+++
src/main/java/org/jbehave/examples/trader/scenarios/pt_trader_is_alerted_of_status.cenario
(revision 0)
@@ -0,0 +1,15 @@
+Cenário:
+Para assegurar uma resposta rápida
+Como um negociante que fala português
+Quero monitorar os preços das ações
+
+Dado que há uma ação com sÃmbolo STK1 e um limite de 15.0
+Quando a ação é oferecida ao preço de 5.0
+Então o estado de alerta é OFF
+Quando a ação é oferecida ao preço de 11.0
+Então o estado de alerta é OFF
+Quando a ação é oferecida ao preço de 16.0
+Então o estado de alerta é ON
+Quando a ação é oferecida ao preço de 20.0
+Então o estado de alerta é ON
+
Index: src/main/java/org/jbehave/examples/trader/PtTraderScenario.java
===================================================================
--- src/main/java/org/jbehave/examples/trader/PtTraderScenario.java
(revision 0)
+++ src/main/java/org/jbehave/examples/trader/PtTraderScenario.java
(revision 0)
@@ -0,0 +1,47 @@
+package org.jbehave.examples.trader;
+
+import java.util.Locale;
+
+import org.jbehave.scenario.JUnitScenario;
+import org.jbehave.scenario.PropertyBasedConfiguration;
+import org.jbehave.scenario.definition.KeyWords;
+import org.jbehave.scenario.i18n.I18nKeyWords;
+import org.jbehave.scenario.parser.ClasspathScenarioDefiner;
+import org.jbehave.scenario.parser.PatternScenarioParser;
+import org.jbehave.scenario.parser.ScenarioDefiner;
+import org.jbehave.scenario.parser.UnderscoredCamelCaseResolver;
+import org.jbehave.scenario.reporters.PrintStreamScenarioReporter;
+import org.jbehave.scenario.reporters.ScenarioReporter;
+
+public class PtTraderScenario extends JUnitScenario {
+
+ public PtTraderScenario() {
+ this(Thread.currentThread().getContextClassLoader());
+ }
+
+ public PtTraderScenario(final ClassLoader classLoader) {
+ super(new PropertyBasedConfiguration() {
+ @Override
+ public ScenarioDefiner forDefiningScenarios() {
+ // use underscored camel case scenario files
with extension ".cenario"
+ return new ClasspathScenarioDefiner(
+ new
UnderscoredCamelCaseResolver(".cenario"),
+ new
PatternScenarioParser(this), classLoader);
+ }
+
+ @Override
+ public ScenarioReporter forReportingScenarios() {
+ // report outcome in Brazilian Portuguese (to
System.out)
+ return new PrintStreamScenarioReporter(new
I18nKeyWords(new Locale("pt-BR")));
+ }
+
+ @Override
+ public KeyWords keywords() {
+ // use Brazilian Portuguese for keywords
+ return new I18nKeyWords(new Locale("pt-BR"));
+ }
+
+ }, new PtTraderSteps(classLoader));
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email