[webbeans-commits] Webbeans SVN: r515 - ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Dec 13 18:42:35 EST 2008


Author: nickarls
Date: 2008-12-13 18:42:34 -0500 (Sat, 13 Dec 2008)
New Revision: 515

Added:
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java
   ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java
Log:
Update context tests to 20081206

Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java (from rev 511, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ApplicationContextTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java	2008-12-13 23:42:34 UTC (rev 515)
@@ -0,0 +1,92 @@
+package org.jboss.webbeans.test.contexts;
+
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.Test;
+
+ at SpecVersion("20081206")
+public class ApplicationContextTest extends AbstractTest
+{
+
+   /**
+    * The application scope is active during the service() method of any servlet
+    * in the web application.
+    */
+   @Test(groups = { "stub", "contexts", "servlet" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationScopeActiveDuringServiceMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The application scope is active during any Java EE web service invocation.
+    */
+   @Test(groups = { "stub", "contexts", "webservice" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationScopeActiveDuringWebSericeInvocation()
+   {
+      assert false;
+   }
+
+   /**
+    * The application scope is also active during any remote method invocation
+    * of any EJB bean, during any call to an EJB timeout method and during
+    * message delivery to any EJB message driven bean.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationScopeActiveDuringRemoteMethodInvocationOfEjb()
+   {
+      assert false;
+   }
+
+   /**
+    * The application scope is also active during any remote method invocation
+    * of any EJB bean, during any call to an EJB timeout method and during
+    * message delivery to any EJB message driven bean.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationScopeActiveDuringCallToEjbTimeoutMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The application scope is also active during any remote method invocation
+    * of any EJB bean, during any call to an EJB timeout method and during
+    * message delivery to any EJB message driven bean.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationScopeActiveDuringEjbMessageDelivery()
+   {
+      assert false;
+   }
+
+   /**
+    * The application context is shared between all servlet requests, web
+    * service invocations, EJB remote method invocations, EJB timeouts and
+    * message deliveries to message driven beans that execute within the same
+    * application
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationContextSharedBetweenInvokationsInApplication()
+   {
+      assert false;
+   }
+
+   /**
+    * The application context is destroyed when the application is undeployed.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.3")
+   public void testApplicationScopeDestroyedWhenApplicationIsUndeployed()
+   {
+      assert false;
+   }
+
+}


Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ApplicationContextTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:mergeinfo
   + 

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ContextManagement.java	2008-12-13 23:42:34 UTC (rev 515)
@@ -0,0 +1,75 @@
+package org.jboss.webbeans.test.contexts;
+
+import javax.webbeans.ContextNotActiveException;
+
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author Nicklas Karlsson (nickarls at gmail.com)
+ * 
+ */
+ at SpecVersion("20081206")
+public class ContextManagement extends AbstractTest
+{
+   /**
+    * For each of the built-in normal scopes, contexts propagate across any Java
+    * method call, including invocation of EJB local business methods.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6")
+   public void testBuiltInNormalScopedContextsPropagateAcrossAnyJavaMethodCall()
+   {
+      assert false;
+   }
+
+   /**
+    * The built-in contexts do not propagate across remote method invocations or
+    * to asynchronous processes such as JMS message listeners or EJB timer
+    * service timeouts
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6")
+   public void testBuiltInNormalScopedContextsDoNotPropagateAcrossRemoteMethodInvocations()
+   {
+      assert false;
+   }
+
+   /**
+    * The built-in contexts do not propagate across remote method invocations or
+    * to asynchronous processes such as JMS message listeners or EJB timer
+    * service timeouts
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6")
+   public void testBuiltInNormalScopedContextsDoNotPropagateAcrossAsynchronousMethodInvocations()
+   {
+      assert false;
+   }
+
+   /**
+    * If no active context object exists for the given scope type, getContext()
+    * must throw a ContextNotActiveException.
+    */
+   @Test(groups = { "stub", "contexts" }, expectedExceptions = ContextNotActiveException.class)
+   @SpecAssertion(section = "9.7")
+   public void testGettingContextNotActiveFails()
+   {
+      assert false;
+   }
+
+   /**
+    * If more than one active context object exists for the given scope type,
+    * getContext() must throw an IllegalStateException.
+    */
+   @Test(groups = { "stub", "contexts" }, expectedExceptions = ContextNotActiveException.class)
+   @SpecAssertion(section = "9.7")
+   public void testGettingContextWithTooManyActiveFails()
+   {
+      assert false;
+   }
+
+}
\ No newline at end of file

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/ConversationContextTest.java	2008-12-13 23:42:34 UTC (rev 515)
@@ -0,0 +1,231 @@
+package org.jboss.webbeans.test.contexts;
+
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author Nicklas Karlsson (nickarls at gmail.com)
+ * 
+ */
+ at SpecVersion("20081206")
+public class ConversationContextTest extends AbstractTest
+{
+   /**
+    * For a JSF faces request, the context is active from the beginning of the
+    * apply request values phase, until the response is complete.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testContextActiveFromBeginningOfApplyRequestValuesPhasetoResponseCompleteForJsfRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * For a JSF non-faces request, the context is active during the render
+    * response phase
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testContextActiveDuringRenderResponsePhaseForNonFacesJsfRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * Any JSF request has exactly one associated conversation
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testJsfRequestHasExactlyOneAssociatedConversation()
+   {
+      assert false;
+   }
+
+   /**
+    * The conversation associated with a JSF request is determined at the end of
+    * the restore view phase and does not change during the request
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testAssociatedConversationOfJsfRequestIsDeterminedAtEndOfRestoreViewPhase()
+   {
+      assert false;
+   }
+
+   /**
+    * The conversation associated with a JSF request is determined at the end of
+    * the restore view phase and does not change during the request
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testAssociatedConversationOfJsfRequestDoesNotChangeDuringRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * By default, a conversation is transient
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testDefaultConversationIsTransient()
+   {
+      assert false;
+   }
+
+   /**
+    * All long-running conversations have a string-valued unique identifier
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testConversationsHaveUniqueStringIdentifiers()
+   {
+      assert false;
+   }
+
+   /**
+    * If the conversation associated with the current JSF request is in the
+    * transient state at the end of a JSF request, it is destroyed, and the
+    * conversation context is also destroyed.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testTransientConversationIsDestroyedAtEndOfJsfRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * If the conversation associated with the current JSF request is in the
+    * transient state at the end of a JSF request, it is destroyed, and the
+    * conversation context is also destroyed.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testTransientConversationContextIsDestroyedAtEndOfJsfRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * If the conversation associated with the current JSF request is in the
+    * long-running state at the end of a JSF request, it is not destroyed
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testLongRunningConversationNotDestroyedAtEndOfJsfRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * The long-running conversation context associated with a request that
+    * renders a JSF view is automatically propagated to any faces request (JSF
+    * form submission) that originates from that rendered page.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testLongRunningConversationOfJsfRenderingRequestIsPropagatedToRequestFromRenderedPage()
+   {
+      assert false;
+   }
+
+   /**
+    * The long-running conversation context associated with a request that
+    * results in a JSF redirect (via a navigation rule) is automatically
+    * propagated to the resulting non-faces request, and to any other subsequent
+    * request to the same URL. This is accomplished via use of a GET request
+    * parameter named cid containing the unique identifier of the conversation.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testLongRunningConversationOfJsfRedirectIsPropagatedToNonFacesRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * The long-running conversation associated with a request may be propagated
+    * to any non-faces request via use of a GET request parameter named cid
+    * containing the unique identifier of the conversation. In this case, the
+    * application must manage this request parameter
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testLongRunningConversationManuallyPropagatedToNonFacesRequest()
+   {
+      assert false;
+   }
+
+   /**
+    * When no conversation is propagated to a JSF request, the request is
+    * associated with a new transient conversation.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testNewTransientRequestIsCreatedWhenNoConversationIsPropagated()
+   {
+      assert false;
+   }
+
+   /**
+    * All long-running conversations are scoped to a particular HTTP servlet
+    * session and may not cross session boundaries
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testLongRunningConversationsMayNotCrossHttpSessions()
+   {
+      assert false;
+   }
+
+   /**
+    * When the HTTP servlet session is invalidated, all long-running
+    * conversation contexts created during the current session are destroyed
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testAllLongRunningConversationContextsOfInvalidatedHttpSessionAreDestroyed()
+   {
+      assert false;
+   }
+
+   /**
+    * The Web Bean manager is permitted to arbitrarily destroy any long-running
+    * conversation that is associated with no current JSF request, in order to
+    * conserve resources
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testManagerCanDestroyOrphanedLongRunningConversations()
+   {
+      assert false;
+   }
+
+   /**
+    * If the propagated conversation cannot be restored, the request is
+    * associated with a new transient conversation
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testNewTransientConversationIsCreatedWhenConversationCannotBeRestored()
+   {
+      assert false;
+   }
+
+   /**
+    * The Web Bean manager ensures that a long-running conversation may be
+    * associated with at most one request at a time, by blocking or rejecting
+    * concurrent requests.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.4")
+   public void testConcurrentRequestsToLongRunningConversationsAreHandled()
+   {
+      assert false;
+   }
+}
\ No newline at end of file

Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java (from rev 511, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RequestContextTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java	2008-12-13 23:42:34 UTC (rev 515)
@@ -0,0 +1,124 @@
+package org.jboss.webbeans.test.contexts;
+
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.Test;
+
+ at SpecVersion("20081206")
+public class RequestContextTest extends AbstractTest
+{
+
+   /**
+    * The request scope is active during the service() method of any Servlet in
+    * the web application.
+    */
+   @Test(groups = { "stub", "contexts", "servlet" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeActiveDuringServiceMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The request context is destroyed at the end of the servlet request, after
+    * the Servlet service() method returns.
+    */
+   @Test(groups = { "stub", "contexts", "servlet" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeIsDestroyedAfterServiceMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The request scope is active during any Java EE web service invocation.
+    */
+   @Test(groups = { "stub", "contexts", "webservice" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeActiveDuringWebSericeInvocation()
+   {
+      assert false;
+   }
+
+   /**
+    * The request context is destroyed after the web service invocation
+    * completes
+    */
+   @Test(groups = { "stub", "contexts", "webservice" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeIsDestroyedAfterWebServiceInvocation()
+   {
+      assert false;
+   }
+
+   /**
+    * The request scope is active during any remote method invocation of any EJB
+    * bean, during any call to an EJB timeout method and during message delivery
+    * to any EJB message driven bean.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeActiveDuringRemoteMethodInvocationOfEjb()
+   {
+      assert false;
+   }
+
+   /**
+    * The request scope is active during any remote method invocation of any EJB
+    * bean, during any call to an EJB timeout method and during message delivery
+    * to any EJB message driven bean.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeActiveDuringCallToEjbTimeoutMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The request scope is active during any remote method invocation of any EJB
+    * bean, during any call to an EJB timeout method and during message delivery
+    * to any EJB message driven bean.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeActiveDuringEjbMessageDelivery()
+   {
+      assert false;
+   }
+
+   /**
+    * The request context is destroyed after the remote method invocation,
+    * timeout or message delivery completes.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeDestroyedAfterRemoteMethodInvocationOfEjb()
+   {
+      assert false;
+   }
+
+   /**
+    * The request context is destroyed after the remote method invocation,
+    * timeout or message delivery completes.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeDestroyedAfterCallToEjbTimeoutMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The request context is destroyed after the remote method invocation,
+    * timeout or message delivery completes.
+    */
+   @Test(groups = { "stub", "contexts", "ejb3" })
+   @SpecAssertion(section = "9.6.1")
+   public void testRequestScopeDestroyedAfterEjbMessageDelivery()
+   {
+      assert false;
+   }
+
+}


Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/RequestContextTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:mergeinfo
   + 

Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java	                        (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/SessionContextTest.java	2008-12-13 23:42:34 UTC (rev 515)
@@ -0,0 +1,45 @@
+package org.jboss.webbeans.test.contexts;
+
+import org.jboss.webbeans.test.AbstractTest;
+import org.jboss.webbeans.test.SpecAssertion;
+import org.jboss.webbeans.test.SpecVersion;
+import org.testng.annotations.Test;
+
+ at SpecVersion("2001206")
+public class SessionContextTest extends AbstractTest
+{
+
+   /**
+    * The session scope is active during the service() method of any servlet in
+    * the web application
+    */
+   @Test(groups = { "stub", "contexts", "servlet" })
+   @SpecAssertion(section = "9.6.2")
+   public void testSessionScopeActiveDuringServiceMethod()
+   {
+      assert false;
+   }
+
+   /**
+    * The session context is shared between all servlet requests that occur in
+    * the same HTTP servlet session
+    */
+   @Test(groups = { "stub", "contexts", "servlet" })
+   @SpecAssertion(section = "9.6.2")
+   public void testSessionContextSharedBetweenServletRequestsInSameHttpSession()
+   {
+      assert false;
+   }
+
+   /**
+    * The session context is destroyed when the HTTPSession is invalidated or
+    * times out.
+    */
+   @Test(groups = { "stub", "contexts" })
+   @SpecAssertion(section = "9.6.2")
+   public void testSessionContextDestroyedWhenHttpSessionInvalidatedOrTimesOut()
+   {
+      assert false;
+   }
+
+}




More information about the weld-commits mailing list