Author: ekoneil
Date: Mon Apr 25 08:42:26 2005
New Revision: 164589

URL: http://svn.apache.org/viewcvs?rev=164589&view=rev
Log:
Add the petstoreWeb tests to the samples/ directory.  These are living in a 
separate project called "petstoreWeb-test" which contains HTTPUnit tests that 
demonstrate how to test JPFs.

Am about to start reorganizing the petstoreWeb/ project so that it's structure 
looks like:

petstoreWeb/
  src/
  test-src/
  web/
  build.xml

BB: self
DRT: none; petstoreWeb builds


Added:
    incubator/beehive/trunk/samples/petstoreWeb-test/
    incubator/beehive/trunk/samples/petstoreWeb-test/README
    incubator/beehive/trunk/samples/petstoreWeb-test/build.xml   (with props)
    incubator/beehive/trunk/samples/petstoreWeb-test/lib/
    incubator/beehive/trunk/samples/petstoreWeb-test/src/
    incubator/beehive/trunk/samples/petstoreWeb-test/src/org/
    incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/
    incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Account.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Address.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/AllTests.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Cart.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Checkout.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Database.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Navigation.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Search.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/SignIn.java
   (with props)
    
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Util.java
   (with props)
Modified:
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/sql/initDB.sql
    
incubator/beehive/trunk/samples/petstoreWeb/account/addresses/listAddresses.jsp
    incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp
    incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp
    incubator/beehive/trunk/samples/petstoreWeb/index.jsp
    incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp
    incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp

Added: incubator/beehive/trunk/samples/petstoreWeb-test/README
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/README?rev=164589&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb-test/README (added)
+++ incubator/beehive/trunk/samples/petstoreWeb-test/README Mon Apr 25 08:42:26 
2005
@@ -0,0 +1,33 @@
+Welcome to the Beehive Petstore Unit Tests
+==========================================
+
+Requirements
+============
+
+In addition to the requirements for petstore, the following software is 
required to run the petstore unit tests:
+
+  - HTTPUnit 1.6
+
+Setup
+=====
+
+1) HTTPUnit
+
+  Download HTTPUnit 1.6 from: http://httpunit.sourceforge.net/
+
+Copy the JAR files from the lib and jars directories of 
+an HTTPUnit 1.6 install into the lib directory.
+
+Building
+========
+
+To build the tests, run the following:
+
+ant build
+
+Running the Tests
+=================
+
+To run the tests, run the following:
+
+ant test

Added: incubator/beehive/trunk/samples/petstoreWeb-test/build.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/build.xml?rev=164589&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb-test/build.xml (added)
+++ incubator/beehive/trunk/samples/petstoreWeb-test/build.xml Mon Apr 25 
08:42:26 2005
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!--
+   Copyright 2004 The Apache Software Foundation.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+   
+       http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  
+   $Header:$
+ -->
+
+<!--
+  An Ant build file for compiling and running the petstoreWeb Beehive sample 
web application HTTPUnit tests.
+  NOTE: If you wish to run these tests, you will need to copy the JAR files 
from the lib and jars directories of 
+       an HTTPUnit 1.6 install into the lib directory.
+       
+       HTTPUnit may be found here: http://httpunit.sourceforge.net/
+
+-->
+<project name="Beehive/Samples/PetstoreWeb-test" default="usage" basedir=".">
+
+    <property name="webapptest.dir" location="${basedir}"/>
+
+    <!-- Define the classpath used to build the tests -->
+    <path id="webapptest.build.classpath">
+               <!-- Need to add the resource files from petstoreWeb -->
+               <pathelement 
location="${webapptest.dir}/../petstoreWeb/WEB-INF/classes"/>
+               <pathelement location="${webapptest.dir}/classes"/>
+        <fileset dir="${webapptest.dir}/lib">
+            <include name="*.jar"/>
+        </fileset>
+    </path>    
+
+    <target name="build" description="Build the petstoreWeb HTTPUnit Tests">
+               <mkdir dir="${webapptest.dir}/classes"/>
+        <javac srcdir="${webapptest.dir}/src" 
+                        destdir="${webapptest.dir}/classes" 
+                        classpathref="webapptest.build.classpath"/>
+       </target>
+
+    <target name="clean" description="Clean the petstoreWeb tests">
+        <delete dir="${webapp.dir}/WEB-INF/classes" includeEmptyDirs="true"/>
+    </target>
+
+    <target name="test" depends="build">
+        <junit fork="yes" haltonfailure="yes" printsummary="yes" >
+            <formatter type="plain" usefile="false"/>
+            <classpath>
+                <path refid="webapptest.build.classpath"/>
+            </classpath>
+            <test name="org.apache.beehive.samples.petstore.test.AllTests"/>
+        </junit>
+    </target>
+
+    <target name="usage" description="Print usage information for this build 
file">
+        <echo>
+Welcome to the Beehive petstoreWeb sample webapp tests!  
+
+To run the tests, two steps need to occur:
+- copy the HTTPUnit jars to the lib
+- build the tests
+
+Once the webapp is built, it's ready to deploy onto your application container.
+        </echo>
+    </target>
+
+</project>
\ No newline at end of file

Propchange: incubator/beehive/trunk/samples/petstoreWeb-test/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Account.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Account.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Account.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Account.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebResponse;
+
+public class Account extends TestCase {
+
+   public void testBasicAccountForm() throws Exception 
+   {
+        /*
+         * Make sure my account looks right
+         */
+         
+         // Sign in as beehive
+         WebResponse resp = Util.doSignIn("beehive", "beehive");
+         
+         // Make sure we are signed in
+         resp = resp.getLinkWith("My Account").click();
+         
+         // Make sure things look ok
+         String[][] table = 
resp.getTableStartingWith(Util.getBundle("account", "userIdLabel") + 
":").asText(); // User ID
+         assertEquals( "beehive",  table[0][1] );
+   }
+
+   public void testAccountEditing() throws Exception 
+   {
+        /*
+         * Update Account Values, then log out and log back in again to see if 
they stuck. Finally, reset them to default values.
+         */
+         
+         // Sign in as beehive
+         WebResponse resp = Util.doSignIn("beehive", "beehive");
+         
+         // Make sure we are signed in
+         resp = resp.getLinkWith("My Account").click();
+
+         // Enter the new data in the form
+         WebForm form = resp.getForms()[1];
+         form.setParameter( "{actionForm.firstName}", "Bob" ); 
+         form.setParameter( "{actionForm.lastName}", "Smith" );
+         form.setParameter( "{actionForm.email}", "[EMAIL PROTECTED]" );
+         form.setParameter( "wlw-select_key:{actionForm.langPref}", "Japanese" 
);
+         form.setParameter( "wlw-select_key:{actionForm.favCategory}", "CATS" 
);
+         form.setCheckbox("wlw-checkbox_key:{actionForm.myListOpt}", false);
+         form.setCheckbox("wlw-checkbox_key:{actionForm.bannerOpt}", false);
+         
+         // Submit
+         resp = form.submit();
+         
+         // Logout, then login again
+         resp = resp.getLinkWith("Sign Out").click();
+         resp = Util.doSignIn("beehive", "beehive");
+         resp = resp.getLinkWith("My Account").click();
+         
+         // Make sure the values stuck
+         form = resp.getForms()[1];
+         assertEquals(form.getParameterValue("{actionForm.firstName}"), "Bob");
+         assertEquals(form.getParameterValue("{actionForm.lastName}"), 
"Smith");
+         assertEquals(form.getParameterValue("{actionForm.email}"), "[EMAIL 
PROTECTED]");
+         
assertEquals(form.getParameterValue("wlw-select_key:{actionForm.langPref}"), 
"Japanese" );
+         
assertEquals(form.getParameterValue("wlw-select_key:{actionForm.favCategory}"), 
"CATS" );
+         
assertNull(form.getParameterValue("wlw-checkbox_key:{actionForm.myListOpt}"));
+         
assertNull(form.getParameterValue("wlw-checkbox_key:{actionForm.bannerOpt}"));
+         
+         // Now set them back to the default
+         form.setParameter( "{actionForm.firstName}", "Joe" ); 
+         form.setParameter( "{actionForm.lastName}", "User" );
+         form.setParameter( "{actionForm.email}", "[EMAIL PROTECTED]" );
+         form.setParameter( "wlw-select_key:{actionForm.langPref}", "English" 
);
+         form.setParameter( "wlw-select_key:{actionForm.favCategory}", "DOGS" 
);
+         form.setCheckbox("wlw-checkbox_key:{actionForm.myListOpt}", true);
+         form.setCheckbox("wlw-checkbox_key:{actionForm.bannerOpt}", true);
+         form.submit();
+   }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Account.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Address.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Address.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Address.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Address.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+
+import com.meterware.httpunit.TableCell;
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebTable;
+
+public class Address extends TestCase {
+
+   public void testBasicAddressForm() throws Exception 
+   {
+        /*
+         * Make sure address page looks right
+         */
+         
+         // Sign in and go to addresses
+         WebResponse resp = Util.navToAddresses();
+         
+         // Make sure things look ok
+         assertNotNull(resp.getTableWithID("addresses"));
+   }
+
+   public void testAddAddress() throws Exception 
+   {
+        /*
+         * Add new address
+         */
+         
+         // Sign in and go to addresses
+         WebResponse resp = Util.navToAddresses();
+
+         // Click the add button
+         resp = resp.getFormWithID("addAddress").submit();
+         
+         // Enter the new data in the form
+         WebForm form = resp.getForms()[1];
+
+         // Make sure this is a new form
+         assertEquals(form.getParameterValue("{actionForm.name}"), "");
+         
+         // Set the new values
+         form.setParameter( "{actionForm.name}", "TestAddress" ); 
+         form.setParameter( "{actionForm.addr1}", "1234 Main Street" );
+         form.setParameter( "{actionForm.addr2}", "Apt 123" );
+         form.setParameter( "{actionForm.city}", "Seattle" );
+         form.setParameter( "{actionForm.state}", "WA" );
+         form.setParameter( "{actionForm.zip}", "98104" );
+         form.setParameter( "{actionForm.country}", "USA" );
+         form.setParameter( "{actionForm.phone}", "206-333-1234" );
+         
+         // Submit
+         resp = form.submit();
+         
+         // Make sure the address took
+         WebTable table = resp.getTableWithID("addresses");
+         assertNotNull(table);
+         TableCell cell = table.getTableCellWithID("address_TestAddress");
+         assertNotNull(cell);
+         assertTrue(cell.asText().contains("TestAddress"));
+         assertTrue(cell.asText().contains("1234 Main Street"));
+         assertTrue(cell.asText().contains("Apt 123"));
+         assertTrue(cell.asText().contains("Seattle"));
+         assertTrue(cell.asText().contains("WA"));
+         assertTrue(cell.asText().contains("98104"));
+         assertTrue(cell.asText().contains("USA"));
+         assertTrue(cell.asText().contains("206-333-1234"));     
+   }
+   
+   public void testEditAddress() throws Exception 
+   {
+        /*
+         * Edit the address we just added
+         */
+
+          // Sign in and go to addresses
+         WebResponse resp = Util.navToAddresses();
+
+         // Get the newly added address
+         WebTable table = resp.getTableWithID("addresses");
+         assertNotNull(table);
+         TableCell cell = table.getTableCellWithID("address_TestAddress");
+         assertNotNull(cell);
+         
+         // Edit the address by clicking the edit link
+         resp = cell.getLinkWith(Util.getBundle("view", 
"buttonEdit")).click(); // "Edit"
+         
+         // Enter the new data in the form
+         WebForm form = resp.getForms()[1];
+
+         // Make sure this is the right form
+         assertEquals(form.getParameterValue("{actionForm.name}"), 
"TestAddress");
+         
+         // Set the new values
+         form.setParameter( "{actionForm.name}", "EditedTestAddress" ); 
+         form.setParameter( "{actionForm.addr1}", "543 Main Street" );
+         form.setParameter( "{actionForm.addr2}", "Unit 345" );
+         form.setParameter( "{actionForm.city}", "Portland" );
+         form.setParameter( "{actionForm.state}", "OR" );
+         form.setParameter( "{actionForm.zip}", "98799" );
+         form.setParameter( "{actionForm.country}", "USA2" );
+         form.setParameter( "{actionForm.phone}", "208-222-3456" );
+         
+         // Submit
+         resp = form.submit();
+         
+         // Make sure the address took
+         table = resp.getTableWithID("addresses");
+         assertNotNull(table);
+         cell = table.getTableCellWithID("address_EditedTestAddress");
+         assertNotNull(cell);
+         assertTrue(cell.asText().contains("EditedTestAddress"));
+         assertTrue(cell.asText().contains("543 Main Street"));
+         assertTrue(cell.asText().contains("Unit 345"));
+         assertTrue(cell.asText().contains("Portland"));
+         assertTrue(cell.asText().contains("OR"));
+         assertTrue(cell.asText().contains("98799"));
+         assertTrue(cell.asText().contains("USA2"));
+         assertTrue(cell.asText().contains("208-222-3456"));     
+   }
+   
+   public void testRemoveAddress() throws Exception 
+   {
+         // Sign in and go to addresses
+         WebResponse resp = Util.navToAddresses();
+
+         // Get the newly added address
+         WebTable table = resp.getTableWithID("addresses");
+         assertNotNull(table);
+         TableCell cell = 
table.getTableCellWithID("address_EditedTestAddress");
+         assertNotNull(cell);
+         
+         // Click the remove link
+         resp = cell.getLinkWith(Util.getBundle("view", 
"buttonRemove")).click();
+         
+         // Make sure it's gone
+         table = resp.getTableWithID("addresses");
+         assertNotNull(table);
+         cell = table.getTableCellWithID("address_EditedTestAddress");
+         assertNull(cell);
+   }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Address.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/AllTests.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/AllTests.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/AllTests.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/AllTests.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test Suite for HTTPUnit.
+ * Tests all main functionality and is localization independent.
+ */
+public class AllTests extends TestSuite{
+    
+       public static Test suite() 
+       {
+        TestSuite suite = new TestSuite();
+               suite.addTestSuite(Database.class);
+               suite.addTestSuite(Navigation.class);
+               suite.addTestSuite(Search.class);
+               suite.addTestSuite(SignIn.class);
+               suite.addTestSuite(Account.class);
+               suite.addTestSuite(Address.class);
+               suite.addTestSuite(Cart.class);
+               suite.addTestSuite(Checkout.class); 
+        return suite;
+    }
+
+     public static void main( String[] args ) {
+        junit.textui.TestRunner.run( suite() );
+    }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Cart.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Cart.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Cart.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Cart.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebTable;
+
+public class Cart extends TestCase {
+
+   public void testEmptyCart() throws Exception 
+   {
+        /*
+         * Test the cart is empty at startup
+         */
+         
+      // Start the conversation
+         WebResponse resp = Util.navToCart();
+
+         // Make sure the cart is empty
+         assertTrue(resp.getText().contains(Util.getBundle("view", 
"emptyCartMessage"))); // "Your cart is empty."
+         
+   }
+
+   public void testAddItem() throws Exception 
+   {
+         /*
+          * Add an item to the cart
+          */
+
+         // Go to the spotted koi page
+         WebResponse resp = Util.navToItem("EST-4");      
+
+         // Add the item to the cart
+         resp = resp.getFormWithID("addToCart").submit();
+
+         // Make sure item is in the cart
+         // Check the first two rows of the table
+         WebTable itemTable = resp.getTableStartingWith(Util.getBundle("view", 
"itemIdLabel")); // "Item ID"
+         itemTable.purgeEmptyCells();
+         String[][] table = itemTable.asText();
+         assertEquals( "EST-4", table[1][0].trim());
+         assertEquals( "FI-FW-01", table[1][1].trim());
+         assertTrue( table[1][2].contains("Spotted") );
+         assertEquals( "$18.50",  table[1][6].trim() );
+   }
+   
+   public void testRemoveItem() throws Exception 
+   {
+        /*
+         * Test the cart is empty after adding then removing an item
+         */
+         
+      // Start the conversation
+         WebResponse resp = Util.navToCart();
+
+         // Make sure the cart is empty
+         assertTrue(resp.getText().contains(Util.getBundle("view", 
"emptyCartMessage"))); // "Your cart is empty."
+         
+         // Add an item
+         // Go to the spotted koi page
+         resp = Util.navToItem("EST-4");          
+
+         // Add the item to the cart
+         resp = resp.getFormWithID("addToCart").submit();
+
+         // Make sure item is in the cart
+         // Check the first two rows of the table
+         WebTable itemTable = resp.getTableStartingWith(Util.getBundle("view", 
"itemIdLabel")); // "Item ID"
+         itemTable.purgeEmptyCells();
+         String[][] table = itemTable.asText();
+         assertEquals( "EST-4", table[1][0].trim());
+         
+         // Now remove it
+         resp = resp.getLinkWith(Util.getBundle("view", 
"buttonRemove")).click(); // "Remove"
+         
+         // Make sure the cart is empty
+         assertTrue(resp.getText().contains(Util.getBundle("view", 
"emptyCartMessage"))); // "Your cart is empty."
+   }
+   
+   public void testUpdateQuantity() throws Exception 
+   {
+        /*
+         * Test the cart quantity is updated correctly
+         */
+         
+      // Start the conversation
+         WebResponse resp = Util.navToCart();
+
+         // Make sure the cart is empty
+         assertTrue(resp.getText().contains("Your cart is empty."));
+         
+         // Add an item
+         // Go to the spotted koi page
+         resp = Util.navToItem("EST-4");          
+
+         // Add the item to the cart
+         resp = resp.getFormWithID("addToCart").submit();
+
+         // Make sure item is in the cart
+         // Check the first two rows of the table
+         WebTable itemTable = resp.getTableStartingWith("Item ID");
+         itemTable.purgeEmptyCells();
+         String[][] table = itemTable.asText();
+         assertEquals( "EST-4", table[1][0].trim());
+         
+         // Set quantity to 3
+         WebForm form = resp.getFormWithID("cart");
+         form.setParameter("{actionForm.cart.lineItems[0].quantity}", "3");
+         resp = form.submit();
+         
+         // Make sure the Total is $55.50
+         itemTable = resp.getTableStartingWith("Item ID");
+         itemTable.purgeEmptyCells();
+         table = itemTable.asText();
+         assertEquals( "$55.50",  table[1][6].trim() );
+   }   
+   
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Cart.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Checkout.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Checkout.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Checkout.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Checkout.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+
+import com.meterware.httpunit.HttpUnitOptions;
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebTable;
+
+public class Checkout extends TestCase {
+
+   public void testCheckOut() throws Exception 
+   {
+         /*
+          * Add an item to the cart, then proceed through checkout
+          */
+
+         // Turn off javaScript
+         HttpUnitOptions.setScriptingEnabled(false);
+         
+         // Go to the spotted koi page
+         WebResponse resp = Util.navToItem("EST-4");      
+
+         // Add the item to the cart
+         resp = resp.getFormWithID("addToCart").submit();
+
+         // Make sure item is in the cart
+         // Check the first two rows of the table
+         WebTable itemTable = resp.getTableStartingWith(Util.getBundle("view", 
"itemIdLabel")); // "Item ID"
+         itemTable.purgeEmptyCells();
+         String[][] table = itemTable.asText();
+         assertEquals( "EST-4", table[1][0].trim());
+         
+         // proceed to checkout
+         resp = resp.getLinkWith(Util.getBundle("view", 
"buttonProceedToCheckout") + " >>").click(); // "Proceed to Checkout"
+         
+         // Make sure it says Checkout Summary
+         assertTrue(resp.getText().contains(Util.getBundle("view", 
"checkoutSummaryLabel"))); // "Checkout Summary"
+         
+         // Now click continue
+         resp = resp.getLinkWith(Util.getBundle("view", "buttonContinue") + " 
>>").click(); // "Continue >>"
+         
+         // Sign in
+         WebForm form = resp.getForms()[1];
+         form.setParameter( "j_username", "beehive" ); 
+         form.setParameter( "j_password", "beehive" );
+         resp = form.submit();   
+         
+         // Enter the Checkout Info
+         form = resp.getForms()[1];
+         form.setParameter( "wlw-select_key:{actionForm.order.cardType}", 
"American Express" );
+         form.setParameter( "{actionForm.order.creditCard}", "1234" ); 
+         form.setParameter( "{actionForm.order.exprDate}", "09-2000" );
+         form.setParameter( 
"wlw-radio_button_group_key:{actionForm.order.billingAddress}", "1" );
+         form.setParameter( 
"wlw-radio_button_group_key:{actionForm.order.shippingAddress}", "1" );
+         resp = form.submit();
+         
+         // Make sure it took
+         assertTrue(resp.getText().contains(Util.getBundle("view", 
"confirmMessage"))); // "Please confirm the information below and then press 
continue..."
+         itemTable = resp.getTableStartingWith("New Order");
+         itemTable.purgeEmptyCells();
+         table = itemTable.asText();
+         assertEquals( "American Express", table[2][1].trim());
+         assertEquals( "1234", table[3][1].trim());
+         assertEquals( "09-2000", table[4][1].trim());
+         
+         // Click Continue
+         resp = resp.getLinkWith(Util.getBundle("view", "buttonContinue") + " 
>>").click(); // "Continue >>"
+
+         // Make sure it took
+         assertTrue(resp.getText().contains(Util.getBundle("view", 
"orderSubmittedMessage"))); // "Thank you, your order has been submitted."
+   }
+
+   public void testOrders() throws Exception 
+   {
+         // Sign in as beehive
+         WebResponse resp = Util.doSignIn("beehive", "beehive");
+         
+         // Go to my account
+         resp = resp.getLinkWith("My Account").click();
+         
+         // go to orders 
+         resp = resp.getLinkWith(Util.getBundle("account", 
"listOrdersLabel")).click(); // "List Orders"
+         
+         // Make sure the new order appears with the proper total price 
+         WebTable itemTable = resp.getTableStartingWith(Util.getBundle("view", 
"orderId")); // "Order ID"
+         String[][] table = itemTable.asText();
+         assertEquals( "1", table[1][0].trim());
+         assertEquals( "$18.50",  table[1][2].trim() );          
+   }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Checkout.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Database.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Database.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Database.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Database.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+import com.meterware.httpunit.WebResponse;
+
+public class Database extends TestCase {
+
+   public void testInitialize() throws Exception 
+   {
+        /*
+         * Test the initialization of the db
+         * 
+         * Run this test first so we start with a clean DB
+         */
+
+      // Start the conversation
+         WebResponse resp = Util.navToFrontPage();
+         
+         // Click the init link
+         resp = resp.getLinkWithID("initDB").click();
+         
+         // Make sure it worked
+         assertTrue(resp.getText().contains("DB Initialized."));
+   }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Database.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Navigation.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Navigation.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Navigation.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Navigation.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebTable;
+
+public class Navigation extends TestCase {
+
+   public void testBasicNavigation() throws Exception 
+   {
+         /* 
+          * Used to test that a user can click through to all the pages
+          * Later tests go to individual links
+          */
+
+      // Start the conversation
+         WebResponse resp = Util.navToFrontPage();
+
+         // Go to the store
+         resp = resp.getLinkWithID("enter").click();
+
+         // Click on the Fish Link
+         resp = resp.getLinkWith("Fish").click();
+
+         // Click on the Koi Link
+         resp = resp.getLinkWith("FI-FW-01").click();
+         
+         // Click on the First Spotted Koi Link
+         resp = resp.getLinkWith("EST-4").click();
+         
+         // Make sure it has the right text
+         assertTrue(resp.getText().contains("Fresh Water fish from Japan"));
+   }
+       
+   public void testFrontPage() throws Exception 
+   {
+      // Start the conversation
+         WebResponse resp = Util.navToFrontPage();
+         
+         // Make sure the front page looks correct
+         assertEquals(resp.getTitle().trim(), Util.getBundle("view", 
"indexTitle")); // "Beehive Petstore Demo"
+         assertNotNull(resp.getLinkWith(Util.getBundle("view", "adminInit"))); 
// "Initialize the DB (recreates all tables and data)"
+         assertNotNull(resp.getLinkWith(Util.getBundle("view", "adminStop"))); 
// "Stop Derby DB (stops the DB to allow redeploy)"
+   }
+
+   public void testStore() throws Exception 
+   {
+      // Start the conversation
+         WebResponse resp = Util.navToStore();
+         
+         // Make sure main catalog page looks correct
+         assertNotNull(resp.getLinkWith("Fish"));
+         assertNotNull(resp.getLinkWith("Dogs"));
+         assertNotNull(resp.getLinkWith("Reptiles"));
+         assertNotNull(resp.getLinkWith("Cats"));
+         assertNotNull(resp.getLinkWith("Birds"));
+   }
+
+   public void testFishCatagory() throws Exception 
+   {
+      // Start the conversation
+         WebResponse resp = Util.navToCategory("FISH");
+         
+         // Check the first two rows of the table
+         String[][] table = resp.getTableStartingWith(Util.getBundle("view", 
"productIdLabel")).asText(); // "Product ID"
+         assertEquals( Util.getBundle("view", "productIdLabel"), table[0][0] 
); //"Product ID"
+         assertEquals( Util.getBundle("view", "nameLabel"), table[0][1] ); // 
"Name"
+         assertEquals( Util.getBundle("view", "descriptionLabel"), table[0][2] 
); // "Description"
+         assertEquals( "FI-FW-01",  table[1][0].trim() );
+         assertEquals( "Koi",  table[1][1] );
+         assertEquals( "Fresh Water fish from Japan",  table[1][2] );
+   }
+
+   public void testKoiProducts() throws Exception 
+   {
+      // Start the conversation
+         WebResponse resp = Util.navToProduct("FI-FW-01");
+         
+         // Check the first two rows of the table
+         String[][] table = resp.getTableStartingWith(Util.getBundle("view", 
"itemIdLabel")).asText(); // "Item ID"
+         assertEquals( Util.getBundle("view", "itemIdLabel"), table[0][0] ); 
// "Item ID"
+         assertEquals( Util.getBundle("view", "productIdLabel"), table[0][1] 
); // "Product ID"
+         assertEquals( Util.getBundle("view", "descriptionLabel"), table[0][2] 
); // "Description"
+         assertEquals( Util.getBundle("view", "listPriceLabel"), table[0][3] 
); // "List Price"
+         assertEquals( "EST-4",  table[1][0].trim() );
+         assertEquals( "FI-FW-01",  table[1][1] );
+         assertTrue( table[1][2].contains( "Spotted" ) );
+         assertEquals( "$18.50",  table[1][3].trim() );
+         
+         // Check the text of the page
+         assertTrue(resp.getText().contains("(Fresh Water fish from Japan)"));
+   }
+
+   public void testKoiItem() throws Exception 
+   {
+      // Start the conversation
+         WebResponse resp = Util.navToItem("EST-4");
+         
+         // Check the first two rows of the table
+         WebTable itemTable = resp.getTableStartingWith("EST-4");
+         itemTable.purgeEmptyCells();
+         String[][] table = itemTable.asText();
+         assertEquals( "EST-4",  table[0][0].trim() );
+         assertTrue( table[1][0].contains("Spotted") );
+         assertEquals( "Fresh Water fish from Japan",  table[2][0] );
+         assertTrue( table[3][0].contains("in Stock") );
+         assertEquals( "$18.50",  table[4][0].trim() );
+   }
+
+}
\ No newline at end of file

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Navigation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Search.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Search.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Search.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Search.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebResponse;
+import com.meterware.httpunit.WebTable;
+
+public class Search extends TestCase {
+
+          public void testBasicSearch() throws Exception 
+          {
+                /*
+                 * Test the basic search mechanism by searching for 'Cat'
+                 */
+                  
+                 // Start the search
+                 WebResponse resp = doSearch("Cat");
+                 
+                 // Make sure we got to the results page
+                 assertTrue(resp.getText().contains(Util.getBundle("search", 
"searchResultsLabel"))); // "Search Results"
+                 
+                 // Make sure we got the right results
+                 WebTable itemTable = 
resp.getTableStartingWith(Util.getBundle("view", "productIdLabel"));
+                 itemTable.purgeEmptyCells();
+                 String[][] table = itemTable.asText();
+                 assertEquals( Util.getBundle("view", "productIdLabel"), 
table[0][0] ); // "Product ID"
+                 assertEquals( Util.getBundle("view", "nameLabel"),  
table[0][1] ); // "Name"
+                 assertEquals( Util.getBundle("view", "descriptionLabel"),  
table[0][2] ); // "Description"
+                 assertEquals( "FL-DLH-02",  table[1][0].trim() );
+                 assertEquals( "Persian",  table[1][1].trim() );
+                 assertEquals( "Friendly house cat, doubles as a princess",  
table[1][2].trim() );
+                 assertEquals( "FL-DSH-01",  table[2][0].trim() );
+                 assertEquals( "Manx",  table[2][1].trim() );
+                 assertEquals( "Great for reducing mouse populations",  
table[2][2].trim() );
+          }
+
+          public void testNothingFound() throws Exception 
+          {
+                 /*
+                  * Test when no search items are found by searching for bogus 
text
+                  */
+
+                 // Start the search
+                 WebResponse resp = doSearch("Should Find Nothing");
+                 
+                 // Make sure we got to the results page
+                 assertTrue(resp.getText().contains(Util.getBundle("search", 
"searchResultsLabel"))); // "Search Results"
+
+                 // Make sure we got no results
+                 assertTrue(resp.getText().contains(Util.getBundle("search", 
"noSearchResults"))); // "No products found"
+          }
+
+          public void testNothingEntered() throws Exception 
+          {
+                 /*
+                  * For now, searching on an empty search term will find every 
product in the catalog
+                  * This should be 17 products
+                  */
+
+                 // Start the search
+                 WebResponse resp = doSearch("");
+                 
+                 // Make sure we got to the results page
+                 assertTrue(resp.getText().contains(Util.getBundle("search", 
"searchResultsLabel"))); // "Search Results"
+
+                 // Make sure we got the right results
+                 WebTable itemTable = 
resp.getTableStartingWith(Util.getBundle("view", "productIdLabel")); //"Product 
ID"
+                 assertEquals(itemTable.getRowCount(), 17);
+          }
+          
+          private WebResponse doSearch(String searchTerm) throws Exception
+          {
+                       // Start the conversation
+                       WebResponse resp = Util.navToStore();
+                         
+                       // Get the search form
+                       WebForm form = resp.getFormWithName("Netui_Form_0");
+                         
+                       // Set the search term
+                       form.setParameter( "{actionForm.keyword}", searchTerm 
); 
+       
+                       // Submit
+                       return form.submit();
+          }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Search.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/SignIn.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/SignIn.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/SignIn.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/SignIn.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import junit.framework.TestCase;
+import com.meterware.httpunit.WebResponse;
+
+public class SignIn extends TestCase {
+
+   public void testBasicSignIn() throws Exception 
+   {
+        /*
+         * Test the basic sign in mechanism by signing in as beehive
+         */
+         
+         // Sign in as beehive
+         WebResponse resp = Util.doSignIn("beehive", "beehive");
+         
+         // Make sure we are signed in
+         assertNotNull(resp.getLinkWith("Sign Out"));
+   }
+
+   public void testSignOut() throws Exception 
+   {
+         /*
+          * Sign in, then sign out
+          */
+
+         // Sign in as beehive
+         WebResponse resp = Util.doSignIn("beehive", "beehive");
+          
+         // Sign Out
+         resp = resp.getLinkWith("Sign Out").click();
+         
+         // Make sure we are signed out
+         assertNotNull(resp.getLinkWith("Sign In"));             
+   }
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/SignIn.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Util.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Util.java?rev=164589&view=auto
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Util.java
 (added)
+++ 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Util.java
 Mon Apr 25 08:42:26 2005
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.beehive.samples.petstore.test;
+
+import java.util.ResourceBundle;
+
+import com.meterware.httpunit.HttpUnitOptions;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebForm;
+import com.meterware.httpunit.WebResponse;
+
+public class Util {
+
+       private static String _baseURL = "http://localhost:8080/petstoreWeb/";;
+       
+       public static WebResponse navToFrontPage() throws Exception {
+                 return navTo("");     }
+
+       public static WebResponse navToStore() throws Exception {
+                 return navTo("shop/begin.do"); }
+
+       public static WebResponse navToCart() throws Exception {
+         return navTo("rootSharedFlow.globalViewCart.do"); }
+
+       public static WebResponse navToCategory(String sCategory) throws 
Exception {
+                 return navTo("shop/viewCategory.do?catId=" + sCategory); }
+
+       public static WebResponse navToProduct(String sProduct) throws 
Exception {
+                 return navTo("shop/viewProduct.do?productId=" + sProduct); }
+
+       public static WebResponse navToItem(String sItem) throws Exception {
+                 return navTo("shop/viewItem.do?itemId=" + sItem); }
+       
+       public static WebResponse doSignIn(String userName, String password) 
throws Exception
+       {
+               // Turn off javaScript
+               HttpUnitOptions.setScriptingEnabled(false);
+               
+               // Start the conversation
+               WebResponse resp = Util.navToStore();
+               
+               // Click the Sign In link
+               resp = resp.getLinkWith("Sign In").click();
+               
+               // Enter the username/password in the form
+               WebForm form = resp.getForms()[1];
+               form.setParameter( "j_username", userName ); 
+               form.setParameter( "j_password", password );
+               
+               // Submit
+               return form.submit();
+       }
+
+       public static WebResponse navToAddresses() throws Exception 
+       {
+               // Sign in as beehive
+               WebResponse resp = Util.doSignIn("beehive", "beehive");
+               
+               // Make sure we are signed in
+               resp = resp.getLinkWith("My Account").click();
+               
+               // Go to the address page
+               return resp.getLinkWith(Util.getBundle("account", 
"listAddressesLabel")).click(); // "Add/Edit Addresses"
+       }
+       
+       private static WebResponse navTo(String sURL) throws Exception 
+       {
+             // Start the conversation
+                 WebConversation wc = new WebConversation();
+             return wc.getResponse(_baseURL + sURL);
+       }
+       
+       public static String getBundle(String bundleType, String bundle)
+       {
+               // Get localized label
+               ResourceBundle resBundle = 
ResourceBundle.getBundle("org.apache.beehive.samples.petstore.resources." + 
bundleType);
+               return resBundle.getString(bundle);
+       }
+
+}

Propchange: 
incubator/beehive/trunk/samples/petstoreWeb-test/src/org/apache/beehive/samples/petstore/test/Util.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/sql/initDB.sql
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/sql/initDB.sql?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/sql/initDB.sql 
(original)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/sql/initDB.sql Mon 
Apr 25 08:42:26 2005
@@ -1,81 +1,81 @@
--- Drop existing tables in proper order
-drop table OrderItems;
-drop table Orders;
-drop table Addresses;
-drop table Accounts;
-drop table Items;
-drop table Products;
-drop table Categories;
-
---- Create tables in proper order
-create table Categories(catId varchar(10) not null primary key, name 
varchar(20) not null, image varchar(20) not null, description varchar(100) not 
null);
-create table Products(productId varchar(10) not null primary key, catID 
varchar(10) references Categories(catId) not null, name varchar(20) not null, 
image varchar(30) not null, description varchar(100) not null);
-create table Items(itemId varchar(10) not null primary key, productId 
varchar(10) references Products(productId) not null, listPrice numeric(8,2) not 
null, unitCost numeric(8,2) not null, supplier int not null, status varchar(10) 
not null, attr1 varchar(20), inventoryQuantity int not null);
-create table Accounts(userId varchar(20) not null primary key, password 
varchar(20) not null, email varchar(50) not null, firstName varchar(20) not 
null, lastName varchar(30) not null, status varchar(20) not null, favCategory 
varchar(10) not null references Categories(catId), langPref varchar(20), 
bannerData varchar(20), myListOpt smallint not null, bannerOpt smallint not 
null);
-
--- Derby Specific
-create table Addresses(addressId int not null GENERATED ALWAYS AS IDENTITY 
primary key, userId varchar(20) references Accounts(userId) not null, name 
varchar(100) not null, phone char(12) not null, addr1 varchar(100) not null, 
addr2 varchar(100), city varchar(100) not null, state varchar(20) not null, zip 
varchar(12) not null, country varchar(20) not null);
-create table Orders(orderId int not null GENERATED ALWAYS AS IDENTITY primary 
key, userId varchar(20) references Accounts(userId), orderDate timestamp not 
null DEFAULT current_timestamp, totalPrice numeric(8,2) not null, creditCard 
varchar(20) not null, exprDate varchar(20) not null, cardType varchar(20) not 
null, status varchar(10) not null, shippingAddress int references 
Addresses(addressId) not null, billingAddress int references 
Addresses(addressId) not null);
-
--- PostgreSQL Specific
--- create table Addresses(addressId serial primary key, userId varchar(20) 
references Accounts(userId) not null, name varchar(100) not null, phone 
char(12) not null, addr1 varchar(100) not null, addr2 varchar(100), city 
varchar(100) not null, state varchar(20) not null, zip varchar(12) not null, 
country varchar(20) not null);
--- create table Orders(orderId serial primary key, userId varchar(20) 
references Accounts(userId), orderDate timestamp not null DEFAULT 
current_timestamp, totalPrice numeric(8,2) not null, creditCard varchar(20) not 
null, exprDate varchar(20) not null, cardType varchar(20) not null, status 
varchar(10) not null, shippingAddress int references Addresses(addressId) not 
null, billingAddress int references Addresses(addressId) not null);
-
-create table OrderItems(orderId int not null references Orders(orderId), 
itemId varchar(10) not null references Items(ItemId), quantity int not null, 
primary key (orderId, itemId));
-
--- Add data to tables
-insert into Categories values('FISH', 'Fish', 'fish_icon.gif', 'Saltwater, 
Freshwater');
-insert into Categories values('DOGS', 'Dogs', 'dogs_icon.gif', 'Various 
Breeds');
-insert into Categories values('REPTILES', 'Reptiles', 'reptiles_icon.gif', 
'Lizards, Turtles, Snakes');
-insert into Categories values('CATS', 'Cats', 'cats_icon.gif', 'Various 
Breeds, Exotic Varieties');
-insert into Categories values('BIRDS', 'Birds', 'birds_icon.gif', 'Exotic 
Varieties');
-
-insert into Accounts (userId, password, email, firstName, lastName, status, 
favCategory, langPref, bannerData, myListOpt, bannerOpt) values ('beehive', 
'beehive', '[EMAIL PROTECTED]', 'Joe', 'User', 'OK', 'DOGS', 'ENGLISH', '', 1, 
1);
-
-insert into Addresses  (name, userId, addr1, addr2, city, state, zip, country, 
phone) values ('Home', 'beehive', '901 San Antonio Road', 'MS UCUP02-206', 
'Palo Alto', 'CA', '94303', 'USA', '555-555-5555');
-
-insert into Products values ('AV-CB-01', 'BIRDS', 'Amazon Parrot', 
'bird2.jpg', 'Great companion for up to 75 years');
-insert into Products values ('AV-SB-02', 'BIRDS', 'Finch', 'bird1.jpg', 'Great 
stress reliever');
-insert into Products values ('FI-FW-01', 'FISH', 'Koi', 'fish3.jpg', 'Fresh 
Water fish from Japan');
-insert into Products values ('FI-FW-02', 'FISH', 'Goldfish', 'fish2.jpg', 
'Fresh Water fish from China');
-insert into Products values ('FI-SW-01', 'FISH', 'Angelfish', 'fish1.jpg', 
'Salt Water fish from Australia');
-insert into Products values ('FI-SW-02', 'FISH', 'Tiger Shark', 'fish4.jpg', 
'Salt Water fish from Australia');
-insert into Products values ('FL-DLH-02', 'CATS', 'Persian', 'cat1.jpg', 
'Friendly house cat, doubles as a princess');
-insert into Products values ('FL-DSH-01', 'CATS', 'Manx', 'cat2.jpg', 'Great 
for reducing mouse populations');
-insert into Products values ('K9-BD-01', 'DOGS', 'Bulldog', 'dog1.jpg', 
'Friendly dog from England');
-insert into Products values ('K9-CW-01', 'DOGS', 'Chihuahua', 'dog2.jpg', 
'Great companion dog');
-insert into Products values ('K9-DL-01', 'DOGS', 'Dalmation', 'dog3.jpg', 
'Great dog for a Fire Station');
-insert into Products values ('K9-PO-02', 'DOGS', 'Poodle', 'dog6.jpg', 'Cute 
dog from France');
-insert into Products values ('K9-RT-01', 'DOGS', 'Golden Retriever', 
'dog4.jpg', 'Great family dog');
-insert into Products values ('K9-RT-02', 'DOGS', 'Labrador Retriever', 
'dog5.jpg', 'Great hunting dog');
-insert into Products values ('RP-LI-02', 'REPTILES', 'Iguana', 'lizard1.jpg', 
'Friendly green friend');
-insert into Products values ('RP-SN-01', 'REPTILES', 'Rattlesnake', 
'snake1.jpg', 'Doubles as a watch dog');
-
-insert into Items values ('EST-1', 'FI-SW-01', 16.50, 10.00, 1, 'P', 'Large', 
10000);
-insert into Items values ('EST-2', 'FI-SW-01', 16.50, 10.00, 1, 'P', 'Small', 
10000);
-insert into Items values ('EST-3', 'FI-SW-02', 18.50, 12.00, 1, 'P', 
'Toothless', 10000);
-insert into Items values ('EST-4', 'FI-FW-01', 18.50, 12.00, 1, 'P', 
'Spotted', 10000);
-insert into Items values ('EST-5', 'FI-FW-01', 18.50, 12.00, 1, 'P', 
'Spotless', 10000);
-insert into Items values ('EST-6', 'K9-BD-01', 18.50, 12.00, 1, 'P', 'Male 
Adult', 10000);
-insert into Items values ('EST-7', 'K9-BD-01', 18.50, 12.00, 1, 'P', 'Female 
Puppy', 10000);
-insert into Items values ('EST-8', 'K9-PO-02', 18.50, 12.00, 1, 'P', 'Male 
Puppy', 10000);
-insert into Items values ('EST-9', 'K9-DL-01', 18.50, 12.00, 1, 'P', 'Spotless 
Male Puppy', 10000);
-insert into Items values ('EST-10', 'K9-DL-01', 18.50, 12.00, 1, 'P', 'Spotted 
Adult Female', 10000);
-insert into Items values ('EST-11', 'RP-SN-01', 18.50, 12.00, 1, 'P', 
'Venomless', 10000);
-insert into Items values ('EST-12', 'RP-SN-01', 18.50, 12.00, 1, 'P', 
'Rattleless', 10000);
-insert into Items values ('EST-13', 'RP-LI-02', 18.50, 12.00, 1, 'P', 'Green 
Adult', 10000);
-insert into Items values ('EST-14', 'FL-DSH-01', 58.50, 12.00, 1, 'P', 
'Tailless', 10000);
-insert into Items values ('EST-15', 'FL-DSH-01', 23.50, 12.00, 1, 'P', 'With 
tail', 10000);
-insert into Items values ('EST-16', 'FL-DLH-02', 93.50, 12.00, 1, 'P', 'Adult 
Female', 10000);
-insert into Items values ('EST-17', 'FL-DLH-02', 93.50, 12.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-18', 'AV-CB-01', 193.50, 92.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-19', 'AV-SB-02', 15.50, 2.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-20', 'FI-FW-02', 5.50, 2.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-21', 'FI-FW-02', 5.29, 1.00, 1, 'P', 'Adult 
Female', 10000);
-insert into Items values ('EST-22', 'K9-RT-02', 135.50, 100.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-23', 'K9-RT-02', 145.49, 100.00, 1, 'P', 'Adult 
Female', 10000);
-insert into Items values ('EST-24', 'K9-RT-02', 255.50, 92.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-25', 'K9-RT-02', 325.29, 90.00, 1, 'P', 'Adult 
Female', 10000);
-insert into Items values ('EST-26', 'K9-CW-01', 125.50, 92.00, 1, 'P', 'Adult 
Male', 10000);
-insert into Items values ('EST-27', 'K9-CW-01', 155.29, 90.00, 1, 'P', 'Adult 
Female', 10000);
-insert into Items values ('EST-28', 'K9-RT-01', 155.29, 90.00, 1, 'P', 'Adult 
Female', 10000);
+-- Drop existing tables in proper order
+drop table OrderItems;
+drop table Orders;
+drop table Addresses;
+drop table Accounts;
+drop table Items;
+drop table Products;
+drop table Categories;
+
+--- Create tables in proper order
+create table Categories(catId varchar(10) not null primary key, name 
varchar(20) not null, image varchar(20) not null, description varchar(100) not 
null);
+create table Products(productId varchar(10) not null primary key, catID 
varchar(10) references Categories(catId) not null, name varchar(20) not null, 
image varchar(30) not null, description varchar(100) not null);
+create table Items(itemId varchar(10) not null primary key, productId 
varchar(10) references Products(productId) not null, listPrice numeric(8,2) not 
null, unitCost numeric(8,2) not null, supplier int not null, status varchar(10) 
not null, attr1 varchar(20), inventoryQuantity int not null);
+create table Accounts(userId varchar(20) not null primary key, password 
varchar(20) not null, email varchar(50) not null, firstName varchar(20) not 
null, lastName varchar(30) not null, status varchar(20) not null, favCategory 
varchar(10) not null references Categories(catId), langPref varchar(20), 
bannerData varchar(20), myListOpt smallint not null, bannerOpt smallint not 
null);
+
+-- Derby Specific
+create table Addresses(addressId int not null GENERATED ALWAYS AS IDENTITY 
primary key, userId varchar(20) references Accounts(userId) not null, name 
varchar(100) not null, phone char(12) not null, addr1 varchar(100) not null, 
addr2 varchar(100), city varchar(100) not null, state varchar(20) not null, zip 
varchar(12) not null, country varchar(20) not null);
+create table Orders(orderId int not null GENERATED ALWAYS AS IDENTITY primary 
key, userId varchar(20) references Accounts(userId), orderDate timestamp not 
null DEFAULT current_timestamp, totalPrice double not null, creditCard 
varchar(20) not null, exprDate varchar(20) not null, cardType varchar(20) not 
null, status varchar(10) not null, shippingAddress int references 
Addresses(addressId) not null, billingAddress int references 
Addresses(addressId) not null);
+
+-- PostgreSQL Specific
+-- create table Addresses(addressId serial primary key, userId varchar(20) 
references Accounts(userId) not null, name varchar(100) not null, phone 
char(12) not null, addr1 varchar(100) not null, addr2 varchar(100), city 
varchar(100) not null, state varchar(20) not null, zip varchar(12) not null, 
country varchar(20) not null);
+-- create table Orders(orderId serial primary key, userId varchar(20) 
references Accounts(userId), orderDate timestamp not null DEFAULT 
current_timestamp, totalPrice numeric(8,2) not null, creditCard varchar(20) not 
null, exprDate varchar(20) not null, cardType varchar(20) not null, status 
varchar(10) not null, shippingAddress int references Addresses(addressId) not 
null, billingAddress int references Addresses(addressId) not null);
+
+create table OrderItems(orderId int not null references Orders(orderId), 
itemId varchar(10) not null references Items(ItemId), quantity int not null, 
primary key (orderId, itemId));
+
+-- Add data to tables
+insert into Categories values('FISH', 'Fish', 'fish_icon.gif', 'Saltwater, 
Freshwater');
+insert into Categories values('DOGS', 'Dogs', 'dogs_icon.gif', 'Various 
Breeds');
+insert into Categories values('REPTILES', 'Reptiles', 'reptiles_icon.gif', 
'Lizards, Turtles, Snakes');
+insert into Categories values('CATS', 'Cats', 'cats_icon.gif', 'Various 
Breeds, Exotic Varieties');
+insert into Categories values('BIRDS', 'Birds', 'birds_icon.gif', 'Exotic 
Varieties');
+
+insert into Accounts (userId, password, email, firstName, lastName, status, 
favCategory, langPref, bannerData, myListOpt, bannerOpt) values ('beehive', 
'beehive', '[EMAIL PROTECTED]', 'Joe', 'User', 'OK', 'DOGS', 'ENGLISH', '', 1, 
1);
+
+insert into Addresses  (name, userId, addr1, addr2, city, state, zip, country, 
phone) values ('Home', 'beehive', '901 San Antonio Road', 'MS UCUP02-206', 
'Palo Alto', 'CA', '94303', 'USA', '555-555-5555');
+
+insert into Products values ('AV-CB-01', 'BIRDS', 'Amazon Parrot', 
'bird2.jpg', 'Great companion for up to 75 years');
+insert into Products values ('AV-SB-02', 'BIRDS', 'Finch', 'bird1.jpg', 'Great 
stress reliever');
+insert into Products values ('FI-FW-01', 'FISH', 'Koi', 'fish3.jpg', 'Fresh 
Water fish from Japan');
+insert into Products values ('FI-FW-02', 'FISH', 'Goldfish', 'fish2.jpg', 
'Fresh Water fish from China');
+insert into Products values ('FI-SW-01', 'FISH', 'Angelfish', 'fish1.jpg', 
'Salt Water fish from Australia');
+insert into Products values ('FI-SW-02', 'FISH', 'Tiger Shark', 'fish4.jpg', 
'Salt Water fish from Australia');
+insert into Products values ('FL-DLH-02', 'CATS', 'Persian', 'cat1.jpg', 
'Friendly house cat, doubles as a princess');
+insert into Products values ('FL-DSH-01', 'CATS', 'Manx', 'cat2.jpg', 'Great 
for reducing mouse populations');
+insert into Products values ('K9-BD-01', 'DOGS', 'Bulldog', 'dog1.jpg', 
'Friendly dog from England');
+insert into Products values ('K9-CW-01', 'DOGS', 'Chihuahua', 'dog2.jpg', 
'Great companion dog');
+insert into Products values ('K9-DL-01', 'DOGS', 'Dalmation', 'dog3.jpg', 
'Great dog for a Fire Station');
+insert into Products values ('K9-PO-02', 'DOGS', 'Poodle', 'dog6.jpg', 'Cute 
dog from France');
+insert into Products values ('K9-RT-01', 'DOGS', 'Golden Retriever', 
'dog4.jpg', 'Great family dog');
+insert into Products values ('K9-RT-02', 'DOGS', 'Labrador Retriever', 
'dog5.jpg', 'Great hunting dog');
+insert into Products values ('RP-LI-02', 'REPTILES', 'Iguana', 'lizard1.jpg', 
'Friendly green friend');
+insert into Products values ('RP-SN-01', 'REPTILES', 'Rattlesnake', 
'snake1.jpg', 'Doubles as a watch dog');
+
+insert into Items values ('EST-1', 'FI-SW-01', 16.50, 10.00, 1, 'P', 'Large', 
10000);
+insert into Items values ('EST-2', 'FI-SW-01', 16.50, 10.00, 1, 'P', 'Small', 
10000);
+insert into Items values ('EST-3', 'FI-SW-02', 18.50, 12.00, 1, 'P', 
'Toothless', 10000);
+insert into Items values ('EST-4', 'FI-FW-01', 18.50, 12.00, 1, 'P', 
'Spotted', 10000);
+insert into Items values ('EST-5', 'FI-FW-01', 18.50, 12.00, 1, 'P', 
'Spotless', 10000);
+insert into Items values ('EST-6', 'K9-BD-01', 18.50, 12.00, 1, 'P', 'Male 
Adult', 10000);
+insert into Items values ('EST-7', 'K9-BD-01', 18.50, 12.00, 1, 'P', 'Female 
Puppy', 10000);
+insert into Items values ('EST-8', 'K9-PO-02', 18.50, 12.00, 1, 'P', 'Male 
Puppy', 10000);
+insert into Items values ('EST-9', 'K9-DL-01', 18.50, 12.00, 1, 'P', 'Spotless 
Male Puppy', 10000);
+insert into Items values ('EST-10', 'K9-DL-01', 18.50, 12.00, 1, 'P', 'Spotted 
Adult Female', 10000);
+insert into Items values ('EST-11', 'RP-SN-01', 18.50, 12.00, 1, 'P', 
'Venomless', 10000);
+insert into Items values ('EST-12', 'RP-SN-01', 18.50, 12.00, 1, 'P', 
'Rattleless', 10000);
+insert into Items values ('EST-13', 'RP-LI-02', 18.50, 12.00, 1, 'P', 'Green 
Adult', 10000);
+insert into Items values ('EST-14', 'FL-DSH-01', 58.50, 12.00, 1, 'P', 
'Tailless', 10000);
+insert into Items values ('EST-15', 'FL-DSH-01', 23.50, 12.00, 1, 'P', 'With 
tail', 10000);
+insert into Items values ('EST-16', 'FL-DLH-02', 93.50, 12.00, 1, 'P', 'Adult 
Female', 10000);
+insert into Items values ('EST-17', 'FL-DLH-02', 93.50, 12.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-18', 'AV-CB-01', 193.50, 92.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-19', 'AV-SB-02', 15.50, 2.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-20', 'FI-FW-02', 5.50, 2.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-21', 'FI-FW-02', 5.29, 1.00, 1, 'P', 'Adult 
Female', 10000);
+insert into Items values ('EST-22', 'K9-RT-02', 135.50, 100.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-23', 'K9-RT-02', 145.49, 100.00, 1, 'P', 'Adult 
Female', 10000);
+insert into Items values ('EST-24', 'K9-RT-02', 255.50, 92.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-25', 'K9-RT-02', 325.29, 90.00, 1, 'P', 'Adult 
Female', 10000);
+insert into Items values ('EST-26', 'K9-CW-01', 125.50, 92.00, 1, 'P', 'Adult 
Male', 10000);
+insert into Items values ('EST-27', 'K9-CW-01', 155.29, 90.00, 1, 'P', 'Adult 
Female', 10000);
+insert into Items values ('EST-28', 'K9-RT-01', 155.29, 90.00, 1, 'P', 'Adult 
Female', 10000);

Modified: 
incubator/beehive/trunk/samples/petstoreWeb/account/addresses/listAddresses.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/account/addresses/listAddresses.jsp?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- 
incubator/beehive/trunk/samples/petstoreWeb/account/addresses/listAddresses.jsp 
(original)
+++ 
incubator/beehive/trunk/samples/petstoreWeb/account/addresses/listAddresses.jsp 
Mon Apr 25 08:42:26 2005
@@ -6,14 +6,6 @@
 
 <netui-data:declarePageInput name="addresses" 
type="org.apache.beehive.samples.petstore.model.address[]" required="true"/>
 
-<script language="javascript">
-       function VerifyDelete(sName, nID)
-       {
-               if (confirm('Delete address named ' + sName + '?'))
-                       window.location.href = 
'${pageContext.request.contextPath}/account/addresses/deleteAddress.do?addressId='
 + nID;
-       }
-</script>              
-       
 <netui-template:template templatePage="/site/template.jsp">
     <netui-template:section name="leftnav"> &nbsp; </netui-template:section>
 
@@ -26,11 +18,11 @@
                            <netui:span styleClass="boldlabel" 
value="${bundle.view.addresses}"/>
                            <netui-data:repeater 
dataSource="pageInput.addresses" defaultText="<br/><br/>No addresses 
found<br/><br/>">
                                <netui-data:repeaterHeader>
-                                   <table class="tablegreen">
+                                   <table class="tablegreen" id="addresses">
                                </netui-data:repeaterHeader>
                                <netui-data:repeaterItem>
                                    <tr valign="top" class="rowyellow">
-                                       <td class="celldata">
+                                       <td class="celldata" 
id="address_${container.item.name}">
                                            <netui:span 
value="${container.item.name}" /><br/>
                                            <netui:span 
value="${container.item.addr1}" /><br/>
                                            <netui:span 
value="${container.item.addr2}" />
@@ -43,17 +35,13 @@
                                            <netui:span 
value="${container.item.country}" /><br/>
                                            <netui:span 
value="${container.item.phone}" /><br/>
                                            <center>
-                                                               <table>
-                                                                       <tr>
-                                                                               
<td><netui:form action="createUpdateAddress">
-                                                                               
                <input type="hidden" name="addressId" 
value="${container.item.addressId}"/>
-                                                                               
                <netui:button value="${bundle.view.buttonEdit}"/>&nbsp;&nbsp;
-                                                                               
        </netui:form>
-                                                                               
</td>
-                                                                               
<td>&nbsp;&nbsp;<netui:button value="${bundle.view.buttonRemove}" 
onClick="javascript:VerifyDelete('${container.item.name}', 
${container.item.addressId});" />
-                                                                               
</td>
-                                                                       </tr>
-                                                               </table>
+                                                               <netui:anchor 
action="createUpdateAddress" value="${bundle.view.buttonEdit}">
+                                                                       
<netui:parameter name="addressId" value="${container.item.addressId}"/>
+                                                               </netui:anchor>
+                                                               
&nbsp;&nbsp;&nbsp;&nbsp;
+                                                               <netui:anchor 
action="deleteAddress" value="${bundle.view.buttonRemove}" >
+                                                                       
<netui:parameter name="addressId" value="${container.item.addressId}"/>
+                                                               </netui:anchor>
                                                    </center>
                                        </td>
                                    </tr>
@@ -64,7 +52,7 @@
                            </netui-data:repeater>
                            <br/>
                            <center>
-                           <netui:form action="createUpdateAddress">
+                           <netui:form action="createUpdateAddress" 
tagId="addAddress">
                                        <netui:button 
value="${bundle.view.buttonAddAddress}" />&nbsp;&nbsp;
                                </netui:form> 
                        <c:if test="${sharedFlow.rootSharedFlow.account.status 
== 'checking_out'}">

Modified: incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/confirm.jsp Mon Apr 25 
08:42:26 2005
@@ -19,18 +19,8 @@
       <beehive-petstore:orderSummary />
       <p>
       <center>
-
-               <table>
-                       <tr>
-                               <td><netui:form action="viewCreateOrder">
-                                       <netui:button value="<< 
${bundle.view.buttonPrevious}" />&nbsp;&nbsp;
-                               </netui:form></td>
-                               <td><netui:form action="confirm">
-                                       &nbsp;&nbsp;<netui:button 
value="${bundle.view.buttonContinue} >>" />
-                               </netui:form></td>
-                       </tr>
-               </table>
-
-               </center>
+      <netui:anchor action="viewCreateOrder" value="<< 
${bundle.view.buttonPrevious}" />&nbsp;&nbsp;
+         <netui:anchor action="confirm" value="${bundle.view.buttonContinue} 
>>"/>
+         </center>
     </netui-template:section>
 </netui-template:template>

Modified: incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/checkout/viewCart.jsp Mon Apr 
25 08:42:26 2005
@@ -71,8 +71,6 @@
         </tr>
     </table>
     <br/>
-       <netui:form action="createNewOrder">
-      <netui:button value="${bundle.view.buttonContinue} >>" />
-       </netui:form>
+       <netui:anchor action="createNewOrder" 
value="${bundle.view.buttonContinue} >>" />
     </center> </netui-template:section>
 </netui-template:template>

Modified: incubator/beehive/trunk/samples/petstoreWeb/index.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/index.jsp?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/index.jsp (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/index.jsp Mon Apr 25 08:42:26 
2005
@@ -24,13 +24,13 @@
                     <p align="center">
                     <netui:span styleClass="boldlabel" 
value="${bundle.view.welcome}"/>
                     <br/>
-                    <netui:anchor href="shop/Controller.jpf">
+                    <netui:anchor tagId="enter" href="shop/Controller.jpf">
                         ${bundle.view.enterTheStore}
                     </netui:anchor>
                     <br/><br/>
                     <c:if test="${pageContext.request.serverName == 
'localhost'}">
                            <b>${bundle.view.adminTitle}</b><br>
-                           <netui:anchor 
action="initDB">${bundle.view.adminInit}</netui:anchor><br/>
+                           <netui:anchor tagId="initDB" 
action="initDB">${bundle.view.adminInit}</netui:anchor><br/>
                            <netui:anchor 
action="stopDB">${bundle.view.adminStop}</netui:anchor><br/>
                            <netui:label value="${requestScope.message}" />
                        </c:if>

Modified: incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/cart.jsp Mon Apr 25 
08:42:26 2005
@@ -29,7 +29,7 @@
     <netui-data:declareBundle 
bundlePath="org.apache.beehive.samples.petstore.resources.view" name="view"/>
     <netui:errors/>
     <netui:span styleClass="boldlabel" 
value="${bundle.view.shoppingCartLabel}"/>
-    <netui:form action="updateCartQuantities">
+    <netui:form action="updateCartQuantities" tagId="cart">
         <table class="tablegreen">
             <tr class="rowgrey">
                 <td class="celldata"><b>${bundle.view.itemIdLabel}</b></td>
@@ -77,7 +77,9 @@
                     </netui:span>
                     </td>
                     <td class="celldata">
-                    <netui:button value="${bundle.view.buttonRemove}" 
onClick="javascript:window.location.href='${pageContext.request.contextPath}/shop/removeItemFromCart.do?workingItemId=${container.item.item.itemId}';"
 />
+                    <netui:anchor action="removeItemFromCart" 
value="${bundle.view.buttonRemove}">
+                       <netui:parameter name="workingItemId" 
value="${container.item.item.itemId}" />
+                    </netui:anchor>
                     </td>
                 </tr>
             </netui-data:repeater>
@@ -101,7 +103,7 @@
         </table>
         <c:if test="${actionForm.cart.lineItems != null && 
fn:length(actionForm.cart.lineItems) > 0}">
                <br/>
-               <netui:button value="${bundle.view.buttonProceedToCheckout} >>" 
action="checkout" />
+               <netui:anchor value="${bundle.view.buttonProceedToCheckout} >>" 
action="checkout" />
         </c:if>
     </netui:form>
     </center>

Modified: incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp?rev=164589&r1=164588&r2=164589&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp (original)
+++ incubator/beehive/trunk/samples/petstoreWeb/shop/item.jsp Mon Apr 25 
08:42:26 2005
@@ -61,7 +61,7 @@
       </tr>
       <tr class="rowyellow">
         <td class="celldata">
-          <netui:form action="addItemToCart" method="get">
+          <netui:form action="addItemToCart" tagId="addToCart" method="get">
                  <input type="hidden" name="workingItemId" 
value="${pageInput.item.itemId}"/>
                  <netui:button value="${bundle.view.buttonAddToCart}" />
           </netui:form>


Reply via email to