Title: [1449] trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java: JBEHAVE-224: Enhanced behaviour verification to include conversion of lists of doubles and floats with NaN and Infinity values.
Revision
1449
Author
mauro
Date
2009-12-22 05:20:04 -0600 (Tue, 22 Dec 2009)

Log Message

JBEHAVE-224:  Enhanced behaviour verification to include conversion of lists of doubles and floats with NaN and Infinity values. 

Modified Paths

Diff

Modified: trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java (1448 => 1449)

--- trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java	2009-12-22 11:13:45 UTC (rev 1448)
+++ trunk/core/jbehave-core/src/behaviour/java/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java	2009-12-22 11:20:04 UTC (rev 1449)
@@ -90,20 +90,24 @@
         Type doublesType = SomeSteps.methodFor("aMethodWithListOfDoubles")
                 .getGenericParameterTypes()[0];
         List<Double> doubles = (List<Double>) converters.convert(
-                "3, 0.5, 0.0, 8.00", doublesType);
+                "3, 0.5, 0.0, 8.00, NaN, Infinity", doublesType);
         ensureThat(doubles.get(0), equalTo(3.0d));
         ensureThat(doubles.get(1), equalTo(0.5d));
         ensureThat(doubles.get(2), equalTo(0.0d));
         ensureThat(doubles.get(3), equalTo(8.00d));
+        ensureThat(doubles.get(4), equalTo(Double.NaN));
+        ensureThat(doubles.get(5), equalTo(Double.POSITIVE_INFINITY));
 
         Type floatsType = SomeSteps.methodFor("aMethodWithListOfFloats")
                 .getGenericParameterTypes()[0];
         List<Float> floats = (List<Float>) converters.convert(
-                "3, 0.5, 0.0, 8.00", floatsType);
+                "3, 0.5, 0.0, 8.00, NaN, -Infinity", floatsType);
         ensureThat(floats.get(0), equalTo(3.0f));
         ensureThat(floats.get(1), equalTo(0.5f));
         ensureThat(floats.get(2), equalTo(0.0f));
         ensureThat(floats.get(3), equalTo(8.00f));
+        ensureThat(floats.get(4), equalTo(Float.NaN));
+        ensureThat(floats.get(5), equalTo(Float.NEGATIVE_INFINITY));
 
         Type longsType = SomeSteps.methodFor("aMethodWithListOfLongs")
                 .getGenericParameterTypes()[0];


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to