[seam-commits] Seam SVN: r14994 - in branches/community/Seam_2_3: seam-integration-tests and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Jul 20 11:11:43 EDT 2012


Author: maschmid
Date: 2012-07-20 11:11:42 -0400 (Fri, 20 Jul 2012)
New Revision: 14994

Modified:
   branches/community/Seam_2_3/pom.xml
   branches/community/Seam_2_3/seam-integration-tests/pom.xml
   branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java
Log:
rewrite PageScopedUIIncludeTest to use plain htmlunit, so we don't need drone in integration-tests


Modified: branches/community/Seam_2_3/pom.xml
===================================================================
--- branches/community/Seam_2_3/pom.xml	2012-07-20 14:21:50 UTC (rev 14993)
+++ branches/community/Seam_2_3/pom.xml	2012-07-20 15:11:42 UTC (rev 14994)
@@ -45,7 +45,6 @@
 
 		<!-- Version string properties -->
 		<version.arquillian_core>1.0.1.Final</version.arquillian_core>
-		<version.arquillian_drone>1.0.0.Final</version.arquillian_drone>
 		<version.wicket>1.4.14</version.wicket>
 		<version.drools>5.1.1</version.drools>
 		<version.testng>5.14.10</version.testng>
@@ -104,14 +103,6 @@
 				<version>1.7.0</version>
 			</dependency>
 
-			<dependency>
-				<groupId>org.jboss.arquillian.extension</groupId>
-				<artifactId>arquillian-drone-bom</artifactId>
-				<version>${version.arquillian_drone}</version>
-				<type>pom</type>
-				<scope>import</scope>
-			</dependency>
-
 			<!-- You should adjust this in the initcore task in build.xml as well -->
 			<dependency>
 				<groupId>org.jboss.cache</groupId>

Modified: branches/community/Seam_2_3/seam-integration-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/pom.xml	2012-07-20 14:21:50 UTC (rev 14993)
+++ branches/community/Seam_2_3/seam-integration-tests/pom.xml	2012-07-20 15:11:42 UTC (rev 14994)
@@ -124,21 +124,6 @@
 		</dependency>
 
 		<dependency>
-			<groupId>org.jboss.arquillian.extension</groupId>
-			<artifactId>arquillian-drone-webdriver-depchain</artifactId>
-			<type>pom</type>
-			<scope>test</scope>
-		</dependency>
-
-		<!-- Override for WebDriver -->
-		<dependency>
-			<groupId>commons-lang</groupId>
-			<artifactId>commons-lang</artifactId>
-			<version>2.6</version>
-			<scope>test</scope>
-		</dependency>
-
-		<dependency>
 			<groupId>org.jboss.seam</groupId>
 			<artifactId>jboss-seam</artifactId>
 			<type>ejb</type>
@@ -162,11 +147,27 @@
 			<scope>provided</scope>
 		</dependency>
 
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <scope>test</scope>
-        </dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>net.sourceforge.htmlunit</groupId>
+			<artifactId>htmlunit</artifactId>
+			<version>2.9</version>
+			<scope>test</scope>
+		</dependency>
+
+		<!-- Override for HtmlUnit -->
+		<dependency>
+			<groupId>commons-lang</groupId>
+			<artifactId>commons-lang</artifactId>
+			<version>2.6</version>
+			<scope>test</scope>
+		</dependency>
+
 	</dependencies>
 	
 	<profiles>

Modified: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java	2012-07-20 14:21:50 UTC (rev 14993)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java	2012-07-20 15:11:42 UTC (rev 14994)
@@ -8,7 +8,6 @@
 import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.container.test.api.OverProtocol;
 import org.jboss.arquillian.container.test.api.RunAsClient;
-import org.jboss.arquillian.drone.api.annotation.Drone;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.arquillian.test.api.ArquillianResource;
 import org.jboss.seam.ScopeType;
@@ -20,17 +19,19 @@
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
 
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+
 // JBSEAM-5002
 @RunWith(Arquillian.class)
 @RunAsClient
 public class PageScopedUIIncludeTest
 {
-   @Drone
-   WebDriver driver;
-   
+   private final WebClient client = new WebClient();
+
    @ArquillianResource
    URL contextPath;
    
@@ -74,27 +75,29 @@
    }
    
    @Test
-   public void testComponent1()
+   public void testComponent1() throws Exception
    {
-      driver.navigate().to(contextPath + "test.seam");
-      assertTrue(driver.getPageSource().contains("Component 1"));
-      driver.findElement(By.id("form1:input")).clear();
-      driver.findElement(By.id("form1:input")).sendKeys("xyzzy");
-      driver.findElement(By.id("form1:save")).click();
-      assertTrue(driver.getPageSource().contains("Hello, xyzzy"));
+      HtmlPage page = client.getPage(contextPath + "test.seam");
+      assertTrue(page.getBody().getTextContent().contains("Component 1"));
+      
+      page.getElementById("form1:input").type("xyzzy");
+      page = page.getElementById("form1:save").click();
+      
+      assertTrue(page.getBody().getTextContent().contains("Hello, xyzzy"));
    }
    
    @Test
-   public void testComponent2()
+   public void testComponent2() throws Exception
    {
-      driver.navigate().to(contextPath + "test.seam");
-      assertTrue(driver.getPageSource().contains("Component 1"));
-      driver.findElement(By.id("controller:component2")).click();
-      assertTrue(driver.getPageSource().contains("Component 2"));
-      driver.findElement(By.id("form2:input")).clear();
-      driver.findElement(By.id("form2:input")).sendKeys("foobar");
-      driver.findElement(By.id("form2:save")).click();
-      assertTrue(driver.getPageSource().contains("Hi, foobar"));
+      HtmlPage page = client.getPage(contextPath + "test.seam");
+      assertTrue(page.getBody().getTextContent().contains("Component 1"));
+      page = page.getElementById("controller:component2").click();
+      assertTrue(page.getBody().getTextContent().contains("Component 2"));
+      
+      page.getElementById("form2:input").type("foobar");
+      page = page.getElementById("form2:save").click();
+      
+      assertTrue(page.getBody().getTextContent().contains("Hi, foobar"));
    }
    
    public abstract static class Component



More information about the seam-commits mailing list