Fixed failing tests in TaskFormProcessorTest caused by AssociationFieldProcessor not converting the values from NodeRefs to Strings.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21173 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
N Smith
2010-07-14 15:29:30 +00:00
parent 650f4e4b8d
commit a7d55e7fe4
2 changed files with 4 additions and 4 deletions

View File

@@ -72,7 +72,7 @@ public class AssociationFieldProcessor extends QNameFieldProcessor<AssociationDe
{ {
return getValues((Collection<?>) values); return getValues((Collection<?>) values);
} }
return Collections.singletonList(values); return Collections.singletonList(values.toString());
} }
private List<String> getValues(Collection<?> collection) private List<String> getValues(Collection<?> collection)

View File

@@ -155,14 +155,14 @@ public class TaskFormProcessorTest extends TestCase
List<String> fields = Arrays.asList(fieldName); List<String> fields = Arrays.asList(fieldName);
Form form = processForm(fields); Form form = processForm(fields);
Serializable fieldData = (Serializable) Arrays.asList(FAKE_NODE.toString()); Serializable fieldData = (Serializable) Arrays.asList(FAKE_NODE.toString());
// checkSingleAssociation(form, fieldName, fieldData); checkSingleAssociation(form, fieldName, fieldData);
// Check Assignee field is added to Form, when explicitly typed as an // Check Assignee field is added to Form, when explicitly typed as an
// association. // association.
String fullAssociationName = "assoc:" + fieldName; String fullAssociationName = "assoc:" + fieldName;
fields = Arrays.asList(fullAssociationName); fields = Arrays.asList(fullAssociationName);
form = processForm(fields); form = processForm(fields);
// checkSingleAssociation(form, fieldName, fieldData); checkSingleAssociation(form, fieldName, fieldData);
} }
public void testIgnoresUnknownFields() throws Exception public void testIgnoresUnknownFields() throws Exception
@@ -187,7 +187,7 @@ public class TaskFormProcessorTest extends TestCase
Serializable fieldData = (Serializable) Arrays.asList(FAKE_NODE.toString()); Serializable fieldData = (Serializable) Arrays.asList(FAKE_NODE.toString());
FormData formData = form.getFormData(); FormData formData = form.getFormData();
assertEquals(4, formData.getNumberOfFields()); assertEquals(4, formData.getNumberOfFields());
// assertEquals(fieldData, formData.getFieldData("assoc_bpm_assignee").getValue()); assertEquals(fieldData, formData.getFieldData("assoc_bpm_assignee").getValue());
assertEquals(WorkflowTaskState.IN_PROGRESS, formData.getFieldData("prop_bpm_status").getValue()); assertEquals(WorkflowTaskState.IN_PROGRESS, formData.getFieldData("prop_bpm_status").getValue());
} }