Weld SVN: r5907 - in core/trunk: tests/src/test/java/org/jboss/weld/tests/ejb/mdb and 2 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 17:45:14 -0500 (Sat, 20 Feb 2010)
New Revision: 5907
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/Control.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/
core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/EJBTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/MilkMan.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/ejb/mdb/test-destinations-service.xml
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/EJBTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/MilkMan.java
Log:
WELD-444
Modified: core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java 2010-02-20 21:48:43 UTC (rev 5906)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java 2010-02-20 22:45:14 UTC (rev 5907)
@@ -1027,7 +1027,14 @@
public <T> InjectionTarget<T> createInjectionTarget(EjbDescriptor<T> descriptor)
{
- return getBean(descriptor).getInjectionTarget();
+ if (descriptor.isMessageDriven())
+ {
+ return createInjectionTarget(createAnnotatedType(descriptor.getBeanClass()));
+ }
+ else
+ {
+ return getBean(descriptor).getInjectionTarget();
+ }
}
public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/Control.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/Control.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/Control.java 2010-02-20 22:45:14 UTC (rev 5907)
@@ -0,0 +1,21 @@
+package org.jboss.weld.tests.ejb.mdb;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class Control
+{
+
+ private volatile boolean messageDelivered;
+
+ public boolean isMessageDelivered()
+ {
+ return messageDelivered;
+ }
+
+ public void setMessageDelivered(boolean messageDelivered)
+ {
+ this.messageDelivered = messageDelivered;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/Control.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/EJBTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/EJBTest.java 2010-02-20 21:48:43 UTC (rev 5906)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/EJBTest.java 2010-02-20 22:45:14 UTC (rev 5907)
@@ -16,7 +16,16 @@
*/
package org.jboss.weld.tests.ejb.mdb;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.naming.InitialContext;
+
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Packaging;
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.weld.test.AbstractWeldTest;
@@ -24,12 +33,25 @@
@Artifact
@Packaging(PackagingType.EAR)
+@IntegrationTest
public class EJBTest extends AbstractWeldTest
{
- @Test
- public void testMdbDeploys()
+ public static final String MESSAGE = "Hello!";
+
+ @Test(groups="broken")
+ // TODO Need a way to deploy test-destinations-service.xml to JBoss AS
+ public void testMdbUsable() throws Exception
{
+ InitialContext ctx = new InitialContext();
+ QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
+ QueueConnection connection = factory.createQueueConnection();
+ QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+ Queue queue = (Queue) ctx.lookup("queue/testQueue");
+ QueueSender sender = session.createSender(queue);
+ sender.send(session.createTextMessage(MESSAGE));
+ Thread.sleep(1000);
+ assert getReference(Control.class).isMessageDelivered();
}
}
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/MilkMan.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/MilkMan.java 2010-02-20 21:48:43 UTC (rev 5906)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/MilkMan.java 2010-02-20 22:45:14 UTC (rev 5907)
@@ -18,19 +18,31 @@
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
+import javax.inject.Inject;
+import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
+import javax.jms.TextMessage;
@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
- @ActivationConfigProperty(propertyName="destination", propertyValue="queue/DLQ")
+ @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue")
})
public class MilkMan implements MessageListener
{
+
+ @Inject Control control;
public void onMessage(Message message)
{
-
+ try
+ {
+ control.setMessageDelivered(((TextMessage) message).getText().equals(EJBTest.MESSAGE));
+ }
+ catch (JMSException e)
+ {
+ throw new RuntimeException(e);
+ }
}
}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/EJBTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/EJBTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/EJBTest.java 2010-02-20 22:45:14 UTC (rev 5907)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.tests.ejb.mdb.dummy;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@IntegrationTest
+public class EJBTest extends AbstractWeldTest
+{
+
+ public static final String MESSAGE = "Hello!";
+
+ @Test
+ public void testMdbDeploys()
+ {
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/EJBTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/MilkMan.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/MilkMan.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/MilkMan.java 2010-02-20 22:45:14 UTC (rev 5907)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.tests.ejb.mdb.dummy;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+@MessageDriven(activationConfig={
+ @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+ @ActivationConfigProperty(propertyName="destination", propertyValue="queue/DLQ")
+ })
+public class MilkMan implements MessageListener
+{
+
+
+ public void onMessage(Message message)
+ {
+
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/mdb/dummy/MilkMan.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/ejb/mdb/test-destinations-service.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/ejb/mdb/test-destinations-service.xml (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/ejb/mdb/test-destinations-service.xml 2010-02-20 22:45:14 UTC (rev 5907)
@@ -0,0 +1,17 @@
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Topic"
+ name="jboss.mq.destination:service=Topic,name=testTopic">
+ <depends optional-attribute-name="ServerPeer">
+ jboss.messaging:service=ServerPeer
+ </depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=testQueue">
+ <depends optional-attribute-name="ServerPeer">
+ jboss.messaging:service=ServerPeer
+ </depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Property changes on: core/trunk/tests/src/test/resources/org/jboss/weld/tests/ejb/mdb/test-destinations-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 10 months
Weld SVN: r5906 - in core/trunk/tests/src/test: resources/org/jboss/weld/tests and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 16:48:43 -0500 (Sat, 20 Feb 2010)
New Revision: 5906
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/
core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
Log:
WELD-445
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java 2010-02-20 21:48:43 UTC (rev 5906)
@@ -0,0 +1,17 @@
+package org.jboss.weld.tests.nonContextual;
+
+import java.util.logging.Logger;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+public class LogManager
+{
+
+ @Produces
+ public Logger createLogger(InjectionPoint injectionPoint)
+ {
+ return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/LogManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java 2010-02-20 21:48:43 UTC (rev 5906)
@@ -0,0 +1,27 @@
+package org.jboss.weld.tests.nonContextual;
+
+import java.util.logging.Logger;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class ServletContextListenerImpl implements ServletContextListener
+{
+
+ public static boolean ok;
+
+ @Inject Logger log;
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+
+ }
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ log.finer("hello!");
+ ok = true;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletContextListenerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java 2010-02-20 21:48:43 UTC (rev 5906)
@@ -0,0 +1,21 @@
+package org.jboss.weld.tests.nonContextual;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.war.WebXml;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+@WebXml("web.xml")
+public class ServletListenerTest extends AbstractWeldTest
+{
+
+ @Test(description="WELD-445")
+ public void test()
+ {
+ assert ServletContextListenerImpl.ok;
+ }
+
+}
Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/nonContextual/ServletListenerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
===================================================================
--- core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml (rev 0)
+++ core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml 2010-02-20 21:48:43 UTC (rev 5906)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>JBoss Test Harness</display-name>
+
+ <listener>
+ <listener-class>org.jboss.testharness.impl.runner.servlet.HarnessServletListener</listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>org.jboss.weld.tests.nonContextual.ServletContextListenerImpl</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <servlet-class>org.jboss.testharness.impl.runner.servlet.ServletTestRunner</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>JBoss Test Harness Test Runner</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: core/trunk/tests/src/test/resources/org/jboss/weld/tests/nonContextual/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 10 months
Weld SVN: r5905 - core/trunk/parent.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 16:29:40 -0500 (Sat, 20 Feb 2010)
New Revision: 5905
Modified:
core/trunk/parent/pom.xml
Log:
WELD-440
Modified: core/trunk/parent/pom.xml
===================================================================
--- core/trunk/parent/pom.xml 2010-02-20 20:34:37 UTC (rev 5904)
+++ core/trunk/parent/pom.xml 2010-02-20 21:29:40 UTC (rev 5905)
@@ -76,7 +76,7 @@
<log4j.version>1.2.14</log4j.version>
<!-- Testing deps -->
<testng.version>5.10</testng.version>
- <jboss.test.harness.version>1.1.0-CR4</jboss.test.harness.version>
+ <jboss.test.harness.version>1.1.0-CR5</jboss.test.harness.version>
<apache.httpclient.version>3.1</apache.httpclient.version>
<junit.version>4.7</junit.version>
<htmlunit.version>2.4</htmlunit.version>
14 years, 10 months
Weld SVN: r5904 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 15:34:37 -0500 (Sat, 20 Feb 2010)
New Revision: 5904
Removed:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
Log:
port CDITCK-108 to trunk
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java 2010-02-20 20:33:10 UTC (rev 5903)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java 2010-02-20 20:34:37 UTC (rev 5904)
@@ -38,7 +38,6 @@
{
@Test(groups = { "contexts", "ejb3", "integration", "rewrite" })
- // TODO Needs to test *all* uses of app context are shared, not each type individually
@SpecAssertion(section = "6.7.3", id = "e")
public void testApplicationContextShared() throws Exception
{
@@ -48,5 +47,15 @@
Thread.sleep(350);
assert flightManagementSystem.isSameBean();
}
+
+ @Test(groups = { "contexts", "ejb3", "integration" })
+ @SpecAssertion(section = "6.7.3", id = "dc")
+ public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
+ {
+ FMS flightManagementSystem = getInstanceByType(FMS.class);
+ flightManagementSystem.climb();
+ Thread.sleep(250);
+ assert flightManagementSystem.isApplicationScopeActive();
+ }
}
Deleted: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2010-02-20 20:33:10 UTC (rev 5903)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2010-02-20 20:34:37 UTC (rev 5904)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.jsr299.tck.tests.context.application.ejb;
-
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.testng.annotations.Test;
-
-/**
- * EJB and related tests with the built-in application context.
- *
- * @author David Allen
- */
-@Artifact
-@IntegrationTest
-(a)Packaging(PackagingType.EAR)
-@SpecVersion(spec="cdi", version="20091101")
-public class EJBApplicationContextTest extends AbstractJSR299Test
-{
- @Test(groups = { "contexts", "ejb3", "integration" })
- @SpecAssertion(section = "6.7.3", id = "dc")
- public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
- {
- FMS flightManagementSystem = getInstanceByType(FMS.class);
- flightManagementSystem.climb();
- Thread.sleep(250);
- assert flightManagementSystem.isApplicationScopeActive();
- }
-
-}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java 2010-02-20 20:33:10 UTC (rev 5903)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java 2010-02-20 20:34:37 UTC (rev 5904)
@@ -21,17 +21,13 @@
@Local
public interface FMS
{
- public void turnLeft();
- public void turnRight();
+ public void climb() throws Exception;
- public void climb();
+ public void descend() throws Exception;
- public void descend();
+ public boolean isSameBean();
public boolean isApplicationScopeActive();
-
- public void setApplicationScopeActive(boolean applicationScopeActive);
- public boolean isSameBean();
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2010-02-20 20:33:10 UTC (rev 5903)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2010-02-20 20:34:37 UTC (rev 5904)
@@ -40,30 +40,47 @@
@Inject
private Instance<SimpleApplicationBean> simpleApplicationBeanInstance;
- private static boolean applicationScopeActive = false;
- private static double beanId = 0.0d;
- private static boolean sameBean = false;
+ private static volatile boolean applicationScopeActive = false;
+ private static volatile double beanId = 0.0d;
+ private static volatile boolean sameBean = false;
+
+ private static volatile int climbState;
+ private static volatile int descendState;
- public void climb()
+ public void climb() throws Exception
{
+ climbState = 0;
timerService.createTimer(200, "Climb command timeout");
+ long timestamp = System.currentTimeMillis();
+ // Wait for the timer
+ while (climbState == 0)
+ {
+ // but don't wait more than 10s so we don't just hang!
+ if (System.currentTimeMillis() > timestamp + 10000)
+ {
+ return;
+ }
+ Thread.sleep(1);
+ }
}
- public void descend()
+ public void descend() throws Exception
{
+ descendState = 0;
timerService.createTimer(100, "Descend command timeout");
- beanId = 0.0d;
- sameBean = false;
+ long timestamp = System.currentTimeMillis();
+ // Wait for the timer
+ while (descendState == 0)
+ {
+ // but don't wait more than 10s so we don't just hang!
+ if (System.currentTimeMillis() > timestamp + 10000)
+ {
+ return;
+ }
+ Thread.sleep(1);
+ }
}
- public void turnLeft()
- {
- }
-
- public void turnRight()
- {
- }
-
@Timeout
public void timeout(Timer timer)
{
@@ -82,6 +99,8 @@
beanId = simpleApplicationBeanInstance.get().getId();
}
}
+ climbState = 1;
+ descendState = 1;
}
public boolean isApplicationScopeActive()
@@ -89,11 +108,6 @@
return applicationScopeActive;
}
- public void setApplicationScopeActive(boolean applicationScopeActive)
- {
- FMSModelIII.applicationScopeActive = applicationScopeActive;
- }
-
public boolean isSameBean()
{
return sameBean;
14 years, 10 months
Weld SVN: r5903 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 15:33:10 -0500 (Sat, 20 Feb 2010)
New Revision: 5903
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java
Log:
port CDITCK-110 to trunk
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java 2010-02-20 20:27:28 UTC (rev 5902)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java 2010-02-20 20:33:10 UTC (rev 5903)
@@ -27,7 +27,6 @@
import org.jboss.testharness.impl.packaging.war.WebXml;
import org.testng.annotations.Test;
-import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSpan;
@@ -56,17 +55,6 @@
public class ClientConversationContextTest extends AbstractConversationTest
{
- private WebClient client;
-
-
- @Override
- public void beforeMethod()
- {
- super.beforeMethod();
- client = new WebClient();
- }
-
-
@Test(groups = { "contexts"})
@SpecAssertions({
@SpecAssertion(section = "6.7.4", id = "hb"),
@@ -74,6 +62,7 @@
})
public void testConversationIdSetByContainerIsUnique() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage storm = client.getPage(getPath("/storm.jsf"));
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
@@ -94,6 +83,7 @@
// TODO this test doesn't verify that the conversation context itself is destroyed
public void testTransientConversationInstancesDestroyedAtRequestEnd() throws Exception
{
+ WebClient client = new WebClient();
resetCloud(client);
HtmlPage page = client.getPage(getPath("/cloud.jsf"));
assert !isLongRunning(page);
@@ -104,6 +94,7 @@
@SpecAssertion(section = "6.7.4", id = "k")
public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage storm = client.getPage(getPath("/storm.jsf"));
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
@@ -118,6 +109,8 @@
@SpecAssertion(section = "6.7.4", id = "p")
public void testConversationsDontCrossSessionBoundary1() throws Exception
{
+ WebClient client = new WebClient();
+ client.setThrowExceptionOnFailingStatusCode(false);
// Load the page
HtmlPage rain = client.getPage(getPath("/rain.jsf"));
@@ -146,6 +139,8 @@
@SpecAssertion(section = "6.7.4", id = "p")
public void testConversationsDontCrossSessionBoundary2() throws Exception
{
+ WebClient client = new WebClient();
+
// Load the page
HtmlPage rain = client.getPage(getPath("/rain.jsf"));
@@ -163,8 +158,9 @@
assert hasRained(rain);
// Create a new web client and load the page
- client = new WebClient();
- rain = client.getPage(getPath("/rain.jsf", cid));
+ WebClient client2 = new WebClient();
+ client2.setThrowExceptionOnFailingStatusCode(false);
+ rain = client2.getPage(getPath("/rain.jsf", cid));
assert !hasRained(rain);
}
@@ -172,24 +168,17 @@
@SpecAssertion(section = "6.7.4", id = "a")
public void testConversationActiveDuringNonFacesRequest() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cloud.jsf"));
HtmlSpan span = getFirstMatchingElement(page, HtmlSpan.class, "cloudName");
assert span.getTextContent().equals(Cloud.NAME);
}
@Test(groups = { "contexts" })
- @SpecAssertion(section = "6.7.4", id = "tb")
- public void testConversationPropagationToNonExistentConversationLeadsToTransientConversation() throws Exception
- {
- Page page = client.getPage(getPath("/cloud.jsf", "org.jboss.jsr299"));
- assert !isLongRunning(page);
- assert !getCid(page).equals("org.jboss.jsr299");
- }
-
- @Test(groups = { "contexts" })
@SpecAssertion(section = "6.7.4", id = "f")
public void testConversationBeginMakesConversationLongRunning() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -203,6 +192,7 @@
@SpecAssertion(section = "6.7.5", id = "r")
public void testBeginAlreadyLongRunningConversationThrowsException() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -225,6 +215,7 @@
})
public void testConversationEndMakesConversationTransient() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -243,6 +234,7 @@
@SpecAssertion(section = "6.7.5", id = "q")
public void testEndTransientConversationThrowsException() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -259,6 +251,7 @@
})
public void testBeanWithRequestScope() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct scope: true");
}
@@ -267,6 +260,7 @@
@SpecAssertion(section = "6.7.5", id = "id")
public void testBeanWithDefaultQualifier() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct qualifier: true");
}
@@ -275,6 +269,7 @@
@SpecAssertion(section = "6.7.5", id = "ie")
public void testBeanWithNameJavaxEnterpriseContextConversation() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct name: true");
}
@@ -286,6 +281,7 @@
})
public void testTransientConversationHasNullId() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Default conversation has null id: true");
}
@@ -297,6 +293,7 @@
})
public void testConversationIdMayBeSetByApplication() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -315,6 +312,7 @@
})
public void testConversationIdMayBeSetByContainer() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -333,6 +331,7 @@
})
public void testSetConversationTimeoutOverride() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -346,6 +345,7 @@
@SpecAssertion(section = "6.7.5", id = "m")
public void testConversationHasDefaultTimeout() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
14 years, 10 months
Weld SVN: r5902 - cdi-tck/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 15:27:28 -0500 (Sat, 20 Feb 2010)
New Revision: 5902
Modified:
cdi-tck/trunk/pom.xml
Log:
port r5898 to trunk
Modified: cdi-tck/trunk/pom.xml
===================================================================
--- cdi-tck/trunk/pom.xml 2010-02-20 20:17:17 UTC (rev 5901)
+++ cdi-tck/trunk/pom.xml 2010-02-20 20:27:28 UTC (rev 5902)
@@ -75,7 +75,7 @@
<properties>
<jboss.test.audit.version>1.1.0.CR1</jboss.test.audit.version>
- <jboss.test.harness.version>1.1.0-CR4</jboss.test.harness.version>
+ <jboss.test.harness.version>1.1.0-CR5</jboss.test.harness.version>
<testng.version>5.10</testng.version>
<jsr250.api.version>1.0</jsr250.api.version>
<cdi.api.version>1.0</cdi.api.version>
14 years, 10 months
Weld SVN: r5901 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 15:17:17 -0500 (Sat, 20 Feb 2010)
New Revision: 5901
Removed:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
Log:
CDITCK-108
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java 2010-02-20 19:50:14 UTC (rev 5900)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/ApplicationContextSharedTest.java 2010-02-20 20:17:17 UTC (rev 5901)
@@ -38,7 +38,6 @@
{
@Test(groups = { "contexts", "ejb3", "integration", "rewrite" })
- // TODO Needs to test *all* uses of app context are shared, not each type individually
@SpecAssertion(section = "6.7.3", id = "e")
public void testApplicationContextShared() throws Exception
{
@@ -48,5 +47,15 @@
Thread.sleep(250);
assert flightManagementSystem.isSameBean();
}
+
+ @Test(groups = { "contexts", "ejb3", "integration" })
+ @SpecAssertion(section = "6.7.3", id = "dc")
+ public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
+ {
+ FMS flightManagementSystem = getInstanceByType(FMS.class);
+ flightManagementSystem.climb();
+ Thread.sleep(250);
+ assert flightManagementSystem.isApplicationScopeActive();
+ }
}
Deleted: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2010-02-20 19:50:14 UTC (rev 5900)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/EJBApplicationContextTest.java 2010-02-20 20:17:17 UTC (rev 5901)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.jsr299.tck.tests.context.application.ejb;
-
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.testng.annotations.Test;
-
-/**
- * EJB and related tests with the built-in application context.
- *
- * @author David Allen
- */
-@Artifact
-@IntegrationTest
-(a)Packaging(PackagingType.EAR)
-@SpecVersion(spec="cdi", version="20091101")
-public class EJBApplicationContextTest extends AbstractJSR299Test
-{
-
- @Test(groups = { "contexts", "ejb3", "integration" })
- @SpecAssertion(section = "6.7.3", id = "dc")
- public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod() throws Exception
- {
- FMS flightManagementSystem = getInstanceByType(FMS.class);
- flightManagementSystem.climb();
- Thread.sleep(250);
- assert flightManagementSystem.isApplicationScopeActive();
- }
-
-}
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java 2010-02-20 19:50:14 UTC (rev 5900)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMS.java 2010-02-20 20:17:17 UTC (rev 5901)
@@ -21,17 +21,13 @@
@Local
public interface FMS
{
- public void turnLeft();
- public void turnRight();
+ public void climb() throws Exception;
- public void climb();
+ public void descend() throws Exception;
- public void descend();
+ public boolean isSameBean();
public boolean isApplicationScopeActive();
-
- public void setApplicationScopeActive(boolean applicationScopeActive);
- public boolean isSameBean();
}
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2010-02-20 19:50:14 UTC (rev 5900)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java 2010-02-20 20:17:17 UTC (rev 5901)
@@ -40,30 +40,47 @@
@Inject
private Instance<SimpleApplicationBean> simpleApplicationBeanInstance;
- private static boolean applicationScopeActive = false;
- private static double beanId = 0.0d;
- private static boolean sameBean = false;
+ private static volatile boolean applicationScopeActive = false;
+ private static volatile double beanId = 0.0d;
+ private static volatile boolean sameBean = false;
+
+ private static volatile int climbState;
+ private static volatile int descendState;
- public void climb()
+ public void climb() throws Exception
{
+ climbState = 0;
timerService.createTimer(200, "Climb command timeout");
+ long timestamp = System.currentTimeMillis();
+ // Wait for the timer
+ while (climbState == 0)
+ {
+ // but don't wait more than 10s so we don't just hang!
+ if (System.currentTimeMillis() > timestamp + 10000)
+ {
+ return;
+ }
+ Thread.sleep(1);
+ }
}
- public void descend()
+ public void descend() throws Exception
{
+ descendState = 0;
timerService.createTimer(100, "Descend command timeout");
- beanId = 0.0d;
- sameBean = false;
+ long timestamp = System.currentTimeMillis();
+ // Wait for the timer
+ while (descendState == 0)
+ {
+ // but don't wait more than 10s so we don't just hang!
+ if (System.currentTimeMillis() > timestamp + 10000)
+ {
+ return;
+ }
+ Thread.sleep(1);
+ }
}
- public void turnLeft()
- {
- }
-
- public void turnRight()
- {
- }
-
@Timeout
public void timeout(Timer timer)
{
@@ -82,6 +99,8 @@
beanId = simpleApplicationBeanInstance.get().getId();
}
}
+ climbState = 1;
+ descendState = 1;
}
public boolean isApplicationScopeActive()
@@ -89,11 +108,6 @@
return applicationScopeActive;
}
- public void setApplicationScopeActive(boolean applicationScopeActive)
- {
- FMSModelIII.applicationScopeActive = applicationScopeActive;
- }
-
public boolean isSameBean()
{
return sameBean;
14 years, 10 months
Weld SVN: r5900 - cdi-tck/branches/1.0/impl/src/main/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 14:50:14 -0500 (Sat, 20 Feb 2010)
New Revision: 5900
Modified:
cdi-tck/branches/1.0/impl/src/main/resources/tck-audit-cdi.xml
Log:
ws
Modified: cdi-tck/branches/1.0/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/resources/tck-audit-cdi.xml 2010-02-20 19:49:37 UTC (rev 5899)
+++ cdi-tck/branches/1.0/impl/src/main/resources/tck-audit-cdi.xml 2010-02-20 19:50:14 UTC (rev 5900)
@@ -3893,7 +3893,7 @@
</assertion>
<assertion id="tb">
- <text>If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an exception of type |javax.enterprise.context.NonexistentConversationException| from the restore view phase of the JSF lifecycle. The application may handle this exception using the JSF |ExceptionHandler|.</text>
+ <text>If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an exception of type |javax.enterprise.context.NonexistentConversationException| from the restore view phase of the JSF lifecycle. The application may handle this exception using the JSF |ExceptionHandler|.</text>
</assertion>
<assertion id="ua">
14 years, 10 months
Weld SVN: r5899 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 14:49:37 -0500 (Sat, 20 Feb 2010)
New Revision: 5899
Modified:
cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java
Log:
CDITCK-110
Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java 2010-02-20 19:49:06 UTC (rev 5898)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java 2010-02-20 19:49:37 UTC (rev 5899)
@@ -27,7 +27,6 @@
import org.jboss.testharness.impl.packaging.war.WebXml;
import org.testng.annotations.Test;
-import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSpan;
@@ -56,17 +55,6 @@
public class ClientConversationContextTest extends AbstractConversationTest
{
- private WebClient client;
-
-
- @Override
- public void beforeMethod()
- {
- super.beforeMethod();
- client = new WebClient();
- }
-
-
@Test(groups = { "contexts"})
@SpecAssertions({
@SpecAssertion(section = "6.7.4", id = "hb"),
@@ -74,6 +62,7 @@
})
public void testConversationIdSetByContainerIsUnique() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage storm = client.getPage(getPath("/storm.jsf"));
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
@@ -94,6 +83,7 @@
// TODO this test doesn't verify that the conversation context itself is destroyed
public void testTransientConversationInstancesDestroyedAtRequestEnd() throws Exception
{
+ WebClient client = new WebClient();
resetCloud(client);
HtmlPage page = client.getPage(getPath("/cloud.jsf"));
assert !isLongRunning(page);
@@ -104,6 +94,7 @@
@SpecAssertion(section = "6.7.4", id = "k")
public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage storm = client.getPage(getPath("/storm.jsf"));
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
@@ -118,6 +109,8 @@
@SpecAssertion(section = "6.7.4", id = "p")
public void testConversationsDontCrossSessionBoundary1() throws Exception
{
+ WebClient client = new WebClient();
+ client.setThrowExceptionOnFailingStatusCode(false);
// Load the page
HtmlPage rain = client.getPage(getPath("/rain.jsf"));
@@ -146,6 +139,8 @@
@SpecAssertion(section = "6.7.4", id = "p")
public void testConversationsDontCrossSessionBoundary2() throws Exception
{
+ WebClient client = new WebClient();
+
// Load the page
HtmlPage rain = client.getPage(getPath("/rain.jsf"));
@@ -163,8 +158,9 @@
assert hasRained(rain);
// Create a new web client and load the page
- client = new WebClient();
- rain = client.getPage(getPath("/rain.jsf", cid));
+ WebClient client2 = new WebClient();
+ client2.setThrowExceptionOnFailingStatusCode(false);
+ rain = client2.getPage(getPath("/rain.jsf", cid));
assert !hasRained(rain);
}
@@ -172,24 +168,17 @@
@SpecAssertion(section = "6.7.4", id = "a")
public void testConversationActiveDuringNonFacesRequest() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cloud.jsf"));
HtmlSpan span = getFirstMatchingElement(page, HtmlSpan.class, "cloudName");
assert span.getTextContent().equals(Cloud.NAME);
}
@Test(groups = { "contexts" })
- @SpecAssertion(section = "6.7.4", id = "tb")
- public void testConversationPropagationToNonExistentConversationLeadsToTransientConversation() throws Exception
- {
- Page page = client.getPage(getPath("/cloud.jsf", "org.jboss.jsr299"));
- assert !isLongRunning(page);
- assert !getCid(page).equals("org.jboss.jsr299");
- }
-
- @Test(groups = { "contexts" })
@SpecAssertion(section = "6.7.4", id = "f")
public void testConversationBeginMakesConversationLongRunning() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -203,6 +192,7 @@
@SpecAssertion(section = "6.7.5", id = "r")
public void testBeginAlreadyLongRunningConversationThrowsException() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -225,6 +215,7 @@
})
public void testConversationEndMakesConversationTransient() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -243,6 +234,7 @@
@SpecAssertion(section = "6.7.5", id = "q")
public void testEndTransientConversationThrowsException() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -259,6 +251,7 @@
})
public void testBeanWithRequestScope() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct scope: true");
}
@@ -267,6 +260,7 @@
@SpecAssertion(section = "6.7.5", id = "id")
public void testBeanWithDefaultQualifier() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct qualifier: true");
}
@@ -275,6 +269,7 @@
@SpecAssertion(section = "6.7.5", id = "ie")
public void testBeanWithNameJavaxEnterpriseContextConversation() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct name: true");
}
@@ -286,6 +281,7 @@
})
public void testTransientConversationHasNullId() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/builtin.jsf"));
assert page.getBody().getTextContent().contains("Default conversation has null id: true");
}
@@ -297,6 +293,7 @@
})
public void testConversationIdMayBeSetByApplication() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -315,6 +312,7 @@
})
public void testConversationIdMayBeSetByContainer() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -333,6 +331,7 @@
})
public void testSetConversationTimeoutOverride() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
@@ -346,6 +345,7 @@
@SpecAssertion(section = "6.7.5", id = "m")
public void testConversationHasDefaultTimeout() throws Exception
{
+ WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
assert !isLongRunning(page);
14 years, 10 months
Weld SVN: r5898 - cdi-tck/branches/1.0.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-20 14:49:06 -0500 (Sat, 20 Feb 2010)
New Revision: 5898
Modified:
cdi-tck/branches/1.0/pom.xml
Log:
update harness version
Modified: cdi-tck/branches/1.0/pom.xml
===================================================================
--- cdi-tck/branches/1.0/pom.xml 2010-02-20 19:03:56 UTC (rev 5897)
+++ cdi-tck/branches/1.0/pom.xml 2010-02-20 19:49:06 UTC (rev 5898)
@@ -75,7 +75,7 @@
<properties>
<jboss.test.audit.version>1.1.0.CR1</jboss.test.audit.version>
- <jboss.test.harness.version>1.1.0-CR4</jboss.test.harness.version>
+ <jboss.test.harness.version>1.1.0-CR5</jboss.test.harness.version>
<testng.version>5.10</testng.version>
<jsr250.api.version>1.0</jsr250.api.version>
<cdi.api.version>1.0</cdi.api.version>
14 years, 10 months