Changeset 520:84587e916e10

Show
Ignore:
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:
1 modified

Legend:

Unmodified
Added
Removed
  • src/org/w3c/unicorn/output/MailOutputModule.java

    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 $ 
    22// Author: Damien LEROY. 
    33// (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. 
     
    1515 
    1616import java.util.*;  
     17import org.w3c.unicorn.UnicornCall; 
    1718import org.w3c.unicorn.util.Property; 
    1819import org.w3c.unicorn.util.UnicornAuthenticator; 
     
    6566             
    6667                try { 
     68                         
     69                        mapOfStringObject.put("baseUri", "http://qa-dev.w3.org:8001/unicorn/"); 
     70                         
    6771                        Properties mailProps = Property.getProps("mail.properties"); 
    6872                        Authenticator auth = new UnicornAuthenticator(mailProps.getProperty("unicorn.mail.username"), mailProps.getProperty("unicorn.mail.password")); 
     
    7882                    InternetAddress addressFrom = new InternetAddress(mailProps.getProperty("unicorn.mail.from"), "Unicorn"); 
    7983                        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)); 
    8385                         
    8486                        // 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); 
    8698                         
    8799                        CharArrayWriter writer = new CharArrayWriter();