Title: [1244] trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps: Better names for mock classes.
Revision
1244
Author
mauro
Date
2009-09-13 07:48:14 -0500 (Sun, 13 Sep 2009)

Log Message

Better names for mock classes.

Modified Paths


Diff

Modified: trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java (1243 => 1244)

--- trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java	2009-09-13 11:23:39 UTC (rev 1243)
+++ trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java	2009-09-13 12:48:14 UTC (rev 1244)
@@ -153,9 +153,9 @@
     
     @Test
     public void shouldMatchMethodParametersByAnnotatedNamesInNaturalOrder() throws Exception {
-    	NamedParameterStepsViaNamedAnnotation steps = new NamedParameterStepsViaNamedAnnotation();
+    	AnnotationNamedParameterSteps steps = new AnnotationNamedParameterSteps();
         CandidateStep candidateStep = new CandidateStep("I live on the $ith floor but some call it the $nth",
-        		NamedParameterStepsViaNamedAnnotation.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
+        		AnnotationNamedParameterSteps.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
         candidateStep.createFrom(tableRow, "When I live on the first floor but some call it the ground").perform();
         ensureThat(steps.ith, equalTo("first"));
         ensureThat(steps.nth, equalTo("ground"));
@@ -163,9 +163,9 @@
 
     @Test
     public void shouldMatchMethodParametersByAnnotatedNamesInverseOrder() throws Exception {
-    	NamedParameterStepsViaNamedAnnotation steps = new NamedParameterStepsViaNamedAnnotation();
+    	AnnotationNamedParameterSteps steps = new AnnotationNamedParameterSteps();
         CandidateStep candidateStep = new CandidateStep("I live on the $ith floor but some call it the $nth",
-        		NamedParameterStepsViaNamedAnnotation.methodFor("methodWithNamedParametersInInverseOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
+        		AnnotationNamedParameterSteps.methodFor("methodWithNamedParametersInInverseOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
         candidateStep.createFrom(tableRow, "When I live on the first floor but some call it the ground").perform();
         ensureThat(steps.ith, equalTo("first"));
         ensureThat(steps.nth, equalTo("ground"));
@@ -173,18 +173,18 @@
 
     @Test
     public void shouldCreateStepFromTableValuesViaAnnotations() throws Exception {
-    	NamedParameterStepsViaNamedAnnotation steps = new NamedParameterStepsViaNamedAnnotation();
+    	AnnotationNamedParameterSteps steps = new AnnotationNamedParameterSteps();
     	tableRow.put("ith", "first");
     	tableRow.put("nth", "ground");
         CandidateStep candidateStep = new CandidateStep("I live on the ith floor but some call it the nth",
-        		NamedParameterStepsViaNamedAnnotation.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
+        		AnnotationNamedParameterSteps.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
         candidateStep.createFrom(tableRow, "When I live on the <ith> floor but some call it the <nth>").perform();
         ensureThat(steps.ith, equalTo("first"));
         ensureThat(steps.nth, equalTo("ground"));
     }
     
     
-    public static class NamedParameterStepsViaNamedAnnotation extends Steps {
+    static class AnnotationNamedParameterSteps extends Steps {
     	String ith;
         String nth;
 
@@ -199,7 +199,7 @@
         }
 
         public static Method methodFor(String methodName) throws IntrospectionException {
-            BeanInfo beanInfo = Introspector.getBeanInfo(NamedParameterStepsViaNamedAnnotation.class);
+            BeanInfo beanInfo = Introspector.getBeanInfo(AnnotationNamedParameterSteps.class);
             for (MethodDescriptor md : beanInfo.getMethodDescriptors()) {
                 if (md.getMethod().getName().equals(methodName)) {
                     return md.getMethod();
@@ -211,9 +211,9 @@
 
     @Test
     public void shouldMatchMethodParametersByParanamerNamesInNaturalOrder() throws Exception {
-    	NamedParameterStepsViaParanamer steps = new NamedParameterStepsViaParanamer();
+    	ParanamerNamedParameterSteps steps = new ParanamerNamedParameterSteps();
         CandidateStep candidateStep = new CandidateStep("I live on the $ith floor but some call it the $nth",
-        		NamedParameterStepsViaParanamer.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
+        		ParanamerNamedParameterSteps.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
         candidateStep.useParanamer(paranamer);
         candidateStep.createFrom(tableRow, "When I live on the first floor but some call it the ground").perform();
         ensureThat(steps.ith, equalTo("first"));
@@ -222,9 +222,9 @@
 
     @Test
     public void shouldMatchMethodParametersByParanamerInverseOrder() throws Exception {
-    	NamedParameterStepsViaParanamer steps = new NamedParameterStepsViaParanamer();
+    	ParanamerNamedParameterSteps steps = new ParanamerNamedParameterSteps();
         CandidateStep candidateStep = new CandidateStep("I live on the $ith floor but some call it the $nth",
-        		NamedParameterStepsViaParanamer.methodFor("methodWithNamedParametersInInverseOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
+        		ParanamerNamedParameterSteps.methodFor("methodWithNamedParametersInInverseOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
         candidateStep.useParanamer(paranamer);
         candidateStep.createFrom(tableRow, "When I live on the first floor but some call it the ground").perform();
         ensureThat(steps.ith, equalTo("first"));
@@ -233,19 +233,18 @@
 
     @Test
     public void shouldCreateStepFromTableValuesViaParanamer() throws Exception {
-    	NamedParameterStepsViaParanamer steps = new NamedParameterStepsViaParanamer();
+    	ParanamerNamedParameterSteps steps = new ParanamerNamedParameterSteps();
     	tableRow.put("ith", "first");
     	tableRow.put("nth", "ground");
         CandidateStep candidateStep = new CandidateStep("I live on the ith floor but some call it the nth",
-        		NamedParameterStepsViaParanamer.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
+        		ParanamerNamedParameterSteps.methodFor("methodWithNamedParametersInNaturalOrder"), steps, PATTERN_BUILDER, MONITOR, new ParameterConverters(), "Given", "When", "Then");
         candidateStep.useParanamer(paranamer);
         candidateStep.createFrom(tableRow, "When I live on the <ith> floor but some call it the <nth>").perform();
         ensureThat(steps.ith, equalTo("first"));
         ensureThat(steps.nth, equalTo("ground"));
     }
 
-
-    public static class NamedParameterStepsViaParanamer extends Steps {
+    static class ParanamerNamedParameterSteps extends Steps {
     	String ith;
         String nth;
 
@@ -260,7 +259,7 @@
         }
 
         public static Method methodFor(String methodName) throws IntrospectionException {
-            BeanInfo beanInfo = Introspector.getBeanInfo(NamedParameterStepsViaParanamer.class);
+            BeanInfo beanInfo = Introspector.getBeanInfo(ParanamerNamedParameterSteps.class);
             for (MethodDescriptor md : beanInfo.getMethodDescriptors()) {
                 if (md.getMethod().getName().equals(methodName)) {
                     return md.getMethod();

Modified: trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java (1243 => 1244)

--- trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java	2009-09-13 11:23:39 UTC (rev 1243)
+++ trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java	2009-09-13 12:48:14 UTC (rev 1244)
@@ -17,7 +17,7 @@
 
 	@Test
     public void shouldProvideCandidateStepsCorrespondingToAnnotatedStepsWithMultipleAliases() {
-        MyStepsWithAliases steps = new MyStepsWithAliases();
+        MultipleAliasesSteps steps = new MultipleAliasesSteps();
         CandidateStep[] candidateSteps = steps.getSteps();
         ensureThat(candidateSteps.length, equalTo(9));
 
@@ -38,7 +38,7 @@
 
     @Test
     public void shouldProvideCandidateStepsCorrespondingToAnnotatedStepsWithSingleAlias() {
-        MyStepsWithAlias steps = new MyStepsWithAlias();
+        SingleAliasSteps steps = new SingleAliasSteps();
         CandidateStep[] candidateSteps = steps.getSteps();
         ensureThat(candidateSteps.length, equalTo(6));
 
@@ -56,7 +56,7 @@
 
     @Test
     public void shouldProvideStepsToBePerformedBeforeScenarios() {
-    	MyStepsWithAliases steps = new MyStepsWithAliases();
+    	MultipleAliasesSteps steps = new MultipleAliasesSteps();
     	List<Step> executableSteps = steps.runBeforeScenario();
 		ensureThat(executableSteps.size(), equalTo(1));
 		
@@ -66,7 +66,7 @@
     
     @Test
     public void shouldProvideStepsToBePerformedAfterScenarios() {
-    	MyStepsWithAliases steps = new MyStepsWithAliases();
+    	MultipleAliasesSteps steps = new MultipleAliasesSteps();
     	List<Step> executableSteps = steps.runAfterScenario();
     	ensureThat(executableSteps.size(), equalTo(3));
     	
@@ -82,7 +82,7 @@
     
     @Test
     public void shouldIgnoreSuccessfulStepsWhichArePerformedInUnsuccessfulScenarioOrViceVersa() {
-    	MyStepsWithAliases steps = new MyStepsWithAliases();
+    	MultipleAliasesSteps steps = new MultipleAliasesSteps();
     	List<Step> executableSteps = steps.runAfterScenario();
     	
     	executableSteps.get(0).doNotPerform();
@@ -109,7 +109,7 @@
     }
 
     
-    public static class MyStepsWithAliases extends Steps {
+    static class MultipleAliasesSteps extends Steps {
         
         private int givens;
         private int whens;
@@ -161,7 +161,7 @@
         
     }
 
-    public static class MyStepsWithAlias extends Steps {
+    static class SingleAliasSteps extends Steps {
 
         private int givens;
         private int whens;
@@ -187,7 +187,7 @@
 
     }
 
-    public static class DuplicateSteps extends Steps {
+    static class DuplicateSteps extends Steps {
         
         @org.jbehave.scenario.annotations.Given("a given")
         public void given() {


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to