Merged V2.2 to HEAD

8371: Merged V2.1 to V2.2
      8307: Next round of fixes for session management.
      8309: Fixed AR-1891: Long MLText strings fail in Oracle
      8313: Fix for case where existing MLText entry is null
      8319: Follow-up fix for NPE where StringValue is null when persisting
      8331: Fix for AR-1696: Long text in an aspect property causes an exception


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8496 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2008-03-11 06:03:17 +00:00
parent 78c695fc0a
commit ceed05d26f
40 changed files with 1276 additions and 1445 deletions

View File

@@ -25,6 +25,7 @@
package org.alfresco.repo.attributes;
import java.rmi.server.LogStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -82,7 +83,7 @@ public class AttributeServiceTest extends TestCase
}
}
public void testBasic()
public void testBasic() throws Exception
{
try
{
@@ -126,15 +127,30 @@ public class AttributeServiceTest extends TestCase
}
catch (Exception e)
{
e.printStackTrace();
fail();
throw e;
}
}
public void testLongStrings() throws Exception
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1000; i++)
{
sb.append(i);
}
String longStr = sb.toString();
StringAttributeValue attributeValue = new StringAttributeValue(longStr);
fService.setAttribute("", "long-string", attributeValue);
// Check that we can get it back
Attribute checkAttribute = fService.getAttribute("long-string");
String checkStr = checkAttribute.getStringValue();
assertEquals("Retrieved String is not the same as the persisted one", longStr, checkStr);
}
/**
* Test the query capability.
*/
public void testQuery()
public void testQuery() throws Exception
{
try
{
@@ -236,12 +252,11 @@ public class AttributeServiceTest extends TestCase
}
catch (Exception e)
{
e.printStackTrace();
fail();
throw e;
}
}
public void testDelete()
public void testDelete() throws Exception
{
try
{
@@ -290,14 +305,14 @@ public class AttributeServiceTest extends TestCase
}
catch (Exception e)
{
e.printStackTrace();
throw e;
}
}
/**
* Test ListAttributes
*/
public void testList()
public void testList() throws Exception
{
try
{
@@ -344,8 +359,7 @@ public class AttributeServiceTest extends TestCase
}
catch (Exception e)
{
e.printStackTrace();
fail();
throw e;
}
}
}