Changeset 3543 for devel/testlink/automation/src/test/java/br/gov/serpro/cte/common/BaseTestCase.java
- Timestamp:
- 11/26/10 16:00:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation/src/test/java/br/gov/serpro/cte/common/BaseTestCase.java
r3523 r3543 4 4 import java.lang.reflect.InvocationTargetException; 5 5 import java.lang.reflect.Method; 6 import java.net.URL; 7 import java.text.MessageFormat; 8 import java.util.Properties; 6 9 7 10 import org.junit.After; … … 21 24 */ 22 25 public class BaseTestCase extends SeleneseTestCase { 26 private Properties mensagens; 27 private Properties campos; 28 private Properties valores; 29 23 30 @Before 24 31 public void setUp() throws Exception { 25 System.out.println("SETUP"); 32 this.mensagens = this 33 .load("br/gov/serpro/cte/common/mensagens.properties"); 34 this.campos = this.load("br/gov/serpro/cte/common/campos.properties"); 35 this.valores = this.load("br/gov/serpro/cte/common/valores.properties"); 26 36 String url = "https://cte.serpro.gov.br"; 27 37 DAOSelenium conn = new DAOSelenium("localhost", 4444, "*firefox", url); 28 38 selenium = conn.newConnection(); 39 } 40 41 public String getMensagem(String key) { 42 return this.mensagens.getProperty(key); 43 } 44 45 public String getCampo(String key) { 46 return this.campos.getProperty(key); 47 } 48 49 public String getCampo(String key, Object... args) { 50 return MessageFormat.format(getCampo("email.responder.todos"), args); 51 } 52 53 public String getValor(String key) { 54 return this.valores.getProperty(key); 55 } 56 57 private Properties load(String propsName) throws Exception { 58 Properties props = new Properties(); 59 URL url = ClassLoader.getSystemResource(propsName); 60 props.load(url.openStream()); 61 return props; 29 62 } 30 63 … … 182 215 @After 183 216 public void tearDown() throws Exception { 184 System.out.println("STOP SELENIUM");185 217 selenium.stop(); 186 218 }
Note: See TracChangeset
for help on using the changeset viewer.