Unit test fix for PostgreSQL (which does not support '\u0000' embedded in a string)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19992 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2010-04-26 15:42:35 +00:00
parent 6239095959
commit f367dd8e74
3 changed files with 47 additions and 5 deletions

View File

@@ -97,6 +97,8 @@ import org.alfresco.util.CachingDateFormat;
import org.alfresco.util.ISO9075;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.springframework.context.ApplicationContext;
import org.springframework.extensions.surf.util.I18NUtil;
@@ -210,6 +212,9 @@ public class ADMLuceneTest extends TestCase implements DictionaryListener
private NodeRef n15;
private M2Model model;
// TODO: pending replacement
private Dialect dialect;
/**
*
@@ -240,6 +245,8 @@ public class ADMLuceneTest extends TestCase implements DictionaryListener
public void setUp() throws Exception
{
dialect = (Dialect) ctx.getBean("dialect");
nodeService = (NodeService) ctx.getBean("dbNodeService");
dictionaryService = (DictionaryService) ctx.getBean("dictionaryService");
dictionaryDAO = (DictionaryDAO) ctx.getBean("dictionaryDAO");
@@ -5927,7 +5934,13 @@ public class ADMLuceneTest extends TestCase implements DictionaryListener
public void testAddEscapedChild() throws Exception
{
String COMPLEX_LOCAL_NAME = "\u0020\u0060\u00ac\u00a6\u0021\"\u00a3\u0024\u0025\u005e\u0026\u002a\u0028\u0029\u002d\u005f\u003d\u002b\t\n\\\u0000\u005b\u005d\u007b\u007d\u003b\u0027\u0023\u003a\u0040\u007e\u002c\u002e\u002f\u003c\u003e\u003f\\u007c\u005f\u0078\u0054\u0036\u0035\u0041\u005f";
if (dialect instanceof PostgreSQLDialect)
{
// Note: PostgreSQL does not support \u0000 char embedded in a string
// http://archives.postgresql.org/pgsql-jdbc/2007-02/msg00115.php
COMPLEX_LOCAL_NAME = "\u0020\u0060\u00ac\u00a6\u0021\"\u00a3\u0024\u0025\u005e\u0026\u002a\u0028\u0029\u002d\u005f\u003d\u002b\t\n\\\u005b\u005d\u007b\u007d\u003b\u0027\u0023\u003a\u0040\u007e\u002c\u002e\u002f\u003c\u003e\u003f\\u007c\u005f\u0078\u0054\u0036\u0035\u0041\u005f";
}
luceneFTS.pause();
buildBaseIndex();
runBaseTests();