File tree Expand file tree Collapse file tree
java/com/actionbazaar/interfaces/web Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444import java .io .Serializable ;
4545import javax .enterprise .context .SessionScoped ;
4646import javax .enterprise .inject .Produces ;
47- import javax .faces .view .ViewScoped ;
4847import javax .inject .Inject ;
4948import javax .inject .Named ;
5049
5150@ Named
52- @ ViewScoped
51+ @ SessionScoped
5352public class AddBid implements Serializable {
5453
5554 private static final long serialVersionUID = 1L ;
@@ -63,7 +62,6 @@ public class AddBid implements Serializable {
6362 private final Bid bid = new Bid ();
6463
6564 public String onAdd () {
66- System .err .println (bid );
6765 bidService .addBid (bid );
6866
6967 return "confirm_add_bid.jsf" ;
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<persistence version =" 2.1" xmlns =" http://xmlns.jcp.org/xml/ns/persistence" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" >
3- <persistence-unit name =" action-bazaar-unit" transaction-type =" JTA" >
4- <jta-data-source >java:global/jdbc/ActionBazaarDB</jta-data-source >
5- <properties >
6- <property name =" javax.persistence.schema-generation.database.action" value =" drop-and-create" />
7- <property name =" eclipselink.logging.level" value =" INFO" />
8- </properties >
9- </persistence-unit >
3+ <persistence-unit name =" action-bazaar-unit" transaction-type =" JTA" >
4+ <jta-data-source >java:global/jdbc/ActionBazaarDB</jta-data-source >
5+ <properties >
6+ <property name =" javax.persistence.schema-generation.database.action" value =" drop-and-create" />
7+ <property name =" eclipselink.logging.level" value =" INFO" />
8+ </properties >
9+ </persistence-unit >
1010</persistence >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <beans
3- version =" 1.0"
4- xmlns =" http://java.sun.com/xml/ns/javaee"
5- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
6- xsi : schemaLocation =" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd" >
2+ <beans xmlns =" http://xmlns.jcp.org/xml/ns/javaee"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_2.xsd"
5+ version =" 1.2" bean-discovery-mode =" all" >
76</beans >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <web-app
3- version =" 3.0"
4- xmlns =" http://java.sun.com/xml/ns/javaee"
5- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
6- xsi : schemaLocation =" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" >
2+ <web-app version =" 3.1"
3+ xmlns =" http://xmlns.jcp.org/xml/ns/javaee"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" >
76 <context-param >
87 <param-name >javax.faces.PROJECT_STAGE</param-name >
98 <param-value >Development</param-value >
2726 <name >java:global/jdbc/ActionBazaarDB</name >
2827 <class-name >org.apache.derby.jdbc.EmbeddedDriver</class-name >
2928 <url >jdbc:derby:/tmp/actionbazaar-database;create=true</url >
30- </data-source >
29+ </data-source >
3130</web-app >
Load diff This file was deleted.
Original file line number Diff line number Diff line change 3939 */
4040package com .actionbazaar .application ;
4141
42- import static org . junit . Assert . assertEquals ;
43- import static org . junit . Assert . assertNotNull ;
44-
42+ import com . actionbazaar . domain . Bid ;
43+ import com . actionbazaar . domain . BidRepository ;
44+ import com . actionbazaar . infrastructure . database . MockBidRepository ;
4545import javax .ejb .EJB ;
46-
4746import org .jboss .arquillian .container .test .api .Deployment ;
4847import org .jboss .arquillian .junit .Arquillian ;
4948import org .jboss .shrinkwrap .api .ShrinkWrap ;
50- import org .jboss .shrinkwrap .api .asset .EmptyAsset ;
5149import org .jboss .shrinkwrap .api .spec .WebArchive ;
50+ import static org .junit .Assert .assertEquals ;
51+ import static org .junit .Assert .assertNotNull ;
5252import org .junit .Test ;
5353import org .junit .runner .RunWith ;
5454
55- import com .actionbazaar .domain .Bid ;
56- import com .actionbazaar .domain .BidRepository ;
57- import com .actionbazaar .infrastructure .database .MockBidRepository ;
58-
5955@ RunWith (Arquillian .class )
6056public class BidServiceUnitTest {
6157
Original file line number Diff line number Diff line change 5151import org .jboss .arquillian .test .api .ArquillianResource ;
5252import org .jboss .shrinkwrap .api .Archive ;
5353import org .jboss .shrinkwrap .api .ShrinkWrap ;
54- import org .jboss .shrinkwrap .api .asset .EmptyAsset ;
5554import org .jboss .shrinkwrap .api .spec .WebArchive ;
5655import static org .junit .Assert .assertEquals ;
5756import org .junit .Test ;
@@ -78,7 +77,7 @@ public static Archive<?> createDeployment() {
7877 .addAsWebInfResource ("test-web.xml" , "web.xml" )
7978 .addAsWebResource ("add_bid.xhtml" , "add_bid.xhtml" )
8079 .addAsWebResource ("confirm_add_bid.xhtml" , "confirm_add_bid.xhtml" )
81- .addAsWebInfResource (EmptyAsset . INSTANCE , "beans.xml" )
80+ .addAsWebInfResource ("test-beans.xml" , "beans.xml" )
8281 .addAsResource ("test-persistence.xml" ,
8382 "META-INF/persistence.xml" );
8483 }
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <web-app
3- version =" 3.0"
4- xmlns =" http://java.sun.com/xml/ns/javaee"
5- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
6- xsi : schemaLocation =" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" >
2+ <web-app version =" 3.1"
3+ xmlns =" http://xmlns.jcp.org/xml/ns/javaee"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" >
76 <context-param >
87 <param-name >javax.faces.PROJECT_STAGE</param-name >
98 <param-value >UnitTest</param-value >
You can’t perform that action at this time.
0 commit comments