Ignore:
Timestamp:
07/18/11 10:56:36 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1771 - Refactoring, criadas novas classes para Pasta, Filtro, Pesquisa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/MailPreferencesTestCase.java

    r4675 r4780  
    11package org.expressolivre.cte.email; 
    22 
     3import java.io.IOException; 
    34import java.lang.reflect.InvocationTargetException; 
    45import java.lang.reflect.Method; 
     
    78import org.expressolivre.cte.common.BaseTestCase; 
    89import org.expressolivre.cte.common.Config; 
     10import org.expressolivre.cte.common.IOUtil; 
    911import org.expressolivre.cte.pages.email.MailPreferencesPage; 
    1012import org.testng.annotations.Parameters; 
     
    2628         * @throws IllegalAccessException 
    2729         * @throws InvocationTargetException 
     30         * @throws IOException 
    2831         */ 
    2932        @Test 
    3033        public void setAllPreferences() throws IllegalArgumentException, 
    31                         IllegalAccessException, InvocationTargetException { 
     34                        IllegalAccessException, InvocationTargetException, IOException { 
    3235                openPreferencesPage(); 
    3336                MailPreferencesPage prefs = openEmailPreferencesPage(); 
     37 
     38                // Clean up the preferences file. 
     39                IOUtil.writeFile("temppref.txt", "", false); 
    3440 
    3541                // Percorre todos os metodos "setters" da classe 
     
    5258                                                        .getEmailPreference(name).split(","); 
    5359                                        System.out.println(name + " " + values[0]); 
    54                                         method.invoke(prefs, values[0]); 
     60 
     61                                        // Grava apenas as preferencias que o usuario tem disponivel 
     62                                        // e foram setadas em um arquivo para posterior uso em casos 
     63                                        // de teste. 
     64                                        Object response = method.invoke(prefs, values[0]); 
     65                                        if (response != null) { 
     66                                                if ((Boolean) response) { 
     67                                                        IOUtil.writeFile( 
     68                                                                        "temppref.txt", 
     69                                                                        name + System.getProperty("line.separator"), 
     70                                                                        true); 
     71                                                } 
     72                                        } 
    5573                                } 
    5674                        } 
     
    7795        } 
    7896 
     97        @Test 
     98        @Parameters({ "returnRecipientDefault" }) 
     99        public void setReturnRecipientDefault(String returnRecipientDefault) { 
     100                openPreferencesPage(); 
     101                MailPreferencesPage prefs = openEmailPreferencesPage(); 
     102                prefs.setReturnRecipientDefault(returnRecipientDefault); 
     103                prefs.savePreferences(); 
     104        } 
     105 
    79106} 
Note: See TracChangeset for help on using the changeset viewer.