- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 23 Sep 2009 16:59:55 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/output In directory hutz:/tmp/cvs-serv20656/src/org/w3c/unicorn/output Modified Files: MailOutputModule.java Log Message: changed subject + add baseUri to the context Index: MailOutputModule.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/output/MailOutputModule.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MailOutputModule.java 23 Sep 2009 15:40:34 -0000 1.6 +++ MailOutputModule.java 23 Sep 2009 16:59:53 -0000 1.7 @@ -14,6 +14,7 @@ import javax.mail.internet.*; import java.util.*; +import org.w3c.unicorn.UnicornCall; import org.w3c.unicorn.util.Property; import org.w3c.unicorn.util.UnicornAuthenticator; @@ -64,6 +65,9 @@ public void produceOutput(Map<String, Object> mapOfStringObject, final Writer aWriter) { try { + + mapOfStringObject.put("baseUri", "http://qa-dev.w3.org:8001/unicorn/"); + Properties mailProps = Property.getProps("mail.properties"); Authenticator auth = new UnicornAuthenticator(mailProps.getProperty("unicorn.mail.username"), mailProps.getProperty("unicorn.mail.password")); Session session = Session.getDefaultInstance(mailProps, auth); @@ -77,12 +81,20 @@ InternetAddress addressFrom = new InternetAddress(mailProps.getProperty("unicorn.mail.from"), "Unicorn"); msg.setFrom(addressFrom); - - InternetAddress[] adresses = {new InternetAddress(recipient)}; - msg.setRecipients(Message.RecipientType.TO, adresses); + msg.setRecipient(Message.RecipientType.TO, new InternetAddress(recipient)); // Setting the Subject and Content Type - msg.setSubject("Unicorn results, " + new Date()); + UnicornCall uniCall = (UnicornCall) mapOfStringObject.get("unicorncall"); + boolean passed = ((UnicornCall) mapOfStringObject.get("unicorncall")).isPassed(); + + String subject = "[Unicorn] "; + if (passed) + subject += "SUCCEEDED: "; + else + subject += "FAILED: "; + subject += "Task \"" + uniCall.getTask().getLongName(mapOfOutputParameters.get("lang")) + "\" for \"" + uniCall.getDocumentName() + "\""; + + msg.setSubject(subject); CharArrayWriter writer = new CharArrayWriter(); mailOutputFormater.produceOutput(mapOfStringObject, writer);
Received on Wednesday, 23 September 2009 17:00:03 UTC