/** * Casts the specified value into a string. * @param value value to cast as a string. * @param separator string to use as a separator. * @return <code>value</code> as a string. */ public static String getValue(List<String> value, String separator) { return ValueList.toString(value, separator); }
/** * Tests the {@link ValueList#listValueAt(int, String)} method. */ @Test public void testListValues() { Vector<String> data; data = new Vector<String>(); data.add(ValueList.toString(createIntegerData(), ";")); data.add(ValueList.toString(createIntegerData(), ";")); data.add(ValueList.toString(createIntegerData(), ";")); data.add(ValueList.toString(createFloatData(), ";")); data.add(ValueList.toString(createFloatData(), ";")); data.add(ValueList.toString(createBooleanData(), ";")); testListValues(new ValueList(ValueList.toString(data, " - "), " - ") , ";"); } }
/** * Tests the {@link ValueList#longValueAt(int)} method. */ @Test public void testLongValues() { testLongValues(new ValueList(ValueList.toString(createIntegerData(), ";"), ";")); }
/** * Tests the {@link ValueList#valueAt(int)} method. */ @Test public void testStringValues() { testStringValues(new ValueList(ValueList.toString(createIntegerData(), ";"), ";")); }
/** * Tests the {@link ValueList#integerValueAt(int)} method. */ @Test public void testIntegerValues() { testIntegerValues(new ValueList(ValueList.toString(createIntegerData(), ";"), ";")); }
/** * Tests the {@link ValueList#booleanValueAt(int)} method. */ @Test public void testBooleanValues() { testBooleanValues(new ValueList(ValueList.toString(createBooleanData(), ";"), ";")); }
/** * Tests the {@link ValueList#floatValueAt(int)} method. */ @Test public void testFloatValues() { testFloatValues(new ValueList(ValueList.toString(createFloatData(), ";"), ";")); }
/** * Tests the {@link ValueList#doubleValueAt(int)} method. */ @Test public void testDoubleValues() { testDoubleValues(new ValueList(ValueList.toString(createFloatData(), ";"), ";")); }
/** * Tests list events. */ @Test public void testListEvents() { ConfigurationEvent event; // Makes sure the value passed to the constructor is properly returned. event = new ConfigurationEvent(conf, VARIABLE_NAME, ValueList.toString(LIST_VALUE, ";")); assert LIST_VALUE.equals(event.getListValue(";")); // Makes sure unset values are returned as null. event = new ConfigurationEvent(conf, VARIABLE_NAME, null); assert null == event.getListValue(";"); }