[jboss-cvs] JBossAS SVN: r84784 - projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 26 02:35:08 EST 2009


Author: jeff.zhang
Date: 2009-02-26 02:35:08 -0500 (Thu, 26 Feb 2009)
New Revision: 84784

Added:
   projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkInterfaceTestCase.java
   projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagerInterfaceTestCase.java
Modified:
   projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagementModelTestCase.java
Log:
[JBJCA-33] add some tests plan

Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkInterfaceTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkInterfaceTestCase.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkInterfaceTestCase.java	2009-02-26 07:35:08 UTC (rev 84784)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.test.core.spec.chapter10.section3;
+
+import org.junit.AfterClass;
+import static org.junit.Assert.* ;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * WorkInterfaceTestCase.
+ * 
+ * Tests for the JCA specific Chapter 10 Section 3.2
+ * 
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class WorkInterfaceTestCase
+{
+
+   
+   /**
+    * Test for paragraph 2
+    * The WorkManager dispatches a thread that calls the run method to
+    *             begin execution of a Work instance.
+    */
+   @Test
+   public void testCallRunMethod() throws Throwable
+   {
+      
+   }
+
+   /**
+    * Test for paragraph 2
+    * The WorkManager must catch any exception thrown during Work processing,
+    *             which includes execution context setup, and wrap it with a 
+    *             WorkCompletedException set to an appropriate error code, 
+    *             which indicates the nature of the error condition.
+    */
+   @Ignore
+   public void testCatchAllExceptionAroundRun() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 3
+    * The WorkManager may call the release method to request the active Work 
+    *            instance to complete execution as soon as possible. 
+    */
+   @Ignore
+   public void testReleaseMethod() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 3
+    * This would be called on a separate thread than the one currently executing the Work instance.
+    */
+   @Ignore
+   public void testCalledBySeparateThread() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 3
+    * Since this method call causes the Work instance to be simultaneously acted upon
+    *            by multiple threads, the Work instance implementation must be 
+    *            thread-safe, and this method must be re-entrant.
+    */
+   @Ignore
+   public void testWorkInstanceThreadSafeAndReentrant() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 5
+    * Both the run and release methods in the Work implementation may contain synchronization 
+    *            blocks but they must not be declared as synchronized methods.
+    */
+   @Ignore
+   public void testCannotDeclaredSynchronized() throws Throwable
+   {
+   }
+}

Modified: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagementModelTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagementModelTestCase.java	2009-02-26 07:27:08 UTC (rev 84783)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagementModelTestCase.java	2009-02-26 07:35:08 UTC (rev 84784)
@@ -41,6 +41,8 @@
    
    /**
     * Test for paragraph 1
+    * A resource adapter obtains a WorkManager instance from the BootstrapContext
+    *            instance provided by the application server during its deployment.
     */
    @Test
    public void testGetWorkManagerFromBootstrapConext() throws Throwable
@@ -50,6 +52,9 @@
 
    /**
     * Test for paragraph 2
+    * When a Work instance is submitted, one of the free threads picks up the
+    *            Work instance, sets up an appropriate execution context and 
+    *            calls the run method on the Work instance. 
     */
    @Ignore
    public void testOneThreadPickWorkInstance() throws Throwable
@@ -57,7 +62,9 @@
    }
    
    /**
-    * Test for paragraph at Test 2
+    * Test for paragraph2
+    * There is no restriction on the NUMBER of Work instances submitted by a 
+    *            resource adapter or when Work instances may be submitted.
     */
    @Ignore
    public void testManyWorkInstancesSubmitted() throws Throwable
@@ -66,6 +73,8 @@
    
    /**
     * Test for paragraph 2
+    * There is no restriction on the number of Work instances submitted by a 
+    *            resource adapter or WHEN Work instances may be submitted.
     */
    @Ignore
    public void testAnytimeWorkInstanceSubmitted() throws Throwable
@@ -74,6 +83,8 @@
    
    /**
     * Test for paragraph 2
+    * When the run method on the Work instance completes, the application 
+    *            server reuses the thread.
     */
    @Ignore
    public void testThreadBackPoolWhenWorkDone() throws Throwable
@@ -82,6 +93,7 @@
    
    /**
     * Test for paragraph 3
+    * The application server may decide to reclaim active threads based on load conditions. 
     */
    @Ignore
    public void testAsActiveThreadOnLoadCondition() throws Throwable
@@ -90,6 +102,8 @@
    
    /**
     * Test for paragraph 3
+    * he resource adapter should periodically monitor such hints and do the 
+    *            necessary internal cleanup to avoid any inconsistencies. 
     */
    @Ignore
    public void testRaPeriodicalReleaseWorkResource() throws Throwable
@@ -98,6 +112,8 @@
    
    /**
     * Test for paragraph 4
+    * the application server must use threads of the same thread priority level to
+    *            process Work instances submitted by a specific resource adapter. 
     */
    @Ignore
    public void testAsUseThreadSamePriorityLevel() throws Throwable

Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagerInterfaceTestCase.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagerInterfaceTestCase.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/test/core/spec/chapter10/section3/WorkManagerInterfaceTestCase.java	2009-02-26 07:35:08 UTC (rev 84784)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.test.core.spec.chapter10.section3;
+
+import org.junit.AfterClass;
+import static org.junit.Assert.* ;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * WorkManagerInterfaceTestCase.
+ * 
+ * Tests for the JCA specific Chapter 10 Section 3.3
+ * 
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a>
+ * @version $Revision: $
+ */
+public class WorkManagerInterfaceTestCase
+{
+
+   
+   /**
+    * Test for paragraph 1
+    * WorkManager instance can be obtained by calling the getWorkManager method of the BootstrapContext instance.
+    */
+   @Test
+   public void testGetWorkManagerFromBootstrapConext() throws Throwable
+   {
+      
+   }
+
+   /**
+    * Test for paragraph 3
+    * doWork method: This call blocks until the Work instance completes execution.
+    */
+   @Ignore
+   public void testDoWorkMethod() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 3
+    * doWork method: this provides a first in, first out (FIFO) execution start 
+    *      ordering and last in, first out (LIFO) execution completion ordering guarantee.
+    */
+   @Ignore
+   public void testFifoStartLifoFinish() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 4
+    * startWork method: This call blocks until the Work instance starts execution but
+    *       not until its completion.
+    */
+   @Ignore
+   public void testStartWorkMethod() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 4
+    * startWork method: This returns the time elapsed in milliseconds from Work acceptance until the start of execution.
+    */
+   @Ignore
+   public void testReturnTimeBeforeStart() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 4
+    * startWork method: A value of -1 (WorkManager.UNKNOWN) must be returned, if the actual start delay duration is unknown.
+    */
+   @Ignore
+   public void testUnknownReturnedIfDonotKnowDelay() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 4
+    * startWork method: this provides a FIFO execution start ordering guarantee, 
+    *                 but no execution completion ordering guarantee.
+    */
+   @Ignore
+   public void testFifoStart() throws Throwable
+   {
+   }
+   
+   /**
+    * Test for paragraph 5
+    * scheduleWork method: This call does not block and returns immediately once a
+    *                Work instance has been accepted for processing.
+    */
+   @Ignore
+   public void testScheduleWorkMethod() throws Throwable
+   {
+   }
+}
+




More information about the jboss-cvs-commits mailing list