Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue number 2 - updates

  • Loading branch information...
commit e3dc3b4f060ebc379eeff877dfe32f756eb5acd7 1 parent 675654f
@flashboss authored
View
50 src/test/java/it/vige/magazzino/test/AddressAgentTest.java
@@ -16,18 +16,11 @@
*/
package it.vige.magazzino.test;
-import static it.vige.magazzino.test.Dependencies.INTERNATIONAL;
-import static it.vige.magazzino.test.Dependencies.SOLDER;
-import it.vige.magazzino.i18n.DefaultBundleKey;
-import it.vige.magazzino.log.ArticleLog;
-import it.vige.magazzino.log.CustomerLog;
-import it.vige.magazzino.log.MagazzinoLog;
-import it.vige.magazzino.log.ReceiptLog;
+import static it.vige.magazzino.test.Dependencies.ALL;
+import it.vige.magazzino.DataContainer;
import it.vige.magazzino.model.Address;
import it.vige.magazzino.model.Article;
import it.vige.magazzino.model.Customer;
-import it.vige.magazzino.model.Magazzino;
-import it.vige.magazzino.model.Receipt;
import javax.inject.Inject;
import javax.persistence.EntityManager;
@@ -48,13 +41,8 @@
public static WebArchive createDeployment() {
return ShrinkWrap
.create(WebArchive.class, "test.war")
- .addPackage(Magazzino.class.getPackage())
- .addClasses(Receipt.class, Magazzino.class, Customer.class,
- Article.class, DefaultBundleKey.class,
- AuthenticatedUserProducer.class, ArticleLog.class,
- CustomerLog.class, MagazzinoLog.class, ReceiptLog.class)
- .addAsLibraries(SOLDER)
- .addAsLibraries(INTERNATIONAL)
+ .addPackages(true, DataContainer.class.getPackage())
+ .addAsLibraries(ALL)
.addAsWebInfResource("test-persistence.xml",
"classes/META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
@@ -71,10 +59,10 @@ public void prepareSeedData() throws Exception {
em.joinTransaction();
em.createQuery("delete from Article").executeUpdate();
em.createQuery("delete from Receipt").executeUpdate();
- em.persist(new Article("6767676",
- "3342 Peachtree Road NE"));
+ em.persist(new Article("6767676", "3342 Peachtree Road NE"));
em.createQuery("delete from User").executeUpdate();
- em.persist(new Customer("3246565", "ike", "ike@mailinator.com", "545454"));
+ em.persist(new Customer("3246565", "ike", "ike@mailinator.com",
+ "545454"));
utx.commit();
}
@@ -115,27 +103,25 @@ public void createAddress() throws Exception {
address("222", "viale Mazzini", "00114", "531446", "3463165736",
"hgdfgsfg@vige.it", "fdfd.com", "67", "LO", "Setteville",
"London");
- address("76435", "piazza Bologna", "00234", "54253516457", "8871115645732",
- "afadfsd@vige.it", "wwqewr.com", "33", "BO", "Settecamini",
- "Bologna");
+ address("76435", "piazza Bologna", "00234", "54253516457",
+ "8871115645732", "afadfsd@vige.it", "wwqewr.com", "33", "BO",
+ "Settecamini", "Bologna");
address("23567", "viale Giulio Cesare", "00987", "896969687",
"32456733", "hdhhjdghf@vige.it", "qasas.com", "6526", "FI",
"Tivoli", "Florence");
address("876", "via Tibutina", "01234", "23423423", "2436233453",
"fdsfsdfsd@vige.it", "ffkkfkf.com", "34", "PA", "Francoforte",
"Paris");
- address("345", "via Prenestina", "00152", "87584734637",
- "84562354656", "gdhdgjfgj@vige.it", "ppopo.com", "124", "SH",
- "Zagarolo", "Shangai");
- address("764", "piazza Tuscolo", "00212", "32678475323",
- "74684736433", "fsdfsdfsd@vige.it", "ewe.com", "716", "BO",
- "Nola", "Bombay");
+ address("345", "via Prenestina", "00152", "87584734637", "84562354656",
+ "gdhdgjfgj@vige.it", "ppopo.com", "124", "SH", "Zagarolo",
+ "Shangai");
+ address("764", "piazza Tuscolo", "00212", "32678475323", "74684736433",
+ "fsdfsdfsd@vige.it", "ewe.com", "716", "BO", "Nola", "Bombay");
address("3454", "via Tuscolana", "09833", "42675473364", "754684333",
"tytre@vige.it", "swswd.com", "546", "RM", "Castelvolturno",
"Rome");
- address("7654", "via Serafini", "00999", "534748622",
- "7568473634", "ewrete@vige.it", "ewewwq.com", "616", "KY",
- "Tropea", "Kyoto");
+ address("7654", "via Serafini", "00999", "534748622", "7568473634",
+ "ewrete@vige.it", "ewewwq.com", "616", "KY", "Tropea", "Kyoto");
address("23453", "via Serafina", "00666", "63564832764", "3467468733",
"ngnghghg@vige.it", "llklk.it", "33", "TK", "Palinuro", "Tokyo");
java.io.ObjectInputStream ois = new java.io.ObjectInputStream(
@@ -188,7 +174,7 @@ public String toHexString(byte[] b) {
}
return setBinaryLength(sb.toString());
}
-
+
private String setBinaryLength(String result) {
while (true) {
if (result.endsWith("0"))
View
18 src/test/java/it/vige/magazzino/test/CustomerAgentTest.java
@@ -16,19 +16,15 @@
*/
package it.vige.magazzino.test;
+import static it.vige.magazzino.test.Dependencies.JAVAEE;
import static it.vige.magazzino.test.Dependencies.INTERNATIONAL;
import static it.vige.magazzino.test.Dependencies.SOLDER;
-import it.vige.magazzino.i18n.DefaultBundleKey;
-import it.vige.magazzino.log.ArticleLog;
-import it.vige.magazzino.log.CustomerLog;
-import it.vige.magazzino.log.MagazzinoLog;
-import it.vige.magazzino.log.ReceiptLog;
+import static it.vige.magazzino.test.Dependencies.RICHFACES;
+import it.vige.magazzino.DataContainer;
import it.vige.magazzino.model.Address;
import it.vige.magazzino.model.Article;
import it.vige.magazzino.model.Customer;
import it.vige.magazzino.model.Data;
-import it.vige.magazzino.model.Magazzino;
-import it.vige.magazzino.model.Receipt;
import java.util.ArrayList;
@@ -51,13 +47,11 @@
public static WebArchive createDeployment() {
return ShrinkWrap
.create(WebArchive.class, "test.war")
- .addPackage(Magazzino.class.getPackage())
- .addClasses(Receipt.class, Magazzino.class, Customer.class,
- Article.class, DefaultBundleKey.class,
- AuthenticatedUserProducer.class, ArticleLog.class,
- CustomerLog.class, MagazzinoLog.class, ReceiptLog.class)
+ .addPackages(true, DataContainer.class.getPackage())
+ .addAsLibraries(JAVAEE)
.addAsLibraries(SOLDER)
.addAsLibraries(INTERNATIONAL)
+ .addAsLibraries(RICHFACES)
.addAsWebInfResource("test-persistence.xml",
"classes/META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
View
19 src/test/java/it/vige/magazzino/test/Dependencies.java
@@ -23,13 +23,28 @@
public interface Dependencies {
- static final Archive<?>[] SOLDER = DependencyResolvers
+ static final Archive<?>[] ALL = DependencyResolvers
+ .use(MavenDependencyResolver.class).loadReposFromPom("pom.xml")
+ .loadDependenciesFromPom("pom.xml").resolveAs(GenericArchive.class)
+ .toArray(new Archive<?>[0]);
+ static final Archive<?>[] JAVAEE = DependencyResolvers
.use(MavenDependencyResolver.class).loadReposFromPom("pom.xml")
- .artifact("org.jboss.seam.solder:seam-solder-tooling").exclusion("*")
+ .artifact("com.sun.faces:jsf-api:2.1.0").exclusion("*")
+ .artifact("com.sun.faces:jsf-impl:2.1.0").exclusion("*")
.resolveAs(GenericArchive.class).toArray(new Archive<?>[0]);
+ static final Archive<?>[] SOLDER = DependencyResolvers
+ .use(MavenDependencyResolver.class).loadReposFromPom("pom.xml")
+ .artifact("org.jboss.seam.solder:seam-solder:3.0.0.Final")
+ .exclusion("*").resolveAs(GenericArchive.class)
+ .toArray(new Archive<?>[0]);
static final Archive<?>[] INTERNATIONAL = DependencyResolvers
.use(MavenDependencyResolver.class).loadReposFromPom("pom.xml")
.artifact("org.jboss.seam.international:seam-international")
.exclusion("*").resolveAs(GenericArchive.class)
.toArray(new Archive<?>[0]);
+ static final Archive<?>[] RICHFACES = DependencyResolvers
+ .use(MavenDependencyResolver.class).loadReposFromPom("pom.xml")
+ .artifact("org.richfaces.ui:richfaces-components-api:4.1.0.Final")
+ .exclusion("*").resolveAs(GenericArchive.class)
+ .toArray(new Archive<?>[0]);
}
View
9 src/test/java/it/vige/magazzino/test/ListDataAgentTest.java
@@ -16,10 +16,12 @@
*/
package it.vige.magazzino.test;
+import static it.vige.magazzino.test.Dependencies.JAVAEE;
import static it.vige.magazzino.test.Dependencies.INTERNATIONAL;
import static it.vige.magazzino.test.Dependencies.SOLDER;
+import static it.vige.magazzino.test.Dependencies.RICHFACES;
+import it.vige.magazzino.DataContainer;
import it.vige.magazzino.model.Data;
-import it.vige.magazzino.model.Magazzino;
import java.util.ArrayList;
import java.util.List;
@@ -43,10 +45,11 @@
public static WebArchive createDeployment() {
return ShrinkWrap
.create(WebArchive.class, "test.war")
- .addPackage(Magazzino.class.getPackage())
- .addClasses(Data.class)
+ .addPackages(true, DataContainer.class.getPackage())
+ .addAsLibraries(JAVAEE)
.addAsLibraries(SOLDER)
.addAsLibraries(INTERNATIONAL)
+ .addAsLibraries(RICHFACES)
.addAsWebInfResource("test-persistence.xml",
"classes/META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
View
19 src/test/java/it/vige/magazzino/test/MagazzinoAgentTest.java
@@ -16,19 +16,16 @@
*/
package it.vige.magazzino.test;
+import static it.vige.magazzino.test.Dependencies.JAVAEE;
import static it.vige.magazzino.test.Dependencies.INTERNATIONAL;
import static it.vige.magazzino.test.Dependencies.SOLDER;
-import it.vige.magazzino.i18n.DefaultBundleKey;
-import it.vige.magazzino.log.ArticleLog;
-import it.vige.magazzino.log.CustomerLog;
-import it.vige.magazzino.log.MagazzinoLog;
-import it.vige.magazzino.log.ReceiptLog;
+import static it.vige.magazzino.test.Dependencies.RICHFACES;
+import it.vige.magazzino.DataContainer;
import it.vige.magazzino.model.Address;
import it.vige.magazzino.model.Article;
import it.vige.magazzino.model.Customer;
import it.vige.magazzino.model.Data;
import it.vige.magazzino.model.Magazzino;
-import it.vige.magazzino.model.Receipt;
import java.util.ArrayList;
import java.util.HashMap;
@@ -58,13 +55,11 @@
public static WebArchive createDeployment() {
return ShrinkWrap
.create(WebArchive.class, "test.war")
- .addPackage(Magazzino.class.getPackage())
- .addClasses(Receipt.class, Magazzino.class, Customer.class,
- Article.class, DefaultBundleKey.class,
- AuthenticatedUserProducer.class, ArticleLog.class,
- CustomerLog.class, MagazzinoLog.class, ReceiptLog.class)
+ .addPackages(true, DataContainer.class.getPackage())
+ .addAsLibraries(JAVAEE)
.addAsLibraries(SOLDER)
.addAsLibraries(INTERNATIONAL)
+ .addAsLibraries(RICHFACES)
.addAsWebInfResource("test-persistence.xml",
"classes/META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
@@ -94,7 +89,7 @@ public void prepareSeedData() throws Exception {
public void createMagazzino() throws Exception {
byte[] image = image();
-
+
magazzino("21344", "01/06/1999", "23432", "cause 1", "compensation 1",
"2654654", "rag soc 1", "rag soc 2", "111", "01/05/1998",
"4343289479", "39.000,00 Û", "70075", "4353", "piazza Clodio",
Please sign in to comment.
Something went wrong with that request. Please try again.