* value in <code>portlet.xml</code>.
* @return the test result.
*/
private TestResult doCheckDefaultPreference(PortletRequest request,
String preferenceName) {
TestResult result = new TestResult();
result.setDescription("Ensure proper default is returned when "
+ "a non-existing/value-undefined preference is requested.");
result.setSpecPLT("14.1");
PortletPreferences preferences = request.getPreferences();
String value = preferences.getValue(preferenceName, DEF_VALUE);
String[] values = preferences.getValues(preferenceName,
new String[] { DEF_VALUE });
if (DEF_VALUE.equals(value)
&& values != null && values.length == 1
&& DEF_VALUE.equals(values[0])) {
result.setReturnCode(TestResult.PASSED);
} else if (!DEF_VALUE.equals(value)) {
TestUtils.failOnAssertion("preference value", value, DEF_VALUE, result);
} else {
TestUtils.failOnAssertion("preference values",
values,