Author: lfryc(a)redhat.com
Date: 2010-07-10 16:50:32 -0400 (Sat, 10 Jul 2010)
New Revision: 17871
Modified:
root/tests/metamer/trunk/ftest/pom.xml
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
Log:
type-safe creation of URL to test (using buildUrl)
Modified: root/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:50:06 UTC (rev 17870)
+++ root/tests/metamer/trunk/ftest/pom.xml 2010-07-10 20:50:32 UTC (rev 17871)
@@ -14,7 +14,7 @@
</parent>
<properties>
- <context.path>/testapp</context.path>
+ <context.path>/testapp/</context.path>
<deployable.version>4.0.0-SNAPSHOT</deployable.version>
<deployable.classifier>tomcat6</deployable.classifier>
<tomcat6x.installer.url.unix>file:/qa/home/lfryc/apache-tomcat-6.0.26--jsf2.zip</tomcat6x.installer.url.unix>
Modified:
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java
===================================================================
---
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java 2010-07-10
20:50:06 UTC (rev 17870)
+++
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/AbstractTestappTestCase.java 2010-07-10
20:50:32 UTC (rev 17871)
@@ -23,8 +23,8 @@
package org.richfaces.tests.testapp;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.test.selenium.AbstractTestCase;
@@ -54,7 +54,7 @@
*
* @return absolute url to the test page to be opened by Selenium
*/
- public abstract String getTestUrl();
+ public abstract URL getTestUrl();
/**
* Data provider for templates.
@@ -68,7 +68,7 @@
return templates;
}
- return new Object[][] {{"plain"}};
+ return new Object[][]{{"plain"}};
}
/**
@@ -104,11 +104,7 @@
if (templates != null && templates.length != 0) {
urlParams = "?templates=" + templates[0];
}
- try {
- selenium.open(new URL(getTestUrl() + urlParams));
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
+ selenium.open(buildUrl(getTestUrl() + urlParams));
}
/**
Modified:
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java
===================================================================
---
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10
20:50:06 UTC (rev 17870)
+++
root/tests/metamer/trunk/ftest/src/test/java/org/richfaces/tests/testapp/commandButton/CommandButtonTestCase.java 2010-07-10
20:50:32 UTC (rev 17871)
@@ -26,7 +26,10 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import java.net.URL;
+
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
@@ -50,8 +53,8 @@
private JQueryLocator output3 = jq("#form\\:output3");
@Override
- public String getTestUrl() {
- return contextPath.toString() +
"/faces/components/commandButton/simple.xhtml";
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/commandButton/simple.xhtml");
}
@Override
Show replies by date