Seam SVN: r11376 - branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2009-08-13 09:26:01 -0400 (Thu, 13 Aug 2009)
New Revision: 11376
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-ear.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-war.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-ear.xml
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-war.xml
Log:
Increased verbosity of seam-gen tests
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-ear.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-ear.xml 2009-08-13 12:17:44 UTC (rev 11375)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-ear.xml 2009-08-13 13:26:01 UTC (rev 11376)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="seam-gen RichFaces suite" parallel="false" verbose="2">
+<suite name="seam-gen RichFaces suite" parallel="false" verbose="3">
<listeners>
<listener
class-name="org.jboss.seam.test.functional.seamgen.utils.SeleniumTestListener" />
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-war.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-war.xml 2009-08-13 12:17:44 UTC (rev 11375)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-deployed-war.xml 2009-08-13 13:26:01 UTC (rev 11376)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="seam-gen RichFaces suite" parallel="false" verbose="2">
+<suite name="seam-gen RichFaces suite" parallel="false" verbose="3">
<listeners>
<listener
class-name="org.jboss.seam.test.functional.seamgen.utils.SeleniumTestListener" />
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-ear.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-ear.xml 2009-08-13 12:17:44 UTC (rev 11375)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-ear.xml 2009-08-13 13:26:01 UTC (rev 11376)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="seam-gen RichFaces suite" parallel="false" verbose="2">
+<suite name="seam-gen RichFaces suite" parallel="false" verbose="3">
<listeners>
<listener
class-name="org.jboss.seam.test.functional.seamgen.utils.SeleniumTestListener" />
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-war.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-war.xml 2009-08-13 12:17:44 UTC (rev 11375)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/richfaces-exploded-war.xml 2009-08-13 13:26:01 UTC (rev 11376)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="seam-gen RichFaces suite" parallel="false" verbose="2">
+<suite name="seam-gen RichFaces suite" parallel="false" verbose="3">
<listeners>
<listener
class-name="org.jboss.seam.test.functional.seamgen.utils.SeleniumTestListener" />
15 years, 4 months
Seam SVN: r11375 - in branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace: src/org/jboss/seam/example/seamspace/test/selenium and 1 other directory.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-08-13 08:17:44 -0400 (Thu, 13 Aug 2009)
New Revision: 11375
Added:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml
Log:
JBPAPP-2483 Creation of a testcase for seamspace example
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml 2009-08-13 11:35:28 UTC (rev 11374)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml 2009-08-13 12:17:44 UTC (rev 11375)
@@ -28,6 +28,7 @@
<class name="org.jboss.seam.example.seamspace.test.selenium.UserTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.RoleTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.BlogTest" />
+ <class name="org.jboss.seam.example.seamspace.test.selenium.FriendRequestTest" />
</classes>
</test>
</suite>
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java 2009-08-13 12:17:44 UTC (rev 11375)
@@ -0,0 +1,54 @@
+/*
+ * 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.seamspace.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+
+/**
+ * This class tests "Send a friend request" at seamspace example. This
+ * option is available when user opens somebody's profile.
+ *
+ * @author Martin Gencur
+ *
+ */
+
+public class FriendRequestTest extends SeleniumSeamSpaceTest
+{
+ public static final String DUKE_IMAGE = "xpath=//img[contains(@src,\"id=2\")]";
+ public static final String FRIEND_REQUEST_LINK = "link=Send a friend request";
+ public static final String MESSAGE_AREA = "xpath=//textarea[contains(@id,\"introduction\")]";
+ public static final String MESSAGE_TEXT = "Hi Duke, how are you?";
+ public static final String REQUEST_SEND_BUTTON = "xpath=//input[contains(@value,\"Send request\")]";
+ public static final String REQUEST_SENT_MESSAGE = "Friend request sent";
+
+ @Test
+ public void sendFriendRequestText(){
+ browser.clickAndWait(DUKE_IMAGE);
+ browser.clickAndWait(FRIEND_REQUEST_LINK);
+ browser.type(MESSAGE_AREA, MESSAGE_TEXT);
+ browser.clickAndWait(REQUEST_SEND_BUTTON);
+ assertTrue("Friend request sent page expected",browser.isTextPresent(REQUEST_SENT_MESSAGE));
+ }
+
+}
15 years, 4 months
Seam SVN: r11374 - in branches/community/Seam_2_2/src/test/ftest/examples/seamspace: src/org/jboss/seam/example/seamspace/test/selenium and 1 other directory.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-08-13 07:35:28 -0400 (Thu, 13 Aug 2009)
New Revision: 11374
Added:
branches/community/Seam_2_2/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss4.xml
branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss5.xml
Log:
JBSEAM-4355 Added functional testcase for seamspace example
Modified: branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss4.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss4.xml 2009-08-13 05:58:28 UTC (rev 11373)
+++ branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss4.xml 2009-08-13 11:35:28 UTC (rev 11374)
@@ -28,6 +28,7 @@
<class name="org.jboss.seam.example.seamspace.test.selenium.UserTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.RoleTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.BlogTest" />
+ <class name="org.jboss.seam.example.seamspace.test.selenium.FriendRequestTest" />
</classes>
</test>
</suite>
Modified: branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss5.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss5.xml 2009-08-13 05:58:28 UTC (rev 11373)
+++ branches/community/Seam_2_2/src/test/ftest/examples/seamspace/jboss5.xml 2009-08-13 11:35:28 UTC (rev 11374)
@@ -28,6 +28,7 @@
<class name="org.jboss.seam.example.seamspace.test.selenium.UserTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.RoleTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.BlogTest" />
+ <class name="org.jboss.seam.example.seamspace.test.selenium.FriendRequestTest" />
</classes>
</test>
</suite>
Added: branches/community/Seam_2_2/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java 2009-08-13 11:35:28 UTC (rev 11374)
@@ -0,0 +1,54 @@
+/*
+ * 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.seamspace.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+
+/**
+ * This class tests "Send a friend request" at seamspace example. This
+ * option is available when user opens somebody's profile.
+ *
+ * @author Martin Gencur
+ *
+ */
+
+public class FriendRequestTest extends SeleniumSeamSpaceTest
+{
+ public static final String DUKE_IMAGE = "xpath=//img[contains(@src,\"id=2\")]";
+ public static final String FRIEND_REQUEST_LINK = "link=Send a friend request";
+ public static final String MESSAGE_AREA = "xpath=//textarea[contains(@id,\"introduction\")]";
+ public static final String MESSAGE_TEXT = "Hi Duke, how are you?";
+ public static final String REQUEST_SEND_BUTTON = "xpath=//input[contains(@value,\"Send request\")]";
+ public static final String REQUEST_SENT_MESSAGE = "Friend request sent";
+
+ @Test
+ public void sendFriendRequestText(){
+ browser.clickAndWait(DUKE_IMAGE);
+ browser.clickAndWait(FRIEND_REQUEST_LINK);
+ browser.type(MESSAGE_AREA, MESSAGE_TEXT);
+ browser.clickAndWait(REQUEST_SEND_BUTTON);
+ assertTrue("Friend request sent page expected",browser.isTextPresent(REQUEST_SENT_MESSAGE));
+ }
+
+}
15 years, 4 months
Seam SVN: r11373 - branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-13 01:58:28 -0400 (Thu, 13 Aug 2009)
New Revision: 11373
Modified:
branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
Log:
reduced unused imports
Modified: branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-13 05:57:03 UTC (rev 11372)
+++ branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-13 05:58:28 UTC (rev 11373)
@@ -15,6 +15,8 @@
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
+import java.math.BigDecimal;
+import java.math.BigInteger;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
@@ -22,7 +24,6 @@
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
@@ -38,6 +39,7 @@
import org.jboss.seam.mock.MockServletContext;
import org.jboss.seam.remoting.Call;
import org.jboss.seam.remoting.CallContext;
+import org.jboss.seam.remoting.InterfaceGenerator;
import org.jboss.seam.remoting.MarshalUtils;
import org.jboss.seam.remoting.client.ParserUtils;
import org.jboss.seam.remoting.wrapper.BagWrapper;
@@ -53,10 +55,6 @@
import org.jboss.seam.remoting.wrapper.StringWrapper;
import org.jboss.seam.remoting.wrapper.WrapperFactory;
import org.testng.annotations.Test;
-import org.w3c.dom.Node;
-import org.jboss.seam.remoting.InterfaceGenerator;
-import java.math.BigInteger;
-import java.math.BigDecimal;
/**
* Unit tests for Seam Remoting
15 years, 4 months
Seam SVN: r11372 - in branches/enterprise/JBPAPP_5_0/src: test/unit/org/jboss/seam/test/unit and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2009-08-13 01:57:03 -0400 (Thu, 13 Aug 2009)
New Revision: 11372
Modified:
branches/enterprise/JBPAPP_5_0/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java
branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
Log:
JBPAPP-2406 - RemotingTest fixed for MapWrapper
Modified: branches/enterprise/JBPAPP_5_0/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java 2009-08-13 00:46:47 UTC (rev 11371)
+++ branches/enterprise/JBPAPP_5_0/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java 2009-08-13 05:57:03 UTC (rev 11372)
@@ -53,6 +53,11 @@
public Object convert(Type type) throws ConversionException
{
+ if (context == null)
+ {
+ throw new IllegalStateException("No call context has been set");
+ }
+
Class typeClass = null;
Type keyType = null;
Type valueType = null;
@@ -113,7 +118,8 @@
Element keyElement = (Element) e.element("k").elementIterator().next();
Element valueElement = (Element) e.element("v").elementIterator().next();
- ((Map) value).put(context.createWrapperFromElement(keyElement).convert(keyType), context.createWrapperFromElement(valueElement).convert(valueType));
+ ((Map) value).put(context.createWrapperFromElement(keyElement).convert(keyType),
+ context.createWrapperFromElement(valueElement).convert(valueType));
}
return value;
Modified: branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-13 00:46:47 UTC (rev 11371)
+++ branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-13 05:57:03 UTC (rev 11372)
@@ -8,6 +8,7 @@
import static org.testng.Assert.assertEquals;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -21,6 +22,7 @@
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
@@ -51,6 +53,7 @@
import org.jboss.seam.remoting.wrapper.StringWrapper;
import org.jboss.seam.remoting.wrapper.WrapperFactory;
import org.testng.annotations.Test;
+import org.w3c.dom.Node;
import org.jboss.seam.remoting.InterfaceGenerator;
import java.math.BigInteger;
import java.math.BigDecimal;
@@ -599,12 +602,24 @@
{
}
- byte[] expected = ("<map><element><k><str>foo</str></k><v><str>aaaaa</str></v></element>"
- + "<element><k><str>bar</str></k><v><str>zzzzz</str></v></element></map>")
- .getBytes();
+ // ensure when we marshal/unmarshal the values in the map remain the same
ByteArrayOutputStream out = new ByteArrayOutputStream();
wrapper.marshal(out);
- assertEquals(expected, out.toByteArray());
+
+ SAXReader xmlReader = new SAXReader();
+ Document doc = xmlReader.read( new ByteArrayInputStream(out.toByteArray()) );
+
+ Element root = doc.getRootElement();
+
+ MapWrapper other = new MapWrapper();
+ other.setCallContext(new CallContext());
+ other.setElement(root);
+
+ Map otherMap = (Map) other.convert(Map.class);
+ for (Object key : otherMap.keySet())
+ {
+ assert otherMap.get(key).equals(m.get(key));
+ }
// test conversionScore() method
assert ConversionScore.exact == wrapper.conversionScore(Map.class);
15 years, 4 months
Seam SVN: r11371 - in branches/community/Seam_2_2: src/remoting/org/jboss/seam/remoting/wrapper and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-08-12 20:46:47 -0400 (Wed, 12 Aug 2009)
New Revision: 11371
Modified:
branches/community/Seam_2_2/.settings/org.eclipse.jdt.core.prefs
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java
branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
Log:
JBSEAM-4342
Modified: branches/community/Seam_2_2/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- branches/community/Seam_2_2/.settings/org.eclipse.jdt.core.prefs 2009-08-12 19:31:59 UTC (rev 11370)
+++ branches/community/Seam_2_2/.settings/org.eclipse.jdt.core.prefs 2009-08-13 00:46:47 UTC (rev 11371)
@@ -1,4 +1,4 @@
-#Sat Oct 25 15:55:36 BST 2008
+#Thu Aug 13 10:04:04 EST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -8,6 +8,8 @@
org.eclipse.jdt.core.codeComplete.localSuffixes=
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
Modified: branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java
===================================================================
--- branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java 2009-08-12 19:31:59 UTC (rev 11370)
+++ branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/wrapper/MapWrapper.java 2009-08-13 00:46:47 UTC (rev 11371)
@@ -53,6 +53,11 @@
public Object convert(Type type) throws ConversionException
{
+ if (context == null)
+ {
+ throw new IllegalStateException("No call context has been set");
+ }
+
Class typeClass = null;
Type keyType = null;
Type valueType = null;
@@ -113,7 +118,8 @@
Element keyElement = (Element) e.element("k").elementIterator().next();
Element valueElement = (Element) e.element("v").elementIterator().next();
- ((Map) value).put(context.createWrapperFromElement(keyElement).convert(keyType), context.createWrapperFromElement(valueElement).convert(valueType));
+ ((Map) value).put(context.createWrapperFromElement(keyElement).convert(keyType),
+ context.createWrapperFromElement(valueElement).convert(valueType));
}
return value;
Modified: branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-12 19:31:59 UTC (rev 11370)
+++ branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/RemotingTest.java 2009-08-13 00:46:47 UTC (rev 11371)
@@ -8,6 +8,7 @@
import static org.testng.Assert.assertEquals;
+import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -21,6 +22,7 @@
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
@@ -51,6 +53,7 @@
import org.jboss.seam.remoting.wrapper.StringWrapper;
import org.jboss.seam.remoting.wrapper.WrapperFactory;
import org.testng.annotations.Test;
+import org.w3c.dom.Node;
import org.jboss.seam.remoting.InterfaceGenerator;
import java.math.BigInteger;
import java.math.BigDecimal;
@@ -599,12 +602,24 @@
{
}
- byte[] expected = ("<map><element><k><str>foo</str></k><v><str>aaaaa</str></v></element>"
- + "<element><k><str>bar</str></k><v><str>zzzzz</str></v></element></map>")
- .getBytes();
+ // ensure when we marshal/unmarshal the values in the map remain the same
ByteArrayOutputStream out = new ByteArrayOutputStream();
wrapper.marshal(out);
- assertEquals(expected, out.toByteArray());
+
+ SAXReader xmlReader = new SAXReader();
+ Document doc = xmlReader.read( new ByteArrayInputStream(out.toByteArray()) );
+
+ Element root = doc.getRootElement();
+
+ MapWrapper other = new MapWrapper();
+ other.setCallContext(new CallContext());
+ other.setElement(root);
+
+ Map otherMap = (Map) other.convert(Map.class);
+ for (Object key : otherMap.keySet())
+ {
+ assert otherMap.get(key).equals(m.get(key));
+ }
// test conversionScore() method
assert ConversionScore.exact == wrapper.conversionScore(Map.class);
15 years, 4 months
Seam SVN: r11370 - in branches/community/Seam_2_2_Drools5: examples/drools/resources and 3 other directories.
by seam-commits@lists.jboss.org
Author: tsurdilovic
Date: 2009-08-12 15:31:59 -0400 (Wed, 12 Aug 2009)
New Revision: 11370
Added:
branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesschangeset.xml
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeAgent.java
Modified:
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/KnowledgeBase.java
branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java
Log:
Drools5 Integration
Modified: branches/community/Seam_2_2_Drools5/examples/build.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/build.xml 2009-08-12 14:59:52 UTC (rev 11369)
+++ branches/community/Seam_2_2_Drools5/examples/build.xml 2009-08-12 19:31:59 UTC (rev 11370)
@@ -466,6 +466,7 @@
<include name="seam.quartz.properties" />
<include name="*.drl" />
<include name="*.properties"/>
+ <include name="*.xml"/>
<include name="META-INF/persistence.xml" />
<include name="META-INF/ejb-jar.xml" />
<include name="META-INF/orm.xml" />
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-12 14:59:52 UTC (rev 11369)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/WEB-INF/components.xml 2009-08-12 19:31:59 UTC (rev 11370)
@@ -15,7 +15,14 @@
</drools:rule-resources>
</drools:knowledge-base>
- <drools:stateful-knowledge-session name="ksession" knowledge-base="#{kbase}" knowledge-session-config="ksessionconfig.properties">
+ <drools:knowledge-agent name="kagent" agent-name="myAgent" scan-resources="true" scan-directories="false"
+ monitor-change-set-events="true" scan-interval="30">
+ <drools:change-sets>
+ <value>classpath:numberguesschangeset.xml</value>
+ </drools:change-sets>
+ </drools:knowledge-agent>
+
+ <drools:stateful-knowledge-session name="ksession" knowledge-base="#{kagent}" knowledge-session-config="ksessionconfig.properties">
<drools:event-listeners>
<value>org.drools.event.rule.DebugAgendaEventListener</value>
<value>org.drools.event.rule.DebugWorkingMemoryEventListener</value>
Added: branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesschangeset.xml
===================================================================
--- branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesschangeset.xml (rev 0)
+++ branches/community/Seam_2_2_Drools5/examples/drools/resources/numberguesschangeset.xml 2009-08-12 19:31:59 UTC (rev 11370)
@@ -0,0 +1,7 @@
+<change-set xmlns='http://drools.org/drools-5.0/change-set'
+ xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
+ xs:schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd' >
+ <add>
+ <resource source='classpath:numberguess.drl' type='DRL' />
+ </add>
+</change-set>
\ No newline at end of file
Added: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeAgent.java
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeAgent.java (rev 0)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeAgent.java 2009-08-12 19:31:59 UTC (rev 11370)
@@ -0,0 +1,238 @@
+package org.jboss.seam.drools;
+
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.regex.Pattern;
+
+import org.drools.SystemEventListenerFactory;
+import org.drools.agent.KnowledgeAgentConfiguration;
+import org.drools.agent.KnowledgeAgentFactory;
+import org.drools.io.ResourceChangeScannerConfiguration;
+import org.drools.io.ResourceFactory;
+import org.drools.io.impl.ResourceChangeNotifierImpl;
+import org.drools.io.impl.ResourceChangeScannerImpl;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+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;
+
+/**
+ * Manager component for a KnowledgeBase loaded from a drools KnowledgeAgent
+ *
+ * @author Tihomir Surdilovic
+ */
+(a)Scope(ScopeType.APPLICATION)
+@BypassInterceptors
+public class KnowledgeAgent
+{
+ private static final LogProvider log = Logging.getLogProvider(RuleAgent.class);
+ private static final Pattern COLON = Pattern.compile(":");
+ private static final int RESOURCE_PATH = 0;
+ private static final int RESOURCE = 1;
+ private static final String RESOURCE_TYPE_URL = "url";
+ private static final String RESOURCE_TYPE_FILE = "file";
+ private static final String RESOURCE_TYPE_CLASSPATH = "classpath";
+
+ private org.drools.agent.KnowledgeAgent kagent;
+ private String agentName;
+ private String scanResources;
+ private String scanDirectories;
+ private String newInstance;
+ private String monitorChangeSetEvents;
+ private String knowledgeAgentConfig;
+ private String scanInterval;
+ private String[] changeSets;
+ private ValueExpression<org.drools.KnowledgeBase> knowledgeBase;
+
+ @Create
+ public void createAgent() throws Exception
+ {
+ ResourceFactory.getResourceChangeScannerService().start();
+ ResourceFactory.getResourceChangeNotifierService().start();
+
+ if(scanInterval != null) {
+ ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
+ log.info("Setting drools.resource.scanner.interval to " + scanInterval);
+ sconf.setProperty( "drools.resource.scanner.interval", scanInterval);
+ ResourceFactory.getResourceChangeScannerService().configure( sconf );
+ }
+
+ KnowledgeAgentConfiguration kagentConf;
+ if(knowledgeAgentConfig != null) {
+ Properties kagentProp = new Properties();
+ InputStream stream = ResourceLoader.instance().getResourceAsStream(knowledgeAgentConfig);
+ if (stream==null) {
+ throw new IllegalStateException("could not locate knowledgeAgent configuration: " + knowledgeAgentConfig);
+ }
+ kagentProp.load(stream);
+ log.info("loading knowledge agent config properties: " + kagentProp.toString());
+ stream.close();
+ kagentConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(kagentProp);
+ } else {
+ kagentConf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
+ if(scanResources != null) {
+ log.info("Setting drools.agent.scanResources to " + scanResources);
+ kagentConf.setProperty("drools.agent.scanResources", scanResources);
+ }
+ if(scanDirectories != null) {
+ log.info("Setting drools.agent.scanDirectories to " + scanDirectories);
+ kagentConf.setProperty("drools.agent.scanDirectories", scanDirectories);
+ }
+ if(newInstance != null) {
+ log.info("Setting drools.agent.newInstance to " + newInstance);
+ kagentConf.setProperty("drools.agent.newInstance", newInstance);
+ }
+ if(monitorChangeSetEvents != null) {
+ log.info("Setting drools.agent.monitorChangeSetEvents to " + monitorChangeSetEvents);
+ kagentConf.setProperty("drools.agent.monitorChangeSetEvents", monitorChangeSetEvents);
+ }
+ }
+
+ if(agentName == null) {
+ log.info("Invalid knowledge agent name. Setting to default.");
+ agentName = "seamAgent";
+ }
+
+ if(knowledgeBase != null) {
+ kagent = KnowledgeAgentFactory.newKnowledgeAgent(agentName, knowledgeBase.getValue(), kagentConf);
+ } else {
+ kagent = KnowledgeAgentFactory.newKnowledgeAgent(agentName, kagentConf);
+ }
+
+ if(changeSets != null) {
+ for(String changeSet : changeSets) {
+ applyChangeSet(kagent, changeSet);
+ }
+ }
+
+ kagent.setSystemEventListener(SystemEventListenerFactory.getSystemEventListener());
+ }
+
+ private void applyChangeSet(org.drools.agent.KnowledgeAgent kagent, String changeSet) {
+ String[] resourceParts = COLON.split(changeSet.trim());
+
+ if(resourceParts.length != 2) {
+ log.error("Unable to use changeset: " + changeSet);
+ } else {
+ log.info("New changeset path: " + resourceParts[0]);
+ log.info("New changeset location: " + resourceParts[1]);
+
+ if(resourceParts[RESOURCE_PATH].equals(RESOURCE_TYPE_URL)) {
+ kagent.applyChangeSet(ResourceFactory.newUrlResource(resourceParts[RESOURCE]));
+ } else if(resourceParts[RESOURCE_PATH].equals(RESOURCE_TYPE_FILE)) {
+ kagent.applyChangeSet(ResourceFactory.newFileResource(resourceParts[RESOURCE]));
+ } else if(resourceParts[RESOURCE_PATH].equals(RESOURCE_TYPE_CLASSPATH)) {
+ kagent.applyChangeSet(ResourceFactory.newClassPathResource(resourceParts[RESOURCE]));
+ } else {
+ log.error("Unable to use resource path: " + resourceParts[RESOURCE_PATH]);
+ }
+ }
+ }
+
+ @Unwrap
+ public org.drools.KnowledgeBase getKnowledgeBase()
+ {
+ return kagent.getKnowledgeBase();
+ }
+
+ @Destroy
+ public void destroy() {
+ ResourceFactory.getResourceChangeNotifierService().stop();
+ ResourceFactory.getResourceChangeScannerService().stop();
+ ((ResourceChangeNotifierImpl) ResourceFactory.getResourceChangeNotifierService()).reset();
+ ((ResourceChangeScannerImpl) ResourceFactory.getResourceChangeScannerService()).reset();
+ }
+
+ public String getAgentName()
+ {
+ return agentName;
+ }
+
+ public void setAgentName(String agentName)
+ {
+ this.agentName = agentName;
+ }
+
+ public String getScanResources()
+ {
+ return scanResources;
+ }
+
+ public void setScanResources(String scanResources)
+ {
+ this.scanResources = scanResources;
+ }
+
+ public String getScanDirectories()
+ {
+ return scanDirectories;
+ }
+
+ public void setScanDirectories(String scanDirectories)
+ {
+ this.scanDirectories = scanDirectories;
+ }
+
+ public String getNewInstance()
+ {
+ return newInstance;
+ }
+
+ public void setNewInstance(String newInstance)
+ {
+ this.newInstance = newInstance;
+ }
+
+ public String getMonitorChangeSetEvents()
+ {
+ return monitorChangeSetEvents;
+ }
+
+ public void setMonitorChangeSetEvents(String monitorChangeSetEvents)
+ {
+ this.monitorChangeSetEvents = monitorChangeSetEvents;
+ }
+
+ public String getKnowledgeAgentConfig()
+ {
+ return knowledgeAgentConfig;
+ }
+
+ public void setKnowledgeAgentConfig(String knowledgeAgentConfig)
+ {
+ this.knowledgeAgentConfig = knowledgeAgentConfig;
+ }
+
+ public String getScanInterval()
+ {
+ return scanInterval;
+ }
+
+ public void setScanInterval(String scanInterval)
+ {
+ this.scanInterval = scanInterval;
+ }
+
+ public void setKnowledgeBase(ValueExpression<org.drools.KnowledgeBase> knowledgeBase)
+ {
+ this.knowledgeBase = knowledgeBase;
+ }
+
+ public String[] getChangeSets()
+ {
+ return changeSets;
+ }
+
+ public void setChangeSets(String[] changeSets)
+ {
+ this.changeSets = changeSets;
+ }
+
+
+}
Modified: branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeBase.java
===================================================================
--- branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeBase.java 2009-08-12 14:59:52 UTC (rev 11369)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/KnowledgeBase.java 2009-08-12 19:31:59 UTC (rev 11370)
@@ -58,6 +58,7 @@
}
kbuilderProp.load(stream);
log.info("loading knowledge builder config properties: " + kbuilderProp.toString());
+ stream.close();
kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(kbuilderProp, null);
} else {
kbuilderconfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
@@ -89,6 +90,7 @@
}
kbaseProp.load(stream);
log.info("loading knowledge base config properties: " + kbaseProp.toString());
+ stream.close();
kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(kbaseProp, null);
} else {
kbaseconfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
@@ -145,13 +147,13 @@
protected void addResource(KnowledgeBuilder kbuilder, String resource) {
String[] resourceParts = COLON.split(resource.trim());
- log.info("New resource path: " + resourceParts[0]);
- log.info("New resource location: " + resourceParts[1]);
- log.info("New resource type: " + resourceParts[2]);
-
if(resourceParts.length != 3) {
log.error("Unable to use resource: " + resource);
} else {
+ log.info("New resource path: " + resourceParts[0]);
+ log.info("New resource location: " + resourceParts[1]);
+ log.info("New resource type: " + resourceParts[2]);
+
ResourceType resourceType = ResourceType.getResourceType(resourceParts[RESOURCE_TYPE]);
if(resourceParts[RESOURCE_PATH].equals(RESOURCE_TYPE_URL)) {
kbuilder.add(ResourceFactory.newUrlResource(resourceParts[RESOURCE]), resourceType);
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-12 14:59:52 UTC (rev 11369)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools/StatefulKnowledgeSession.java 2009-08-12 19:31:59 UTC (rev 11370)
@@ -58,6 +58,7 @@
}
ksessionProp.load(stream);
log.info("loading knowledge session config properties: " + ksessionProp.toString());
+ stream.close();
ksessionconfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(ksessionProp);
} else {
ksessionconfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
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-12 14:59:52 UTC (rev 11369)
+++ branches/community/Seam_2_2_Drools5/src/main/org/jboss/seam/drools-2.2.xsd 2009-08-12 19:31:59 UTC (rev 11370)
@@ -98,5 +98,28 @@
<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:schema>
15 years, 4 months
Seam SVN: r11369 - in branches/community/Seam_2_2/src/test/ftest: examples and 9 other directories.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2009-08-12 10:59:52 -0400 (Wed, 12 Aug 2009)
New Revision: 11369
Added:
branches/community/Seam_2_2/src/test/ftest/examples/guice/
branches/community/Seam_2_2/src/test/ftest/examples/guice/build.xml
branches/community/Seam_2_2/src/test/ftest/examples/guice/jboss5.xml
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/test/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/test/selenium/
branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/test/selenium/GuiceTest.java
Modified:
branches/community/Seam_2_2/src/test/ftest/build.xml
Log:
JBSEAM-4353 Added functional test for guice example.
Modified: branches/community/Seam_2_2/src/test/ftest/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/build.xml 2009-08-12 12:05:37 UTC (rev 11368)
+++ branches/community/Seam_2_2/src/test/ftest/build.xml 2009-08-12 14:59:52 UTC (rev 11369)
@@ -99,6 +99,7 @@
<testexample name="dvdstore" />
<testexample name="contactlist" />
<testexample name="excel" />
+ <testexample name="guice" />
<testexample name="groovybooking" />
<testexample name="hibernate" />
<testexample name="icefaces" />
@@ -199,6 +200,7 @@
<cleanexample name="dvdstore" />
<cleanexample name="contactlist" />
<cleanexample name="excel" />
+ <cleanexample name="guice" />
<cleanexample name="groovybooking" />
<cleanexample name="hibernate" />
<cleanexample name="icefaces" />
@@ -237,6 +239,7 @@
<undeployexample name="contactlist" />
<undeployexample name="excel" />
<undeployexample name="groovybooking" />
+ <undeployexample name="guice" />
<undeployexample name="hibernate" />
<undeployexample name="icefaces" />
<undeployexample name="itext" />
Added: branches/community/Seam_2_2/src/test/ftest/examples/guice/build.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/guice/build.xml (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/guice/build.xml 2009-08-12 14:59:52 UTC (rev 11369)
@@ -0,0 +1,27 @@
+<?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="guice.ftest.build" basedir="." default="build">
+ <property name="example.name" value="guice" />
+
+ <import file="../build.xml" />
+</project>
Added: branches/community/Seam_2_2/src/test/ftest/examples/guice/jboss5.xml
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/guice/jboss5.xml (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/guice/jboss5.xml 2009-08-12 14:59:52 UTC (rev 11369)
@@ -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="Guice example" verbose="2" parallel="false">
+ <test name="guice_jboss5">
+ <parameter name="PROPERTY_FILE" value="" />
+ <classes>
+ <class
+ name="org.jboss.seam.example.guice.test.selenium.GuiceTest" />
+ </classes>
+ </test>
+</suite>
Property changes on: branches/community/Seam_2_2/src/test/ftest/examples/guice/jboss5.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/test/selenium/GuiceTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/test/selenium/GuiceTest.java (rev 0)
+++ branches/community/Seam_2_2/src/test/ftest/examples/guice/src/org/jboss/seam/example/guice/test/selenium/GuiceTest.java 2009-08-12 14:59:52 UTC (rev 11369)
@@ -0,0 +1,58 @@
+/*
+ * 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.guice.test.selenium;
+
+import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+ /*
+ * @author Martin Gencur
+ *
+ */
+public class GuiceTest extends SeamSeleniumTest
+{
+ protected static final String BAR_URL = "/bar.seam";
+ protected static final String JUICE_OF_THE_DAY = "Apple Juice* - 10 cents";
+ protected static final String ANOTHER_JUICE = "Orange Juice - 12 cents";
+ protected static final String GUICE_TITLE = "Juice Bar";
+
+ @Override
+ @BeforeMethod
+ public void setUp()
+ {
+ super.setUp();
+ browser.open(CONTEXT_PATH + BAR_URL);
+ }
+
+ @Test
+ public void simplePageContentTest()
+ {
+ assertTrue("Home page of Guice Example expected", browser.getLocation().contains(BAR_URL));
+ assertTrue("Different page title expected",browser.getTitle().contains(GUICE_TITLE));
+ assertTrue("Juice of the day should contain its name and price", browser.isTextPresent(JUICE_OF_THE_DAY));
+ assertTrue("Another juice should contain its name and price", browser.isTextPresent(ANOTHER_JUICE));
+ }
+
+}
15 years, 4 months
Seam SVN: r11367 - in branches/community/Seam_2_2/examples/excel/src/org/jboss/seam: example and 3 other directories.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2009-08-12 08:04:06 -0400 (Wed, 12 Aug 2009)
New Revision: 11367
Added:
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/
Removed:
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/ExcelTest.java
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/test/
Modified:
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/RenderTest.java
branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/testng.xml
Log:
JBSEAM-4352
Copied: branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java (from rev 11360, branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/ExcelTest.java)
===================================================================
--- branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java (rev 0)
+++ branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/ExcelTest.java 2009-08-12 12:04:06 UTC (rev 11367)
@@ -0,0 +1,120 @@
+package org.jboss.seam.example.excel;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("excelTest")
+(a)Scope(ScopeType.SESSION)
+public class ExcelTest
+{
+
+ private List<Person> people = new LinkedList<Person>();
+ private List<Person> result = new LinkedList<Person>();
+ private List<List<Person>> repeat = new LinkedList<List<Person>>();
+ private String searchWord;
+
+
+ @Create
+ public void create()
+ {
+ people.add(new Person("Pete Muir", "Red Hat Inc.", "Project Lead"));
+ people.add(new Person("Gavin King", "Red Hat Inc.", "Project Founder"));
+ people.add(new Person("Norman Richards", "Red Hat Inc.", "Seam Core"));
+ people.add(new Person("Shane Bryzak", "Red Hat Inc.", "Seam Security, Seam Remoting"));
+ people.add(new Person("Michael Yuan", "Individual", ""));
+ people.add(new Person("Mike Youngstrom", "Individual", "Spring Integration"));
+ people.add(new Person("Ales Justin", "Red Hat Inc.", "JBoss5/MC Integration"));
+ people.add(new Person("Christian Bauer", "Red Hat Inc.", "Seam Wiki, REST and GWT integration"));
+ people.add(new Person("Jay Balunas", "Red Hat Inc.", "Cross-platform testing"));
+ people.add(new Person("Dan Allen", "Individual", "Seam-gen, Bug fixes"));
+ people.add(new Person("Matt Drees", "Individual", "Seam Core"));
+ people.add(new Person("Jacob Orshalick", "Focus IT Solutions LLC", ""));
+ people.add(new Person("Nicklas Karlsson", "Individual", "Excel reporting"));
+ people.add(new Person("Daniel Roth", "Individual", "Excel reporting"));
+ people.add(new Person("Judy Guglielmin", "ICESoft Inc.", "ICEFaces integration"));
+ people.add(new Person("Max Rydahl Andersen", "Red Hat Inc.", "Lead developer JBoss Tools, Hibernate Tools, Seam Tools"));
+ people.add(new Person("Emmanuel Bernard", "Red Hat Inc.", "Lead developer Hibernate Annotations, EntityManager, Validator, Search"));
+ repeat.add(people.subList(0, 5));
+ }
+
+ public List<List<Person>> getRepeat()
+ {
+ return repeat;
+ }
+
+ public void setRepeat(List<List<Person>> repeat)
+ {
+ this.repeat = repeat;
+ }
+
+ public void setSearchWord(String searchWord)
+ {
+ this.searchWord = searchWord;
+ }
+
+ public String getSearchWord()
+ {
+ return searchWord;
+ }
+
+ public List<Person> getPeople()
+ {
+ return people;
+ }
+
+ public List<Person> getResult()
+ {
+ return result;
+ }
+
+ public void search()
+ {
+ result = new LinkedList<Person>();
+ for (Person person : people)
+ {
+ if (person.getName().toLowerCase().contains(searchWord.toLowerCase()))
+ result.add(person);
+ }
+ }
+
+ public void clear()
+ {
+ this.result = new LinkedList<Person>();
+ }
+
+ public class Person
+ {
+ String name;
+ String company;
+ String task;
+
+ public Person(String name, String company, String task)
+ {
+ this.company = company;
+ this.name = name;
+ this.task = task;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getTask()
+ {
+ return task;
+ }
+
+ public String getCompany()
+ {
+ return company;
+ }
+
+ }
+
+}
Copied: branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test (from rev 11360, branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/test)
Modified: branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/RenderTest.java
===================================================================
--- branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/test/RenderTest.java 2009-08-10 23:27:39 UTC (rev 11360)
+++ branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/RenderTest.java 2009-08-12 12:04:06 UTC (rev 11367)
@@ -1,16 +1,13 @@
-package org.jboss.seam.excel.test;
+package org.jboss.seam.example.excel.test;
import java.io.ByteArrayInputStream;
-import java.util.List;
-import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.document.ByteArrayDocumentData;
import org.jboss.seam.document.DocumentData;
-import org.jboss.seam.excel.ExcelTest.Person;
import org.jboss.seam.faces.Renderer;
import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;
Modified: branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/testng.xml
===================================================================
--- branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/test/testng.xml 2009-08-10 23:27:39 UTC (rev 11360)
+++ branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/example/excel/test/testng.xml 2009-08-12 12:04:06 UTC (rev 11367)
@@ -4,7 +4,7 @@
<test name="Excel Tests">
<classes>
- <class name="org.jboss.seam.excel.test.RenderTest"/>
+ <class name="org.jboss.seam.example.excel.test.RenderTest"/>
</classes>
</test>
Deleted: branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/ExcelTest.java
===================================================================
--- branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/ExcelTest.java 2009-08-12 11:19:37 UTC (rev 11366)
+++ branches/community/Seam_2_2/examples/excel/src/org/jboss/seam/excel/ExcelTest.java 2009-08-12 12:04:06 UTC (rev 11367)
@@ -1,122 +0,0 @@
-package org.jboss.seam.excel;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Begin;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-@Name("excelTest")
-(a)Scope(ScopeType.SESSION)
-public class ExcelTest
-{
-
- private List<Person> people = new LinkedList<Person>();
- private List<Person> result = new LinkedList<Person>();
- private List<List<Person>> repeat = new LinkedList<List<Person>>();
- private String searchWord;
-
-
- @Create
- public void create()
- {
- people.add(new Person("Pete Muir", "Red Hat Inc.", "Project Lead"));
- people.add(new Person("Gavin King", "Red Hat Inc.", "Project Founder"));
- people.add(new Person("Norman Richards", "Red Hat Inc.", "Seam Core"));
- people.add(new Person("Shane Bryzak", "Red Hat Inc.", "Seam Security, Seam Remoting"));
- people.add(new Person("Michael Yuan", "Individual", ""));
- people.add(new Person("Mike Youngstrom", "Individual", "Spring Integration"));
- people.add(new Person("Ales Justin", "Red Hat Inc.", "JBoss5/MC Integration"));
- people.add(new Person("Christian Bauer", "Red Hat Inc.", "Seam Wiki, REST and GWT integration"));
- people.add(new Person("Jay Balunas", "Red Hat Inc.", "Cross-platform testing"));
- people.add(new Person("Dan Allen", "Individual", "Seam-gen, Bug fixes"));
- people.add(new Person("Matt Drees", "Individual", "Seam Core"));
- people.add(new Person("Jacob Orshalick", "Focus IT Solutions LLC", ""));
- people.add(new Person("Nicklas Karlsson", "Individual", "Excel reporting"));
- people.add(new Person("Daniel Roth", "Individual", "Excel reporting"));
- people.add(new Person("Judy Guglielmin", "ICESoft Inc.", "ICEFaces integration"));
- people.add(new Person("Max Rydahl Andersen", "Red Hat Inc.", "Lead developer JBoss Tools, Hibernate Tools, Seam Tools"));
- people.add(new Person("Emmanuel Bernard", "Red Hat Inc.", "Lead developer Hibernate Annotations, EntityManager, Validator, Search"));
- repeat.add(people.subList(0, 5));
- }
-
- public List<List<Person>> getRepeat()
- {
- return repeat;
- }
-
- public void setRepeat(List<List<Person>> repeat)
- {
- this.repeat = repeat;
- }
-
- public void setSearchWord(String searchWord)
- {
- this.searchWord = searchWord;
- }
-
- public String getSearchWord()
- {
- return searchWord;
- }
-
- public List<Person> getPeople()
- {
- return people;
- }
-
- public List<Person> getResult()
- {
- return result;
- }
-
- public void search()
- {
- result = new LinkedList<Person>();
- for (Person person : people)
- {
- if (person.getName().toLowerCase().contains(searchWord.toLowerCase()))
- result.add(person);
- }
- }
-
- public void clear()
- {
- this.result = new LinkedList<Person>();
- }
-
- public class Person
- {
- String name;
- String company;
- String task;
-
- public Person(String name, String company, String task)
- {
- this.company = company;
- this.name = name;
- this.task = task;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getTask()
- {
- return task;
- }
-
- public String getCompany()
- {
- return company;
- }
-
- }
-
-}
15 years, 4 months