Seam SVN: r11498 - in branches/enterprise/JBPAPP_5_0/src/test/ftest: src/main/org/jboss/seam/example/common/test/selenium and 1 other directory.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-09-17 06:30:21 -0400 (Thu, 17 Sep 2009)
New Revision: 11498
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java
branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
Log:
JBPAPP-2822 Added a functional test for seam chatroom example
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java 2009-09-17 09:19:11 UTC (rev 11497)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java 2009-09-17 10:30:21 UTC (rev 11498)
@@ -1,25 +1,161 @@
+/*
+ * 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.chatroom.test.selenium;
+import org.jboss.seam.example.common.test.selenium.SeamSelenium;
import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
+/**
+ * This class tests functionality of remoting/chatroom example.
+ * The test opens two browsers and tests communication between users.
+ *
+ * @author Martin Gencur
+ *
+ */
public class SeleniumChatroomTest extends SeamSeleniumTest
{
+ public static long timeout = 22000;
+
public static final String HOME_PAGE = "/chatroom.seam";
public static final String HOME_PAGE_TITLE = "Chat Room Example";
+ public static final String NAME_INPUT = "id=username";
+ public static final String CONNECT_BUTTON = "id=btnConnect";
+ public static final String DISCONNECT_BUTTON = "id=btnDisconnect";
+ public static final String CONNECT_BUTTON_DISABLED = "xpath=//input[@id='btnConnect'][@disabled]";
+ public static final String DISCONNECT_BUTTON_DISABLED = "xpath=//input[@id='btnDisconnect'][@disabled]";
+ public static final String MESSAGE_INPUT = "id=messageText";
+ public static final String CHAT_AREA = "id=channelDisplay";
+ public static final String NAME1 = "Martin";
+ public static final String NAME2 = "Jozef";
+ public static final String MARTIN_CONNECTED = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Martin connected.')]";
+ public static final String MARTIN_LISTED = "xpath=//div/select[@id='userList']/option[contains(text(),'Martin')]";
+ public static final String JOZEF_CONNECTED = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Jozef connected.')]";
+ public static final String JOZEF_LISTED = "xpath=//div/select[@id='userList']/option[contains(text(),'Jozef')]";
+ public static final String JOZEF_DISCONNECTED = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Jozef disconnected.')]";
+ public static final String MESSAGE_FROM_MARTIN = "Hello";
+ public static final String MESSAGE_FROM_JOZEF = "Good evening";
+ public static final String MARTIN_GT = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Martin>')]";
+ public static final String HELLO = "xpath=//div[@id='channelDisplay']/text()[contains(.,'"+ MESSAGE_FROM_MARTIN +"')]";
+ public static final String JOZEF_GT = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Jozef>')]";
+ public static final String GOOD_MORNING = "xpath=//div[@id='channelDisplay']/text()[contains(.,'" + MESSAGE_FROM_JOZEF + "')]";
+
+ protected SeamSelenium browser2;
@BeforeMethod
@Override
public void setUp() {
super.setUp();
- browser.open(CONTEXT_PATH + HOME_PAGE);
+ startSecondBrowser();
+ browser.open(CONTEXT_PATH + HOME_PAGE);
+ browser2.open(CONTEXT_PATH + HOME_PAGE);
}
+ @AfterMethod
+ @Override
+ public void tearDown() {
+ stopSecondBrowser();
+ super.tearDown();
+ }
+
@Test // place holder - should be replaced by better tests as soon as JBSEAM-3944 is resolved
public void homePageLoadTest() {
assertEquals("Unexpected page title.", HOME_PAGE_TITLE, browser.getTitle());
}
-
+
+ @Test(dependsOnMethods={"homePageLoadTest"})
+ public void connectAndChatTest(){
+ /*connect user to chat*/
+ connect();
+ /*verify that user is connected and is seen by other users*/
+ verifyConnecting();
+ /*exchange several messages*/
+ chat();
+ /*disconnect user from chat*/
+ disconnect();
+ /*verify that user is disconnected and is not in a list of users anymore*/
+ verifyDisconnecting();
+ }
+
+ public void connect(){
+ browser.type(NAME_INPUT, NAME1);
+ browser.click(CONNECT_BUTTON);
+ }
+
+ public void verifyConnecting(){
+ browser.waitForElement(MARTIN_CONNECTED, timeout);
+ browser.waitForElement(MARTIN_LISTED, timeout);
+ browser2.type(NAME_INPUT, NAME2);
+ browser2.click(CONNECT_BUTTON);
+ browser2.waitForElement(JOZEF_CONNECTED, timeout);
+ browser2.waitForElement(JOZEF_LISTED, timeout);
+ browser2.waitForElement(MARTIN_LISTED, timeout);
+ browser.waitForElement(JOZEF_CONNECTED, timeout);
+ browser.waitForElement(JOZEF_LISTED, timeout);
+ }
+
+ public void disconnect(){
+ browser2.click(DISCONNECT_BUTTON);
+ }
+
+ public void verifyDisconnecting(){
+ browser2.waitForElementNotPresent(JOZEF_LISTED, timeout);
+ browser2.waitForElement(DISCONNECT_BUTTON_DISABLED, timeout);
+ browser.waitForElement(JOZEF_DISCONNECTED, timeout);
+ browser.waitForElementNotPresent(JOZEF_LISTED, timeout);
+ browser.click(DISCONNECT_BUTTON);
+ browser.waitForElementNotPresent(MARTIN_LISTED, timeout);
+ browser.waitForElement(DISCONNECT_BUTTON_DISABLED, timeout);
+ }
+
+ public void chat(){
+ /*first user is sending a message*/
+ browser.type(MESSAGE_INPUT, MESSAGE_FROM_MARTIN);
+ browser.focus(MESSAGE_INPUT);
+ browser.keyPressNative("10");//browser.keyPressNative("13");
+ browser.keyPress(MESSAGE_INPUT,"13");
+ browser.waitForElement(MARTIN_GT, timeout);
+ browser.waitForElement(HELLO, timeout);
+ browser2.waitForElement(MARTIN_GT, timeout);
+ browser2.waitForElement(HELLO, timeout);
+ /*second user is sending a message*/
+ browser2.type(MESSAGE_INPUT, MESSAGE_FROM_JOZEF);
+ browser2.focus(MESSAGE_INPUT);
+ browser2.keyPressNative("10");
+ browser2.keyPress(MESSAGE_INPUT,"13");
+ browser2.waitForElement(JOZEF_GT, timeout);
+ browser2.waitForElement(GOOD_MORNING, timeout);
+ browser.waitForElement(JOZEF_GT, timeout);
+ browser.waitForElement(GOOD_MORNING, timeout);
+ }
+
+ public void startSecondBrowser(){
+ browser2 = super.startBrowser();
+ }
+
+ public void stopSecondBrowser(){
+ browser2.stop();
+ }
}
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java 2009-09-17 09:19:11 UTC (rev 11497)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java 2009-09-17 10:30:21 UTC (rev 11498)
@@ -113,6 +113,53 @@
}
/**
+ * Waits until element is asynchronously loaded on page. Uses global Selenium
+ * timeout
+ *
+ * @param locator Locator of element
+ */
+ public void waitForElement(final String locator)
+ {
+ waitForElement(locator, Long.valueOf(timeout));
+ }
+
+ /**
+ * Waits until element is asynchronously loaded on page.
+ *
+ * @param timeout Timeout in milliseconds
+ * @param locator Locator of element
+ */
+ public void waitForElement(final String locator, long timeout)
+ {
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return isElementPresent(locator);
+ }
+ }.wait("Timeout while waiting for asynchronous update of " + locator, timeout);
+ }
+
+ /**
+ * Waits until element is asynchronously unloaded from page.
+ *
+ * @param timeout Timeout in milliseconds
+ * @param locator Locator of element
+ */
+ public void waitForElementNotPresent(final String locator, long timeout)
+ {
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return !isElementPresent(locator);
+ }
+ }.wait("Timeout while waiting for asynchronous update of " + locator, timeout);
+ }
+
+ /**
* Returns true if icefaces detection is turned on
*/
public boolean isIcefacesDetection()
15 years, 3 months
Seam SVN: r11497 - in branches/community/Seam_2_2/src/test/ftest: src/main/org/jboss/seam/example/common/test/selenium and 1 other directory.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-09-17 05:19:11 -0400 (Thu, 17 Sep 2009)
New Revision: 11497
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java
branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
Log:
JBSEAM-4418 Added a functional test for chatroom example
Modified: branches/community/Seam_2_2/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java 2009-09-16 16:16:01 UTC (rev 11496)
+++ branches/community/Seam_2_2/src/test/ftest/examples/remoting/chatroom/src/org/jboss/seam/example/remoting/chatroom/test/selenium/SeleniumChatroomTest.java 2009-09-17 09:19:11 UTC (rev 11497)
@@ -1,25 +1,161 @@
+/*
+ * 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.chatroom.test.selenium;
+import org.jboss.seam.example.common.test.selenium.SeamSelenium;
import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
+/**
+ * This class tests functionality of remoting/chatroom example.
+ * The test opens two browsers and tests communication between users.
+ *
+ * @author Martin Gencur
+ *
+ */
public class SeleniumChatroomTest extends SeamSeleniumTest
{
+ public static long timeout = 22000;
+
public static final String HOME_PAGE = "/chatroom.seam";
public static final String HOME_PAGE_TITLE = "Chat Room Example";
+ public static final String NAME_INPUT = "id=username";
+ public static final String CONNECT_BUTTON = "id=btnConnect";
+ public static final String DISCONNECT_BUTTON = "id=btnDisconnect";
+ public static final String CONNECT_BUTTON_DISABLED = "xpath=//input[@id='btnConnect'][@disabled]";
+ public static final String DISCONNECT_BUTTON_DISABLED = "xpath=//input[@id='btnDisconnect'][@disabled]";
+ public static final String MESSAGE_INPUT = "id=messageText";
+ public static final String CHAT_AREA = "id=channelDisplay";
+ public static final String NAME1 = "Martin";
+ public static final String NAME2 = "Jozef";
+ public static final String MARTIN_CONNECTED = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Martin connected.')]";
+ public static final String MARTIN_LISTED = "xpath=//div/select[@id='userList']/option[contains(text(),'Martin')]";
+ public static final String JOZEF_CONNECTED = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Jozef connected.')]";
+ public static final String JOZEF_LISTED = "xpath=//div/select[@id='userList']/option[contains(text(),'Jozef')]";
+ public static final String JOZEF_DISCONNECTED = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Jozef disconnected.')]";
+ public static final String MESSAGE_FROM_MARTIN = "Hello";
+ public static final String MESSAGE_FROM_JOZEF = "Good evening";
+ public static final String MARTIN_GT = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Martin>')]";
+ public static final String HELLO = "xpath=//div[@id='channelDisplay']/text()[contains(.,'"+ MESSAGE_FROM_MARTIN +"')]";
+ public static final String JOZEF_GT = "xpath=//div[@id='channelDisplay']/span[contains(text(),'Jozef>')]";
+ public static final String GOOD_MORNING = "xpath=//div[@id='channelDisplay']/text()[contains(.,'" + MESSAGE_FROM_JOZEF + "')]";
+
+ protected SeamSelenium browser2;
@BeforeMethod
@Override
public void setUp() {
super.setUp();
- browser.open(CONTEXT_PATH + HOME_PAGE);
+ startSecondBrowser();
+ browser.open(CONTEXT_PATH + HOME_PAGE);
+ browser2.open(CONTEXT_PATH + HOME_PAGE);
}
+ @AfterMethod
+ @Override
+ public void tearDown() {
+ stopSecondBrowser();
+ super.tearDown();
+ }
+
@Test // place holder - should be replaced by better tests as soon as JBSEAM-3944 is resolved
public void homePageLoadTest() {
assertEquals("Unexpected page title.", HOME_PAGE_TITLE, browser.getTitle());
}
-
+
+ @Test(dependsOnMethods={"homePageLoadTest"})
+ public void connectAndChatTest(){
+ /*connect user to chat*/
+ connect();
+ /*verify that user is connected and is seen by other users*/
+ verifyConnecting();
+ /*exchange several messages*/
+ chat();
+ /*disconnect user from chat*/
+ disconnect();
+ /*verify that user is disconnected and is not in a list of users anymore*/
+ verifyDisconnecting();
+ }
+
+ public void connect(){
+ browser.type(NAME_INPUT, NAME1);
+ browser.click(CONNECT_BUTTON);
+ }
+
+ public void verifyConnecting(){
+ browser.waitForElement(MARTIN_CONNECTED, timeout);
+ browser.waitForElement(MARTIN_LISTED, timeout);
+ browser2.type(NAME_INPUT, NAME2);
+ browser2.click(CONNECT_BUTTON);
+ browser2.waitForElement(JOZEF_CONNECTED, timeout);
+ browser2.waitForElement(JOZEF_LISTED, timeout);
+ browser2.waitForElement(MARTIN_LISTED, timeout);
+ browser.waitForElement(JOZEF_CONNECTED, timeout);
+ browser.waitForElement(JOZEF_LISTED, timeout);
+ }
+
+ public void disconnect(){
+ browser2.click(DISCONNECT_BUTTON);
+ }
+
+ public void verifyDisconnecting(){
+ browser2.waitForElementNotPresent(JOZEF_LISTED, timeout);
+ browser2.waitForElement(DISCONNECT_BUTTON_DISABLED, timeout);
+ browser.waitForElement(JOZEF_DISCONNECTED, timeout);
+ browser.waitForElementNotPresent(JOZEF_LISTED, timeout);
+ browser.click(DISCONNECT_BUTTON);
+ browser.waitForElementNotPresent(MARTIN_LISTED, timeout);
+ browser.waitForElement(DISCONNECT_BUTTON_DISABLED, timeout);
+ }
+
+ public void chat(){
+ /*first user is sending a message*/
+ browser.type(MESSAGE_INPUT, MESSAGE_FROM_MARTIN);
+ browser.focus(MESSAGE_INPUT);
+ browser.keyPressNative("10");//browser.keyPressNative("13");
+ browser.keyPress(MESSAGE_INPUT,"13");
+ browser.waitForElement(MARTIN_GT, timeout);
+ browser.waitForElement(HELLO, timeout);
+ browser2.waitForElement(MARTIN_GT, timeout);
+ browser2.waitForElement(HELLO, timeout);
+ /*second user is sending a message*/
+ browser2.type(MESSAGE_INPUT, MESSAGE_FROM_JOZEF);
+ browser2.focus(MESSAGE_INPUT);
+ browser2.keyPressNative("10");
+ browser2.keyPress(MESSAGE_INPUT,"13");
+ browser2.waitForElement(JOZEF_GT, timeout);
+ browser2.waitForElement(GOOD_MORNING, timeout);
+ browser.waitForElement(JOZEF_GT, timeout);
+ browser.waitForElement(GOOD_MORNING, timeout);
+ }
+
+ public void startSecondBrowser(){
+ browser2 = super.startBrowser();
+ }
+
+ public void stopSecondBrowser(){
+ browser2.stop();
+ }
}
Modified: branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java 2009-09-16 16:16:01 UTC (rev 11496)
+++ branches/community/Seam_2_2/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java 2009-09-17 09:19:11 UTC (rev 11497)
@@ -140,6 +140,24 @@
}
}.wait("Timeout while waiting for asynchronous update of " + locator, timeout);
}
+
+ /**
+ * Waits until element is asynchronously unloaded from page.
+ *
+ * @param timeout Timeout in milliseconds
+ * @param locator Locator of element
+ */
+ public void waitForElementNotPresent(final String locator, long timeout)
+ {
+ new Wait()
+ {
+ @Override
+ public boolean until()
+ {
+ return !isElementPresent(locator);
+ }
+ }.wait("Timeout while waiting for asynchronous update of " + locator, timeout);
+ }
/**
* Returns true if icefaces detection is turned on
15 years, 3 months
Seam SVN: r11496 - branches/community/Seam_2_1/src/remoting/org/jboss/seam/remoting.
by seam-commits@lists.jboss.org
Author: smendenh(a)redhat.com
Date: 2009-09-16 12:16:01 -0400 (Wed, 16 Sep 2009)
New Revision: 11496
Modified:
branches/community/Seam_2_1/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
Log:
Backporting patch from the 2_2 branch seen here http://fisheye.jboss.org/changelog/Seam?cs=11485&csize=1 related to shttps://jira.jboss.org/jira/browse/JBSEAM-4415
Modified: branches/community/Seam_2_1/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java
===================================================================
--- branches/community/Seam_2_1/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java 2009-09-16 12:34:12 UTC (rev 11495)
+++ branches/community/Seam_2_1/src/remoting/org/jboss/seam/remoting/InterfaceGenerator.java 2009-09-16 16:16:01 UTC (rev 11496)
@@ -269,7 +269,7 @@
{
StringBuilder componentSrc = new StringBuilder();
- Class type = null;
+ Set<Class> componentTypes = new HashSet<Class>();
if (component.getType().isSessionBean() &&
component.getBusinessInterfaces().size() > 0)
@@ -279,12 +279,12 @@
// Use the Local interface
if (c.isAnnotationPresent(EJB.LOCAL))
{
- type = c;
+ componentTypes.add(c);
break;
}
}
- if (type == null)
+ if (componentTypes.isEmpty())
throw new RuntimeException(String.format(
"Type cannot be determined for component [%s]. Please ensure that it has a local interface.", component));
}
@@ -301,25 +301,34 @@
{
if (m.getAnnotation(WebRemote.class) != null)
{
- type = component.getBeanClass();
+ componentTypes.add(component.getBeanClass());
break;
}
}
- if (type == null)
+ if (componentTypes.isEmpty())
{
appendTypeSource(out, component.getBeanClass(), types);
return;
}
}
else
- type = component.getBeanClass();
+ {
+ componentTypes.add(component.getBeanClass());
+ }
- if (types.contains(type))
- return;
-
- types.add(type);
-
+ // If types already contains all the component types, then return
+ boolean foundNew = false;
+ for (Class type : componentTypes)
+ {
+ if (!types.contains(type))
+ {
+ foundNew = true;
+ break;
+ }
+ }
+ if (!foundNew) return;
+
if (component.getName().contains("."))
{
componentSrc.append("Seam.Remoting.createNamespace('");
@@ -332,64 +341,75 @@
componentSrc.append(component.getName());
componentSrc.append(" = function() {\n");
componentSrc.append(" this.__callback = new Object();\n");
-
- for (Method m : type.getDeclaredMethods())
+
+ for (Class type : componentTypes)
{
- if (m.getAnnotation(WebRemote.class) == null) continue;
+ if (types.contains(type))
+ {
+ break;
+ }
+ else
+ {
+ types.add(type);
- // Append the return type to the source block
- appendTypeSource(out, m.getGenericReturnType(), types);
+ for (Method m : type.getDeclaredMethods())
+ {
+ if (m.getAnnotation(WebRemote.class) == null) continue;
- componentSrc.append(" Seam.Remoting.type.");
- componentSrc.append(component.getName());
- componentSrc.append(".prototype.");
- componentSrc.append(m.getName());
- componentSrc.append(" = function(");
+ // Append the return type to the source block
+ appendTypeSource(out, m.getGenericReturnType(), types);
- // Insert parameters p0..pN
- for (int i = 0; i < m.getGenericParameterTypes().length; i++)
- {
- appendTypeSource(out, m.getGenericParameterTypes()[i], types);
+ componentSrc.append(" Seam.Remoting.type.");
+ componentSrc.append(component.getName());
+ componentSrc.append(".prototype.");
+ componentSrc.append(m.getName());
+ componentSrc.append(" = function(");
- if (i > 0) componentSrc.append(", ");
- componentSrc.append("p");
- componentSrc.append(i);
- }
+ // Insert parameters p0..pN
+ for (int i = 0; i < m.getGenericParameterTypes().length; i++)
+ {
+ appendTypeSource(out, m.getGenericParameterTypes()[i], types);
- if (m.getGenericParameterTypes().length > 0) componentSrc.append(", ");
- componentSrc.append("callback, exceptionHandler) {\n");
+ if (i > 0) componentSrc.append(", ");
+ componentSrc.append("p");
+ componentSrc.append(i);
+ }
- componentSrc.append(" return Seam.Remoting.execute(this, \"");
- componentSrc.append(m.getName());
- componentSrc.append("\", [");
+ if (m.getGenericParameterTypes().length > 0) componentSrc.append(", ");
+ componentSrc.append("callback, exceptionHandler) {\n");
- for (int i = 0; i < m.getParameterTypes().length; i++)
- {
- if (i > 0) componentSrc.append(", ");
- componentSrc.append("p");
- componentSrc.append(i);
- }
+ componentSrc.append(" return Seam.Remoting.execute(this, \"");
+ componentSrc.append(m.getName());
+ componentSrc.append("\", [");
- componentSrc.append("], callback, exceptionHandler);\n");
+ for (int i = 0; i < m.getParameterTypes().length; i++)
+ {
+ if (i > 0) componentSrc.append(", ");
+ componentSrc.append("p");
+ componentSrc.append(i);
+ }
- componentSrc.append(" }\n");
- }
+ componentSrc.append("], callback, exceptionHandler);\n");
- componentSrc.append("}\n");
+ componentSrc.append(" }\n");
+ }
+ }
+ componentSrc.append("}\n");
- // Set the component name
- componentSrc.append("Seam.Remoting.type.");
- componentSrc.append(component.getName());
- componentSrc.append(".__name = \"");
- componentSrc.append(component.getName());
- componentSrc.append("\";\n\n");
+ // Set the component name
+ componentSrc.append("Seam.Remoting.type.");
+ componentSrc.append(component.getName());
+ componentSrc.append(".__name = \"");
+ componentSrc.append(component.getName());
+ componentSrc.append("\";\n\n");
- // Register the component
- componentSrc.append("Seam.Component.register(Seam.Remoting.type.");
- componentSrc.append(component.getName());
- componentSrc.append(");\n\n");
+ // Register the component
+ componentSrc.append("Seam.Component.register(Seam.Remoting.type.");
+ componentSrc.append(component.getName());
+ componentSrc.append(");\n\n");
- out.write(componentSrc.toString().getBytes());
+ out.write(componentSrc.toString().getBytes());
+ }
}
/**
15 years, 3 months
Seam SVN: r11495 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-09-16 08:34:12 -0400 (Wed, 16 Sep 2009)
New Revision: 11495
Modified:
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
Log:
JBPAPP-2800 - added exclusion for servlet-api in org.tuckey:urlrewrite dependency, banned servlet-api 2.3 dependency
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2009-09-16 07:35:20 UTC (rev 11494)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2009-09-16 12:34:12 UTC (rev 11495)
@@ -1069,6 +1069,10 @@
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -1216,6 +1220,35 @@
See http://news.gmane.org/gmane.comp.apache.maven.announce
-->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>enforce-banned-dependencies</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <excludes>
+ <exclude>javax.servlet:servlet-api:2.3</exclude>
+ </excludes>
+ <includes>
+ <!--only 2.5 of servlet-api is allowed-->
+ <include>javax.servlet:servlet-api:2.5</include>
+ </includes>
+ </bannedDependencies>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+
<!-- Building -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
15 years, 3 months
Seam SVN: r11494 - branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-09-16 03:35:20 -0400 (Wed, 16 Sep 2009)
New Revision: 11494
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java
branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties
Log:
JBSEAM-4416 Fixed a functional test for UI example
Modified: branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java 2009-09-16 07:23:27 UTC (rev 11493)
+++ branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java 2009-09-16 07:35:20 UTC (rev 11494)
@@ -183,7 +183,7 @@
browser.type(getProperty("DATE_INPUT"), date1);
browser.type(getProperty("DATE_VERIFICATION_INPUT"), date2);
browser.clickAndWait(getProperty("CHECK_DATE_BUTTON"));
- assertTrue("Page should contain \"Value does not equal that in 'date'\"", browser.isTextPresent("Value does not equal that in 'date' "));
+ assertTrue("Page should contain \"Value does not equal that in 'date'\"", browser.isTextPresent("Value does not equal"));
//assertTrue("Page should contain information about Pete Muir working all the time on Seam", browser.isTextPresent("works on Seam, of course"));
}
Modified: branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties 2009-09-16 07:23:27 UTC (rev 11493)
+++ branches/community/Seam_2_2/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties 2009-09-16 07:35:20 UTC (rev 11494)
@@ -29,6 +29,6 @@
MINIMUM_AGE_INPUT=xpath\=//input[@type\='text'][contains(@name,'min')][not(contains(@name,'minVerification'))]
MAXIMUM_AGE_INPUT=xpath\=//input[@type\='text'][contains(@name,'minVerification')]
CHECK_AGES_BUTTON=xpath\=//input[@type\='submit'][@value\='Check ages']
-DATE_INPUT=xpath\=//input[@type\='text'][contains(@name,'date')][not(contains(@name,'dateVerification'))]
-DATE_VERIFICATION_INPUT=xpath\=//input[@type\='text'][contains(@name,'dateVerification')]
-CHECK_DATE_BUTTON=xpath\=//input[@type\='submit'][@value\='Check date']
\ No newline at end of file
+DATE_INPUT=xpath\=//input[contains(@name,'date')][not(contains(@name,'dateVerification'))]
+DATE_VERIFICATION_INPUT=xpath\=//input[contains(@name,'dateVerification')]
+CHECK_DATE_BUTTON=xpath\=//input[@type\='submit'][@value\='Check date']
15 years, 3 months
Seam SVN: r11493 - branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-09-16 03:23:27 -0400 (Wed, 16 Sep 2009)
New Revision: 11493
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties
Log:
JBPAPP-2812 Fixed functional test of UI example
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java 2009-09-16 05:06:41 UTC (rev 11492)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/SeleniumUITest.java 2009-09-16 07:23:27 UTC (rev 11493)
@@ -183,7 +183,7 @@
browser.type(getProperty("DATE_INPUT"), date1);
browser.type(getProperty("DATE_VERIFICATION_INPUT"), date2);
browser.clickAndWait(getProperty("CHECK_DATE_BUTTON"));
- assertTrue("Page should contain \"Value does not equal that in 'date'\"", browser.isTextPresent("Value does not equal that in 'date' "));
+ assertTrue("Page should contain \"Value does not equal that in 'date'\"", browser.isTextPresent("Value does not equal"));
//assertTrue("Page should contain information about Pete Muir working all the time on Seam", browser.isTextPresent("works on Seam, of course"));
}
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties 2009-09-16 05:06:41 UTC (rev 11492)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/ui/src/org/jboss/seam/example/ui/test/selenium/ui.properties 2009-09-16 07:23:27 UTC (rev 11493)
@@ -29,6 +29,6 @@
MINIMUM_AGE_INPUT=xpath\=//input[@type\='text'][contains(@name,'min')][not(contains(@name,'minVerification'))]
MAXIMUM_AGE_INPUT=xpath\=//input[@type\='text'][contains(@name,'minVerification')]
CHECK_AGES_BUTTON=xpath\=//input[@type\='submit'][@value\='Check ages']
-DATE_INPUT=xpath\=//input[@type\='text'][contains(@name,'date')][not(contains(@name,'dateVerification'))]
-DATE_VERIFICATION_INPUT=xpath\=//input[@type\='text'][contains(@name,'dateVerification')]
-CHECK_DATE_BUTTON=xpath\=//input[@type\='submit'][@value\='Check date']
\ No newline at end of file
+DATE_INPUT=xpath\=//input[contains(@name,'date')][not(contains(@name,'dateVerification'))]
+DATE_VERIFICATION_INPUT=xpath\=//input[contains(@name,'dateVerification')]
+CHECK_DATE_BUTTON=xpath\=//input[@type\='submit'][@value\='Check date']
15 years, 3 months
Seam SVN: r11492 - in branches/community/Seam_2_2_Drools5: examples/drools/resources/WEB-INF and 3 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2009-09-16 01:06:41 -0400 (Wed, 16 Sep 2009)
New Revision: 11492
Added:
branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesstemplate.drl
branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/NumberGuessTemplateDataProvider.java
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcess.java
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcessInterceptor.java
Removed:
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/annotations/drools/FlowProcessInterceptor.java
Modified:
branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml
Log:
Drools5 Integration.
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-09-15 20:49:34 UTC (rev 11491)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml 2009-09-16 05:06:41 UTC (rev 11492)
@@ -11,7 +11,7 @@
<drools:knowledge-base name="kbase" knowledge-builder-config="kbuilderconfig.properties" knowledge-base-config="kbaseconfig.properties">
<drools:rule-resources>
- <value>classpath;numberguess.drl;DRL</value>
+ <value>classpath;numberguesstemplate.drl;DRL;numberGuessTemplateDataProvider</value>
</drools:rule-resources>
<drools:event-listeners>
<value>org.drools.event.knowledgebase.DefaultKnowledgeBaseEventListener</value>
@@ -108,6 +108,8 @@
<value>org.drools.event.DebugAgendaEventListener</value>
</drools:event-listeners> -->
<!-- </drools:managed-working-memory> -->
+
+
<bpm:jbpm>
<bpm:pageflow-definitions>
<value>pageflow.jpdl.xml</value>
Added: branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesstemplate.drl
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesstemplate.drl (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesstemplate.drl 2009-09-16 05:06:41 UTC (rev 11492)
@@ -0,0 +1,55 @@
+template header
+wintext
+losetext
+guesscount
+increment
+
+package org.jboss.seam.example.numberguess
+import org.jboss.seam.drools.Decision;
+import java.lang.Integer;
+
+global Decision decision
+global Integer randomNumber
+global Game game
+template "numberGuess"
+
+rule High
+ when
+ Guess(guess: value>randomNumber)
+ then
+ game.setBiggest(guess - @{increment} );
+end
+
+rule Low
+ when
+ Guess(guess: value<randomNumber)
+ then
+ game.setSmallest(guess + @{increment} );
+end
+
+rule Win
+ when
+ Guess(value==randomNumber)
+ then
+ decision.setOutcome("@{wintext}");
+end
+
+rule Lose
+ when
+ Game(guessCount == @{guesscount} )
+ then
+ if ( decision.getOutcome()==null )
+ {
+ decision.setOutcome("@{losetext}");
+ }
+end
+
+rule Increment
+ salience -10
+ when
+ Guess()
+ then
+ game.incrementGuessCount();
+end
+
+end template
\ No newline at end of file
Added: branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/NumberGuessTemplateDataProvider.java
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/NumberGuessTemplateDataProvider.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/src/org/jboss/seam/example/numberguess/NumberGuessTemplateDataProvider.java 2009-09-16 05:06:41 UTC (rev 11492)
@@ -0,0 +1,38 @@
+package org.jboss.seam.example.numberguess;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.drools.TemplateDataProvider;
+
+@Name("numberGuessTemplateDataProvider")
+public class NumberGuessTemplateDataProvider implements TemplateDataProvider
+{
+ Collection<Map<String, Object>> templateData = new ArrayList<Map<String,Object>>();
+
+ @Create
+ public void init()
+ {
+ Map<String, Object> m1 = new HashMap<String, Object>();
+ m1.put("wintext", "win");
+ m1.put("losetext", "lose");
+ m1.put("guesscount", 9);
+ m1.put("increment", 1);
+
+ templateData.add(m1);
+ }
+
+ public Collection<Map<String, Object>> getTemplateData()
+ {
+ return templateData;
+ }
+
+ public void setTemplateData(Collection<Map<String, Object>> templateData)
+ {
+ this.templateData = templateData;
+ }
+}
Deleted: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/annotations/drools/FlowProcessInterceptor.java
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/annotations/drools/FlowProcessInterceptor.java 2009-09-15 20:49:34 UTC (rev 11491)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/annotations/drools/FlowProcessInterceptor.java 2009-09-16 05:06:41 UTC (rev 11492)
@@ -1,97 +0,0 @@
-package org.jboss.seam.annotations.drools;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import org.drools.runtime.process.ProcessInstance;
-import org.jboss.seam.Component;
-import org.jboss.seam.annotations.intercept.AroundInvoke;
-import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.core.BijectionInterceptor;
-import org.jboss.seam.intercept.InvocationContext;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-/**
- * Implements annotation-based flow process demarcation.
- *
- * @author Tihomir Surdilovic
- */
-@Interceptor(stateless=true, around=BijectionInterceptor.class)
-public class FlowProcessInterceptor
-{
- private static final LogProvider log = Logging.getLogProvider( FlowProcessInterceptor.class );
-
- @AroundInvoke
- public Object aroundInvoke(InvocationContext invocation) throws Exception
- {
- if ( !beforeInvocation(invocation) )
- {
- return null;
- }
- else
- {
- return afterInvocation( invocation, invocation.proceed() );
- }
- }
-
- private boolean beforeInvocation(InvocationContext invocationContext)
- {
- Method method = invocationContext.getMethod();
- if ( method.isAnnotationPresent(StartProcess.class) )
- {
- log.info( "encountered @StartProcess" );
- StartProcess tag = method.getAnnotation(StartProcess.class);
- org.drools.runtime.StatefulKnowledgeSession ksession =
- (org.drools.runtime.StatefulKnowledgeSession) Component.getInstance(tag.ksession(), true);
-
- if(tag.processData() != "") {
- ksession.startProcess(tag.processName(), (Map<String, Object>) Component.getInstance(tag.processData()));
- } else {
- ksession.startProcess(tag.processName());
- }
- }
- else if ( method.isAnnotationPresent(AbortProcess.class) ) {
- log.info( "encountered @AbortProcess" );
- AbortProcess tag = method.getAnnotation(AbortProcess.class);
- org.drools.runtime.StatefulKnowledgeSession ksession =
- (org.drools.runtime.StatefulKnowledgeSession) Component.getInstance(tag.ksession(), true);
- ksession.getProcessInstances();
- for(ProcessInstance processInstance: ksession.getProcessInstances()) {
- if(processInstance.getProcessName().equals(tag.processName())) {
- ksession.abortProcessInstance(processInstance.getId());
- }
- }
- }
- else if ( method.isAnnotationPresent(SignalEvent.class) ) {
- log.info( "encountered @SignalEvent" );
- SignalEvent tag = method.getAnnotation(SignalEvent.class);
- org.drools.runtime.StatefulKnowledgeSession ksession =
- (org.drools.runtime.StatefulKnowledgeSession) Component.getInstance(tag.ksession(), true);
-
- if(tag.processName() != "") {
- for(ProcessInstance processInstance: ksession.getProcessInstances()) {
- if(processInstance.getProcessName().equals(tag.processName())) {
- if (tag.eventData() != "") {
- processInstance.signalEvent(tag.eventType(), Component.getInstance(tag.eventData()));
- } else {
- processInstance.signalEvent(tag.eventType(), null);
- }
- }
- }
- } else {
- if (tag.eventData() != "") {
- ksession.signalEvent(tag.eventType(), Component.getInstance(tag.eventData()));
- } else {
- ksession.signalEvent(tag.eventType(), null);
- }
- }
- }
- return true;
- }
-
- private Object afterInvocation(InvocationContext invocation, Object result)
- {
- return result;
- }
-}
Added: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcess.java
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcess.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcess.java 2009-09-16 05:06:41 UTC (rev 11492)
@@ -0,0 +1,34 @@
+package org.jboss.seam.drools;
+
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.core.AbstractMutable;
+
+/**
+ * Holds the process ids for the current conversation,
+ * and provides programmatic control over the flow process.
+ *
+ * @author Tihomir Surdilovic
+ *
+ */
+
+(a)Scope(ScopeType.CONVERSATION)
+@Name("org.jboss.seam.drools.flowProcess")
+@BypassInterceptors
+@Install(precedence=BUILT_IN)
+
+public class FlowProcess extends AbstractMutable implements Serializable
+{
+ private Long processId;
+
+
+
+
+}
Copied: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcessInterceptor.java (from rev 11446, branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/annotations/drools/FlowProcessInterceptor.java)
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcessInterceptor.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/FlowProcessInterceptor.java 2009-09-16 05:06:41 UTC (rev 11492)
@@ -0,0 +1,100 @@
+package org.jboss.seam.drools;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import org.drools.runtime.process.ProcessInstance;
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.drools.AbortProcess;
+import org.jboss.seam.annotations.drools.SignalEvent;
+import org.jboss.seam.annotations.drools.StartProcess;
+import org.jboss.seam.annotations.intercept.AroundInvoke;
+import org.jboss.seam.annotations.intercept.Interceptor;
+import org.jboss.seam.core.BijectionInterceptor;
+import org.jboss.seam.intercept.InvocationContext;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+/**
+ * Implements annotation-based flow process demarcation.
+ *
+ * @author Tihomir Surdilovic
+ */
+@Interceptor(stateless=true, around=BijectionInterceptor.class)
+public class FlowProcessInterceptor
+{
+ private static final LogProvider log = Logging.getLogProvider( FlowProcessInterceptor.class );
+
+ @AroundInvoke
+ public Object aroundInvoke(InvocationContext invocation) throws Exception
+ {
+ if ( !beforeInvocation(invocation) )
+ {
+ return null;
+ }
+ else
+ {
+ return afterInvocation( invocation, invocation.proceed() );
+ }
+ }
+
+ private boolean beforeInvocation(InvocationContext invocationContext)
+ {
+ Method method = invocationContext.getMethod();
+ if ( method.isAnnotationPresent(StartProcess.class) )
+ {
+ log.info( "encountered @StartProcess" );
+ StartProcess tag = method.getAnnotation(StartProcess.class);
+ org.drools.runtime.StatefulKnowledgeSession ksession =
+ (org.drools.runtime.StatefulKnowledgeSession) Component.getInstance(tag.ksession(), true);
+
+ if(tag.processData() != "") {
+ ksession.startProcess(tag.processName(), (Map<String, Object>) Component.getInstance(tag.processData()));
+ } else {
+ ksession.startProcess(tag.processName());
+ }
+ }
+ else if ( method.isAnnotationPresent(AbortProcess.class) ) {
+ log.info( "encountered @AbortProcess" );
+ AbortProcess tag = method.getAnnotation(AbortProcess.class);
+ org.drools.runtime.StatefulKnowledgeSession ksession =
+ (org.drools.runtime.StatefulKnowledgeSession) Component.getInstance(tag.ksession(), true);
+ ksession.getProcessInstances();
+ for(ProcessInstance processInstance: ksession.getProcessInstances()) {
+ if(processInstance.getProcessName().equals(tag.processName())) {
+ ksession.abortProcessInstance(processInstance.getId());
+ }
+ }
+ }
+ else if ( method.isAnnotationPresent(SignalEvent.class) ) {
+ log.info( "encountered @SignalEvent" );
+ SignalEvent tag = method.getAnnotation(SignalEvent.class);
+ org.drools.runtime.StatefulKnowledgeSession ksession =
+ (org.drools.runtime.StatefulKnowledgeSession) Component.getInstance(tag.ksession(), true);
+
+ if(tag.processName() != "") {
+ for(ProcessInstance processInstance: ksession.getProcessInstances()) {
+ if(processInstance.getProcessName().equals(tag.processName())) {
+ if (tag.eventData() != "") {
+ processInstance.signalEvent(tag.eventType(), Component.getInstance(tag.eventData()));
+ } else {
+ processInstance.signalEvent(tag.eventType(), null);
+ }
+ }
+ }
+ } else {
+ if (tag.eventData() != "") {
+ ksession.signalEvent(tag.eventType(), Component.getInstance(tag.eventData()));
+ } else {
+ ksession.signalEvent(tag.eventType(), null);
+ }
+ }
+ }
+ return true;
+ }
+
+ private Object afterInvocation(InvocationContext invocation, Object result)
+ {
+ return result;
+ }
+}
15 years, 3 months
Seam SVN: r11491 - branches/community/Seam_2_2/src/flex/org/jboss/seam/flex.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-09-15 16:49:34 -0400 (Tue, 15 Sep 2009)
New Revision: 11491
Modified:
branches/community/Seam_2_2/src/flex/org/jboss/seam/flex/FlexFilter.java
Log:
JBSEAM-4409
Modified: branches/community/Seam_2_2/src/flex/org/jboss/seam/flex/FlexFilter.java
===================================================================
--- branches/community/Seam_2_2/src/flex/org/jboss/seam/flex/FlexFilter.java 2009-09-15 19:26:32 UTC (rev 11490)
+++ branches/community/Seam_2_2/src/flex/org/jboss/seam/flex/FlexFilter.java 2009-09-15 20:49:34 UTC (rev 11491)
@@ -21,7 +21,7 @@
@Scope(ScopeType.APPLICATION)
@Name("org.jboss.seam.flex.flexFilter")
@Startup
-(a)Install(precedence=Install.BUILT_IN)
+(a)Install(precedence=Install.BUILT_IN, value=false)
@BypassInterceptors
@org.jboss.seam.annotations.web.Filter //within={"org.jboss.seam.????"}
public class FlexFilter
15 years, 3 months
Seam SVN: r11490 - in branches/community/Seam_2_2/examples: icefaces/src/org/jboss/seam/example/booking/test and 4 other directories.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-09-15 15:26:32 -0400 (Tue, 15 Sep 2009)
New Revision: 11490
Modified:
branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/testng.xml
branches/community/Seam_2_2/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/testng.xml
branches/community/Seam_2_2/examples/seambay/src/org/jboss/seam/example/seambay/test/testng.xml
branches/community/Seam_2_2/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/testng.xml
branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml
Log:
JBSEAM-4344
Modified: branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
+++ branches/community/Seam_2_2/examples/dvdstore/src/com/jboss/dvd/seam/testng.xml 2009-09-15 19:26:32 UTC (rev 11490)
@@ -1,25 +1,25 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="DVD Store" verbose="2" parallel="false">
- <test name="DVD Store: Model Unit Tests">
+ <test name="DVD Store Model Unit Tests">
<classes>
<class name="com.jboss.dvd.seam.test.ProductUnitTest" />
</classes>
</test>
- <test name="DVD Store: Store Beans">
+ <test name="DVD Store Store Beans">
<classes>
<class name="com.jboss.dvd.seam.test.SearchTest"/>
<class name="com.jboss.dvd.seam.test.BestSellersTest"/>
</classes>
</test>
- <test name="DVD Store: Admin Beans">
+ <test name="DVD Store Admin Beans">
<classes>
<class name="com.jboss.dvd.seam.test.StoreManagerTest"/>
</classes>
</test>
- <test name="DVD Store: Order">
+ <test name="DVD Store Order">
<classes>
<class name="com.jboss.dvd.seam.test.OrderTest" />
</classes>
Modified: branches/community/Seam_2_2/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
+++ branches/community/Seam_2_2/examples/icefaces/src/org/jboss/seam/example/booking/test/testng.xml 2009-09-15 19:26:32 UTC (rev 11490)
@@ -4,7 +4,7 @@
- <test name="Hotel Booking: Login">
+ <test name="Hotel Booking Login">
<classes>
<class name="org.jboss.seam.example.booking.test.LoginTest"/>
@@ -12,7 +12,7 @@
</test>
- <test name="Hotel Booking: Book Hotel">
+ <test name="Hotel Booking Book Hotel">
<classes>
<class name="org.jboss.seam.example.booking.test.BookingTest"/>
@@ -20,11 +20,11 @@
</test>
- <test name="Hotel Booking: Change Password">
+ <test name="Hotel Booking Change Password">
<classes>
<class name="org.jboss.seam.example.booking.test.ChangePasswordTest"/>
</classes>
</test>
-</suite>
\ No newline at end of file
+</suite>
Modified: branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
+++ branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/testng.xml 2009-09-15 19:26:32 UTC (rev 11490)
@@ -2,37 +2,37 @@
<suite name="RestBay" verbose="2" parallel="false">
- <test name="RestBay: Basic Services">
+ <test name="RestBay Basic Services">
<classes>
<class name="org.jboss.seam.example.restbay.test.BasicServiceTest"/>
</classes>
</test>
- <test name="RestBay: Auction Services">
+ <test name="RestBay Auction Services">
<classes>
<class name="org.jboss.seam.example.restbay.test.AuctionServiceTest"/>
</classes>
</test>
- <test name="RestBay: ResourceHome">
+ <test name="RestBay ResourceHome">
<classes>
<class name="org.jboss.seam.example.restbay.test.ResourceHomeTest"/>
</classes>
</test>
- <test name="RestBay: ResourceQuery">
+ <test name="RestBay ResourceQuery">
<classes>
<class name="org.jboss.seam.example.restbay.test.ResourceQueryTest"/>
</classes>
</test>
- <test name="RestBay: Security">
+ <test name="RestBay Security">
<classes>
<class name="org.jboss.seam.example.restbay.test.SecurityTest"/>
</classes>
</test>
- <test name="RestBay: DBUnit Integration">
+ <test name="RestBay DBUnit Integration">
<parameter name="database" value="hsql"/>
<parameter name="datasourceJndiName" value="java:/restbayDatasource"/>
@@ -42,4 +42,4 @@
</classes>
</test>
-</suite>
\ No newline at end of file
+</suite>
Modified: branches/community/Seam_2_2/examples/seambay/src/org/jboss/seam/example/seambay/test/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/seambay/src/org/jboss/seam/example/seambay/test/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
+++ branches/community/Seam_2_2/examples/seambay/src/org/jboss/seam/example/seambay/test/testng.xml 2009-09-15 19:26:32 UTC (rev 11490)
@@ -2,10 +2,10 @@
<suite name="SeamBay" verbose="2" parallel="false">
- <test name="SeamBay: Create Auction">
+ <test name="SeamBay Create Auction">
<classes>
<class name="org.jboss.seam.example.seambay.test.AuctionTest"/>
</classes>
</test>
-</suite>
\ No newline at end of file
+</suite>
Modified: branches/community/Seam_2_2/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
+++ branches/community/Seam_2_2/examples/seamdiscs/src/org/jboss/seam/example/seamdiscs/test/testng.xml 2009-09-15 19:26:32 UTC (rev 11490)
@@ -1,6 +1,6 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="SeamDiscs" verbose="2" parallel="false">
- <test name="SeamDiscs: Artist Tests">
+ <test name="SeamDiscs Artist Tests">
<parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
<parameter name="database" value="HSQL" />
@@ -12,7 +12,7 @@
</test>
- <test name="SeamDiscs: Disc Tests">
+ <test name="SeamDiscs Disc Tests">
<parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
<parameter name="database" value="HSQL" />
@@ -25,7 +25,7 @@
</test>
- <test name="SeamDiscs: Login Test">
+ <test name="SeamDiscs Login Test">
<parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
<parameter name="database" value="HSQL" />
Modified: branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
+++ branches/community/Seam_2_2/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml 2009-09-15 19:26:32 UTC (rev 11490)
@@ -2,16 +2,16 @@
<suite name="SeamSpace" verbose="2" parallel="false">
- <test name="SeamSpace: Register">
+ <test name="SeamSpace Register">
<classes>
<class name="org.jboss.seam.example.seamspace.test.RegisterTest"/>
</classes>
</test>
- <test name="SeamSpace: Blog">
+ <test name="SeamSpace Blog">
<classes>
<class name="org.jboss.seam.example.seamspace.test.BlogTest"/>
</classes>
</test>
-</suite>
\ No newline at end of file
+</suite>
15 years, 3 months
Seam SVN: r11489 - in branches/community/Seam_2_2/src/test: integration/src/org/jboss/seam/test/integration and 2 other directories.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2009-09-15 15:21:29 -0400 (Tue, 15 Sep 2009)
New Revision: 11489
Modified:
branches/community/Seam_2_2/src/test/excel/unit/org/jboss/seam/test/excel/unit/testng.xml
branches/community/Seam_2_2/src/test/integration/src/org/jboss/seam/test/integration/testng.xml
branches/community/Seam_2_2/src/test/mail/unit/org/jboss/seam/test/mail/unit/testng.xml
branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/testng.xml
Log:
JBSEAM-4344
Modified: branches/community/Seam_2_2/src/test/excel/unit/org/jboss/seam/test/excel/unit/testng.xml
===================================================================
--- branches/community/Seam_2_2/src/test/excel/unit/org/jboss/seam/test/excel/unit/testng.xml 2009-09-15 18:14:24 UTC (rev 11488)
+++ branches/community/Seam_2_2/src/test/excel/unit/org/jboss/seam/test/excel/unit/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
@@ -1,8 +1,8 @@
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="Seam Mail Unit Testsuite" verbose="2" parallel="false">
- <test name="Seam Unit Tests: Excel">
- <classes>
+ <test name="Seam Unit Tests Excel">
+ <classes>
<class name="org.jboss.seam.test.excel.unit.TestCsvWorkbook"/>
</classes>
</test>
Modified: branches/community/Seam_2_2/src/test/integration/src/org/jboss/seam/test/integration/testng.xml
===================================================================
--- branches/community/Seam_2_2/src/test/integration/src/org/jboss/seam/test/integration/testng.xml 2009-09-15 18:14:24 UTC (rev 11488)
+++ branches/community/Seam_2_2/src/test/integration/src/org/jboss/seam/test/integration/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
@@ -1,7 +1,7 @@
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="Seam Integration Testsuite" verbose="2" parallel="false">
- <test name="Seam Integration Tests: Contexts and Components">
+ <test name="Seam Integration Tests Contexts and Components">
<classes>
<class name="org.jboss.seam.test.integration.PageContextTest" />
<class name="org.jboss.seam.test.integration.ConversationTest" />
@@ -11,71 +11,71 @@
<class name="org.jboss.seam.test.integration.NamespaceResolverTest" />
</classes>
</test>
- <test name="Seam Integration Tests: Persistence">
+ <test name="Seam Integration Tests Persistence">
<classes>
<class name="org.jboss.seam.test.integration.EntityTest" />
<class name="org.jboss.seam.test.integration.EntityPassivationTest" />
</classes>
</test>
- <test name="Seam Integration Tests: Events">
+ <test name="Seam Integration Tests Events">
<classes>
<class name="org.jboss.seam.test.integration.EventTest" />
</classes>
</test>
- <test name="Seam Integration Tests: EL">
+ <test name="Seam Integration Tests EL">
<classes>
<class name="org.jboss.seam.test.integration.ELTest" />
</classes>
</test>
- <test name="Seam Integration Tests: Framework">
+ <test name="Seam Integration Tests Framework">
<classes>
<class name="org.jboss.seam.test.integration.IdentifierTest" />
</classes>
</test>
- <test name="Seam Integration Tests: i8ln">
+ <test name="Seam Integration Tests i8ln">
<classes>
<class name="org.jboss.seam.test.integration.i8ln.TimeZoneTest" />
<class name="org.jboss.seam.test.integration.i8ln.LocaleTest" />
</classes>
</test>
- <test name="Seam Integration Tests: BPM">
+ <test name="Seam Integration Tests BPM">
<classes>
<class name="org.jboss.seam.test.integration.BusinessProcessTest" />
<class name="org.jboss.seam.test.integration.bpm.SeamExpressionEvaluatorTest" />
</classes>
</test>
- <test name="Seam Integration Tests: JMS">
+ <test name="Seam Integration Tests JMS">
<classes>
<class name="org.jboss.seam.test.integration.MessagingTest" />
</classes>
</test>
- <test name="Seam Integration Tests: Mocks">
+ <test name="Seam Integration Tests Mocks">
<classes>
<class name="org.jboss.seam.test.integration.mock.SeamMockELResolverTest" />
<class name="org.jboss.seam.test.integration.mock.SeamTestTest" />
</classes>
</test>
- <test name="Seam Integration Tests: Pages dot xml">
+ <test name="Seam Integration Tests Pages dot xml">
<classes>
<class name="org.jboss.seam.test.integration.PageParamTest" />
</classes>
</test>
- <test name="Seam Integration Tests: DataBinding">
+ <test name="Seam Integration Tests DataBinding">
<classes>
<class name="org.jboss.seam.test.integration.databinding.DataModelTest" />
</classes>
</test>
- <test name="Seam Integration Tests: Security">
+ <test name="Seam Integration Tests Security">
<classes>
<class name="org.jboss.seam.test.integration.security.SecurityTest" />
</classes>
Modified: branches/community/Seam_2_2/src/test/mail/unit/org/jboss/seam/test/mail/unit/testng.xml
===================================================================
--- branches/community/Seam_2_2/src/test/mail/unit/org/jboss/seam/test/mail/unit/testng.xml 2009-09-15 18:14:24 UTC (rev 11488)
+++ branches/community/Seam_2_2/src/test/mail/unit/org/jboss/seam/test/mail/unit/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
@@ -1,7 +1,7 @@
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="Seam Mail Unit Testsuite" verbose="2" parallel="false">
- <test name="Seam Unit Tests: Mail">
+ <test name="Seam Unit Tests Mail">
<classes>
<class name="org.jboss.seam.test.mail.unit.HeaderTest"/>
</classes>
Modified: branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/testng.xml
===================================================================
--- branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/testng.xml 2009-09-15 18:14:24 UTC (rev 11488)
+++ branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/testng.xml 2009-09-15 19:21:29 UTC (rev 11489)
@@ -1,7 +1,7 @@
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="Seam Unit Testsuite" verbose="2" parallel="false">
- <test name="Seam Unit Tests: Core">
+ <test name="Seam Unit Tests Core">
<classes>
<class name="org.jboss.seam.test.unit.CoreTest"/>
<class name="org.jboss.seam.test.unit.InitializationTest"/>
@@ -13,13 +13,13 @@
</classes>
</test>
- <test name="Seam Unit Tests: Mail">
+ <test name="Seam Unit Tests Mail">
<classes>
<class name="org.jboss.seam.test.unit.MailTest"/>
</classes>
</test>
- <test name="Seam Unit Tests: BPM and Pageflow">
+ <test name="Seam Unit Tests BPM and Pageflow">
<classes>
<class name="org.jboss.seam.test.unit.bpm.ActorTest" />
<class name="org.jboss.seam.test.unit.bpm.TaskListTest" />
@@ -27,7 +27,7 @@
</classes>
</test>
- <test name="Seam Unit Tests: Pages dot xml">
+ <test name="Seam Unit Tests Pages dot xml">
<classes>
<class name="org.jboss.seam.test.unit.PageActionsTest" />
<class name="org.jboss.seam.test.unit.PageDescriptorTest" />
@@ -35,46 +35,46 @@
</classes>
</test>
- <test name="Seam Unit Tests: JSF integration">
+ <test name="Seam Unit Tests JSF integration">
<classes>
<class name="org.jboss.seam.test.unit.PhaseListenerTest"/>
</classes>
</test>
- <test name="Seam Unit Tests: Remoting">
+ <test name="Seam Unit Tests Remoting">
<classes>
<class name="org.jboss.seam.test.unit.RemotingTest"/>
</classes>
</test>
- <test name="Seam Unit Tests: Password Hash">
+ <test name="Seam Unit Tests Password Hash">
<classes>
<class name="org.jboss.seam.test.unit.PasswordHashTest"/>
</classes>
</test>
- <test name="Seam Unit Tests: Framework">
+ <test name="Seam Unit Tests Framework">
<classes>
<class name="org.jboss.seam.test.unit.HomeTest" />
<class name="org.jboss.seam.test.unit.QueryTest" />
</classes>
</test>
- <test name="Seam Unit Tests: Filters">
+ <test name="Seam Unit Tests Filters">
<classes>
<class name="org.jboss.seam.test.unit.web.MultipartRequestTest" />
<class name="org.jboss.seam.test.unit.web.IdentityRequestWrapperTest" />
</classes>
</test>
- <test name="Seam Unit Tests: Resources and i8ln">
+ <test name="Seam Unit Tests Resources and i8ln">
<classes>
<class name="org.jboss.seam.test.unit.InterpolatorTest"/>
<class name="org.jboss.seam.test.unit.web.ConditionalRequestTest" />
</classes>
</test>
- <test name="Seam Unit Tests: URL Rewrite">
+ <test name="Seam Unit Tests URL Rewrite">
<classes>
<class name="org.jboss.seam.test.unit.web.RewriteTest" />
</classes>
15 years, 3 months