Change file modified date on returned content from web script of type 'ContentStream', fix for SLNG- 894, change relating to SLNG-989, assertNotNull added to JS unit test API

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10223 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-08-04 12:06:19 +00:00
parent 009c223479
commit 3ad973621f
3 changed files with 28 additions and 1 deletions

View File

@@ -2165,8 +2165,17 @@ public class ScriptNode implements Serializable, Scopeable
*/ */
public String[] getTags() public String[] getTags()
{ {
String[] result = null;
List<String> tags = this.services.getTaggingService().getTags(this.nodeRef); List<String> tags = this.services.getTaggingService().getTags(this.nodeRef);
return (String[])tags.toArray(new String[tags.size()]); if (tags.isEmpty() == true)
{
result = new String[0];
}
else
{
result = (String[])tags.toArray(new String[tags.size()]);
}
return result;
} }
/** /**

View File

@@ -49,6 +49,23 @@ public class ScriptTestUtils extends BaseScopableProcessorExtension
} }
} }
public void assertNotEquals(Object expected, Object value)
{
assertNotEquals(expected, value, null);
}
public void assertNotEquals(Object expected, Object value, String message)
{
if (expected.equals(value) == true)
{
if (message == null)
{
message = "Expected value '" + expected + "' should not match recieved value '" + value + "'";
}
throw new AlfrescoRuntimeException(message);
}
}
public void assertNotNull(Object value) public void assertNotNull(Object value)
{ {
assertNotNull(value, null); assertNotNull(value, null);

View File

@@ -14,6 +14,7 @@ function testAddRemoveTag()
{ {
var tags = document.tags; var tags = document.tags;
test.assertNotNull(tags); test.assertNotNull(tags);
test.assertNotEquals(undefined, tags);
test.assertEquals(0, tags.length); test.assertEquals(0, tags.length);
document.properties.title = "A change is as good as a rest!"; document.properties.title = "A change is as good as a rest!";