Merged V3.1 to HEAD

14192: Support for variable assignment and replacement in upgrade scripts
   14263 (RECORD ONLY)
   14286: Merged V2.2 to V3.1
      14124: Fixed ETWOTWO-961: FileFolderService.listFolders throws UnsupportedOperationException for AVM nodes
      14277: Fixed ETWOTWO-1228: CLONE -NodeService properties don't support collections of collections for d:any
   14302: Merged DEV/V3.1_UPGRADE_SCRIPTS_2 to V3.1: DB2 scripts and other minor changes
      14126 (RECORD ONLY)
      14193 (RECORD ONLY)
      14205: Next version of DB upgrade scripts for SQLServer and DB2
      14208: Enterprise DB scripts review: Move scripts to correct locations as a first pass
      14211: Carried V2.1-A script change into branch; use STR() function for numeric to string comparison
      14212: Moved script from old SQLServer dialect directory
      14213: Minor script formatting
   14303: Merged DEV/V3.1_UPGRADE_SCRIPTS_2 to V3.1: DB2 scripts and other formatting
      14214: Removed redundant scripts; these are all covered by generic scripts
      14236: Format SQL
      14248: Formatting of SQL to produce meaningful diffs
      14266: Next version of upgrade scripts
      14281: Clean up formatting of SQL scripts using Convert utility
   ___________________________________________________________________
   Modified: svn:mergeinfo
      Merged /alfresco/BRANCHES/DEV/V3.1_UPGRADE_SCRIPTS_2:r14126,14193,14205,14208,14211-14213
      Merged /alfresco/BRANCHES/V2.2:r14124,14130,14277
      Merged /alfresco/BRANCHES/V3.1:r14192,14263,14286,14302-14303


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14652 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-06-11 10:30:57 +00:00
parent 592a2bb2fc
commit 5b6ff13d94
7 changed files with 190 additions and 34 deletions

View File

@@ -32,6 +32,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -1430,6 +1431,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
assertTrue("Serialization/deserialization failed", checkPropertyQname instanceof QName);
}
@SuppressWarnings("unchecked")
public void testMultiProp() throws Exception
{
QName undeclaredPropQName = QName.createQName(NAMESPACE, getName());
@@ -1439,7 +1441,7 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathA"),
TYPE_QNAME_TEST_MULTIPLE_TESTER).getChildRef();
ArrayList<String> values = new ArrayList<String>(1);
ArrayList<Serializable> values = new ArrayList<Serializable>(1);
values.add("ABC");
values.add("DEF");
// test allowable conditions
@@ -1473,6 +1475,62 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
{
try { txn.rollback(); } catch (Throwable e) {}
}
txn = transactionService.getUserTransaction();
try
{
txn.begin();
// Check that multi-valued d:mltext can be collections of MLText
values.clear();
values.add(new MLText("ABC"));
values.add(new MLText("DEF"));
nodeService.setProperty(nodeRef, PROP_QNAME_MULTI_ML_VALUE, values);
List<Serializable> checkValues = (List<Serializable>) nodeService.getProperty(
nodeRef, PROP_QNAME_MULTI_ML_VALUE);
assertEquals("Expected 2 MLText values back", 2, checkValues.size());
assertTrue("Incorrect type in collection", checkValues.get(0) instanceof MLText);
assertTrue("Incorrect type in collection", checkValues.get(1) instanceof MLText);
// Check that multi-valued d:any properties can be collections of collections (empty)
// We put ArrayLists and HashSets into the Collection of d:any, so that is exactly what should come out
values.clear();
ArrayList<Serializable> arrayListVal = new ArrayList<Serializable>(2);
HashSet<Serializable> hashSetVal = new HashSet<Serializable>(2);
values.add(arrayListVal);
values.add(hashSetVal);
nodeService.setProperty(nodeRef, PROP_QNAME_ANY_PROP_MULTIPLE, values);
checkValues = (List<Serializable>) nodeService.getProperty(
nodeRef, PROP_QNAME_ANY_PROP_MULTIPLE);
assertEquals("Expected 2 Collection values back", 2, checkValues.size());
assertTrue("Incorrect type in collection", checkValues.get(0) instanceof ArrayList); // ArrayList in - ArrayList out
assertTrue("Incorrect type in collection", checkValues.get(1) instanceof HashSet); // HashSet in - HashSet out
// Check that multi-valued d:any properties can be collections of collections (with values)
// We put ArrayLists and HashSets into the Collection of d:any, so that is exactly what should come out
arrayListVal.add("ONE");
arrayListVal.add("TWO");
hashSetVal.add("ONE");
hashSetVal.add("TWO");
values.clear();
values.add(arrayListVal);
values.add(hashSetVal);
nodeService.setProperty(nodeRef, PROP_QNAME_ANY_PROP_MULTIPLE, values);
checkValues = (List<Serializable>) nodeService.getProperty(
nodeRef, PROP_QNAME_ANY_PROP_MULTIPLE);
assertEquals("Expected 2 Collection values back", 2, checkValues.size());
assertTrue("Incorrect type in collection", checkValues.get(0) instanceof ArrayList); // ArrayList in - ArrayList out
assertTrue("Incorrect type in collection", checkValues.get(1) instanceof HashSet); // HashSet in - HashSet out
assertEquals("First collection incorrect", 2, ((Collection)checkValues.get(0)).size());
assertEquals("Second collection incorrect", 2, ((Collection)checkValues.get(1)).size());
}
catch (DictionaryException e)
{
// expected
}
finally
{
try { txn.rollback(); } catch (Throwable e) {}
}
}
/**