mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Attempt to reinstate some of the invalid character tests
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2839 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.dictionary.constraint;
|
package org.alfresco.repo.dictionary.constraint;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -23,6 +24,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.i18n.I18NUtil;
|
import org.alfresco.i18n.I18NUtil;
|
||||||
import org.alfresco.repo.dictionary.DictionaryDAOTest;
|
import org.alfresco.repo.dictionary.DictionaryDAOTest;
|
||||||
import org.alfresco.service.cmr.dictionary.Constraint;
|
import org.alfresco.service.cmr.dictionary.Constraint;
|
||||||
@@ -38,6 +40,7 @@ import org.alfresco.service.cmr.dictionary.DictionaryException;
|
|||||||
*
|
*
|
||||||
* @author Derek Hulley
|
* @author Derek Hulley
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class ConstraintsTest extends TestCase
|
public class ConstraintsTest extends TestCase
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@@ -229,10 +232,8 @@ public class ConstraintsTest extends TestCase
|
|||||||
public void testRegexConstraintFilename() throws Exception
|
public void testRegexConstraintFilename() throws Exception
|
||||||
{
|
{
|
||||||
// we assume UTF-8
|
// we assume UTF-8
|
||||||
String expression = ".*[\\\"\\*\\\\\\>\\<\\?\\/\\:\\|\\xA3\\xAC\\%\\&\\+\\;]+.*";
|
String expression = new String(".*[\\\"\\*\\\\\\>\\<\\?\\/\\:\\|\\¬\\£\\%\\&\\+\\;]+.*".getBytes("UTF-8"));
|
||||||
String invalidChars = "\"*\\><?/:|%&+;";
|
String invalidChars = new String("\"*\\><?/:|%&+;£".getBytes("UTF-8"));
|
||||||
// TODO: re-instate these after talking to Derek
|
|
||||||
String temp = "£";
|
|
||||||
|
|
||||||
RegexConstraint constraint = new RegexConstraint();
|
RegexConstraint constraint = new RegexConstraint();
|
||||||
constraint.setExpression(expression);
|
constraint.setExpression(expression);
|
||||||
|
Reference in New Issue
Block a user