Search in sources :

Example 6 with EmailLogEntry

use of teammates.common.util.EmailLogEntry in project teammates by TEAMMATES.

the class EmailLogEntryTest method emailLog_withAppLogLine_constructCorrectly.

@Test
public void emailLog_withAppLogLine_constructCorrectly() {
    String logMessage = "TEAMMATESEMAILLOG|||myRecipient@email.com|||mySubject|||myContent";
    AppLogLine appLog = new AppLogLine();
    appLog.setLogMessage(logMessage);
    appLog.setTimeUsec(2456L);
    EmailLogEntry logEntry = new EmailLogEntry(appLog);
    assertEquals(logMessage, logEntry.generateLogMessage());
    assertEquals("myRecipient@email.com", logEntry.getReceiver());
    assertEquals("mySubject", logEntry.getSubject());
    assertEquals("myContent", logEntry.getContent());
    assertEquals(2L, logEntry.getTime());
    assertFalse(logEntry.isTestData());
}
Also used : EmailLogEntry(teammates.common.util.EmailLogEntry) AppLogLine(com.google.appengine.api.log.AppLogLine) Test(org.testng.annotations.Test)

Example 7 with EmailLogEntry

use of teammates.common.util.EmailLogEntry in project teammates by TEAMMATES.

the class AdminEmailLogPageData method initLogsAsTemplateRows.

private void initLogsAsTemplateRows(List<EmailLogEntry> entries) {
    logs = new ArrayList<>();
    for (EmailLogEntry entry : entries) {
        AdminEmailTableRow row = new AdminEmailTableRow(entry);
        logs.add(row);
    }
}
Also used : EmailLogEntry(teammates.common.util.EmailLogEntry) AdminEmailTableRow(teammates.ui.template.AdminEmailTableRow)

Example 8 with EmailLogEntry

use of teammates.common.util.EmailLogEntry in project teammates by TEAMMATES.

the class EmailLogEntryTest method emailLog_withEmailWrapper_constructCorrectly.

@Test
public void emailLog_withEmailWrapper_constructCorrectly() {
    EmailWrapper email = generateTypicalEmail();
    EmailLogEntry logEntry = new EmailLogEntry(email);
    assertEquals("TEAMMATESEMAILLOG|||myRecipient@email.tmt|||mySubject|||myContent", logEntry.generateLogMessage());
    assertEquals("myRecipient@email.tmt", logEntry.getReceiver());
    assertEquals("mySubject", logEntry.getSubject());
    assertEquals("myContent", logEntry.getContent());
    assertEquals(0, logEntry.getTime());
    assertTrue(logEntry.isTestData());
}
Also used : EmailLogEntry(teammates.common.util.EmailLogEntry) EmailWrapper(teammates.common.util.EmailWrapper) Test(org.testng.annotations.Test)

Aggregations

EmailLogEntry (teammates.common.util.EmailLogEntry)8 AppLogLine (com.google.appengine.api.log.AppLogLine)4 Test (org.testng.annotations.Test)3 LinkedList (java.util.LinkedList)2 AdminLogQuery (teammates.common.util.AdminLogQuery)1 EmailWrapper (teammates.common.util.EmailWrapper)1 GaeLogApi (teammates.common.util.GaeLogApi)1 StatusMessage (teammates.common.util.StatusMessage)1 AdminEmailLogPageAction (teammates.ui.controller.AdminEmailLogPageAction)1 ShowPageResult (teammates.ui.controller.ShowPageResult)1 AdminEmailLogPageData (teammates.ui.pagedata.AdminEmailLogPageData)1 AdminEmailTableRow (teammates.ui.template.AdminEmailTableRow)1