1 package test.net.sourceforge.pmd.properties; 2 3 import net.sourceforge.pmd.PropertyDescriptor; 4 import net.sourceforge.pmd.properties.FloatProperty; 5 6 8 public class FloatPropertyTest extends AbstractPropertyDescriptorTester { 9 10 public FloatPropertyTest() { 11 super(); 12 } 13 14 19 protected Object createValue(int count) { 20 21 if (count == 1) return new Float ((int)(System.currentTimeMillis() % 100)); 22 23 Float [] values = new Float [count]; 24 for (int i=0; i<values.length; i++) values[i] = (Float )createValue(1); 25 return values; 26 } 27 28 33 protected PropertyDescriptor createProperty(int maxCount) { 34 35 return maxCount == 1 ? 36 new FloatProperty("testFloat", "Test float property", 9.0f, 1.0f) : 37 new FloatProperty("testFloat", "Test float property", new float[] {-1,0,1,2}, 1.0f, maxCount); 38 } 39 40 } 41 | Popular Tags |