Author: sannegrinovero
Date: 2011-01-10 12:58:12 -0500 (Mon, 10 Jan 2011)
New Revision: 13983
Modified:
branches/community/Seam_2_2/examples/dvdstore/
branches/community/Seam_2_2/examples/dvdstore/build-jboss6.xml
branches/community/Seam_2_2/examples/dvdstore/build.xml
branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/test/SearchTest.java
Log:
JBSEAM-4759 - fix DVD-Store example test failures
Property changes on: branches/community/Seam_2_2/examples/dvdstore
___________________________________________________________________
Name: svn:ignore
- build
test-build
dist
exploded-archives
dvdindexes
staging-jbossas6
exploded-archives-jbossas6
dist-jbossas6
+ build
test-build
dist
exploded-archives
dvdindexes
staging-jbossas6
exploded-archives-jbossas6
dist-jbossas6
lib
Modified: branches/community/Seam_2_2/examples/dvdstore/build-jboss6.xml
===================================================================
--- branches/community/Seam_2_2/examples/dvdstore/build-jboss6.xml 2011-01-09 22:55:46 UTC
(rev 13982)
+++ branches/community/Seam_2_2/examples/dvdstore/build-jboss6.xml 2011-01-10 17:58:12 UTC
(rev 13983)
@@ -1,23 +1,23 @@
<?xml version="1.0"?>
<project name="DvdStore" default="deploy"
basedir=".">
- <!-- Naming -->
- <property name="Name" value="Seam Dvd Store
Example"/>
- <property name="example.name"
value="jboss-seam-dvdstore"/>
- <property name="jboss6" value="yes"/>
+ <!-- Naming -->
+ <property name="Name" value="Seam Dvd Store
Example"/>
+ <property name="example.name"
value="jboss-seam-dvdstore"/>
+ <property name="jboss6" value="yes"/>
<!-- Libraries -->
- <property name="seam.ui.lib" value="yes" />
- <property name="seam.debug.lib" value="yes" />
- <property name="facelets.lib" value="yes" />
- <property name="jbpm.lib" value="yes" />
- <property name="search.lib" value="yes" />
- <property name="urlrewrite.lib" value="yes"/>
+ <property name="seam.ui.lib" value="yes" />
+ <property name="seam.debug.lib" value="yes" />
+ <property name="facelets.lib" value="yes" />
+ <property name="jbpm.lib" value="yes" />
+ <property name="search.lib" value="yes" />
+ <property name="urlrewrite.lib" value="yes"/>
<target name="init" depends="preparesrc">
<antcall target="SeamExample.init"/>
<path id="build.classpath.extras">
<fileset dir="${lib.search.dir}">
- <include name="*.jar"/>
+ <include name="*.jar" />
</fileset>
</path>
</target>
@@ -38,5 +38,5 @@
</target>
<import file="../build.xml"/>
-
+
</project>
Modified: branches/community/Seam_2_2/examples/dvdstore/build.xml
===================================================================
--- branches/community/Seam_2_2/examples/dvdstore/build.xml 2011-01-09 22:55:46 UTC (rev
13982)
+++ branches/community/Seam_2_2/examples/dvdstore/build.xml 2011-01-10 17:58:12 UTC (rev
13983)
@@ -26,6 +26,8 @@
<path id="build.classpath.extras">
<fileset dir="${lib.search.dir}">
<include name="*.jar"/>
+ <!-- Exclude at least wicket or it has tests fail-->
+ <exclude name="*wicket*.jar" />
</fileset>
<fileset dir="${example.lib.dir}">
<include name="*.jar"/>
Modified:
branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/test/SearchTest.java
===================================================================
---
branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/test/SearchTest.java 2011-01-09
22:55:46 UTC (rev 13982)
+++
branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/test/SearchTest.java 2011-01-10
17:58:12 UTC (rev 13983)
@@ -9,6 +9,7 @@
import org.testng.annotations.Test;
import com.jboss.dvd.seam.FullTextSearch;
+import com.jboss.dvd.seam.Product;
public class SearchTest
extends SeamTest
@@ -36,9 +37,14 @@
protected void renderResponse()
{
ListDataModel model = (ListDataModel) lookup("searchResults");
- assertEquals("page size", 4, model.getRowCount());
+ //exact number of matches depends on search algorithm,
+ //so we only check that at least something was found:
+ assertTrue("should have found
something",model.isRowAvailable());
+ Product firstMatch = (Product) model.getRowData();
+ assertTrue("at least top match should have keyword in title",
+ firstMatch.getTitle().toLowerCase().contains("king"));
assertTrue("in conversation", isLongRunningConversation());
- }
+ }
}.run();
}