1   package org.paneris.jammyjoes.functional;
2   
3   import net.sourceforge.jwebunit.WebTestCase;
4   
5   public class TestCaseFunctionalSingleItem extends WebTestCase {
6   
7      public TestCaseFunctionalSingleItem(String name) {
8         super(name);
9      }
10  
11     public void setUp() {
12        getTestContext().setBaseUrl("http://localhost/toys");
13     }
14  
15    public void testDiscontinuedWithoutStock() throws Exception {
16      beginAt("/4568");
17      assertTextPresent("Sorry, we no longer stock this item");
18      assertTextPresent("location.href = \"/\";");
19    }
20  
21    public void testCurrentItemOutOfStock() throws Exception {
22      beginAt("/4736");
23      assertTextPresent("Sorry, but this item is temporarily out of stock");
24    }
25  
26    public void testDoNotReorderWithoutStock() throws Exception {
27      beginAt("/4762");
28      assertTextPresent("Sorry, we no longer stock this item");
29      assertTextPresent("location.href = \"/\";");
30    }
31  
32    public void testDoNotReorderWithStock() throws Exception {
33      beginAt("/4646");
34      assertTextPresent("/images/add.gif");
35    }
36  
37    public void testDiscontinuedWithStock() throws Exception {
38      beginAt("/2926");
39      assertTextPresent("/images/add.gif");
40    }
41  
42  }