Seam SVN: r11386 - branches/enterprise/JBPAPP_5_0/src/test/ftest.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2009-08-14 12:53:31 -0400 (Fri, 14 Aug 2009)
New Revision: 11386
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
Log:
JBPAPP-2497 Added a functional test for helloworld example
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-08-14 15:52:11 UTC (rev 11385)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-08-14 16:53:31 UTC (rev 11386)
@@ -22,7 +22,7 @@
-->
<!-- core build file for executing and managing Seam functional tests -->
-<project name="ftest.base.build" default="testall" basedir=".">
+<project name="ftest.base.build" basedir=".">
<!-- Location of Seam -->
<dirname property="seam.dir" file="${ant.file.ftest.base.build}/../../../" />
@@ -42,149 +42,72 @@
</fileset>
</path>
- <!-- TODO : should the libs be in seam/lib and managed with mvn? -->
- <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="../../../lib/groovy-all.jar"/>
-
- <target name="testall" description="Run functional testsuite based on container property">
- <fail unless="container">Please set container property.</fail>
- <antcall target="testall.${container}" />
- </target>
-
- <target name="testall.jboss4" description="Run functional testsuite for JBoss 4">
- <property name="container" value="jboss4" />
- <antcall target="start.container" />
+ <target name="testall.1" description="Run functional testsuite for JBoss 5">
+ <property name="container" value="jboss5" />
<antcall target="start.selenium.server" />
- <!-- Execute tests for all examples jboss-->
<testexample name="blog" />
<testexample name="booking" />
<testexample name="drools" />
<testexample name="dvdstore" />
<testexample name="contactlist" />
- <testexample name="excel" />
- <testexample name="groovybooking" />
- <testexample name="hibernate" />
- <testexample name="icefaces" />
- <testexample name="itext" />
- <testexample name="jpa" />
- <testexample name="mail" />
- <testexample name="messages" />
- <testexample name="nestedbooking" />
- <testexample name="numberguess" />
- <testexample name="openid" />
- <testexample name="quartz" />
- <testexample name="registration" />
- <testexample name="remoting/chatroom" />
- <testexample name="rss" />
- <testexample name="seambay" />
- <testexample name="seamdiscs" />
- <testexample name="seampay" />
- <testexample name="seamspace" />
- <testexample name="spring" />
- <testexample name="todo" />
- <testexample name="ui" />
- <testexample name="wicket" />
- <testexample name="wicket-runtime" />
<antcall target="stop.selenium.server" />
- <antcall target="stop.container" />
</target>
- <target name="testall.jboss5" description="Run functional testsuite for JBoss 5">
+ <target name="testall.2" description="Run functional testsuite for JBoss 5">
<property name="container" value="jboss5" />
- <antcall target="start.container" />
<antcall target="start.selenium.server" />
- <!-- Execute tests for all examples jboss-->
- <testexample name="blog" />
- <testexample name="booking" />
- <testexample name="drools" />
- <testexample name="dvdstore" />
- <testexample name="contactlist" />
<testexample name="excel" />
- <testexample name="guice" />
<testexample name="groovybooking" />
<testexample name="hibernate" />
- <testexample name="icefaces" />
<testexample name="itext" />
<testexample name="jee5/booking" />
+ <antcall target="stop.selenium.server" />
+ </target>
+
+ <target name="testall.3" description="Run functional testsuite for JBoss 5">
+ <property name="container" value="jboss5" />
+ <antcall target="start.selenium.server" />
<testexample name="jpa" />
<testexample name="mail" />
<testexample name="messages" />
- <testexample name="metawidget/booking" />
- <testexample name="metawidget/dvdstore" />
- <testexample name="metawidget/groovybooking" />
<testexample name="nestedbooking" />
<testexample name="numberguess" />
+ <antcall target="stop.selenium.server" />
+ </target>
+
+ <target name="testall.4" description="Run functional testsuite for JBoss 5">
+ <property name="container" value="jboss5" />
+ <antcall target="start.selenium.server" />
<testexample name="openid" />
<testexample name="quartz" />
<testexample name="registration" />
<testexample name="remoting/chatroom" />
<testexample name="remoting/helloworld" />
- <testexample name="rss" />
<testexample name="seambay" />
+ <antcall target="stop.selenium.server" />
+ </target>
+
+ <target name="testall.5" description="Run functional testsuite for JBoss 5">
+ <property name="container" value="jboss5" />
+ <antcall target="start.selenium.server" />
<testexample name="seampay" />
<testexample name="seamspace" />
<testexample name="spring" />
<testexample name="todo" />
<testexample name="ui" />
- <testexample name="wicket" />
- <testexample name="wicket-runtime" />
<antcall target="stop.selenium.server" />
- <antcall target="stop.container" />
</target>
- <target name="testall.jboss-embedded" description="Run functional testsuite for JBoss Embedded">
- <property name="container" value="jboss-embedded" />
- <antcall target="start.selenium.server" />
- <!-- Execute tests for all examples on jboss-embedded -->
- <testexample name="blog" />
- <testexample name="dvdstore" />
- <testexample name="messages" />
- <testexample name="numberguess" />
- <testexample name="registration" />
- <testexample name="seambay" />
- <testexample name="seampay" />
- <testexample name="todo" />
- <testexample name="booking" />
- <testexample name="jpa" />
- <testexample name="hibernate" />
- <antcall target="stop.selenium.server" />
- </target>
-
- <target name="testall.tomcat6" description="Run functional testsuite for Tomcat 6">
-
- <property name="container" value="tomcat6" />
- <antcall target="start.selenium.server" />
-
- <testexample name="jpa" />
- <testexample name="hibernate" />
-
- <antcall target="stop.selenium.server" />
- </target>
-
<target name="test" description="Run tests for single example. Container selection is based on the value of container property">
<fail unless="container">Please set container property.</fail>
<antcall target="test.${container}" />
</target>
-
- <target name="test.jboss4" description="Run tests for single example on JBoss 4">
- <property name="container" value="jboss4" />
- <antcall target="test.single.example" />
- </target>
-
+
<target name="test.jboss5" description="Run tests for single example on JBoss 5">
<property name="container" value="jboss5" />
<antcall target="test.single.example" />
</target>
- <target name="test.tomcat6" description="Run tests for single example on Tomcat 6">
- <property name="container" value="tomcat6" />
- <antcall target="test.single.example" />
- </target>
-
- <target name="test.jboss-embedded" description="Run tests for single example on JBoss Embedded">
- <property name="container" value="jboss-embedded" />
- <antcall target="test.single.example" />
- </target>
-
<target name="test.single.example">
<antcall target="start.selenium.server" />
@@ -201,18 +124,13 @@
<cleanexample name="dvdstore" />
<cleanexample name="contactlist" />
<cleanexample name="excel" />
- <cleanexample name="guice" />
<cleanexample name="groovybooking" />
<cleanexample name="hibernate" />
- <cleanexample name="icefaces" />
<cleanexample name="itext" />
<cleanexample name="jee5/booking" />
<cleanexample name="jpa" />
<cleanexample name="mail" />
<cleanexample name="messages" />
- <cleanexample name="metawidget/booking" />
- <cleanexample name="metawidget/dvdstore" />
- <cleanexample name="metawidget/groovybooking" />
<cleanexample name="nestedbooking" />
<cleanexample name="numberguess" />
<cleanexample name="openid" />
@@ -220,7 +138,6 @@
<cleanexample name="registration" />
<cleanexample name="remoting/chatroom" />
<cleanexample name="remoting/helloworld" />
- <cleanexample name="rss" />
<cleanexample name="seambay" />
<cleanexample name="seamdiscs" />
<cleanexample name="seampay" />
@@ -228,8 +145,6 @@
<cleanexample name="spring" />
<cleanexample name="todo" />
<cleanexample name="ui" />
- <cleanexample name="wicket" />
- <cleanexample name="wicket-runtime" />
</target>
<target name="undeployall">
@@ -241,23 +156,17 @@
<undeployexample name="contactlist" />
<undeployexample name="excel" />
<undeployexample name="groovybooking" />
- <undeployexample name="guice" />
<undeployexample name="hibernate" />
- <undeployexample name="icefaces" />
<undeployexample name="itext" />
<undeployexample name="jee5/booking" />
<undeployexample name="jpa" />
<undeployexample name="mail" />
<undeployexample name="messages" />
- <undeployexample name="metawidget/booking" />
- <undeployexample name="metawidget/dvdstore" />
- <undeployexample name="metawidget/groovybooking" />
<undeployexample name="nestedbooking" />
<undeployexample name="numberguess" />
<undeployexample name="openid" />
<undeployexample name="quartz" />
<undeployexample name="registration" />
- <undeployexample name="rss" />
<undeployexample name="remoting/chatroom" />
<undeployexample name="remoting/helloworld" />
<undeployexample name="seambay" />
@@ -267,7 +176,6 @@
<undeployexample name="spring" />
<undeployexample name="todo" />
<undeployexample name="ui" />
- <undeployexample name="wicket" />
</target>
@@ -299,17 +207,6 @@
<attribute name="path" default="examples/@{name}" />
<attribute name="message" default="Running functional tests on @{name} example" />
<sequential>
- <groovy>
- <![CDATA[
- def testExamplesRunSoFar = properties['testExamplesRunSoFar'] == null ? 0 : Integer.valueOf(properties['testExamplesRunSoFar']);
- def jbossDeploymentsRestart = properties['jboss.deployments.restart'] == null ? 0 : Integer.valueOf(properties['jboss.deployments.restart']);
- if (jbossDeploymentsRestart > 0 && testExamplesRunSoFar > 0 && testExamplesRunSoFar % jbossDeploymentsRestart == 0 ) {
- ant.antcall(target:"restart.container");
- }
- testExamplesRunSoFar++;
- properties['testExamplesRunSoFar'] = testExamplesRunSoFar;
- ]]>
- </groovy>
<echo>@{message}</echo>
<callExample path="@{path}" target="test" />
</sequential>
@@ -343,22 +240,8 @@
</ant>
</sequential>
</macrodef>
-
- <target name="restart.container" if="run.container.per.suite">
- <echo>Restarting container</echo>
- <antcall target="stop.container" >
- </antcall>
- <antcall target="start.container" >
- </antcall>
- </target>
- <target name="stop.container" if="run.container.per.suite">
- <echo>Stopping container</echo>
- <ant antfile="examples/build.xml" target="stop.container.jboss" inheritall="false">
- <property name="container" value="${container}" />
- </ant>
- </target>
- <target name="start.container" if="run.container.per.suite">
+ <target name="start.container.before.suite" if="run.container.per.suite">
<echo>Starting container</echo>
<ant antfile="examples/build.xml" target="start.container.jboss" inheritall="false">
<property name="container" value="${container}" />
15 years, 4 months
Seam SVN: r11385 - branches/enterprise/JBPAPP_5_0/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-14 11:52:11 -0400 (Fri, 14 Aug 2009)
New Revision: 11385
Modified:
branches/enterprise/JBPAPP_5_0/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/LoggerBean.java
Log:
rollbacked unwanted commit change
Modified: branches/enterprise/JBPAPP_5_0/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/LoggerBean.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/LoggerBean.java 2009-08-14 15:43:25 UTC (rev 11384)
+++ branches/enterprise/JBPAPP_5_0/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/LoggerBean.java 2009-08-14 15:52:11 UTC (rev 11385)
@@ -25,9 +25,7 @@
{
try
{
- Object omsg = ((ObjectMessage) msg ).getObject();
- log.info("URL is **** " + Thread.currentThread().getContextClassLoader().getResource("ChatroomEvent"));
- ChatroomEvent event = (ChatroomEvent) omsg;
+ ChatroomEvent event = (ChatroomEvent) ( (ObjectMessage) msg ).getObject();
log.info( "#0: #1", event.getUser(), event.getData()==null ? event.getAction() : event.getData() );
}
catch (JMSException jmse)
15 years, 4 months
Seam SVN: r11384 - in branches/enterprise/JBPAPP_5_0/src/test/ftest: examples/remoting and 10 other directories.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-08-14 11:43:25 -0400 (Fri, 14 Aug 2009)
New Revision: 11384
Added:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/build.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/jboss5.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
Log:
JBPAPP-2497 Added a functional test for helloworld example
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-08-14 15:37:55 UTC (rev 11383)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/build.xml 2009-08-14 15:43:25 UTC (rev 11384)
@@ -42,71 +42,149 @@
</fileset>
</path>
- <target name="testall.1" description="Run functional testsuite for JBoss 5">
- <property name="container" value="jboss5" />
+ <!-- TODO : should the libs be in seam/lib and managed with mvn? -->
+ <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="../../../lib/groovy-all.jar"/>
+
+ <target name="testall" description="Run functional testsuite based on container property">
+ <fail unless="container">Please set container property.</fail>
+ <antcall target="testall.${container}" />
+ </target>
+
+ <target name="testall.jboss4" description="Run functional testsuite for JBoss 4">
+ <property name="container" value="jboss4" />
+ <antcall target="start.container" />
<antcall target="start.selenium.server" />
+ <!-- Execute tests for all examples jboss-->
<testexample name="blog" />
<testexample name="booking" />
<testexample name="drools" />
<testexample name="dvdstore" />
<testexample name="contactlist" />
+ <testexample name="excel" />
+ <testexample name="groovybooking" />
+ <testexample name="hibernate" />
+ <testexample name="icefaces" />
+ <testexample name="itext" />
+ <testexample name="jpa" />
+ <testexample name="mail" />
+ <testexample name="messages" />
+ <testexample name="nestedbooking" />
+ <testexample name="numberguess" />
+ <testexample name="openid" />
+ <testexample name="quartz" />
+ <testexample name="registration" />
+ <testexample name="remoting/chatroom" />
+ <testexample name="rss" />
+ <testexample name="seambay" />
+ <testexample name="seamdiscs" />
+ <testexample name="seampay" />
+ <testexample name="seamspace" />
+ <testexample name="spring" />
+ <testexample name="todo" />
+ <testexample name="ui" />
+ <testexample name="wicket" />
+ <testexample name="wicket-runtime" />
<antcall target="stop.selenium.server" />
+ <antcall target="stop.container" />
</target>
- <target name="testall.2" description="Run functional testsuite for JBoss 5">
+ <target name="testall.jboss5" description="Run functional testsuite for JBoss 5">
<property name="container" value="jboss5" />
+ <antcall target="start.container" />
<antcall target="start.selenium.server" />
+ <!-- Execute tests for all examples jboss-->
+ <testexample name="blog" />
+ <testexample name="booking" />
+ <testexample name="drools" />
+ <testexample name="dvdstore" />
+ <testexample name="contactlist" />
<testexample name="excel" />
+ <testexample name="guice" />
<testexample name="groovybooking" />
<testexample name="hibernate" />
+ <testexample name="icefaces" />
<testexample name="itext" />
<testexample name="jee5/booking" />
- <antcall target="stop.selenium.server" />
- </target>
-
- <target name="testall.3" description="Run functional testsuite for JBoss 5">
- <property name="container" value="jboss5" />
- <antcall target="start.selenium.server" />
<testexample name="jpa" />
<testexample name="mail" />
<testexample name="messages" />
+ <testexample name="metawidget/booking" />
+ <testexample name="metawidget/dvdstore" />
+ <testexample name="metawidget/groovybooking" />
<testexample name="nestedbooking" />
<testexample name="numberguess" />
- <antcall target="stop.selenium.server" />
- </target>
-
- <target name="testall.4" description="Run functional testsuite for JBoss 5">
- <property name="container" value="jboss5" />
- <antcall target="start.selenium.server" />
<testexample name="openid" />
<testexample name="quartz" />
<testexample name="registration" />
<testexample name="remoting/chatroom" />
+ <testexample name="remoting/helloworld" />
+ <testexample name="rss" />
<testexample name="seambay" />
- <antcall target="stop.selenium.server" />
- </target>
-
- <target name="testall.5" description="Run functional testsuite for JBoss 5">
- <property name="container" value="jboss5" />
- <antcall target="start.selenium.server" />
<testexample name="seampay" />
<testexample name="seamspace" />
<testexample name="spring" />
<testexample name="todo" />
<testexample name="ui" />
+ <testexample name="wicket" />
+ <testexample name="wicket-runtime" />
<antcall target="stop.selenium.server" />
+ <antcall target="stop.container" />
</target>
+ <target name="testall.jboss-embedded" description="Run functional testsuite for JBoss Embedded">
+ <property name="container" value="jboss-embedded" />
+ <antcall target="start.selenium.server" />
+ <!-- Execute tests for all examples on jboss-embedded -->
+ <testexample name="blog" />
+ <testexample name="dvdstore" />
+ <testexample name="messages" />
+ <testexample name="numberguess" />
+ <testexample name="registration" />
+ <testexample name="seambay" />
+ <testexample name="seampay" />
+ <testexample name="todo" />
+ <testexample name="booking" />
+ <testexample name="jpa" />
+ <testexample name="hibernate" />
+ <antcall target="stop.selenium.server" />
+ </target>
+
+ <target name="testall.tomcat6" description="Run functional testsuite for Tomcat 6">
+
+ <property name="container" value="tomcat6" />
+ <antcall target="start.selenium.server" />
+
+ <testexample name="jpa" />
+ <testexample name="hibernate" />
+
+ <antcall target="stop.selenium.server" />
+ </target>
+
<target name="test" description="Run tests for single example. Container selection is based on the value of container property">
<fail unless="container">Please set container property.</fail>
<antcall target="test.${container}" />
</target>
-
+
+ <target name="test.jboss4" description="Run tests for single example on JBoss 4">
+ <property name="container" value="jboss4" />
+ <antcall target="test.single.example" />
+ </target>
+
<target name="test.jboss5" description="Run tests for single example on JBoss 5">
<property name="container" value="jboss5" />
<antcall target="test.single.example" />
</target>
+ <target name="test.tomcat6" description="Run tests for single example on Tomcat 6">
+ <property name="container" value="tomcat6" />
+ <antcall target="test.single.example" />
+ </target>
+
+ <target name="test.jboss-embedded" description="Run tests for single example on JBoss Embedded">
+ <property name="container" value="jboss-embedded" />
+ <antcall target="test.single.example" />
+ </target>
+
<target name="test.single.example">
<antcall target="start.selenium.server" />
@@ -123,19 +201,26 @@
<cleanexample name="dvdstore" />
<cleanexample name="contactlist" />
<cleanexample name="excel" />
+ <cleanexample name="guice" />
<cleanexample name="groovybooking" />
<cleanexample name="hibernate" />
+ <cleanexample name="icefaces" />
<cleanexample name="itext" />
<cleanexample name="jee5/booking" />
<cleanexample name="jpa" />
<cleanexample name="mail" />
<cleanexample name="messages" />
+ <cleanexample name="metawidget/booking" />
+ <cleanexample name="metawidget/dvdstore" />
+ <cleanexample name="metawidget/groovybooking" />
<cleanexample name="nestedbooking" />
<cleanexample name="numberguess" />
<cleanexample name="openid" />
<cleanexample name="quartz" />
<cleanexample name="registration" />
<cleanexample name="remoting/chatroom" />
+ <cleanexample name="remoting/helloworld" />
+ <cleanexample name="rss" />
<cleanexample name="seambay" />
<cleanexample name="seamdiscs" />
<cleanexample name="seampay" />
@@ -143,6 +228,8 @@
<cleanexample name="spring" />
<cleanexample name="todo" />
<cleanexample name="ui" />
+ <cleanexample name="wicket" />
+ <cleanexample name="wicket-runtime" />
</target>
<target name="undeployall">
@@ -154,18 +241,25 @@
<undeployexample name="contactlist" />
<undeployexample name="excel" />
<undeployexample name="groovybooking" />
+ <undeployexample name="guice" />
<undeployexample name="hibernate" />
+ <undeployexample name="icefaces" />
<undeployexample name="itext" />
<undeployexample name="jee5/booking" />
<undeployexample name="jpa" />
<undeployexample name="mail" />
<undeployexample name="messages" />
+ <undeployexample name="metawidget/booking" />
+ <undeployexample name="metawidget/dvdstore" />
+ <undeployexample name="metawidget/groovybooking" />
<undeployexample name="nestedbooking" />
<undeployexample name="numberguess" />
<undeployexample name="openid" />
<undeployexample name="quartz" />
<undeployexample name="registration" />
+ <undeployexample name="rss" />
<undeployexample name="remoting/chatroom" />
+ <undeployexample name="remoting/helloworld" />
<undeployexample name="seambay" />
<undeployexample name="seamdiscs" />
<undeployexample name="seampay" />
@@ -173,6 +267,7 @@
<undeployexample name="spring" />
<undeployexample name="todo" />
<undeployexample name="ui" />
+ <undeployexample name="wicket" />
</target>
@@ -204,6 +299,17 @@
<attribute name="path" default="examples/@{name}" />
<attribute name="message" default="Running functional tests on @{name} example" />
<sequential>
+ <groovy>
+ <![CDATA[
+ def testExamplesRunSoFar = properties['testExamplesRunSoFar'] == null ? 0 : Integer.valueOf(properties['testExamplesRunSoFar']);
+ def jbossDeploymentsRestart = properties['jboss.deployments.restart'] == null ? 0 : Integer.valueOf(properties['jboss.deployments.restart']);
+ if (jbossDeploymentsRestart > 0 && testExamplesRunSoFar > 0 && testExamplesRunSoFar % jbossDeploymentsRestart == 0 ) {
+ ant.antcall(target:"restart.container");
+ }
+ testExamplesRunSoFar++;
+ properties['testExamplesRunSoFar'] = testExamplesRunSoFar;
+ ]]>
+ </groovy>
<echo>@{message}</echo>
<callExample path="@{path}" target="test" />
</sequential>
@@ -237,8 +343,22 @@
</ant>
</sequential>
</macrodef>
+
+ <target name="restart.container" if="run.container.per.suite">
+ <echo>Restarting container</echo>
+ <antcall target="stop.container" >
+ </antcall>
+ <antcall target="start.container" >
+ </antcall>
+ </target>
- <target name="start.container.before.suite" if="run.container.per.suite">
+ <target name="stop.container" if="run.container.per.suite">
+ <echo>Stopping container</echo>
+ <ant antfile="examples/build.xml" target="stop.container.jboss" inheritall="false">
+ <property name="container" value="${container}" />
+ </ant>
+ </target>
+ <target name="start.container" if="run.container.per.suite">
<echo>Starting container</echo>
<ant antfile="examples/build.xml" target="start.container.jboss" inheritall="false">
<property name="container" value="${container}" />
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/build.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/build.xml 2009-08-14 15:43:25 UTC (rev 11384)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<project name="remoting.helloworld.ftest.build" basedir="." default="build">
+ <property name="example.name" value="remoting/helloworld" />
+ <property name="context.path" value="/seam-helloworld" />
+
+ <import file="../../build.xml" />
+</project>
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/jboss5.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/jboss5.xml (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/jboss5.xml 2009-08-14 15:43:25 UTC (rev 11384)
@@ -0,0 +1,27 @@
+
+ <!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, and individual contributors by the @authors tag. See
+ the copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Helloworld example" verbose="2" parallel="false">
+ <test name="remoting_helloworld_jboss5">
+ <parameter name="PROPERTY_FILE" value="" />
+ <classes>
+ <class
+ name="org.jboss.seam.example.remoting.helloworld.test.selenium.HelloworldTest" />
+ </classes>
+ </test>
+</suite>
Property changes on: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/jboss5.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java 2009-08-14 15:43:25 UTC (rev 11384)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.example.remoting.helloworld.test.selenium;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.thoughtworks.selenium.Wait;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests a functionality of remoting/helloworld example.
+ *
+ * @author Martin Gencur
+ *
+ */
+public class HelloworldTest extends SeamSeleniumTest
+{
+ protected static final String HELLOWORLD_URL = "/helloworld.seam";
+ protected static final String HELLOWORLD_TITLE = "Seam Remoting - Hello World Example";
+ protected static final String SAYHELLO_BUTTON = "xpath=//button[contains(@onclick,\"sayHello\")]";
+ protected static final String PROMPT_ANSWER = "Martin";
+ protected static final String ALERT_MESSAGE = "Hello, Martin";
+ protected static final Long TIMEOUT = 2000L; //2 seconds
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.open(CONTEXT_PATH + HELLOWORLD_URL);
+ }
+
+ @Test
+ public void simplePageContentTest()
+ {
+ assertTrue("Home page of Remoting/Helloworld Example expected", browser.getLocation().contains(HELLOWORLD_URL));
+ assertTrue("Different page title expected",browser.getTitle().contains(HELLOWORLD_TITLE));
+ assertTrue("Home page should contain Say Hello button", browser.isElementPresent(SAYHELLO_BUTTON));
+ }
+
+ @Test(dependsOnMethods = {"simplePageContentTest"})
+ public void sayHelloButtonTest(){
+ String result = "";
+ browser.answerOnNextPrompt(PROMPT_ANSWER);
+ browser.click(SAYHELLO_BUTTON);
+ waitForAlertPresent(TIMEOUT);
+ result = browser.getAlert();
+ assertTrue("An alert message should show up and should contain \"Hello,\" and name.", result.contains(ALERT_MESSAGE));
+ }
+
+ public void waitForAlertPresent(Long timeout){
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return browser.isAlertPresent();
+ }
+ }.wait("Timeout while waiting for alert window.", timeout);
+ }
+}
15 years, 4 months
Seam SVN: r11383 - in branches/community/Seam_2_2/src/test/ftest: examples/remoting and 10 other directories.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-08-14 11:37:55 -0400 (Fri, 14 Aug 2009)
New Revision: 11383
Added:
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/build.xml
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/jboss5.xml
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/
branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java
Modified:
branches/community/Seam_2_2/src/test/ftest/build.xml
Log:
JBSEAM-4356 Added a functional test for helloworld example
Modified: branches/community/Seam_2_2/src/test/ftest/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/build.xml 2009-08-14 13:35:27 UTC (rev 11382)
+++ branches/community/Seam_2_2/src/test/ftest/build.xml 2009-08-14 15:37:55 UTC (rev 11383)
@@ -117,6 +117,7 @@
<testexample name="quartz" />
<testexample name="registration" />
<testexample name="remoting/chatroom" />
+ <testexample name="remoting/helloworld" />
<testexample name="rss" />
<testexample name="seambay" />
<testexample name="seampay" />
@@ -218,6 +219,7 @@
<cleanexample name="quartz" />
<cleanexample name="registration" />
<cleanexample name="remoting/chatroom" />
+ <cleanexample name="remoting/helloworld" />
<cleanexample name="rss" />
<cleanexample name="seambay" />
<cleanexample name="seamdiscs" />
@@ -257,6 +259,7 @@
<undeployexample name="registration" />
<undeployexample name="rss" />
<undeployexample name="remoting/chatroom" />
+ <undeployexample name="remoting/helloworld" />
<undeployexample name="seambay" />
<undeployexample name="seamdiscs" />
<undeployexample name="seampay" />
Added: branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/build.xml (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/build.xml 2009-08-14 15:37:55 UTC (rev 11383)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2008, Red Hat Middleware LLC, and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<project name="remoting.helloworld.ftest.build" basedir="." default="build">
+ <property name="example.name" value="remoting/helloworld" />
+ <property name="context.path" value="/seam-helloworld" />
+
+ <import file="../../build.xml" />
+</project>
Added: branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/jboss5.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/jboss5.xml (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/jboss5.xml 2009-08-14 15:37:55 UTC (rev 11383)
@@ -0,0 +1,27 @@
+
+ <!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, and individual contributors by the @authors tag. See
+ the copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+<suite name="Helloworld example" verbose="2" parallel="false">
+ <test name="remoting_helloworld_jboss5">
+ <parameter name="PROPERTY_FILE" value="" />
+ <classes>
+ <class
+ name="org.jboss.seam.example.remoting.helloworld.test.selenium.HelloworldTest" />
+ </classes>
+ </test>
+</suite>
Property changes on: branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/jboss5.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/remoting/helloworld/src/org/jboss/seam/example/remoting/helloworld/test/selenium/HelloworldTest.java 2009-08-14 15:37:55 UTC (rev 11383)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.seam.example.remoting.helloworld.test.selenium;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+
+
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.thoughtworks.selenium.Wait;
+
+import static org.testng.AssertJUnit.*;
+
+/**
+ * This class tests a functionality of remoting/helloworld example.
+ *
+ * @author Martin Gencur
+ *
+ */
+public class HelloworldTest extends SeamSeleniumTest
+{
+ protected static final String HELLOWORLD_URL = "/helloworld.seam";
+ protected static final String HELLOWORLD_TITLE = "Seam Remoting - Hello World Example";
+ protected static final String SAYHELLO_BUTTON = "xpath=//button[contains(@onclick,\"sayHello\")]";
+ protected static final String PROMPT_ANSWER = "Martin";
+ protected static final String ALERT_MESSAGE = "Hello, Martin";
+ protected static final Long TIMEOUT = 2000L; //2 seconds
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.open(CONTEXT_PATH + HELLOWORLD_URL);
+ }
+
+ @Test
+ public void simplePageContentTest()
+ {
+ assertTrue("Home page of Remoting/Helloworld Example expected", browser.getLocation().contains(HELLOWORLD_URL));
+ assertTrue("Different page title expected",browser.getTitle().contains(HELLOWORLD_TITLE));
+ assertTrue("Home page should contain Say Hello button", browser.isElementPresent(SAYHELLO_BUTTON));
+ }
+
+ @Test(dependsOnMethods = {"simplePageContentTest"})
+ public void sayHelloButtonTest(){
+ String result = "";
+ browser.answerOnNextPrompt(PROMPT_ANSWER);
+ browser.click(SAYHELLO_BUTTON);
+ waitForAlertPresent(TIMEOUT);
+ result = browser.getAlert();
+ assertTrue("An alert message should show up and should contain \"Hello,\" and name.", result.contains(ALERT_MESSAGE));
+ }
+
+ public void waitForAlertPresent(Long timeout){
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return browser.isAlertPresent();
+ }
+ }.wait("Timeout while waiting for alert window.", timeout);
+ }
+}
15 years, 4 months
Seam SVN: r11382 - branches/enterprise/JBPAPP_5_0/seam-gen.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-14 09:35:27 -0400 (Fri, 14 Aug 2009)
New Revision: 11382
Modified:
branches/enterprise/JBPAPP_5_0/seam-gen/build.xml
Log:
JBPAPP-2491
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/build.xml 2009-08-14 13:33:19 UTC (rev 11381)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/build.xml 2009-08-14 13:35:27 UTC (rev 11382)
@@ -1551,7 +1551,6 @@
<echo message="Project name: ${project.name}"/>
<echo message="Project location: ${workspace.home}/${project.name}"/>
<echo message="Project type: ${project.type}"/>
- <echo message="IceFaces: ${icefaces}"/>
<echo message="Action package: ${action.package}"/>
<echo message="Model package: ${model.package}"/>
<echo message="Test package: ${test.package}"/>
15 years, 4 months
Seam SVN: r11381 - branches/enterprise/JBPAPP_5_0/seam-gen.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-14 09:33:19 -0400 (Fri, 14 Aug 2009)
New Revision: 11381
Modified:
branches/enterprise/JBPAPP_5_0/seam-gen/build.xml
Log:
JBPAPP-2492
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/build.xml 2009-08-13 21:48:05 UTC (rev 11380)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/build.xml 2009-08-14 13:33:19 UTC (rev 11381)
@@ -27,7 +27,7 @@
<property environment="env"/>
<!-- set property defaults (also maintains backwards compatibility) -->
- <condition property="jboss.home" value="${env.JBOSS_HOME}" else="C:/Program Files/jboss-4.2.3.GA">
+ <condition property="jboss.home" value="${env.JBOSS_HOME}" else="/var/lib/jbossas">
<isset property="env.JBOSS_HOME"/>
</condition>
<property name="jboss.domain" value="default"/>
15 years, 4 months
Seam SVN: r11380 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/util.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-13 17:48:05 -0400 (Thu, 13 Aug 2009)
New Revision: 11380
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/util/Work.java
Log:
JBPAPP-2378
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/util/Work.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/util/Work.java 2009-08-13 21:47:15 UTC (rev 11379)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/util/Work.java 2009-08-13 21:48:05 UTC (rev 11380)
@@ -29,12 +29,26 @@
public final T workInTransaction() throws Exception
{
- org.jboss.seam.transaction.UserTransaction transaction = Transaction.instance();
+ org.jboss.seam.transaction.UserTransaction transaction = null;
+ boolean transactionActive = false;
+ boolean newTransactionRequired = false;
+ UserTransaction userTransaction = null;
- boolean transactionActive = transaction.isActiveOrMarkedRollback()
+ try {
+ transaction = Transaction.instance();
+
+ transactionActive = transaction.isActiveOrMarkedRollback()
|| transaction.isRolledBack(); //TODO: temp workaround, what should we really do in this case??
- boolean newTransactionRequired = isNewTransactionRequired(transactionActive);
- UserTransaction userTransaction = newTransactionRequired ? transaction : null;
+ newTransactionRequired = isNewTransactionRequired(transactionActive);
+ userTransaction = newTransactionRequired ? transaction : null;
+ } catch (IllegalStateException e) {
+ // for shutdown case, when we can't get the tx object because the event context is gone
+ // but we should still check if a tx is required and fail accordingly if it is
+ newTransactionRequired = isNewTransactionRequired(false);
+ if (newTransactionRequired) {
+ throw e;
+ }
+ }
try
{
15 years, 4 months
Seam SVN: r11379 - branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-13 17:47:15 -0400 (Thu, 13 Aug 2009)
New Revision: 11379
Modified:
branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/MessagingTest.java
Log:
sometimes test fail - so I increased the timeout for delay before test starts
Modified: branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/MessagingTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/MessagingTest.java 2009-08-13 18:18:27 UTC (rev 11378)
+++ branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/MessagingTest.java 2009-08-13 21:47:15 UTC (rev 11379)
@@ -26,7 +26,7 @@
{
// need to delay a bit to make sure the messaging system is running
// really only needed when running this test in isolation
- Thread.sleep(3000);
+ Thread.sleep(5000);
}
@Test(dependsOnMethods={"delayForStartup"})
@@ -48,6 +48,7 @@
// need to delay a bit to make sure the message is delivered
// might need
Thread.sleep(2000);
+ System.out.println("HODNOTA ->" + messageText.getValue());
assert messageText.getValue().equals("message for topic");
}
15 years, 4 months
Seam SVN: r11378 - in branches/community/Seam_2_2_Drools5: examples and 6 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2009-08-13 14:18:27 -0400 (Thu, 13 Aug 2009)
New Revision: 11378
Added:
branches/community/Seam_2_2_Drools5/examples/drools/resources/test.drl
branches/community/Seam_2_2_Drools5/examples/drools/resources/testbatch.xml
branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/Message.java
branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/RulesTest.java
branches/community/Seam_2_2_Drools5/examples/drools/view/simple.jsp
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/BatchExecution.java
Modified:
branches/community/Seam_2_2_Drools5/build/core.pom.xml
branches/community/Seam_2_2_Drools5/build/root.pom.xml
branches/community/Seam_2_2_Drools5/examples/build.xml
branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java
Log:
Support for Drools5 (integration)
Modified: branches/community/Seam_2_2_Drools5/build/core.pom.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/build/core.pom.xml 2009-08-13 17:24:13 UTC (rev 11377)
+++ branches/community/Seam_2_2_Drools5/build/core.pom.xml 2009-08-13 18:18:27 UTC (rev 11378)
@@ -272,7 +272,31 @@
</dependency>
<dependency>
- <groupId>xstream</groupId>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-transformer-xstream</artifactId>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</dependency>
Modified: branches/community/Seam_2_2_Drools5/build/root.pom.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/build/root.pom.xml 2009-08-13 17:24:13 UTC (rev 11377)
+++ branches/community/Seam_2_2_Drools5/build/root.pom.xml 2009-08-13 18:18:27 UTC (rev 11378)
@@ -803,6 +803,30 @@
</dependency>
<dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-transformer-xstream</artifactId>
+ <version>${version.drools}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>org.drools</groupId>
<artifactId>drools-templates</artifactId>
<version>${version.drools}</version>
@@ -837,9 +861,9 @@
</dependency>
<dependency>
- <groupId>xstream</groupId>
+ <groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
- <version>1.1.3</version>
+ <version>1.3.1</version>
</dependency>
<dependency>
Modified: branches/community/Seam_2_2_Drools5/examples/build.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/build.xml 2009-08-13 17:24:13 UTC (rev 11377)
+++ branches/community/Seam_2_2_Drools5/examples/build.xml 2009-08-13 18:18:27 UTC (rev 11378)
@@ -327,6 +327,7 @@
<include name="drools-compiler.jar" if="drools.lib" />
<include name="drools-api.jar" if="drools.lib" />
<include name="drools-decisiontables.jar" if="drools.lib"/>
+ <include name="drools-transformer-xstream.jar" if="drools.lib"/>
<include name="drools-templates.jar" if="drools.lib"/>
<include name="xstream.jar" if="drools.lib"/>
<include name="xpp3_min.jar" if="drools.lib"/>
Modified: branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml 2009-08-13 17:24:13 UTC (rev 11377)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml 2009-08-13 18:18:27 UTC (rev 11378)
@@ -22,12 +22,31 @@
</drools:change-sets>
</drools:knowledge-agent>
- <drools:stateful-knowledge-session name="ksession" knowledge-base="#{kagent}" knowledge-session-config="ksessionconfig.properties">
+ <drools:stateful-knowledge-session name="ksession" knowledge-base="#{kbase}" knowledge-session-config="ksessionconfig.properties">
<drools:event-listeners>
<value>org.drools.event.rule.DebugAgendaEventListener</value>
<value>org.drools.event.rule.DebugWorkingMemoryEventListener</value>
</drools:event-listeners>
</drools:stateful-knowledge-session>
+
+
+ <drools:knowledge-base name="kbase2" knowledge-builder-config="kbuilderconfig.properties" knowledge-base-config="kbaseconfig.properties">
+ <drools:rule-resources>
+ <value>classpath:test.drl:DRL</value>
+ </drools:rule-resources>
+ </drools:knowledge-base>
+
+ <drools:stateful-knowledge-session name="ksession2"
+ knowledge-base="#{kbase2}"
+ knowledge-session-config="ksessionconfig.properties">
+ <drools:event-listeners>
+ <value>org.drools.event.rule.DebugAgendaEventListener</value>
+ <value>org.drools.event.rule.DebugWorkingMemoryEventListener</value>
+ </drools:event-listeners>
+ </drools:stateful-knowledge-session>
+
+ <drools:batch-execution name="batch1" ksession="#{ksession2}"
+ batch-xml-config="testbatch.xml"/>
<!-- <drools:rule-base name="ruleBase" rule-files="numberguess.drl"/> -->
<!-- use this in order to load from decision table instead -->
Added: branches/community/Seam_2_2_Drools5/examples/drools/resources/test.drl
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/resources/test.drl (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/test.drl 2009-08-13 18:18:27 UTC (rev 11378)
@@ -0,0 +1,14 @@
+package org.jboss.seam.example.numberguess
+
+import org.jboss.seam.example.numberguess.Message;
+
+rule simple
+no-loop true
+ when
+ $m : Message();
+ then
+ modify($m) {
+ setMessage("Hello " + $m.getMessage());
+ }
+
+end
\ No newline at end of file
Added: branches/community/Seam_2_2_Drools5/examples/drools/resources/testbatch.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/resources/testbatch.xml (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/testbatch.xml 2009-08-13 18:18:27 UTC (rev 11378)
@@ -0,0 +1,8 @@
+<batch-execution>
+ <insert out-identifier="message">
+ <org.jboss.seam.example.numberguess.Message>
+ <message>Tihomir</message>
+ </org.jboss.seam.example.numberguess.Message>
+ </insert>
+ <fire-all-rules />
+</batch-execution>
\ No newline at end of file
Added: branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/Message.java
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/Message.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/Message.java 2009-08-13 18:18:27 UTC (rev 11378)
@@ -0,0 +1,18 @@
+package org.jboss.seam.example.numberguess;
+
+public class Message
+{
+ private String message;
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public void setMessage(String message)
+ {
+ this.message = message;
+ }
+
+
+}
Added: branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/RulesTest.java
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/RulesTest.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/RulesTest.java 2009-08-13 18:18:27 UTC (rev 11378)
@@ -0,0 +1,30 @@
+package org.jboss.seam.example.numberguess;
+
+import org.drools.runtime.ExecutionResults;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+@Name("rulesTest")
+(a)Scope(ScopeType.CONVERSATION)
+public class RulesTest
+{
+ @In(create=true) ExecutionResults batch1;
+ private static final LogProvider log = Logging.getLogProvider(RulesTest.class);
+ private String result;
+
+ @Begin(join=true)
+ public String getResult()
+ {
+ return ((Message) batch1.getValue( "message" )).getMessage();
+ }
+
+ public void setResult(String result)
+ {
+ this.result = result;
+ }
+}
Added: branches/community/Seam_2_2_Drools5/examples/drools/view/simple.jsp
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/view/simple.jsp (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/view/simple.jsp 2009-08-13 18:18:27 UTC (rev 11378)
@@ -0,0 +1,16 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+<head>
+<title>Simple test</title>
+</head>
+<body>
+<h1>Simple Test</h1>
+<f:view>
+ <h:form id="simples">
+ <h:outputLabel value="Rules Result" for="output" />
+ <h:outputText id="output" value="#{rulesTest.result}"/>
+ </h:form>
+</f:view>
+</body>
+</html>
Added: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/BatchExecution.java
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/BatchExecution.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/BatchExecution.java 2009-08-13 18:18:27 UTC (rev 11378)
@@ -0,0 +1,166 @@
+package org.jboss.seam.drools;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.drools.runtime.ExecutionResults;
+import org.drools.runtime.help.BatchExecutionHelper;
+import org.drools.runtime.pipeline.Action;
+import org.drools.runtime.pipeline.KnowledgeRuntimeCommand;
+import org.drools.runtime.pipeline.Pipeline;
+import org.drools.runtime.pipeline.PipelineFactory;
+import org.drools.runtime.pipeline.ResultHandler;
+import org.drools.runtime.pipeline.Transformer;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.core.ResourceLoader;
+import org.jboss.seam.core.Expressions.ValueExpression;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+
+/**
+ * A conversation-scoped that performs batch execution for specified
+ * StatefulKnowledgeSession.
+ *
+ * @author Tihomir Surdilovic
+ *
+ */
+(a)Scope(ScopeType.CONVERSATION)
+@BypassInterceptors
+public class BatchExecution
+{
+ private static final LogProvider log = Logging.getLogProvider(BatchExecution.class);
+
+
+ private ValueExpression<org.drools.runtime.StatefulKnowledgeSession> ksession;
+ private String batchXmlConfig;
+ private ValueExpression<java.lang.String> batchXml;
+
+ private String outXml;
+
+ @Create
+ public void createBatchExecution() throws Exception
+ {
+ String inXml = "";
+ if (batchXmlConfig != null)
+ {
+ InputStream stream = ResourceLoader.instance().getResourceAsStream(batchXmlConfig);
+ if (stream == null)
+ {
+ throw new IllegalStateException("could not locate knowledgeSession configuration: " + batchXmlConfig);
+ }
+ inXml = inputStreamAsString(stream);
+ ResultHandlerImpl resultsHandler = new ResultHandlerImpl();
+ getPipelineStateful(ksession.getValue()).insert(inXml, resultsHandler);
+
+ outXml = (String) resultsHandler.getObject();
+ }
+ else if (batchXml != null)
+ {
+ inXml = batchXml.getValue();
+ ResultHandlerImpl resultsHandler = new ResultHandlerImpl();
+ getPipelineStateful(ksession.getValue()).insert(inXml, resultsHandler);
+
+ outXml = (String) resultsHandler.getObject();
+ }
+ else
+ {
+ log.error("No valid batch xml input.");
+ }
+ }
+
+ @Unwrap
+ public ExecutionResults getExecutionResults()
+ {
+ return (ExecutionResults) BatchExecutionHelper.newXStreamMarshaller().fromXML(outXml);
+ }
+
+ private Pipeline getPipelineStateful(org.drools.runtime.StatefulKnowledgeSession ksession)
+ {
+ Action executeResultHandler = PipelineFactory.newExecuteResultHandler();
+
+ Action assignResult = PipelineFactory.newAssignObjectAsResult();
+ assignResult.setReceiver(executeResultHandler);
+
+ Transformer outTransformer = PipelineFactory.newXStreamToXmlTransformer(BatchExecutionHelper.newXStreamMarshaller());
+ outTransformer.setReceiver(assignResult);
+
+ KnowledgeRuntimeCommand batchExecution = PipelineFactory.newCommandExecutor();
+ batchExecution.setReceiver(outTransformer);
+
+ Transformer inTransformer = PipelineFactory.newXStreamFromXmlTransformer(BatchExecutionHelper.newXStreamMarshaller());
+ inTransformer.setReceiver(batchExecution);
+
+ Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline(ksession);
+ pipeline.setReceiver(inTransformer);
+
+ return pipeline;
+ }
+
+ public String getBatchXmlConfig()
+ {
+ return batchXmlConfig;
+ }
+
+ public void setBatchXmlConfig(String batchXmlConfig)
+ {
+ this.batchXmlConfig = batchXmlConfig;
+ }
+
+ public ValueExpression<java.lang.String> getBatchXml()
+ {
+ return batchXml;
+ }
+
+ public void setBatchXml(ValueExpression<java.lang.String> batchXml)
+ {
+ this.batchXml = batchXml;
+ }
+
+ public ValueExpression<org.drools.runtime.StatefulKnowledgeSession> getKsession()
+ {
+ return ksession;
+ }
+
+ public void setKsession(ValueExpression<org.drools.runtime.StatefulKnowledgeSession> ksession)
+ {
+ this.ksession = ksession;
+ }
+
+ public static class ResultHandlerImpl implements ResultHandler
+ {
+ Object object;
+
+ public void handleResult(Object object)
+ {
+ this.object = object;
+ }
+
+ public Object getObject()
+ {
+ return this.object;
+ }
+
+ }
+
+ private String inputStreamAsString(InputStream stream) throws IOException
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(stream));
+ StringBuilder sb = new StringBuilder();
+ String line = null;
+
+ while ((line = br.readLine()) != null)
+ {
+ sb.append(line + "\n");
+ }
+
+ br.close();
+ return sb.toString();
+ }
+}
Modified: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java 2009-08-13 17:24:13 UTC (rev 11377)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java 2009-08-13 18:18:27 UTC (rev 11378)
@@ -3,7 +3,6 @@
import java.io.InputStream;
import java.io.Serializable;
import java.util.Properties;
-import java.util.regex.Pattern;
import org.drools.KnowledgeBaseFactory;
import org.drools.runtime.KnowledgeSessionConfiguration;
@@ -16,7 +15,6 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Unwrap;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Mutable;
import org.jboss.seam.core.ResourceLoader;
import org.jboss.seam.core.Expressions.ValueExpression;
@@ -34,13 +32,8 @@
public class StatefulKnowledgeSession implements Mutable, Serializable
{
private static final LogProvider log = Logging.getLogProvider(org.jboss.seam.drools.StatefulKnowledgeSession.class);
- private static final Pattern COLON = Pattern.compile(":");
- private static final int GLOBAL_NAME = 0;
- private static final int GLOBAL_OBJ = 1;
- private static final int GLOBAL_TYPE = 2;
-
+
private ValueExpression<org.drools.KnowledgeBase> knowledgeBase;
- private String[] globals;
private String[] eventListeners;
private String knowledgeSessionConfig;
@@ -73,23 +66,6 @@
setEventListener(ksession, eventListener);
}
}
-
- if(globals != null) {
- for(String nextGlobal : globals) {
- String[] globalParts = COLON.split(nextGlobal.trim());
- if(globalParts.length == 3) {
- log.info("setting global: " + globalParts[GLOBAL_NAME] + " - " + globalParts[GLOBAL_OBJ]);
- try {
- Class ctype = Class.forName(globalParts[GLOBAL_TYPE]);
- ksession.setGlobal(globalParts[GLOBAL_NAME], Expressions.instance().createValueExpression(globalParts[GLOBAL_OBJ], ctype).getValue());
- } catch (Exception e) {
- log.error("Error setting global: " + globalParts[GLOBAL_NAME] + " - " + globalParts[GLOBAL_OBJ] + " Exception : " + e.getMessage());
- }
- } else {
- log.warn("Invalid global entry: " + nextGlobal);
- }
- }
- }
}
return ksession;
@@ -142,16 +118,6 @@
this.knowledgeBase = knowledgeBase;
}
- public String[] getGlobals()
- {
- return globals;
- }
-
- public void setGlobals(String[] globals)
- {
- this.globals = globals;
- }
-
public String[] getEventListeners()
{
return eventListeners;
Modified: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd 2009-08-13 17:24:13 UTC (rev 11377)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd 2009-08-13 18:18:27 UTC (rev 11378)
@@ -1,125 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/seam/drools" xmlns:drools="http://jboss.com/products/seam/drools"
- xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
-
- <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.2.xsd"/>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" targetNamespace="http://jboss.com/products/seam/drools"
+ xmlns:drools="http://jboss.com/products/seam/drools" xmlns:components="http://jboss.com/products/seam/components"
+ attributeFormDefault="unqualified">
- <xs:element name="rule-base">
- <xs:annotation>
- <xs:documentation>A drools rule base</xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element minOccurs="0" maxOccurs="1" ref="drools:rule-files"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="drools:attlist.RuleBase"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="rule-files" type="components:multiValuedProperty"/>
- <xs:attributeGroup name="attlist.RuleBase">
- <xs:attribute name="dsl-file" type="components:string"/>
- <xs:attribute name="rule-files" type="components:string"/>
- <xs:attribute name="consequence-exception-handler" type="components:expressionType"/>
- </xs:attributeGroup>
+ <xs:import namespace="http://jboss.com/products/seam/components"
+ schemaLocation="components-2.2.xsd" />
- <xs:element name="rule-agent">
- <xs:annotation>
- <xs:documentation>A drools BRMS configuration</xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component" />
- <xs:attributeGroup ref="drools:attlist.RuleAgent" />
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.RuleAgent">
- <xs:attribute name="configuration-file" type="components:string" />
- <xs:attribute name="config-name" type="components:string" />
- <xs:attribute name="new-instance" type="components:string" />
- <xs:attribute name="files" type="components:string" />
- <xs:attribute name="url" type="components:string" />
- <xs:attribute name="local-cache-dir" type="components:string" />
- <xs:attribute name="poll" type="components:string" />
- </xs:attributeGroup>
+ <xs:element name="rule-base">
+ <xs:annotation>
+ <xs:documentation>A drools rule base</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element minOccurs="0" maxOccurs="1" ref="drools:rule-files" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.RuleBase" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rule-files" type="components:multiValuedProperty" />
+ <xs:attributeGroup name="attlist.RuleBase">
+ <xs:attribute name="dsl-file" type="components:string" />
+ <xs:attribute name="rule-files" type="components:string" />
+ <xs:attribute name="consequence-exception-handler" type="components:expressionType" />
+ </xs:attributeGroup>
- <xs:element name="managed-working-memory">
- <xs:annotation>
- <xs:documentation>A working memory for rules calculations</xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element minOccurs="0" maxOccurs="1" ref="drools:event-listeners"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="drools:attlist.ManagedWorkingMemory"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.ManagedWorkingMemory">
- <xs:attribute name="rule-base" type="components:expressionType"/>
- </xs:attributeGroup>
- <xs:element name="event-listeners" type="components:multiValuedProperty"/>
-
- <xs:element name="knowledge-base">
- <xs:annotation>
- <xs:documentation>Drools KnowledgeBase</xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element minOccurs="0" maxOccurs="1" ref="drools:rule-resources"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="drools:attlist.KnowledgeBase"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="rule-resources" type="components:multiValuedProperty"/>
- <xs:attributeGroup name="attlist.KnowledgeBase">
- <xs:attribute name="knowledge-builder-config" type="components:string"/>
- <xs:attribute name="knowledge-base-config" type="components:string"/>
- </xs:attributeGroup>
-
- <xs:element name="stateful-knowledge-session">
- <xs:annotation>
- <xs:documentation>Drools StatefulKnowledgeSession</xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element minOccurs="0" maxOccurs="1" ref="drools:event-listeners"/>
- <xs:element minOccurs="0" maxOccurs="1" ref="drools:globals"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="drools:attlist.StatefulKnowledgeSession"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.StatefulKnowledgeSession">
- <xs:attribute name="knowledge-base" type="components:expressionType"/>
- <xs:attribute name="globals" type="components:string"/>
- <xs:attribute name="event-listeners" type="components:string"/>
- <xs:attribute name="knowledge-session-config" type="components:string"/>
- </xs:attributeGroup>
- <xs:element name="globals" type="components:multiValuedProperty"/>
-
- <xs:element name="knowledge-agent">
- <xs:annotation>
- <xs:documentation>Drools KnowledgeAgent</xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element minOccurs="0" maxOccurs="1" ref="drools:change-sets"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="drools:attlist.KnowledgeAgent"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.KnowledgeAgent">
- <xs:attribute name="knowledge-base" type="components:expressionType"/>
- <xs:attribute name="agent-name" type="components:string"/>
- <xs:attribute name="scan-resources" type="components:string"/>
- <xs:attribute name="scan-directories" type="components:string"/>
- <xs:attribute name="new-instance" type="components:string"/>
- <xs:attribute name="monitor-change-set-events" type="components:string"/>
- <xs:attribute name="knowledge-agent-config" type="components:string"/>
- <xs:attribute name="scan-interval" type="components:string"/>
- </xs:attributeGroup>
- <xs:element name="change-sets" type="components:multiValuedProperty"/>
+ <xs:element name="rule-agent">
+ <xs:annotation>
+ <xs:documentation>A drools BRMS configuration</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.RuleAgent" />
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.RuleAgent">
+ <xs:attribute name="configuration-file" type="components:string" />
+ <xs:attribute name="config-name" type="components:string" />
+ <xs:attribute name="new-instance" type="components:string" />
+ <xs:attribute name="files" type="components:string" />
+ <xs:attribute name="url" type="components:string" />
+ <xs:attribute name="local-cache-dir" type="components:string" />
+ <xs:attribute name="poll" type="components:string" />
+ </xs:attributeGroup>
+
+ <xs:element name="managed-working-memory">
+ <xs:annotation>
+ <xs:documentation>A working memory for rules calculations
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element minOccurs="0" maxOccurs="1"
+ ref="drools:event-listeners" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.ManagedWorkingMemory" />
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.ManagedWorkingMemory">
+ <xs:attribute name="rule-base" type="components:expressionType" />
+ </xs:attributeGroup>
+ <xs:element name="event-listeners" type="components:multiValuedProperty" />
+
+ <xs:element name="knowledge-base">
+ <xs:annotation>
+ <xs:documentation>Drools KnowledgeBase</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element minOccurs="0" maxOccurs="1"
+ ref="drools:rule-resources" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.KnowledgeBase" />
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rule-resources" type="components:multiValuedProperty" />
+ <xs:attributeGroup name="attlist.KnowledgeBase">
+ <xs:attribute name="knowledge-builder-config" type="components:string" />
+ <xs:attribute name="knowledge-base-config" type="components:string" />
+ </xs:attributeGroup>
+
+ <xs:element name="stateful-knowledge-session">
+ <xs:annotation>
+ <xs:documentation>Drools StatefulKnowledgeSession</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element minOccurs="0" maxOccurs="1"
+ ref="drools:event-listeners" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.StatefulKnowledgeSession" />
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.StatefulKnowledgeSession">
+ <xs:attribute name="knowledge-base" type="components:expressionType" />
+ <xs:attribute name="event-listeners" type="components:string" />
+ <xs:attribute name="knowledge-session-config" type="components:string" />
+ </xs:attributeGroup>
+ <xs:element name="globals" type="components:multiValuedProperty" />
+
+ <xs:element name="knowledge-agent">
+ <xs:annotation>
+ <xs:documentation>Drools KnowledgeAgent</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element minOccurs="0" maxOccurs="1" ref="drools:change-sets" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.KnowledgeAgent" />
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.KnowledgeAgent">
+ <xs:attribute name="knowledge-base" type="components:expressionType" />
+ <xs:attribute name="agent-name" type="components:string" />
+ <xs:attribute name="scan-resources" type="components:string" />
+ <xs:attribute name="scan-directories" type="components:string" />
+ <xs:attribute name="new-instance" type="components:string" />
+ <xs:attribute name="monitor-change-set-events" type="components:string" />
+ <xs:attribute name="knowledge-agent-config" type="components:string" />
+ <xs:attribute name="scan-interval" type="components:string" />
+ </xs:attributeGroup>
+ <xs:element name="change-sets" type="components:multiValuedProperty" />
+
+ <xs:element name="batch-execution">
+ <xs:annotation>
+ <xs:documentation>Batch Execution Component</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="drools:attlist.BatchExecution" />
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.BatchExecution">
+ <xs:attribute name="ksession" type="components:expressionType" />
+ <xs:attribute name="batch-xml" type="components:expressionType" />
+ <xs:attribute name="batch-xml-config" type="components:string" />
+ </xs:attributeGroup>
</xs:schema>
15 years, 4 months
Seam SVN: r11377 - branches/community/Seam_2_2/src/main/org/jboss/seam/util.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-08-13 13:24:13 -0400 (Thu, 13 Aug 2009)
New Revision: 11377
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/util/Work.java
Log:
JBSEAM-4340
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/util/Work.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/util/Work.java 2009-08-13 13:26:01 UTC (rev 11376)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/util/Work.java 2009-08-13 17:24:13 UTC (rev 11377)
@@ -29,12 +29,26 @@
public final T workInTransaction() throws Exception
{
- org.jboss.seam.transaction.UserTransaction transaction = Transaction.instance();
+ org.jboss.seam.transaction.UserTransaction transaction = null;
+ boolean transactionActive = false;
+ boolean newTransactionRequired = false;
+ UserTransaction userTransaction = null;
- boolean transactionActive = transaction.isActiveOrMarkedRollback()
+ try {
+ transaction = Transaction.instance();
+
+ transactionActive = transaction.isActiveOrMarkedRollback()
|| transaction.isRolledBack(); //TODO: temp workaround, what should we really do in this case??
- boolean newTransactionRequired = isNewTransactionRequired(transactionActive);
- UserTransaction userTransaction = newTransactionRequired ? transaction : null;
+ newTransactionRequired = isNewTransactionRequired(transactionActive);
+ userTransaction = newTransactionRequired ? transaction : null;
+ } catch (IllegalStateException e) {
+ // for shutdown case, when we can't get the tx object because the event context is gone
+ // but we should still check if a tx is required and fail accordingly if it is
+ newTransactionRequired = isNewTransactionRequired(false);
+ if (newTransactionRequired) {
+ throw e;
+ }
+ }
try
{
15 years, 4 months