From 1764c85f7e69831679edf67f91f9c3772af42ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Tenc=C3=A9?= Date: Mon, 20 Dec 2010 14:02:57 -0500 Subject: [PATCH 1/3] Don't start embedded jetty when running cargo --- petstore-system-tests/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/petstore-system-tests/pom.xml b/petstore-system-tests/pom.xml index b370824..7e2741b 100644 --- a/petstore-system-tests/pom.xml +++ b/petstore-system-tests/pom.xml @@ -254,9 +254,9 @@ - + - + test.support.com.pyxis.petstore.web.serverdriver.ExternallyManagedServerDriverFactory ${test.timeServer.host} ${test.timeServer.port} ${test.server.port} From 300754d0453342c759bc5cb75c0c582f9960085f Mon Sep 17 00:00:00 2001 From: Vincent Tence Date: Mon, 20 Dec 2010 15:27:15 -0500 Subject: [PATCH 2/3] Fixed package name capitalization --- .../petstore/web/{serverDriver => serverdriver}/ServerDriver.java | 0 .../SingletonServerDriverFactory.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/{serverDriver => serverdriver}/ServerDriver.java (100%) rename petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/{serverDriver => serverdriver}/SingletonServerDriverFactory.java (100%) diff --git a/petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverDriver/ServerDriver.java b/petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverdriver/ServerDriver.java similarity index 100% rename from petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverDriver/ServerDriver.java rename to petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverdriver/ServerDriver.java diff --git a/petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverDriver/SingletonServerDriverFactory.java b/petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverdriver/SingletonServerDriverFactory.java similarity index 100% rename from petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverDriver/SingletonServerDriverFactory.java rename to petstore-system-tests/src/test/java/test/support/com/pyxis/petstore/web/serverdriver/SingletonServerDriverFactory.java From 4fd14670aa68cbcf4981f2abfbc603590a174b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Tenc=C3=A9?= Date: Tue, 21 Dec 2010 19:42:16 -0500 Subject: [PATCH 3/3] Updated to hamcrest-matchers 1.4-SNAPSHOT to get src jars. Suppressed warnings due to vargars --- .../java/test/com/pyxis/petstore/view/CartViewTest.java | 2 ++ .../java/test/com/pyxis/petstore/view/ItemsViewTest.java | 3 +++ .../java/test/com/pyxis/petstore/view/MenuPartialTest.java | 1 + .../test/com/pyxis/petstore/view/ShowReceiptViewTest.java | 4 ++++ .../petstore/domain/billing/CreditCardDetailsTest.java | 1 + .../java/test/com/pyxis/petstore/domain/order/CartTest.java | 2 ++ .../com/pyxis/petstore/domain/order/OrderNumberTest.java | 1 + .../test/com/pyxis/petstore/domain/order/OrderTest.java | 1 + .../com/pyxis/petstore/domain/product/ItemNumberTest.java | 1 + .../test/com/pyxis/petstore/domain/product/ItemTest.java | 4 ++++ .../test/com/pyxis/petstore/domain/product/ProductTest.java | 2 ++ pom.xml | 6 +----- 12 files changed, 23 insertions(+), 5 deletions(-) diff --git a/petstore-app/src/test/java/test/com/pyxis/petstore/view/CartViewTest.java b/petstore-app/src/test/java/test/com/pyxis/petstore/view/CartViewTest.java index 00f9dc3..a237d61 100644 --- a/petstore-app/src/test/java/test/com/pyxis/petstore/view/CartViewTest.java +++ b/petstore-app/src/test/java/test/com/pyxis/petstore/view/CartViewTest.java @@ -21,6 +21,7 @@ public class CartViewTest { String CART_VIEW_NAME = "cart"; Element cartView; + @SuppressWarnings("unchecked") @Test public void displaysColumnHeadings() { cartView = renderCartView().using(aModel().with(aCart())).asDom(); @@ -32,6 +33,7 @@ public class CartViewTest { withText("Total")))); } + @SuppressWarnings("unchecked") @Test public void displaysProductDetailsInColumns() throws Exception { Item item = anItem().withNumber("12345678").priced("18.50").describedAs("Green Adult").build(); diff --git a/petstore-app/src/test/java/test/com/pyxis/petstore/view/ItemsViewTest.java b/petstore-app/src/test/java/test/com/pyxis/petstore/view/ItemsViewTest.java index 6fb576a..9e183e7 100644 --- a/petstore-app/src/test/java/test/com/pyxis/petstore/view/ItemsViewTest.java +++ b/petstore-app/src/test/java/test/com/pyxis/petstore/view/ItemsViewTest.java @@ -31,6 +31,7 @@ public class ItemsViewTest { assertThat("view", itemsView, hasSelector("#inventory tr[id^='item']", withSize(2))); } + @SuppressWarnings("unchecked") @Test public void displaysColumnHeadingsOnItemsTable() { itemsView = renderItemsView().using(aModel().listing(anItem())).asDom(); @@ -42,6 +43,7 @@ public class ItemsViewTest { withBlankText()))); } + @SuppressWarnings("unchecked") @Test public void displaysProductDetailsInColumns() throws Exception { itemsView = renderItemsView().using(aModel().listing(anItem(). @@ -56,6 +58,7 @@ public class ItemsViewTest { hasChild(withTag("form"))))); } + @SuppressWarnings("unchecked") @Test public void addToCartButtonAddsItemToShoppingCart() { itemsView = renderItemsView().using(aModel().listing(anItem().withNumber("12345678"))).asDom(); diff --git a/petstore-app/src/test/java/test/com/pyxis/petstore/view/MenuPartialTest.java b/petstore-app/src/test/java/test/com/pyxis/petstore/view/MenuPartialTest.java index a0ab68b..f2971ee 100644 --- a/petstore-app/src/test/java/test/com/pyxis/petstore/view/MenuPartialTest.java +++ b/petstore-app/src/test/java/test/com/pyxis/petstore/view/MenuPartialTest.java @@ -25,6 +25,7 @@ public class MenuPartialTest { assertThat("partial", partial, withText(containsString("0"))); } + @SuppressWarnings("unchecked") @Test public void displaysTotalItemsInCartAndLinksToCart() throws Exception { partial = renderMenuPartial().using(aModel().with( diff --git a/petstore-app/src/test/java/test/com/pyxis/petstore/view/ShowReceiptViewTest.java b/petstore-app/src/test/java/test/com/pyxis/petstore/view/ShowReceiptViewTest.java index 288830e..98c3408 100644 --- a/petstore-app/src/test/java/test/com/pyxis/petstore/view/ShowReceiptViewTest.java +++ b/petstore-app/src/test/java/test/com/pyxis/petstore/view/ShowReceiptViewTest.java @@ -61,6 +61,7 @@ public class ShowReceiptViewTest { assertThat("view", showReceiptView, hasOrderTotal(orderTotal)); } + @SuppressWarnings("unchecked") @Test public void setsUpOrderDetailsColumnHeadings() { assertThat("view", showReceiptView, @@ -71,6 +72,7 @@ public class ShowReceiptViewTest { withText("Total")))); } + @SuppressWarnings("unchecked") @Test public void displaysOrderLineItemsInColumns() { assertThat("view", showReceiptView, hasSelector("#order-details tr#line-item-12345678 td", @@ -85,6 +87,7 @@ public class ShowReceiptViewTest { assertThat("view", showReceiptView, hasSelector("#order-details tr[id^='line-item']", withSize(2))); } + @SuppressWarnings("unchecked") @Test public void displaysPaymentDetails() { assertThat("view", showReceiptView, hasSelector("#payment-details span", inOrder( @@ -93,6 +96,7 @@ public class ShowReceiptViewTest { withText("12/12")))); } + @SuppressWarnings("unchecked") @Test public void displaysBillingInformation() { assertThat("view", showReceiptView, hasSelector("#billing-address span", inOrder( diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/billing/CreditCardDetailsTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/billing/CreditCardDetailsTest.java index e9d6d94..8e38d4d 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/billing/CreditCardDetailsTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/billing/CreditCardDetailsTest.java @@ -12,6 +12,7 @@ public class CreditCardDetailsTest { String SHOULD_NOT_BE_EMPTY = "{org.hibernate.validator.constraints.NotEmpty.message}"; + @SuppressWarnings("unchecked") @Test public void areInvalidWithoutACardNumber() { assertThat("constraint violations", validationOf(detailsMissingCardNumber()), violates(on("cardNumber"), withError(SHOULD_NOT_BE_EMPTY))); diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/CartTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/CartTest.java index e92c673..5af5095 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/CartTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/CartTest.java @@ -23,6 +23,7 @@ public class CartTest { assertThat("total quantity", cart.getTotalQuantity(), equalTo(0)); } + @SuppressWarnings("unchecked") @Test public void containsCartItemsInBuyingOrder() { String[] itemNumbers = { "11111111", "22222222", "33333333" }; @@ -53,6 +54,7 @@ public class CartTest { assertThat("grand total", cart.getGrandTotal(), equalTo(expectedTotal)); } + @SuppressWarnings("unchecked") @Test public void groupsItemsByNumber() { String[] itemNumbers = { "11111111", "11111111", "22222222" }; diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderNumberTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderNumberTest.java index eb1638b..4ab4728 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderNumberTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderNumberTest.java @@ -21,6 +21,7 @@ public class OrderNumberTest { assertThat("constraint violations", validationOf(aValidOrderNumber), succeeds()); } + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutANumber() { OrderNumber anEmptyOrderNumber = new OrderNumber(null); diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderTest.java index 28b2c6d..0447e73 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/order/OrderTest.java @@ -114,6 +114,7 @@ private List> matchingItemsOf(Cart cart) { return all; } + @SuppressWarnings("unchecked") private Matcher matchingCartItem(CartItem cartItem) { return with(number(cartItem.getItemNumber()), quantity(cartItem.getQuantity()), totalPrice(cartItem.getTotalPrice())); } diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemNumberTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemNumberTest.java index 3e49027..4c09311 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemNumberTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemNumberTest.java @@ -18,6 +18,7 @@ public class ItemNumberTest { assertThat("constraint violations", validationOf(aValidItemNumber), succeeds()); } + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutANumber() { ItemNumber anEmptyItemNumber = new ItemNumber(null); diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemTest.java index e5bafd9..3fad770 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ItemTest.java @@ -17,21 +17,25 @@ public class ItemTest { String SHOULD_NOT_BE_NULL = "{javax.validation.constraints.NotNull.message}"; ItemNumber AN_INVALID_NUMBER = new ItemNumber(null); + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutAProduct() { assertThat("constraint violations", validationOf(anItem().withoutAProduct()), violates(on("product"), withError(SHOULD_NOT_BE_NULL))); } + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutANumber() { assertThat("constraint violations", validationOf(anItem().withoutANumber()), violates(on("number"), withError(SHOULD_NOT_BE_NULL))); } + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutAValidNumber() { assertThat("constraint violations", validationOf(anItem().with(AN_INVALID_NUMBER)), violates(on("number.number"), withError(SHOULD_NOT_BE_NULL))); } + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutAPrice() { assertThat("constraint violations", validationOf(anItem().withoutAPrice()), violates(on("price"), withError(SHOULD_NOT_BE_NULL))); diff --git a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ProductTest.java b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ProductTest.java index 0519cd0..e081e55 100644 --- a/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ProductTest.java +++ b/petstore-domain/src/test/java/test/com/pyxis/petstore/domain/product/ProductTest.java @@ -15,11 +15,13 @@ public class ProductTest { String SHOULD_NOT_BE_NULL = "{javax.validation.constraints.NotNull.message}"; + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutAName() { assertThat("constraint violations", validationOf(aProductWithoutAName()), violates(on("name"), withError(SHOULD_NOT_BE_NULL))); } + @SuppressWarnings("unchecked") @Test public void isInvalidWithoutANumber() { assertThat("constraint violations", validationOf(aProductWithoutANumber()), violates(on("number"), withError(SHOULD_NOT_BE_NULL))); diff --git a/pom.xml b/pom.xml index a709bbc..d7e4505 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ com.pyxis.matchers all-matchers - 1.3 + 1.4-SNAPSHOT test