Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

83910: Reverse Merge HEAD-BUG-FIX (5.0/Cloud)
      <<Does not include 83538, 83539 as intended>>
      83891: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud)
         81657: Merged DEV to V4.2-BUG-FIX (4.2.4)
            78463 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
               - Tags containing \n chars should not be created 
            80398 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
               - Tags containing \n and | chars should not be created 
            80403 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
               - Replace bad \n and | characters to _ char patch 
         83538: MNT-12288 : Reverse Merge V4.2-BUG-FIX (4.2.4)
            << Caused upgrade failure as the patch relies on search >>
            81657 : Merged DEV to V4.2-BUG-FIX (4.2.4)
               78463 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
                  - Tags containing \n chars should not be created
               80398 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
                  - Tags containing \n and | chars should not be created
               80403 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
                  - Replace bad \n and | characters to _ char patch
         83539: Merged DEV to V4.2-BUG-FIX (4.2.4)
            78463 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
               - Tags containing \n chars should not be created
            80398 : MNT-11871 : Adding tag with name containing new lines (\n) breaks the tagging service.
               - Tags containing \n and | chars should not be created


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84596 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-09-18 17:17:02 +00:00
parent 03952f8551
commit b27d1c0dec
6 changed files with 2 additions and 209 deletions

View File

@@ -124,9 +124,6 @@ public class TaggingServiceImplTest extends TestCase
private static final String TAG_5 = "tag five";
private static final String TAG_I18N = "àâæçéèêëîïôœùûüÿñ";
private static final String BAD_TAG = "bad \n tag";
private static final String BAD_TAG2 = "Broken|2";
private static final String UPPER_TAG = "House";
private static final String LOWER_TAG = "house";
@@ -2162,55 +2159,4 @@ public class TaggingServiceImplTest extends TestCase
assertEquals(tags.get(1).getCount(), 20);
assertEquals(tags.get(2).getCount(), 1);
}
/* Test adding tags containing \n and | chars. Test all ways to create tag (e.g. createTag, addTag, setTags) */
public void testBadTags()
{
testTag(BAD_TAG);
testTag(BAD_TAG2);
}
private void testTag(final String tag)
{
this.transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>(){
@Override
public Void execute() throws Throwable
{
try
{
taggingService.createTag(storeRef, tag);
fail();
}
catch(IllegalArgumentException iae)
{
//
}
try
{
taggingService.addTag(document, tag);
fail();
}
catch(IllegalArgumentException iae)
{
//
}
try
{
List<String> setTags = new ArrayList<String>(2);
setTags.add(tag);
taggingService.setTags(document, setTags);
fail();
}
catch(IllegalArgumentException iae)
{
//
}
return null;
}
});
}
}