[seam-commits] Seam SVN: r14663 - in branches/community/Seam_2_3/examples-ee6/booking/booking-tests: src/test/java/org/jboss/seam/example/booking/test and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri May 11 03:56:31 EDT 2012
Author: maschmid
Date: 2012-05-11 03:56:31 -0400 (Fri, 11 May 2012)
New Revision: 14663
Removed:
branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/testng.xml
Modified:
branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
Log:
remove arq-seam extension from the booking example test
Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml 2012-05-11 01:25:17 UTC (rev 14662)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml 2012-05-11 07:56:31 UTC (rev 14663)
@@ -75,12 +75,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.arquillian.extension</groupId>
- <artifactId>arquillian-seam2</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_2.2_spec</artifactId>
</dependency>
Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java 2012-05-11 01:25:17 UTC (rev 14662)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java 2012-05-11 07:56:31 UTC (rev 14663)
@@ -16,6 +16,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.annotations.In;
import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.booking.Booking;
import org.jboss.seam.example.booking.BookingList;
@@ -26,6 +27,9 @@
import org.jboss.seam.security.Identity;
import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -44,24 +48,25 @@
return er;
}
- @In(value="org.jboss.seam.core.manager")
- private Manager manager;
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
- @In(value="org.jboss.seam.security.identity")
- private Identity identity;
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
- @In
- private HotelSearching hotelSearch;
-
- @In
- private HotelBooking hotelBooking;
-
- @In
- private BookingList bookingList;
-
@Test
public void testBookHotel() throws Exception
{
+ Manager manager = Manager.instance();
+ Identity identity = Identity.instance();
+ HotelSearching hotelSearch = (HotelSearching)Component.getInstance("hotelSearch");
+ HotelBooking hotelBooking = (HotelBooking)Component.getInstance("hotelBooking");
+ BookingList bookingList = (BookingList)Component.getInstance("bookingList");
+
manager.initializeTemporaryConversation();
Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2012-05-11 01:25:17 UTC (rev 14662)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2012-05-11 07:56:31 UTC (rev 14663)
@@ -8,14 +8,17 @@
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.Component;
-import org.jboss.seam.annotations.In;
import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.booking.ChangePassword;
import org.jboss.seam.example.booking.User;
import org.jboss.seam.security.Identity;
import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -34,12 +37,21 @@
return er;
}
- @In(value="org.jboss.seam.security.identity")
- private Identity identity;
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
@Test
public void testChangePassword() throws Exception
{
+ Identity identity = Identity.instance();
+
Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
identity.setUsername("gavin");
identity.setPassword("foobar");
Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java 2012-05-11 01:25:17 UTC (rev 14662)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java 2012-05-11 07:56:31 UTC (rev 14663)
@@ -9,12 +9,16 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.Component;
import org.jboss.seam.annotations.In;
+import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.Manager;
import org.jboss.seam.example.booking.User;
import org.jboss.seam.security.Identity;
import org.jboss.seam.web.Session;
import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,13 +36,22 @@
return er;
}
-
- @In(value="org.jboss.seam.security.identity")
- private Identity identity;
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
@Test
public void testLoginComponent() throws Exception
{
+ Identity identity = Identity.instance();
+
assertFalse(identity.isLoggedIn());
identity.setUsername("gavin");
identity.setPassword("foobar");
@@ -60,6 +73,8 @@
@Test
public void testLogin() throws Exception
{
+ Identity identity = Identity.instance();
+
assertFalse(identity.isLoggedIn());
identity.setUsername("gavin");
Deleted: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/testng.xml 2012-05-11 01:25:17 UTC (rev 14662)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/testng.xml 2012-05-11 07:56:31 UTC (rev 14663)
@@ -1,13 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-
-<suite name="Hotel Booking" verbose="2" parallel="false">
-
- <test name="Hotel Booking">
- <classes>
- <class name="org.jboss.seam.example.booking.test.LoginTest"/>
- <class name="org.jboss.seam.example.booking.test.BookingTest"/>
- <class name="org.jboss.seam.example.booking.test.ChangePasswordTest"/>
- </classes>
- </test>
-
-</suite>
\ No newline at end of file
More information about the seam-commits
mailing list