[4527] | 1 | package org.expressolivre.cte.email.listar; |
---|
| 2 | |
---|
| 3 | import org.expressolivre.cte.common.BaseEmailTestCase; |
---|
| 4 | import org.testng.Assert; |
---|
| 5 | import org.testng.annotations.Test; |
---|
| 6 | |
---|
| 7 | /** |
---|
| 8 | * Suite:[FUN02.3] Listar Mensagens |
---|
| 9 | * |
---|
| 10 | * Caso de Teste: EL-577:Listar mensagens lidas |
---|
| 11 | * |
---|
| 12 | * Link: http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item= |
---|
| 13 | * testcase&id=EL-577 |
---|
| 14 | * |
---|
| 15 | * @see org.expressolivre.cte.email.compor.EnviarEmailTestCase |
---|
| 16 | * @see org.expressolivre.cte.email.ler.LerEmailTestCase |
---|
| 17 | * |
---|
| 18 | * @author L.F.Estivalet (Serpro) |
---|
| 19 | * |
---|
| 20 | * Created on Mai 16, 2011 at 9:49:10 AM |
---|
| 21 | * |
---|
| 22 | */ |
---|
| 23 | public class ListarEmailsLidosTestCase extends BaseEmailTestCase { |
---|
| 24 | |
---|
| 25 | /** |
---|
| 26 | * Filtra apenas as mensagens importantes da Caixa de Entrada. |
---|
| 27 | * |
---|
| 28 | * @throws Exception |
---|
| 29 | */ |
---|
| 30 | @Test |
---|
| 31 | public void test() throws Exception { |
---|
| 32 | mp.setReadFilter(); |
---|
| 33 | |
---|
| 34 | // TODO Deve ter um jeito melhor de fazer isso, mas nao consegui pegar o |
---|
| 35 | // numero total de mensagens apos filtrar pelas mensagens importantes. |
---|
| 36 | // Se nao colocar o comando abaixo, ele continua pegando o numero de |
---|
| 37 | // mensagens totais e nao apenas as importantes. |
---|
| 38 | super.dummyWait(); |
---|
| 39 | |
---|
| 40 | // Busca todos os IDs dos emails apos aplicar o filtro "Lidas". |
---|
| 41 | String[] t = mp.getEmailIds(); |
---|
| 42 | |
---|
| 43 | System.out.println("Total msgs lidas: " + t.length); |
---|
| 44 | |
---|
| 45 | boolean ok = true; |
---|
| 46 | // Verifica se todas as mensagens estao marcadas como "Lidas". |
---|
| 47 | for (int i = 0; i < t.length; i++) { |
---|
| 48 | if (!mp.isRead(t[i])) { |
---|
| 49 | ok = false; |
---|
| 50 | break; |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | } |
---|
| 54 | Assert.assertTrue(ok); |
---|
| 55 | |
---|
| 56 | } |
---|
| 57 | } |
---|