[weld-commits] Weld SVN: r6870 - in core/trunk: tests/src/test/resources/org/jboss/weld/tests and 4 other directories.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Sun Aug 1 12:52:38 EDT 2010
Author: aslak
Date: 2010-08-01 12:52:38 -0400 (Sun, 01 Aug 2010)
New Revision: 6870
Added:
core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/
core/trunk/tests-arquillian/src/test/resources/org/jboss/weld/tests/event/
Removed:
core/trunk/tests/src/test/java/org/jboss/weld/tests/event/tx/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/event/
Modified:
core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/InvalidateSessionTest.java
core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/AbstractHtmlUnitTest.java
core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/TxEventTest.java
Log:
WELD-493 Converted TxEventTest to Arquillian
Modified: core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/InvalidateSessionTest.java
===================================================================
--- core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/InvalidateSessionTest.java 2010-08-01 16:33:41 UTC (rev 6869)
+++ core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/InvalidateSessionTest.java 2010-08-01 16:52:38 UTC (rev 6870)
@@ -29,8 +29,9 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.weld.tests.contexts.errorpage.ErrorPageTest;
+import org.jboss.weld.tests.category.Integration;
import org.junit.Test;
+import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import com.gargoylesoftware.htmlunit.WebClient;
@@ -45,14 +46,7 @@
* @author Pete Muir
*
*/
-//@Artifact(addCurrentPackage=false)
-//@Classes({Storm.class,SomeBean.class})
-//@IntegrationTest(runLocally=true)
-//@Resources({
-// @Resource(destination=WarArtifactDescriptor.WEB_XML_DESTINATION, source="web.xml"),
-// @Resource(destination="storm.jspx", source="storm.jsf"),
-// @Resource(destination="/WEB-INF/faces-config.xml", source="faces-config.xml")
-//})
+ at Category(Integration.class)
@RunWith(Arquillian.class)
@Run(RunModeType.AS_CLIENT)
public class InvalidateSessionTest
Copied: core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx (from rev 6868, core/trunk/tests/src/test/java/org/jboss/weld/tests/event/tx)
Modified: core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/AbstractHtmlUnitTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/event/tx/AbstractHtmlUnitTest.java 2010-08-01 16:19:26 UTC (rev 6868)
+++ core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/AbstractHtmlUnitTest.java 2010-08-01 16:52:38 UTC (rev 6870)
@@ -19,12 +19,10 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.weld.test.AbstractWeldTest;
-
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-public abstract class AbstractHtmlUnitTest extends AbstractWeldTest
+public abstract class AbstractHtmlUnitTest
{
public AbstractHtmlUnitTest()
Modified: core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/TxEventTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/event/tx/TxEventTest.java 2010-08-01 16:19:26 UTC (rev 6868)
+++ core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/event/tx/TxEventTest.java 2010-08-01 16:52:38 UTC (rev 6870)
@@ -17,33 +17,42 @@
package org.jboss.weld.tests.event.tx;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.testharness.impl.packaging.war.WarArtifactDescriptor;
-import org.testng.annotations.Test;
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.api.Run;
+import org.jboss.arquillian.api.RunModeType;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.weld.tests.category.Integration;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
- at Artifact(addCurrentPackage=false)
- at IntegrationTest(runLocally=true)
- at Resources({
- @Resource(source="faces-config.xml", destination="WEB-INF/faces-config.xml"),
- @Resource(source="web.xml", destination=WarArtifactDescriptor.WEB_XML_DESTINATION),
- @Resource(source="home.xhtml", destination="home.xhtml")
-})
- at Classes({
- Foo.class,
- Updated.class
-})
+ at Category(Integration.class)
+ at RunWith(Arquillian.class)
+ at Run(RunModeType.AS_CLIENT)
public class TxEventTest extends AbstractHtmlUnitTest
{
-
- @Test(description="WBRI-401")
+ @Deployment
+ public static WebArchive createDeployment()
+ {
+ return ShrinkWrap.create(WebArchive.class, "test.war")
+ .addClasses(Foo.class, Updated.class)
+ .addWebResource(TxEventTest.class.getPackage(), "web.xml", "web.xml")
+ .addWebResource(TxEventTest.class.getPackage(), "faces-config.xml", "faces-config.xml")
+ .addResource(TxEventTest.class.getPackage(), "home.xhtml", "home.xhtml")
+ .addWebResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+ /*
+ * description = "WBRI-401"
+ */
+ @Test
public void testRequestContextLifecycle() throws Exception
{
WebClient webClient = new WebClient();
@@ -51,5 +60,10 @@
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(home, HtmlSubmitInput.class, "SaveButton");
beginConversationButton.click();
}
-
+
+ protected String getPath(String page)
+ {
+ // TODO: this should be moved out and be handled by Arquillian
+ return "http://localhost:8080/test/" + page;
+ }
}
\ No newline at end of file
Copied: core/trunk/tests-arquillian/src/test/resources/org/jboss/weld/tests/event (from rev 6868, core/trunk/tests/src/test/resources/org/jboss/weld/tests/event)
More information about the weld-commits
mailing list