source: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/ExpressoMailPreferencesTestCase.java @ 3789

Revision 3789, 1.5 KB checked in by luiz-fernando, 13 years ago (diff)

Ticket #1402 - Mudança no nome dos pacotes das classes

Line 
1package org.expressolivre.cte.email;
2
3import java.lang.reflect.InvocationTargetException;
4import java.lang.reflect.Method;
5
6import org.apache.commons.lang.StringUtils;
7import org.expressolivre.cte.common.Config;
8import org.expressolivre.cte.common.PreferencesTestCase;
9import org.expressolivre.cte.pages.email.ExpressoMailPreferencesPage;
10import org.testng.annotations.Test;
11
12/**
13 * @author L.F.Estivalet (Serpro)
14 *
15 *         Created on Feb 3, 2011 at 11:07:04 AM
16 *
17 */
18public class ExpressoMailPreferencesTestCase extends PreferencesTestCase {
19        ExpressoMailPreferencesPage prefs;
20
21        // @BeforeTest
22        // public void gotoEmailPreferencesPage() {
23        // openPreferencesPage();
24        // prefs = openEmailPreferencesPage();
25        // }
26
27        @Test
28        public void test() throws IllegalArgumentException, IllegalAccessException,
29                        InvocationTargetException {
30                openPreferencesPage();
31                prefs = openEmailPreferencesPage();
32
33                Method[] methods = ExpressoMailPreferencesPage.class.getMethods();
34                for (Method method : methods) {
35                        if (method.getName().startsWith("set")
36                                        && !method.getName().equals("setComboValue")
37                                        && !method.getName().equals("setSavePreferences")) {
38                                String name = StringUtils.uncapitalize(method.getName()
39                                                .substring(3));
40                                System.out.println(name);
41                                String[] values = Config.getInstance().getEmailPreference(name)
42                                                .split(",");
43                                System.out.println(name + " " + values[0]);
44                                method.invoke(prefs, values[0]);
45                        }
46                }
47                prefs.savePreferences();
48
49        }
50
51        // @AfterTest
52        // public void savePreferences() {
53        // prefs.savePreferences();
54        // }
55
56}
Note: See TracBrowser for help on using the repository browser.