Changeset 520:84587e916e10
- Timestamp:
- 09/23/09 16:59:53 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@521
- Message:
-
changed subject
+ add baseUri to the context
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r518
|
r520
|
|
| 1 | | // $Id: MailOutputModule.java,v 1.6 2009-09-23 15:40:34 tgambet Exp $ |
| | 1 | // $Id: MailOutputModule.java,v 1.7 2009-09-23 16:59:53 tgambet Exp $ |
| 2 | 2 | // Author: Damien LEROY. |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. |
| … |
… |
|
| 15 | 15 | |
| 16 | 16 | import java.util.*; |
| | 17 | import org.w3c.unicorn.UnicornCall; |
| 17 | 18 | import org.w3c.unicorn.util.Property; |
| 18 | 19 | import org.w3c.unicorn.util.UnicornAuthenticator; |
| … |
… |
|
| 65 | 66 | |
| 66 | 67 | try { |
| | 68 | |
| | 69 | mapOfStringObject.put("baseUri", "http://qa-dev.w3.org:8001/unicorn/"); |
| | 70 | |
| 67 | 71 | Properties mailProps = Property.getProps("mail.properties"); |
| 68 | 72 | Authenticator auth = new UnicornAuthenticator(mailProps.getProperty("unicorn.mail.username"), mailProps.getProperty("unicorn.mail.password")); |
| … |
… |
|
| 78 | 82 | InternetAddress addressFrom = new InternetAddress(mailProps.getProperty("unicorn.mail.from"), "Unicorn"); |
| 79 | 83 | msg.setFrom(addressFrom); |
| 80 | | |
| 81 | | InternetAddress[] adresses = {new InternetAddress(recipient)}; |
| 82 | | msg.setRecipients(Message.RecipientType.TO, adresses); |
| | 84 | msg.setRecipient(Message.RecipientType.TO, new InternetAddress(recipient)); |
| 83 | 85 | |
| 84 | 86 | // Setting the Subject and Content Type |
| 85 | | msg.setSubject("Unicorn results, " + new Date()); |
| | 87 | UnicornCall uniCall = (UnicornCall) mapOfStringObject.get("unicorncall"); |
| | 88 | boolean passed = ((UnicornCall) mapOfStringObject.get("unicorncall")).isPassed(); |
| | 89 | |
| | 90 | String subject = "[Unicorn] "; |
| | 91 | if (passed) |
| | 92 | subject += "SUCCEEDED: "; |
| | 93 | else |
| | 94 | subject += "FAILED: "; |
| | 95 | subject += "Task \"" + uniCall.getTask().getLongName(mapOfOutputParameters.get("lang")) + "\" for \"" + uniCall.getDocumentName() + "\""; |
| | 96 | |
| | 97 | msg.setSubject(subject); |
| 86 | 98 | |
| 87 | 99 | CharArrayWriter writer = new CharArrayWriter(); |