Author: manaRH
Date: 2010-03-18 19:11:45 -0400 (Thu, 18 Mar 2010)
New Revision: 12218
Modified:
branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/src/org/jboss/seam/example/seambay/CategoryAction.java
branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/view/sell2.xhtml
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
Log:
JBPAPP-3182
Modified:
branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/src/org/jboss/seam/example/seambay/CategoryAction.java
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/src/org/jboss/seam/example/seambay/CategoryAction.java 2010-03-18
22:45:30 UTC (rev 12217)
+++
branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/src/org/jboss/seam/example/seambay/CategoryAction.java 2010-03-18
23:11:45 UTC (rev 12218)
@@ -9,6 +9,7 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.remoting.WebRemote;
@Name("categoryAction")
public class CategoryAction
@@ -44,6 +45,7 @@
@SuppressWarnings("unchecked")
@Factory("allCategories")
+ @WebRemote
public List<Category> getAllCategories()
{
allCategories = entityManager.createQuery("from
Category").getResultList();
Modified: branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/view/sell2.xhtml
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/view/sell2.xhtml 2010-03-18
22:45:30 UTC (rev 12217)
+++ branches/enterprise/JBPAPP_4_3_FP01/examples/seambay/view/sell2.xhtml 2010-03-18
23:11:45 UTC (rev 12218)
@@ -65,10 +65,9 @@
<script type="text/javascript"
src="sell2.js"></script>
<s:remote include="categoryAction"/>
-
- <script type="text/javascript">
- // Make a remoting call to load the categories
- Seam.Remoting.eval(CATEGORY_EXPR, loadCategories);
- </script>
- </body>
+
+ <script type="text/javascript">
+
Seam.Component.getInstance("categoryAction").getAllCategories(loadCategories);
+ </script>
+</body>
</html>
Modified:
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java
===================================================================
---
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java 2010-03-18
22:45:30 UTC (rev 12217)
+++
branches/enterprise/JBPAPP_4_3_FP01/src/test/ftest/examples/seambay/src/org/jboss/seam/example/seambay/test/selenium/SellTest.java 2010-03-18
23:11:45 UTC (rev 12218)
@@ -24,8 +24,12 @@
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
+import java.text.NumberFormat;
+
import org.testng.annotations.Test;
+import bsh.ParseException;
+
import com.thoughtworks.selenium.Wait;
/**
@@ -36,9 +40,10 @@
public class SellTest extends SeleniumSeamBayTest
{
private long listWaitTime = 5000;
+ private NumberFormat nf = NumberFormat.getInstance();
@Test(dependsOnGroups={"searchTest"})
- public void joystickSellingTest()
+ public void joystickSellingTest() throws NumberFormatException,
java.text.ParseException
{
String title = "Saitek X52 Pro Flight System";
int category = 7;
@@ -50,7 +55,7 @@
sellItem(title, category, subcategory, duration, price, description);
}
- protected void sellItem(String title, int category, int subcategory, String duration,
String price, String description)
+ protected void sellItem(String title, int category, int subcategory, String duration,
String price, String description) throws java.text.ParseException, NumberFormatException
{
login();
browser.clickAndWait(getProperty("SELL"));
@@ -125,10 +130,10 @@
browser.clickAndWait(getProperty("SELL_NEXT"));
}
- protected void validatePreview(String price, String description)
+ protected void validatePreview(String price, String description) throws
java.text.ParseException, NumberFormatException
{
assertTrue("Must be on preview page to validate preview.",
browser.getLocation().contains(getProperty("SELL_PREVIEW_URL")));
- assertEquals("Unexpected price on preview page.", Double.valueOf(price),
Double.valueOf(browser.getText(getProperty("SELL_PREVIEW_PRICE"))));
+ assertEquals("Unexpected price on preview page.", Double.valueOf(price),
nf.parse(browser.getText(getProperty("SELL_PREVIEW_PRICE"))).doubleValue());
assertEquals("Unexpected description on description page.", description,
browser.getText(getProperty("SELL_PREVIEW_DESCRIPTION")));
}
}