/** * Create a new Parameter with all of the values of the given Parameter except for it's Type * * @param param A Parameter * @param type The new Class type * @return A new Parameter */ private Parameter changeParamType(Parameter param, Class type) { return new Parameter( param.getName(), type, param.getTitle(), param.getDescription(), param.isRequired(), param.getMinOccurs(), param.getMaxOccurs(), param.getDefaultValue(), null); } }
assertEquals("geom title", "Input Geometry", geomParam.getTitle().toString()); assertEquals( "geom description", "The target geometry.", geomParam.getDescription().toString()); assertEquals("geom type", Geometry.class, geomParam.getType()); "distance description", "The distance by which to buffer the geometry.", distance.getDescription().toString()); assertEquals("distance type", Double.class, distance.getType());
Parameter<?> first = inputs.get("first"); assertEquals("first title", "First Operand", first.getTitle().toString()); assertEquals("first description", "The first operand.", first.getDescription().toString()); assertEquals("first type", Float.class, first.getType()); assertEquals("second title", "Second Operand", second.getTitle().toString()); assertEquals( "second description", "The second operand.", second.getDescription().toString()); assertEquals("second type", Float.class, second.getType()); "sum description", "The sum of the two inputs", sumParam.getDescription().toString()); assertEquals("sum type", Float.class, sumParam.getType());