[jbehave-dev] problems with extending JBehave

2014-11-07 Thread Willemijn Wouters
Hello,

I work on a opensource project called Unitils
 and at the moment we are working on a
project called unitils-jbehave
. Unitils-jbehave is the
glue between Unitils & JBehave.
But we have had some difficulties because of the fact that so many things
are private.

Is it possible to put the following things on 'protected'?

*The following methods of **org.jbehave.core.steps.Steps:*

o   org.jbehave.core.steps.Steps.scenarioStepsHaving(ScenarioType, Stage,
Class, Outcome...)

o   org.jbehave.core.steps.Steps.createBeforeOrAfterStep(Stage, Method)

o   org.jbehave.core.steps.Steps.createBeforeOrAfterStep(Stage, Method)

o   org.jbehave.core.steps.Steps.scenarioOutcome(Method, Class)

o   org.jbehave.core.steps.Steps.createCandidate(Method, StepType, String,
int, Configuration)
*The following methods in **org.jbehave.core.steps.InstanceStepsFactory: *
org.jbehave.core.steps.AbstractStepsFactory.methodReturningConverters(Class)


*The following classes/methods in **org.jbehave.core.steps.StepCreator:*

o   all the inner classes

o
org.unitils.jbehave.core.stepcreator.UnitilsStepCreator.StepCreatorBeforeOrAfterStep.paramConvertersWithExceptionInjector(UUIDExceptionWrapper)

Thanks.


[jbehave-scm] [scm-core][2/2] JBEHAVE-1053: Added restarting.story to verify restarting behaviour.

2014-11-07 Thread Mauro Talevi
commit 42f0cf699db8d65caa0845776dd868e12585abca
Author: Mauro Talevi 
AuthorDate: Fri, 7 Nov 2014 13:38:19 +0100
Commit: Mauro Talevi 
CommitDate: Fri, 7 Nov 2014 13:38:19 +0100

JBEHAVE-1053:  Added restarting.story to verify restarting behaviour.

diff --git 
a/examples/core/src/main/java/org/jbehave/examples/core/CoreStories.java 
b/examples/core/src/main/java/org/jbehave/examples/core/CoreStories.java
index 6086157..b865bb1 100755
--- a/examples/core/src/main/java/org/jbehave/examples/core/CoreStories.java
+++ b/examples/core/src/main/java/org/jbehave/examples/core/CoreStories.java
@@ -48,6 +48,7 @@ import org.jbehave.examples.core.steps.MyContext;
 import org.jbehave.examples.core.steps.NamedParametersSteps;
 import org.jbehave.examples.core.steps.PendingSteps;
 import org.jbehave.examples.core.steps.PriorityMatchingSteps;
+import org.jbehave.examples.core.steps.RestartingSteps;
 import org.jbehave.examples.core.steps.SandpitSteps;
 import org.jbehave.examples.core.steps.SearchSteps;
 import org.jbehave.examples.core.steps.TableSteps;
@@ -116,7 +117,8 @@ public class CoreStories extends JUnitStories {
 return new InstanceStepsFactory(configuration(), new TraderSteps(new 
TradingService()), new AndSteps(),
 new MetaParametrisationSteps(), new CalendarSteps(), new 
PriorityMatchingSteps(), new PendingSteps(),
 new SandpitSteps(), new SearchSteps(), new BeforeAfterSteps(), 
new CompositeSteps(),
-new NamedParametersSteps(), new 
ExamplesTableParametersSteps(), new TableSteps(), new ContextSteps(context));
+new NamedParametersSteps(), new 
ExamplesTableParametersSteps(), new TableSteps(), 
+new ContextSteps(context), new RestartingSteps());
 }
 
 @Override
diff --git 
a/examples/core/src/main/java/org/jbehave/examples/core/steps/RestartingSteps.java
 
b/examples/core/src/main/java/org/jbehave/examples/core/steps/RestartingSteps.java
new file mode 100644
index 000..f6c3f48
--- /dev/null
+++ 
b/examples/core/src/main/java/org/jbehave/examples/core/steps/RestartingSteps.java
@@ -0,0 +1,28 @@
+package org.jbehave.examples.core.steps;
+
+import org.jbehave.core.annotations.When;
+import org.jbehave.core.failures.RestartingScenarioFailure;
+import org.jbehave.core.failures.RestartingStoryFailure;
+
+public class RestartingSteps {
+   private int restartingScenario;
+   private int restartingStory;
+
+   @When("I restart scenario")
+   public void restartScenario(){
+   if ( restartingScenario < 1 ){
+   restartingScenario++;
+   throw new RestartingScenarioFailure("Restarting 
scenario: "+restartingScenario);
+   }
+   }
+
+   @When("I restart story")
+   public void restartStory(){
+   if ( restartingStory < 1 ){
+   restartingStory++;
+   throw new RestartingStoryFailure("Restarting story: 
"+restartingStory);
+   }
+   }
+   
+}
+
diff --git 
a/examples/core/src/main/java/org/jbehave/examples/core/stories/Restarting.java 
b/examples/core/src/main/java/org/jbehave/examples/core/stories/Restarting.java
new file mode 100644
index 000..cc7bfa0
--- /dev/null
+++ 
b/examples/core/src/main/java/org/jbehave/examples/core/stories/Restarting.java
@@ -0,0 +1,15 @@
+package org.jbehave.examples.core.stories;
+
+import org.jbehave.core.steps.InjectableStepsFactory;
+import org.jbehave.core.steps.InstanceStepsFactory;
+import org.jbehave.examples.core.CoreStory;
+import org.jbehave.examples.core.steps.RestartingSteps;
+
+public class Restarting extends CoreStory {
+
+   @Override
+   public InjectableStepsFactory stepsFactory() {
+   return new InstanceStepsFactory(configuration(), new 
RestartingSteps());
+   }
+
+}
diff --git 
a/examples/core/src/main/java/org/jbehave/examples/core/stories/restarting.story
 
b/examples/core/src/main/java/org/jbehave/examples/core/stories/restarting.story
new file mode 100755
index 000..b4d5a34
--- /dev/null
+++ 
b/examples/core/src/main/java/org/jbehave/examples/core/stories/restarting.story
@@ -0,0 +1,8 @@
+
+Scenario: Restarting scenario
+
+When I restart scenario
+
+Scenario: Restarting story
+
+When I restart story





[jbehave-dev] [jira] (JBEHAVE-1053) Allow entire story to be restarted

2014-11-07 Thread Mauro Talevi (JIRA)
Title: Message Title










 

 Mauro Talevi commented on an issue











 






  Re: Allow entire story to be restarted 










Pulled commit and added restarting.story in core examples. 
Can you please add a story that can verify the multi-threading behaviour?












   

 Add Comment











 













 JBehave /  JBEHAVE-1053



  Allow entire story to be restarted 







 For selenium tests that keep the same browser / context throughout the story, there are countless things that can go wrong such as network latency, slow application, etc. Since a false positive can cause people to quickly lose trust in the tests, others advised that the story should restart "x" amount of times before failing the test.   There is a way to...















 This message was sent by Atlassian JIRA (v6.1.6#6162-sha1:7af547c)




 












-
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email




[jbehave-dev] [jira] (JBEHAVE-1053) Allow entire story to be restarted

2014-11-07 Thread Mauro Talevi (JIRA)
Title: Message Title










 

 Mauro Talevi updated an issue











 






 JBehave /  JBEHAVE-1053



  Allow entire story to be restarted 










Change By:

 Mauro Talevi




Fix Version/s:

 3.9.6












   

 Add Comment











 










 This message was sent by Atlassian JIRA (v6.1.6#6162-sha1:7af547c)




 












-
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email




Re: [jbehave-dev] problems with extending JBehave

2014-11-07 Thread Mauro Talevi
Hi,

the methods are private because they are internal and not meant to be an API.

Can you explain what you're trying to do? 

Cheers 

> On 7 Nov 2014, at 11:35, Willemijn Wouters  
> wrote:
> 
> Hello,
> 
> I work on a opensource project called Unitils and at the moment we are 
> working on a project called unitils-jbehave. Unitils-jbehave is the glue 
> between Unitils & JBehave.
> But we have had some difficulties because of the fact that so many things are 
> private.
> 
> Is it possible to put the following things on 'protected'?
> 
> The following methods of org.jbehave.core.steps.Steps:
> o   org.jbehave.core.steps.Steps.scenarioStepsHaving(ScenarioType, Stage, 
> Class, Outcome...)
> 
> o   org.jbehave.core.steps.Steps.createBeforeOrAfterStep(Stage, Method)
> 
> o   org.jbehave.core.steps.Steps.createBeforeOrAfterStep(Stage, Method)
> 
> o   org.jbehave.core.steps.Steps.scenarioOutcome(Method, Class Annotation>)
> 
> o   org.jbehave.core.steps.Steps.createCandidate(Method, StepType, String, 
> int, Configuration)
> 
> The following methods in org.jbehave.core.steps.InstanceStepsFactory: 
> org.jbehave.core.steps.AbstractStepsFactory.methodReturningConverters(Class)
> 
> The following classes/methods in org.jbehave.core.steps.StepCreator:
> o   all the inner classes
> 
> o   
> org.unitils.jbehave.core.stepcreator.UnitilsStepCreator.StepCreatorBeforeOrAfterStep.paramConvertersWithExceptionInjector(UUIDExceptionWrapper)
> 
> 
> Thanks.


[jbehave-dev] [jira] (JBEHAVE-1054) Regression: configuration method inherited from JUnitStories class not being overridden

2014-11-07 Thread Paul Sernatinger (JIRA)
Title: Message Title










 

 Paul Sernatinger created an issue











 






 JBehave /  JBEHAVE-1054



  Regression: configuration method inherited from JUnitStories class not being overridden 










Issue Type:

  Bug




Affects Versions:


 3.9.2




Assignee:


 Unassigned




Attachments:


 BaseJBehaveValidator.java, ExampleJBehaveValidator.java, MyStoryReporter.java




Components:


 Core




Created:


 07/Nov/14 2:31 PM




Priority:

  Major




Reporter:

 Paul Sernatinger










When creating a JUnitStories class, the overridden configuration method is no longer executed starting in JBehave 3.9.2.
I also tested this with 3.9.3, 3.9.5 and 4.0-beta-11 and the issue persists. Only by changing the dependency version in my POM back to 3.9.1 does the method override correctly again.
I have attached my StoryReporter class, the abstract class where the issue presents when version >= 3.9.2 and an example Embeddable JUnitRunner class that inherits from it.
MyStoryReporter.class is simply a Reporter that prints information to System.out where every callback pri