[jbehave-scm] [950] trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java: Ensure components are returned only if not null.

2008-09-28 Thread mauro
Title:  [950] trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java: Ensure components are returned only if not null.







Revision 950
Author mauro
Date 2008-09-28 10:25:43 -0500 (Sun, 28 Sep 2008)


Log Message
Ensure components are returned only if not null.

Modified Paths

trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java




Diff

Modified: trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java (949 => 950)

--- trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java	2008-09-27 17:27:10 UTC (rev 949)
+++ trunk/jbehave-core/src/java/org/jbehave/container/pico/AbstractPicoContainer.java	2008-09-28 15:25:43 UTC (rev 950)
@@ -47,10 +47,14 @@
 throw new ComponentNotFoundException(message);
 }
 if (key != null) {
+T component = null;
 // a key has been provided: return the component for that key
 for (ComponentAdapterT adapter : adapters) {
 if (key.equals(adapter.getComponentKey())) {
-return adapter.getComponentInstance(container, type);
+component = adapter.getComponentInstance(container, type);
+if ( component != null ){
+return component;
+}
 }
 }
 String message = format(No component registered in container of type {0} and for key {1}, type, key);










To unsubscribe from this list please visit:


http://xircles.codehaus.org/manage_email



[jbehave-scm] [951] trunk/jbehave-core/src/java/org/jbehave/scenario: JBEHAVE-134: Extracted CandidateSteps interface from Steps.

2008-09-28 Thread mauro
Title:  [951] trunk/jbehave-core/src/java/org/jbehave/scenario: JBEHAVE-134:  Extracted CandidateSteps interface from Steps.







Revision 951
Author mauro
Date 2008-09-28 11:33:06 -0500 (Sun, 28 Sep 2008)


Log Message
JBEHAVE-134:  Extracted CandidateSteps interface from Steps.

Modified Paths

trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioBehaviour.java
trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioRunnerBehaviour.java
trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java
trunk/jbehave-core/src/java/org/jbehave/scenario/AbstractScenario.java
trunk/jbehave-core/src/java/org/jbehave/scenario/JUnitScenario.java
trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java
trunk/jbehave-core/src/java/org/jbehave/scenario/ScenarioRunner.java
trunk/jbehave-core/src/java/org/jbehave/scenario/steps/CandidateStep.java
trunk/jbehave-core/src/java/org/jbehave/scenario/steps/StepCreator.java
trunk/jbehave-core/src/java/org/jbehave/scenario/steps/Steps.java
trunk/jbehave-core/src/java/org/jbehave/scenario/steps/UnmatchedToPendingStepCreator.java


Added Paths

trunk/jbehave-core/src/java/org/jbehave/scenario/steps/CandidateSteps.java




Diff

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioBehaviour.java (950 => 951)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioBehaviour.java	2008-09-28 15:25:43 UTC (rev 950)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioBehaviour.java	2008-09-28 16:33:06 UTC (rev 951)
@@ -13,6 +13,7 @@
 import org.jbehave.scenario.errors.PendingErrorStrategy;
 import org.jbehave.scenario.parser.ScenarioDefiner;
 import org.jbehave.scenario.reporters.ScenarioReporter;
+import org.jbehave.scenario.steps.CandidateSteps;
 import org.jbehave.scenario.steps.StepCreator;
 import org.jbehave.scenario.steps.Steps;
 import org.junit.Test;
@@ -28,7 +29,7 @@
 public void shouldLoadStoryDefinitionAndRunUsingTheScenarioRunner() throws Throwable {
 ScenarioRunner runner = mock(ScenarioRunner.class);
 MockedConfiguration configuration = new MockedConfiguration();
-Steps steps = mock(Steps.class);
+CandidateSteps steps = mock(Steps.class);
 RunnableScenario scenario = new MyScenario(runner, configuration, steps);
 
 StoryDefinition storyDefinition = new StoryDefinition(Blurb.EMPTY, Collections.EMPTY_LIST);
@@ -42,7 +43,7 @@
 private class MyScenario extends JUnitScenario {
 
 public MyScenario(ScenarioRunner runner,
-MockedConfiguration configuration, Steps steps) {
+MockedConfiguration configuration, CandidateSteps steps) {
 super(runner, configuration, steps);
 }
 


Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioRunnerBehaviour.java (950 => 951)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioRunnerBehaviour.java	2008-09-28 15:25:43 UTC (rev 950)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/ScenarioRunnerBehaviour.java	2008-09-28 16:33:06 UTC (rev 951)
@@ -16,6 +16,7 @@
 import org.jbehave.scenario.errors.PendingErrorStrategy;
 import org.jbehave.scenario.reporters.ScenarioReporter;
 import org.jbehave.scenario.steps.CandidateStep;
+import org.jbehave.scenario.steps.CandidateSteps;
 import org.jbehave.scenario.steps.Step;
 import org.jbehave.scenario.steps.StepCreator;
 import org.jbehave.scenario.steps.StepResult;
@@ -40,7 +41,7 @@
 
 ScenarioReporter reporter = mock(ScenarioReporter.class);
 StepCreator creator = mock(StepCreator.class);
-Steps mySteps = mock(Steps.class);
+CandidateSteps mySteps = mock(Steps.class);
 
 stub(mySteps.getSteps()).toReturn(someCandidateSteps);
 IllegalArgumentException anException = new IllegalArgumentException();
@@ -164,7 +165,7 @@
 stub(pendingStep.perform()).toReturn(StepResult.pending(pendingStep));
 stub(secondStep.perform()).toReturn(StepResult.success(secondStep));
 StepCreator creator = mock(StepCreator.class);
-Steps mySteps = mock(Steps.class);
+CandidateSteps mySteps = mock(Steps.class);
 
 ScenarioDefinition scenario1 = mock(ScenarioDefinition.class);
 ScenarioDefinition scenario2 = mock(ScenarioDefinition.class);


Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java (950 => 951)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java	2008-09-28 15:25:43 UTC (rev 950)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java	2008-09-28 16:33:06 UTC (rev 951)
@@ -16,7 +16,7 @@
 UnmatchedToPendingStepCreator creator = new UnmatchedToPendingStepCreator();
 
 CandidateStep candidate = mock(CandidateStep.class);
-Steps steps = 

[jbehave-dev] [jira] Created: (JBEHAVE-134) Extract CandidateSteps interface

2008-09-28 Thread Mauro Talevi (JIRA)
Extract CandidateSteps interface


 Key: JBEHAVE-134
 URL: http://jira.codehaus.org/browse/JBEHAVE-134
 Project: JBehave
  Issue Type: Improvement
Affects Versions: 2.0
Reporter: Mauro Talevi
Assignee: Mauro Talevi
 Fix For: 2.1


Extract CandidateSteps interface from Steps class so to allow composition over 
inheritance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email




[jbehave-scm] [952] trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java: Undeprecated Scenario to represent suggested entry point for developers - as per list discussion.

2008-09-28 Thread mauro
Title:  [952] trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java: Undeprecated Scenario to represent suggested entry point for developers - as per list discussion.







Revision 952
Author mauro
Date 2008-09-28 11:36:52 -0500 (Sun, 28 Sep 2008)


Log Message
Undeprecated Scenario to represent suggested entry point for developers - as per list discussion.

Modified Paths

trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java




Diff

Modified: trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java (951 => 952)

--- trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java	2008-09-28 16:33:06 UTC (rev 951)
+++ trunk/jbehave-core/src/java/org/jbehave/scenario/Scenario.java	2008-09-28 16:36:52 UTC (rev 952)
@@ -4,11 +4,10 @@
 
 /**
  * p
- * Scenario is deprecated to allow for support of multiple test frameworks.
- * Users should extend a scenario class that supports the desired test framework.
+ * Scenario represents the suggested entry point for the scenario developers. 
+ * Its a simple extension of JUnitScenario but users can choose to extend
+ * other abstract implementations of RunnableScenario.
  * /p
- * 
- * @deprecated Since 2.1 use JUnitScenario
  */
 public abstract class Scenario extends JUnitScenario {
 










To unsubscribe from this list please visit:


http://xircles.codehaus.org/manage_email