mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged DEV/FORMS to HEAD (r13057-13069)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13070 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -90,6 +90,7 @@ public class FormServiceImplTest extends BaseAlfrescoSpringTest
|
||||
/**
|
||||
* Called during the transaction setup
|
||||
*/
|
||||
@Override
|
||||
protected void onSetUpInTransaction() throws Exception
|
||||
{
|
||||
super.onSetUpInTransaction();
|
||||
@@ -295,21 +296,22 @@ public class FormServiceImplTest extends BaseAlfrescoSpringTest
|
||||
FormData data = form.getFormData();
|
||||
assertNotNull("Expecting form data", data);
|
||||
Map<String, FormData.FieldData> fieldData = data.getData();
|
||||
assertEquals(VALUE_TITLE, fieldData.get("cm:title").getValue());
|
||||
assertEquals(VALUE_DESCRIPTION, fieldData.get("cm:description").getValue());
|
||||
assertEquals(VALUE_ORIGINATOR, fieldData.get("cm:originator").getValue());
|
||||
assertEquals(VALUE_ADDRESSEE, fieldData.get("cm:addressee").getValue());
|
||||
assertEquals(VALUE_ADDRESSEES1, fieldData.get("cm:addressees_0").getValue());
|
||||
assertEquals(VALUE_ADDRESSEES2, fieldData.get("cm:addressees_1").getValue());
|
||||
assertEquals(VALUE_SUBJECT, fieldData.get("cm:subjectline").getValue());
|
||||
assertNotNull("Expecting field data", fieldData);
|
||||
assertEquals(VALUE_TITLE, fieldData.get("prop:cm:title").getValue());
|
||||
assertEquals(VALUE_DESCRIPTION, fieldData.get("prop:cm:description").getValue());
|
||||
assertEquals(VALUE_ORIGINATOR, fieldData.get("prop:cm:originator").getValue());
|
||||
assertEquals(VALUE_ADDRESSEE, fieldData.get("prop:cm:addressee").getValue());
|
||||
assertEquals(VALUE_ADDRESSEES1, fieldData.get("prop:cm:addressees_0").getValue());
|
||||
assertEquals(VALUE_ADDRESSEES2, fieldData.get("prop:cm:addressees_1").getValue());
|
||||
assertEquals(VALUE_SUBJECT, fieldData.get("prop:cm:subjectline").getValue());
|
||||
|
||||
Calendar calTestValue = Calendar.getInstance();
|
||||
calTestValue.setTime(VALUE_SENT_DATE);
|
||||
Calendar calServiceValue = Calendar.getInstance();
|
||||
calServiceValue.setTime((Date)fieldData.get("cm:sentdate").getValue());
|
||||
calServiceValue.setTime((Date)fieldData.get("prop:cm:sentdate").getValue());
|
||||
assertEquals(calTestValue.getTimeInMillis(), calServiceValue.getTimeInMillis());
|
||||
|
||||
List<String> targets = (List<String>)fieldData.get("cm:references").getValue();
|
||||
List<String> targets = (List<String>)fieldData.get("assoc:cm:references").getValue();
|
||||
assertEquals("Expecting 1 target", 1, targets.size());
|
||||
assertEquals(this.associatedDoc.toString(), targets.get(0));
|
||||
}
|
||||
|
@@ -102,20 +102,20 @@ function testGetFormForContentNode()
|
||||
test.assertNotNull(fieldData, "fieldData should not be null.");
|
||||
test.assertNotNull(fieldData.length, "fieldData.length should not be null.");
|
||||
|
||||
test.assertEquals("This is the title for the test document", fieldData["cm:title"].value);
|
||||
test.assertEquals("This is the description for the test document", fieldData["cm:description"].value);
|
||||
test.assertEquals("fred@customer.com", fieldData["cm:originator"].value);
|
||||
test.assertEquals("bill@example.com", fieldData["cm:addressee"].value);
|
||||
test.assertEquals("harry@example.com", fieldData["cm:addressees_0"].value);
|
||||
test.assertEquals("jane@example.com", fieldData["cm:addressees_1"].value);
|
||||
test.assertEquals("The subject is...", fieldData["cm:subjectline"].value);
|
||||
test.assertEquals("This is the title for the test document", fieldData["prop:cm:title"].value);
|
||||
test.assertEquals("This is the description for the test document", fieldData["prop:cm:description"].value);
|
||||
test.assertEquals("fred@customer.com", fieldData["prop:cm:originator"].value);
|
||||
test.assertEquals("bill@example.com", fieldData["prop:cm:addressee"].value);
|
||||
test.assertEquals("harry@example.com", fieldData["prop:cm:addressees_0"].value);
|
||||
test.assertEquals("jane@example.com", fieldData["prop:cm:addressees_1"].value);
|
||||
test.assertEquals("The subject is...", fieldData["prop:cm:subjectline"].value);
|
||||
|
||||
//TODO Might add the equivalent of the VALUE_SENT_DATE testing here.
|
||||
// In the meantime I'll use JavaScript's own Date object to assert that it is a valid date.
|
||||
var sentDate = fieldData["cm:sentdate"].value;
|
||||
var sentDate = fieldData["prop:cm:sentdate"].value;
|
||||
test.assertFalse(isNaN(Date.parse(sentDate)));
|
||||
|
||||
var targets = fieldData["cm:references"].value;
|
||||
var targets = fieldData["assoc:cm:references"].value;
|
||||
test.assertEquals(1, targets.length);
|
||||
test.assertEquals(testAssociatedDoc, targets[0]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user