Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:testinfected/petstore
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre Thibodeau committed Dec 22, 2010
2 parents de599bf + be2d5b9 commit 97e755a
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 6 deletions.
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
Expand Up @@ -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();
Expand All @@ -42,6 +43,7 @@ public class ItemsViewTest {
withBlankText())));
}

@SuppressWarnings("unchecked")
@Test public void
displaysProductDetailsInColumns() throws Exception {
itemsView = renderItemsView().using(aModel().listing(anItem().
Expand All @@ -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();
Expand Down
Expand Up @@ -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(
Expand Down
Expand Up @@ -61,6 +61,7 @@ public class ShowReceiptViewTest {
assertThat("view", showReceiptView, hasOrderTotal(orderTotal));
}

@SuppressWarnings("unchecked")
@Test public void
setsUpOrderDetailsColumnHeadings() {
assertThat("view", showReceiptView,
Expand All @@ -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",
Expand All @@ -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(
Expand All @@ -93,6 +96,7 @@ public class ShowReceiptViewTest {
withText("12/12"))));
}

@SuppressWarnings("unchecked")
@Test public void
displaysBillingInformation() {
assertThat("view", showReceiptView, hasSelector("#billing-address span", inOrder(
Expand Down
Expand Up @@ -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)));
Expand Down
Expand Up @@ -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" };
Expand Down Expand Up @@ -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" };
Expand Down
Expand Up @@ -21,6 +21,7 @@ public class OrderNumberTest {
assertThat("constraint violations", validationOf(aValidOrderNumber), succeeds());
}

@SuppressWarnings("unchecked")
@Test public void
isInvalidWithoutANumber() {
OrderNumber anEmptyOrderNumber = new OrderNumber(null);
Expand Down
Expand Up @@ -114,6 +114,7 @@ private List<Matcher<? super LineItem>> matchingItemsOf(Cart cart) {
return all;
}

@SuppressWarnings("unchecked")
private Matcher<LineItem> matchingCartItem(CartItem cartItem) {
return with(number(cartItem.getItemNumber()), quantity(cartItem.getQuantity()), totalPrice(cartItem.getTotalPrice()));
}
Expand Down
Expand Up @@ -18,6 +18,7 @@ public class ItemNumberTest {
assertThat("constraint violations", validationOf(aValidItemNumber), succeeds());
}

@SuppressWarnings("unchecked")
@Test public void
isInvalidWithoutANumber() {
ItemNumber anEmptyItemNumber = new ItemNumber(null);
Expand Down
Expand Up @@ -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)));
Expand Down
Expand Up @@ -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)));
Expand Down
4 changes: 2 additions & 2 deletions petstore-system-tests/pom.xml
Expand Up @@ -254,9 +254,9 @@
</includes>
<systemPropertyVariables>
<!-- Uncomment to change webdriver and jetty runtime options -->
<!--<webdriver.factory.class>test.support.com.pyxis.petstore.web.webdriver.SingletonWebDriverFactorydriver.factory.class>-->
<!--<webdriver.factory.class>test.support.com.pyxis.petstore.web.webdriver.ClassicWebDriverFactory</webdriver.factory.class>-->
<!--<webdriver.class>org.openqa.selenium.chrome.ChromeDriver</webdriver.class>-->
<!--<serverdriver.factory.class>test.support.com.pyxis.petstore.web.serverdriver.SingletonServerDriverFactory</serverdriver.factory.class>-->
<serverdriver.factory.class>test.support.com.pyxis.petstore.web.serverdriver.ExternallyManagedServerDriverFactory</serverdriver.factory.class>
<timeServer.host>${test.timeServer.host}</timeServer.host>
<timeServer.port>${test.timeServer.port}</timeServer.port>
<server.port>${test.server.port}</server.port>
Expand Down
4 changes: 0 additions & 4 deletions pom.xml
Expand Up @@ -377,8 +377,4 @@
</snapshotRepository>
<downloadUrl>${pyxis.distributionManagement.downloadUrl}</downloadUrl>
</distributionManagement>
<scm>
<connection>scm:git:git://github.com/testinfected/petstore.git</connection>
<url>scm:git:git://github.com/testinfected/petstore.git</url>
</scm>
</project>

0 comments on commit 97e755a

Please sign in to comment.