Seam SVN: r15000 - branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-07-24 11:11:55 -0400 (Tue, 24 Jul 2012)
New Revision: 15000
Modified:
branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java
Log:
update FactoryLockTest re JBPAPP-9391 regression
Modified: branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java 2012-07-24 14:25:43 UTC (rev 14999)
+++ branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java 2012-07-24 15:11:55 UTC (rev 15000)
@@ -35,37 +35,43 @@
}
}
+ private void multiThreadedTest(Thread... threads) throws InterruptedException {
+ exceptionOccured = false;
+
+ for (Thread thread : threads) {
+ thread.start();
+ }
+
+ for (Thread thread : threads) {
+ thread.join();
+ }
+
+ assert !exceptionOccured;
+ }
+
+
// JBSEAM-4993
// The test starts two threads, one evaluates #{factoryLock.test.testOtherFactory()} and the other #{factoryLock.testString} 200ms later
@Test
public void factoryLock()
throws Exception
{
- exceptionOccured = false;
- Thread thread1 = new TestThread() {
+ multiThreadedTest(new TestThread() {
@Override
public void runTest() throws Exception
{
FactoryLockTest.this.invokeMethod("foo", "#{factoryLock.test.testOtherFactory()}");
}
- };
-
- Thread thread2 = new TestThread() {
+ },
+
+ new TestThread() {
@Override
public void runTest() throws Exception
{
Thread.sleep(200);
FactoryLockTest.this.getValue("testString", "#{factoryLock.testString}");
}
- };
-
- thread1.start();
- thread2.start();
-
- thread1.join();
- thread2.join();
-
- assert !exceptionOccured;
+ });
}
// This test is the same as factoryLock test, except it uses the same factory in both threads.
@@ -73,31 +79,46 @@
public void sameFactoryLock()
throws Exception
{
- exceptionOccured = false;
- Thread thread1 = new TestThread() {
+ multiThreadedTest(new TestThread() {
@Override
public void runTest() throws Exception
{
FactoryLockTest.this.invokeMethod("testString", "#{factoryLock.test.testSameFactory()}");
}
- };
+ },
- Thread thread2 = new TestThread() {
+ new TestThread() {
@Override
public void runTest() throws Exception
{
Thread.sleep(200);
FactoryLockTest.this.getValue("testString", "#{factoryLock.testString}");
}
- };
+ });
+ }
+
+ // Test the behavior of two components using factories of each other.
+ // Skip the test, as it causes deadlock.
+ @Test(enabled=false)
+ public void interleavingFactories()
+ throws Exception
+ {
+ multiThreadedTest(new TestThread() {
+ @Override
+ public void runTest() throws Exception
+ {
+ FactoryLockTest.this.getValue("knit(purl)", "#{factoryLock.knitPurl}");
+ }
+ },
- thread1.start();
- thread2.start();
-
- thread1.join();
- thread2.join();
-
- assert !exceptionOccured;
+ new TestThread() {
+ @Override
+ public void runTest() throws Exception
+ {
+ Thread.sleep(200);
+ FactoryLockTest.this.getValue("purl(knit)", "#{factoryLock.purlKnit}");
+ }
+ });
}
private void invokeMethod(final String expected, final String el) throws Exception {
@@ -173,4 +194,42 @@
return "foo";
}
}
+
+ @Scope(ScopeType.APPLICATION)
+ @Name("factoryLock.knitFactory")
+ public static class KnitFactory
+ {
+ @Factory(value="factoryLock.knitPurl", scope=ScopeType.SESSION)
+ public String getDoubleKnit() {
+ try
+ {
+ Thread.sleep(500);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ return "knit(" + (String)Component.getInstance("factoryLock.purl") + ")";
+ }
+
+ @Factory(value="factoryLock.knit", scope=ScopeType.SESSION)
+ public String getKnit() {
+ return "knit";
+ }
+ }
+
+ @Scope(ScopeType.APPLICATION)
+ @Name("factoryLock.purlFactory")
+ public static class PurlFactory
+ {
+ @Factory(value="factoryLock.purlKnit", scope=ScopeType.SESSION)
+ public String getDoublePurl() {
+ return "purl(" + (String)Component.getInstance("factoryLock.knit") + ")";
+ }
+
+ @Factory(value="factoryLock.purl", scope=ScopeType.SESSION)
+ public String getPurl() {
+ return "purl";
+ }
+ }
}
12 years, 5 months
Seam SVN: r14999 - branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-07-24 10:25:43 -0400 (Tue, 24 Jul 2012)
New Revision: 14999
Modified:
branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java
Log:
use SESSION scope in FactoryLockTest, as that case is much more interesting.
Modified: branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java 2012-07-24 13:26:31 UTC (rev 14998)
+++ branches/enterprise/JBPAPP_5_0/src/test/integration/src/org/jboss/seam/test/integration/FactoryLockTest.java 2012-07-24 14:25:43 UTC (rev 14999)
@@ -7,7 +7,6 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Factory;
-import org.jboss.seam.annotations.JndiName;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.mock.SeamTest;
@@ -132,7 +131,6 @@
@Stateful
@Scope(ScopeType.SESSION)
@Name("factoryLock.test")
- //@JndiName("java:global/test/FactoryLockTest$FactoryLockAction")
public static class FactoryLockAction implements FactoryLockLocal
{
public String testOtherFactory() {
@@ -160,7 +158,7 @@
return (String)Component.getInstance("factoryLock.testString", true);
}
- @Factory(value="factoryLock.testString", scope=ScopeType.EVENT)
+ @Factory(value="factoryLock.testString", scope=ScopeType.SESSION)
public String getTestString() {
return "testString";
}
@@ -170,7 +168,7 @@
@Name("factoryLock.testProducer")
public static class TestProducer {
- @Factory(value="factoryLock.foo", scope=ScopeType.EVENT)
+ @Factory(value="factoryLock.foo", scope=ScopeType.SESSION)
public String getFoo() {
return "foo";
}
12 years, 5 months
Seam SVN: r14998 - in branches/community/Seam_2_3: seam-integration-tests/src/test/java/org/jboss/seam/test/integration and 1 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-07-24 09:26:31 -0400 (Tue, 24 Jul 2012)
New Revision: 14998
Added:
branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components-precedence.xml
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Deployments.java
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java
branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml
Log:
JBSEAM-3138 fixed Initialization and added isolated components-precedence.xml
Modified: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java 2012-07-24 12:14:28 UTC (rev 14997)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java 2012-07-24 13:26:31 UTC (rev 14998)
@@ -561,7 +561,7 @@
{
return true;
}
- return precedence > highestPriorityDescriptor.getPrecedence();
+ return precedence >= highestPriorityDescriptor.getPrecedence();
}
else
{
Modified: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Deployments.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Deployments.java 2012-07-24 12:14:28 UTC (rev 14997)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Deployments.java 2012-07-24 13:26:31 UTC (rev 14998)
@@ -87,4 +87,28 @@
.addAsWebInfResource("WEB-INF/web.xml", "web.xml")
.addAsWebInfResource("WEB-INF/ejb-jar.xml", "ejb-jar.xml");
}
+
+ public static WebArchive defaultSeamDeployment(String customComponentsXml) {
+ return ShrinkWrap.create(ZipImporter.class, "test.war").importFrom(new File("target/seam-integration-tests.war")).as(WebArchive.class)
+ .addAsWebInfResource(new StringAsset(
+ "<jboss-deployment-structure>" +
+ "<deployment>" +
+ "<dependencies>" +
+ "<module name=\"org.javassist\"/>" +
+ "<module name=\"org.dom4j\"/>" +
+ "</dependencies>" +
+ "</deployment>" +
+ "</jboss-deployment-structure>"), "jboss-deployment-structure.xml")
+ .addAsResource("seam.properties")
+ .addAsResource("components.properties")
+ .addAsResource("messages_en.properties")
+ .addAsResource("META-INF/persistence.xml")
+
+ .addAsResource("hibernate.cfg.xml")
+ .addAsWebInfResource(customComponentsXml, "components.xml")
+ .addAsWebInfResource("WEB-INF/pages.xml", "pages.xml")
+ .addAsWebInfResource("WEB-INF/web.xml", "web.xml")
+ .addAsWebInfResource("WEB-INF/ejb-jar.xml", "ejb-jar.xml")
+ .addAsWebInfResource("WEB-INF/jboss-seam-integration-tests-hornetq-jms.xml", "jboss-seam-integration-tests-hornetq-jms.xml");
+ }
}
Modified: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java 2012-07-24 12:14:28 UTC (rev 14997)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java 2012-07-24 13:26:31 UTC (rev 14998)
@@ -18,7 +18,7 @@
@OverProtocol("Servlet 3.0")
public static Archive<?> createDeployment()
{
- return Deployments.defaultSeamDeployment()
+ return Deployments.defaultSeamDeployment("WEB-INF/components-precedence.xml")
.addClasses(Component1.class, Component2.class);
}
Added: branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components-precedence.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components-precedence.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components-precedence.xml 2012-07-24 13:26:31 UTC (rev 14998)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.org/schema/seam/components"
+ xmlns:core="http://jboss.org/schema/seam/core"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/schema/seam/core http://jboss.org/schema/seam/core-2.3.xsd">
+
+ <core:init debug="false" jndi-pattern="java:app/test/#{ejbName}" />
+
+ <component name="component1" class="org.jboss.seam.test.integration.Component2" precedence="30">
+ <property name="name">Component1High</property>
+ </component>
+
+ <component name="component1" class="org.jboss.seam.test.integration.Component1" precedence="10">
+ <property name="name">Component1Low</property>
+ </component>
+
+</components>
Modified: branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml 2012-07-24 12:14:28 UTC (rev 14997)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml 2012-07-24 13:26:31 UTC (rev 14998)
@@ -41,12 +41,6 @@
<jms:managed-queue-sender name="testSender"
auto-create="true"
- queue-jndi-name="queue/seamTest" />
- <component name="component1" class="org.jboss.seam.test.integration.Component2" precedence="30">
- <property name="name">Component1High</property>
- </component>
- <component name="component1" class="org.jboss.seam.test.integration.Component1" precedence="10">
- <property name="name">Component1Low</property>
- </component>
+ queue-jndi-name="queue/seamTest" />
</components>
12 years, 5 months
Seam SVN: r14997 - in branches/community/Seam_2_3: seam-integration-tests/src/test/java/org/jboss/seam/test/integration and 1 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-07-24 08:14:28 -0400 (Tue, 24 Jul 2012)
New Revision: 14997
Added:
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component1.java
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component2.java
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java
branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml
Log:
JBSEAM-3138 take precedence in count if there is property definition in components.xml
Modified: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java 2012-07-23 13:23:43 UTC (rev 14996)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java 2012-07-24 12:14:28 UTC (rev 14997)
@@ -511,7 +511,17 @@
propName = prop.getQName().getName();
}
String qualifiedPropName = name + '.' + toCamelCase(propName, false);
- properties.put( qualifiedPropName, getPropertyValue(prop, qualifiedPropName, replacements) );
+ if (properties.containsKey(qualifiedPropName))
+ {
+ if (isSetProperties(name, precedence))
+ {
+ properties.put(qualifiedPropName, getPropertyValue(prop, qualifiedPropName, replacements));
+ }
+ }
+ else
+ {
+ properties.put(qualifiedPropName, getPropertyValue(prop, qualifiedPropName, replacements));
+ }
}
for ( Attribute prop: (List<Attribute>) component.attributes() )
@@ -520,11 +530,15 @@
if (isProperty(prop.getNamespaceURI(),attributeName))
{
String qualifiedPropName = name + '.' + toCamelCase( prop.getQName().getName(), false );
+ log.info("qualifiedPropName " + qualifiedPropName);
Conversions.PropertyValue propValue = null;
try
{
propValue = getPropertyValue(prop, replacements);
- properties.put( qualifiedPropName, propValue );
+ if (isSetProperties(name, precedence))
+ {
+ properties.put(qualifiedPropName, propValue);
+ }
}
catch (Exception ex)
{
@@ -537,6 +551,24 @@
}
}
+ private boolean isSetProperties(String name, int precedence)
+ {
+ TreeSet<ComponentDescriptor> currentSet = (TreeSet<ComponentDescriptor>) componentDescriptors.get(name);
+ if (currentSet != null)
+ {
+ ComponentDescriptor highestPriorityDescriptor = currentSet.first();
+ if (highestPriorityDescriptor == null)
+ {
+ return true;
+ }
+ return precedence > highestPriorityDescriptor.getPrecedence();
+ }
+ else
+ {
+ return true;
+ }
+ }
+
/**
* component properties are non-namespaced and not in the reserved attribute list
*/
Added: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component1.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component1.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component1.java 2012-07-24 12:14:28 UTC (rev 14997)
@@ -0,0 +1,19 @@
+package org.jboss.seam.test.integration;
+
+
+public class Component1
+{
+
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component2.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component2.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/Component2.java 2012-07-24 12:14:28 UTC (rev 14997)
@@ -0,0 +1,18 @@
+package org.jboss.seam.test.integration;
+
+public class Component2
+{
+
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/PrecedenceComponentTest.java 2012-07-24 12:14:28 UTC (rev 14997)
@@ -0,0 +1,55 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class PrecedenceComponentTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="JavaBeanEqualsTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(Component1.class, Component2.class);
+ }
+
+ /**
+ * Test if precedence of component is working correctly
+ * components.xml specifies component1 with 2 possible
+ * configuration - first has got higher precedence than
+ * second and the first should set component1.name property
+ * to Componen1High. Result should be that even last component1
+ * is set the higher precedence configuration has to be set and
+ * remain as the only one available.
+ * JBSEAM-3138
+ * @throws Exception
+ */
+ @Test
+ public void testPrecedenceComponents() throws Exception
+ {
+
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Object component = Component.getInstance("component1");
+ if (!(component instanceof Component2))
+ {
+ Assert.fail("component is not expected Component2.class");
+ }
+ Component2 myPrecedenceComponent = (Component2) component;
+ Assert.assertEquals(myPrecedenceComponent.getName(), "Component1High");
+ }
+ }.run();
+ }
+
+}
\ No newline at end of file
Modified: branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml 2012-07-23 13:23:43 UTC (rev 14996)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/resources/WEB-INF/components.xml 2012-07-24 12:14:28 UTC (rev 14997)
@@ -42,6 +42,11 @@
<jms:managed-queue-sender name="testSender"
auto-create="true"
queue-jndi-name="queue/seamTest" />
-
+ <component name="component1" class="org.jboss.seam.test.integration.Component2" precedence="30">
+ <property name="name">Component1High</property>
+ </component>
+ <component name="component1" class="org.jboss.seam.test.integration.Component1" precedence="10">
+ <property name="name">Component1Low</property>
+ </component>
</components>
12 years, 5 months
Seam SVN: r14996 - branches/enterprise/JBPAPP_5_0/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-07-23 09:23:43 -0400 (Mon, 23 Jul 2012)
New Revision: 14996
Modified:
branches/enterprise/JBPAPP_5_0/build/core.pom.xml
branches/enterprise/JBPAPP_5_0/build/root.pom.xml
Log:
replaced openid-consumer with all direct deps
Modified: branches/enterprise/JBPAPP_5_0/build/core.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/core.pom.xml 2012-07-20 19:48:14 UTC (rev 14995)
+++ branches/enterprise/JBPAPP_5_0/build/core.pom.xml 2012-07-23 13:23:43 UTC (rev 14996)
@@ -333,11 +333,24 @@
<dependency>
<groupId>org.openid4java</groupId>
- <artifactId>openid4java-consumer</artifactId>
- <type>pom</type>
+ <artifactId>openid4java-nodeps</artifactId>
<optional>true</optional>
</dependency>
+ <!-- openId dependencies VVV -->
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <!-- openId dependencies ^^^ -->
+
</dependencies>
</project>
Modified: branches/enterprise/JBPAPP_5_0/build/root.pom.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2012-07-20 19:48:14 UTC (rev 14995)
+++ branches/enterprise/JBPAPP_5_0/build/root.pom.xml 2012-07-23 13:23:43 UTC (rev 14996)
@@ -1059,25 +1059,37 @@
<version>1.3</version>
</dependency>
+ <!-- using rather directly deps for openid instead
+ of openid-consumer due minor issues with its pom -->
<dependency>
<groupId>org.openid4java</groupId>
- <artifactId>openid4java-consumer</artifactId>
+ <artifactId>openid4java-nodeps</artifactId>
<version>0.9.6</version>
- <type>pom</type>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
-
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.10</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- end of openId deps -->
-
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
12 years, 5 months
Seam SVN: r14995 - branches/enterprise/JBPAPP_5_0/seam-gen.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-07-20 15:48:14 -0400 (Fri, 20 Jul 2012)
New Revision: 14995
Modified:
branches/enterprise/JBPAPP_5_0/seam-gen/build.xml
Log:
JBPAPP-7520 default hsqldb driver is available in jboss-as directory
Modified: branches/enterprise/JBPAPP_5_0/seam-gen/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/seam-gen/build.xml 2012-07-20 15:11:42 UTC (rev 14994)
+++ branches/enterprise/JBPAPP_5_0/seam-gen/build.xml 2012-07-20 19:48:14 UTC (rev 14995)
@@ -373,7 +373,8 @@
<condition property="hibernate.connection.url.default" value="jdbc:h2:.">
<equals arg1="${database.type.new}" arg2="h2"/>
</condition>
- <condition property="driver.jar.default" value="${seam.dir}/lib/hsqldb.jar">
+ <!--<condition property="driver.jar.default" value="${seam.dir}/lib/hsqldb.jar">-->
+ <condition property="driver.jar.default" value="${jboss.home.new}/common/lib/hsqldb.jar">
<equals arg1="${database.type.new}" arg2="hsql"/>
</condition>
<condition property="hibernate.connection.url.default" value="jdbc:hsqldb:.">
@@ -538,13 +539,20 @@
<entry key="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> <!-- yuck! -->
</propertyfile>
+ <!-- HSQL jdbc driver jar file is not needed a it is in EAP AS libraries already -->
+ <condition property="copyJdbcDriver">
+ <not><equals arg1="${database.type.new}" arg2="hsql"/></not>
+ </condition>
+
<echo message="Installing JDBC driver jar to JBoss AS"/>
<condition property="has.license.jar">
<not><equals arg1="${driver.license.jar.new}" arg2=""/></not>
</condition>
+
<copy todir="${jboss.home.new}/server/${jboss.domain.new}/lib" overwrite="true">
<fileset file="${driver.jar.new}">
- <include name="${driver.jar.new}"/>
+ <include name="${driver.jar.new}" if="copyJdbcDriver"/>
+ <exclude name="**/*" unless="copyJdbcDriver"/>
</fileset>
<fileset file="${driver.license.jar.new}">
<include name="${driver.license.jar.new}" if="has.license.jar"/>
12 years, 6 months
Seam SVN: r14994 - in branches/community/Seam_2_3: seam-integration-tests and 1 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-07-20 11:11:42 -0400 (Fri, 20 Jul 2012)
New Revision: 14994
Modified:
branches/community/Seam_2_3/pom.xml
branches/community/Seam_2_3/seam-integration-tests/pom.xml
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java
Log:
rewrite PageScopedUIIncludeTest to use plain htmlunit, so we don't need drone in integration-tests
Modified: branches/community/Seam_2_3/pom.xml
===================================================================
--- branches/community/Seam_2_3/pom.xml 2012-07-20 14:21:50 UTC (rev 14993)
+++ branches/community/Seam_2_3/pom.xml 2012-07-20 15:11:42 UTC (rev 14994)
@@ -45,7 +45,6 @@
<!-- Version string properties -->
<version.arquillian_core>1.0.1.Final</version.arquillian_core>
- <version.arquillian_drone>1.0.0.Final</version.arquillian_drone>
<version.wicket>1.4.14</version.wicket>
<version.drools>5.1.1</version.drools>
<version.testng>5.14.10</version.testng>
@@ -104,14 +103,6 @@
<version>1.7.0</version>
</dependency>
- <dependency>
- <groupId>org.jboss.arquillian.extension</groupId>
- <artifactId>arquillian-drone-bom</artifactId>
- <version>${version.arquillian_drone}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
<!-- You should adjust this in the initcore task in build.xml as well -->
<dependency>
<groupId>org.jboss.cache</groupId>
Modified: branches/community/Seam_2_3/seam-integration-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/pom.xml 2012-07-20 14:21:50 UTC (rev 14993)
+++ branches/community/Seam_2_3/seam-integration-tests/pom.xml 2012-07-20 15:11:42 UTC (rev 14994)
@@ -124,21 +124,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.arquillian.extension</groupId>
- <artifactId>arquillian-drone-webdriver-depchain</artifactId>
- <type>pom</type>
- <scope>test</scope>
- </dependency>
-
- <!-- Override for WebDriver -->
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<type>ejb</type>
@@ -162,11 +147,27 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Override for HtmlUnit -->
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<profiles>
Modified: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java 2012-07-20 14:21:50 UTC (rev 14993)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java 2012-07-20 15:11:42 UTC (rev 14994)
@@ -8,7 +8,6 @@
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.container.test.api.RunAsClient;
-import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.seam.ScopeType;
@@ -20,17 +19,19 @@
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+
// JBSEAM-5002
@RunWith(Arquillian.class)
@RunAsClient
public class PageScopedUIIncludeTest
{
- @Drone
- WebDriver driver;
-
+ private final WebClient client = new WebClient();
+
@ArquillianResource
URL contextPath;
@@ -74,27 +75,29 @@
}
@Test
- public void testComponent1()
+ public void testComponent1() throws Exception
{
- driver.navigate().to(contextPath + "test.seam");
- assertTrue(driver.getPageSource().contains("Component 1"));
- driver.findElement(By.id("form1:input")).clear();
- driver.findElement(By.id("form1:input")).sendKeys("xyzzy");
- driver.findElement(By.id("form1:save")).click();
- assertTrue(driver.getPageSource().contains("Hello, xyzzy"));
+ HtmlPage page = client.getPage(contextPath + "test.seam");
+ assertTrue(page.getBody().getTextContent().contains("Component 1"));
+
+ page.getElementById("form1:input").type("xyzzy");
+ page = page.getElementById("form1:save").click();
+
+ assertTrue(page.getBody().getTextContent().contains("Hello, xyzzy"));
}
@Test
- public void testComponent2()
+ public void testComponent2() throws Exception
{
- driver.navigate().to(contextPath + "test.seam");
- assertTrue(driver.getPageSource().contains("Component 1"));
- driver.findElement(By.id("controller:component2")).click();
- assertTrue(driver.getPageSource().contains("Component 2"));
- driver.findElement(By.id("form2:input")).clear();
- driver.findElement(By.id("form2:input")).sendKeys("foobar");
- driver.findElement(By.id("form2:save")).click();
- assertTrue(driver.getPageSource().contains("Hi, foobar"));
+ HtmlPage page = client.getPage(contextPath + "test.seam");
+ assertTrue(page.getBody().getTextContent().contains("Component 1"));
+ page = page.getElementById("controller:component2").click();
+ assertTrue(page.getBody().getTextContent().contains("Component 2"));
+
+ page.getElementById("form2:input").type("foobar");
+ page = page.getElementById("form2:save").click();
+
+ assertTrue(page.getBody().getTextContent().contains("Hi, foobar"));
}
public abstract static class Component
12 years, 6 months
Seam SVN: r14993 - in branches/community/Seam_2_3: seam-integration-tests and 2 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-07-20 10:21:50 -0400 (Fri, 20 Jul 2012)
New Revision: 14993
Added:
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/
branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java
Modified:
branches/community/Seam_2_3/pom.xml
branches/community/Seam_2_3/seam-integration-tests/pom.xml
Log:
Add a test for JBSEAM-5002
Modified: branches/community/Seam_2_3/pom.xml
===================================================================
--- branches/community/Seam_2_3/pom.xml 2012-07-20 13:29:40 UTC (rev 14992)
+++ branches/community/Seam_2_3/pom.xml 2012-07-20 14:21:50 UTC (rev 14993)
@@ -45,6 +45,7 @@
<!-- Version string properties -->
<version.arquillian_core>1.0.1.Final</version.arquillian_core>
+ <version.arquillian_drone>1.0.0.Final</version.arquillian_drone>
<version.wicket>1.4.14</version.wicket>
<version.drools>5.1.1</version.drools>
<version.testng>5.14.10</version.testng>
@@ -103,6 +104,13 @@
<version>1.7.0</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-bom</artifactId>
+ <version>${version.arquillian_drone}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
<!-- You should adjust this in the initcore task in build.xml as well -->
<dependency>
Modified: branches/community/Seam_2_3/seam-integration-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/pom.xml 2012-07-20 13:29:40 UTC (rev 14992)
+++ branches/community/Seam_2_3/seam-integration-tests/pom.xml 2012-07-20 14:21:50 UTC (rev 14993)
@@ -122,8 +122,23 @@
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
-
+
<dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-webdriver-depchain</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Override for WebDriver -->
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<type>ejb</type>
Added: branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/PageScopedUIIncludeTest.java 2012-07-20 14:21:50 UTC (rev 14993)
@@ -0,0 +1,169 @@
+package org.jboss.seam.test.integration.faces;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.Serializable;
+import java.net.URL;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.drone.api.annotation.Drone;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.Asset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+
+// JBSEAM-5002
+(a)RunWith(Arquillian.class)
+@RunAsClient
+public class PageScopedUIIncludeTest
+{
+ @Drone
+ WebDriver driver;
+
+ @ArquillianResource
+ URL contextPath;
+
+ @Deployment(name="PageScopedUIIncludeTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ // This is a client test, use a real (non-mocked) Seam deployment
+ return Deployments.realSeamDeployment()
+ .addClasses(Component.class, Component1.class, Component2.class)
+ .addAsWebResource(new StringAsset(
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\"" +
+ " xmlns:h=\"http://java.sun.com/jsf/html\"" +
+ " xmlns:f=\"http://java.sun.com/jsf/core\"" +
+ " xmlns:ui=\"http://java.sun.com/jsf/facelets\">" +
+ "<h:head></h:head>" +
+ "<h:body>" +
+ "<h:form id='controller'>" +
+ "<h:commandButton id='component1' action='#{viewController.component1}' value='Component 1' />" +
+ "<h:commandButton id='component2' action='#{viewController.component2}' value='Component 2' />" +
+ "</h:form>" +
+ "<ui:include src='#{viewController.viewId}'/>" +
+ "</h:body>" +
+ "</html>"), "test.xhtml")
+ .addAsWebResource(createComponentXhtmlAsset(1), "component1.xhtml")
+ .addAsWebResource(createComponentXhtmlAsset(2), "component2.xhtml");
+ }
+
+ private static Asset createComponentXhtmlAsset(int i)
+ {
+ return new StringAsset("<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"" +
+ " xmlns:ui=\"http://java.sun.com/jsf/facelets\"" +
+ " xmlns:h=\"http://java.sun.com/jsf/html\">" +
+ "<h3>Component " + i + "</h3>" +
+ "<h:form id='form" + i + "'>" +
+ "<h:inputText id='input' value='#{component" + i + ".input}' />" +
+ "<h:commandButton id='save' value='Save' action='#{component" + i + ".save}' />" +
+ "<h:outputText value='#{component" + i + ".output}' />" +
+ "</h:form>" +
+ "</ui:composition>"); // Yay for Java String syntax!
+ }
+
+ @Test
+ public void testComponent1()
+ {
+ driver.navigate().to(contextPath + "test.seam");
+ assertTrue(driver.getPageSource().contains("Component 1"));
+ driver.findElement(By.id("form1:input")).clear();
+ driver.findElement(By.id("form1:input")).sendKeys("xyzzy");
+ driver.findElement(By.id("form1:save")).click();
+ assertTrue(driver.getPageSource().contains("Hello, xyzzy"));
+ }
+
+ @Test
+ public void testComponent2()
+ {
+ driver.navigate().to(contextPath + "test.seam");
+ assertTrue(driver.getPageSource().contains("Component 1"));
+ driver.findElement(By.id("controller:component2")).click();
+ assertTrue(driver.getPageSource().contains("Component 2"));
+ driver.findElement(By.id("form2:input")).clear();
+ driver.findElement(By.id("form2:input")).sendKeys("foobar");
+ driver.findElement(By.id("form2:save")).click();
+ assertTrue(driver.getPageSource().contains("Hi, foobar"));
+ }
+
+ public abstract static class Component
+ {
+ protected String input;
+ protected String output;
+
+ public String getInput()
+ {
+ return input;
+ }
+
+ public void setInput(String input)
+ {
+ this.input = input;
+ }
+
+ public String getOutput()
+ {
+ return output;
+ }
+
+ abstract public void save();
+ }
+
+ @Scope(ScopeType.CONVERSATION)
+ @Name("component1")
+ public static class Component1 extends Component
+ {
+ public void save()
+ {
+ output = "Hello, " + input;
+ }
+ }
+
+ @Scope(ScopeType.CONVERSATION)
+ @Name("component2")
+ public static class Component2 extends Component
+ {
+ public void save()
+ {
+ output = "Hi, " + input;
+ }
+ }
+
+ @Scope(ScopeType.PAGE)
+ @Name("viewController")
+ public static class ViewController implements Serializable
+ {
+ private String viewId = "/component1.xhtml";
+
+ public void setViewId(String viewId)
+ {
+ this.viewId = viewId;
+ }
+
+ public String getViewId()
+ {
+ return viewId;
+ }
+
+ public void component1()
+ {
+ setViewId("/component1.xhtml");
+ }
+
+ public void component2()
+ {
+ setViewId("/component2.xhtml");
+ }
+ }
+}
12 years, 6 months
Seam SVN: r14992 - branches/enterprise/JBPAPP_5_0/examples.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-07-20 09:29:40 -0400 (Fri, 20 Jul 2012)
New Revision: 14992
Modified:
branches/enterprise/JBPAPP_5_0/examples/build.xml
Log:
JBPAPP-8465 forgotten reference to cglib.jar
Modified: branches/enterprise/JBPAPP_5_0/examples/build.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/build.xml 2012-07-20 13:11:32 UTC (rev 14991)
+++ branches/enterprise/JBPAPP_5_0/examples/build.xml 2012-07-20 13:29:40 UTC (rev 14992)
@@ -645,7 +645,7 @@
<fileset refid="richfaces-api.jar" />
<fileset refid="ear.lib.extras" />
<fileset refid="jboss-el.jar" />
- <fileset refid="cglib.jar" />
+ <!-- <fileset refid="cglib.jar" />-->
<fileset refid="drools.jar" />
<fileset refid="jbpm.jar" />
<fileset refid="cache.jar" />
12 years, 6 months