private SimpleDocument createFrenchSimpleAttachment() {
   String language = "fr";
   String fileName = "test.odp";
   String title = "Mon document de test";
   String description = "Ceci est un document de test";
   String creatorId = "10";
   Date creationDate = RandomGenerator.getRandomCalendar().getTime();
   SimpleAttachment file =
       new SimpleAttachment(
           fileName,
           language,
           title,
           description,
           "Ceci est un test".getBytes(Charsets.UTF_8).length,
           MimeTypes.MIME_TYPE_OO_PRESENTATION,
           creatorId,
           creationDate,
           null);
   SimpleDocumentPK pk = new SimpleDocumentPK(null, instanceId);
   pk.setOldSilverpeasId(5);
   SimpleDocument attachment = new HistorisedDocument();
   attachment.setPK(pk);
   attachment.setFile(file);
   attachment.setForeignId("12");
   return AttachmentServiceFactory.getAttachmentService()
       .createAttachment(
           attachment, new ByteArrayInputStream("Ceci est un test".getBytes(Charsets.UTF_8)));
 }
 /**
  * Test of convertXMLToNotificationData method, of class NotificationServerUtil.
  *
  * @throws Exception
  */
 @Test
 public void testConvertXMLToNotificationData() throws Exception {
   Date dateParam = RandomGenerator.getRandomCalendar().getTime();
   String p_XML =
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<NOTIFY>	<LOGIN>		<USER>"
           + "<![CDATA[user]]></USER>		<PASSWORD><![CDATA[password]]></PASSWORD>	</LOGIN>	"
           + "<MESSAGE><![CDATA[message]]></MESSAGE>	<SENDER>		<ID><![CDATA[bart.simpson@silverpeas"
           + ".com]]></ID>		<NAME><![CDATA[Bart Simpson]]></NAME>		<ANSWERALLOWED>true"
           + "</ANSWERALLOWED>	</SENDER>	<COMMENT><![CDATA[comment]]></COMMENT>	<TARGET CHANNEL=\"SMTP\">"
           + "		<NAME><![CDATA[Home Simpson]]></NAME>		<RECEIPT><![CDATA[receipt]]></RECEIPT>		"
           + "<PARAM><![CDATA[date=#DATE#"
           + dateParam.getTime()
           + ";string=bonjour le monde;; 0 + 0 == la tête à "
           + "toto]]></PARAM>	</TARGET>	<PRIORITY SPEED=\"fast\"/>	<REPORT>	</REPORT></NOTIFY>";
   NotificationData expResult = new NotificationData();
   Map<String, Object> params = new HashMap<String, Object>(2);
   params.put("string", "bonjour le monde; 0 + 0 = la tête à toto");
   params.put("date", dateParam);
   expResult.setAnswerAllowed(true);
   expResult.setComment("comment");
   expResult.setLoginPassword("password");
   expResult.setLoginUser("user");
   expResult.setMessage("message");
   expResult.setNotificationId(0L);
   expResult.setPrioritySpeed("fast");
   expResult.setSenderId("*****@*****.**");
   expResult.setSenderName("Bart Simpson");
   expResult.setTargetChannel("SMTP");
   expResult.setTargetName("Home Simpson");
   expResult.setTargetParam(params);
   expResult.setTargetReceipt("receipt");
   NotificationData result = NotificationServerUtil.convertXMLToNotificationData(p_XML);
   assertEquals(expResult, result);
 }