You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/02/22 14:40:19 UTC

svn commit: r1292289 - /myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java

Author: lofwyr
Date: Wed Feb 22 13:40:19 2012
New Revision: 1292289

URL: http://svn.apache.org/viewvc?rev=1292289&view=rev
Log:
improve test performance: reusing the selenium object.

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java?rev=1292289&r1=1292288&r2=1292289&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java Wed Feb 22 13:40:19 2012
@@ -19,9 +19,9 @@ package org.apache.myfaces.tobago.exampl
 
 import com.thoughtworks.selenium.DefaultSelenium;
 import com.thoughtworks.selenium.SeleniumException;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
 
 public abstract class SeleniumTest {
 
@@ -33,16 +33,16 @@ public abstract class SeleniumTest {
   public static final String HAS_ERROR_SEVERITY = "has error severity";
   public static final String IS_BROKEN = "is broken";
 
-  private DefaultSelenium selenium;
+  private static DefaultSelenium selenium;
 
-  @Before
-  public void setUp() throws Exception {
+  @BeforeClass
+  public static void setUp() throws Exception {
     selenium = createSeleniumClient();
     selenium.start();
   }
 
-  @After
-  public void tearDown() throws Exception {
+  @AfterClass
+  public static void tearDown() throws Exception {
     selenium.stop();
   }
 
@@ -50,7 +50,7 @@ public abstract class SeleniumTest {
     return selenium;
   }
 
-  protected DefaultSelenium createSeleniumClient() throws Exception {
+  protected static DefaultSelenium createSeleniumClient() throws Exception {
     return new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:8080/");
   }