1 | package br.gov.serpro.expresso.cte.calendar; |
---|
2 | |
---|
3 | import java.text.SimpleDateFormat; |
---|
4 | import java.util.Calendar; |
---|
5 | |
---|
6 | import org.testng.annotations.Parameters; |
---|
7 | import org.testng.annotations.Test; |
---|
8 | |
---|
9 | import br.gov.serpro.expresso.cte.common.BaseCalendarTestCase; |
---|
10 | import br.gov.serpro.expresso.cte.pages.calendar.AppointmentPage; |
---|
11 | |
---|
12 | /** |
---|
13 | * @author L.F.Estivalet (Serpro) |
---|
14 | * |
---|
15 | * Created on Feb 8, 2011 at 9:36:08 AM |
---|
16 | * |
---|
17 | */ |
---|
18 | public class AdicionarCompromisso extends BaseCalendarTestCase { |
---|
19 | |
---|
20 | @Parameters({ "titulo", "horaInicial", "minutoInicial", "horaFinal", |
---|
21 | "minutoFinal" }) |
---|
22 | @Test(dependsOnMethods = { "init" }) |
---|
23 | public void test(String titulo, String horaInicial, String minutoInicial, |
---|
24 | String horaFinal, String minutoFinal) { |
---|
25 | |
---|
26 | // Pega data corrente. |
---|
27 | Calendar cal = Calendar.getInstance(); |
---|
28 | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
---|
29 | SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy"); |
---|
30 | |
---|
31 | // Adiciona um compromisso para data atual. |
---|
32 | AppointmentPage ap = super.newAppointment(sdf.format(cal.getTime())); |
---|
33 | ap.setTitle(titulo); |
---|
34 | ap.setStartDate(sdf2.format(cal.getTime())); |
---|
35 | ap.setStartHour(horaInicial); |
---|
36 | ap.setStartMinute(minutoInicial); |
---|
37 | ap.setEndDate(sdf2.format(cal.getTime())); |
---|
38 | ap.setEndHour(horaFinal); |
---|
39 | ap.setEndMinute(minutoFinal); |
---|
40 | |
---|
41 | ap.saveAppointment(); |
---|
42 | } |
---|
43 | } |
---|