You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2009/09/26 01:35:55 UTC

svn commit: r819066 - in /tuscany/java/sca/itest/scopes/src: main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java main/resources/scopes.composite test/java/org/apache/tuscany/sca/test/ScopeTestCase.java

Author: lresende
Date: Fri Sep 25 23:35:55 2009
New Revision: 819066

URL: http://svn.apache.org/viewvc?rev=819066&view=rev
Log:
TUSCANY-3280 - Removing obsolete iTests that were exercising REQUEST Scope

Removed:
    tuscany/java/sca/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/RequestScopeStateVerifierImpl.java
Modified:
    tuscany/java/sca/itest/scopes/src/main/resources/scopes.composite
    tuscany/java/sca/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java

Modified: tuscany/java/sca/itest/scopes/src/main/resources/scopes.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scopes/src/main/resources/scopes.composite?rev=819066&r1=819065&r2=819066&view=diff
==============================================================================
--- tuscany/java/sca/itest/scopes/src/main/resources/scopes.composite (original)
+++ tuscany/java/sca/itest/scopes/src/main/resources/scopes.composite Fri Sep 25 23:35:55 2009
@@ -22,11 +22,6 @@
            name="Scopes">
 
     <!-- Components used to test scopes. -->
-
- 	<component name="RequestScopeComponent">
-		<implementation.java class="org.apache.tuscany.sca.itest.scopes.RequestScopeStateVerifierImpl"/>
-    </component>
-
  	<component name="ModuleScopeComponent">
 		<implementation.java class="org.apache.tuscany.sca.itest.scopes.CompositeScopeStateVerifierImpl"/>
     </component>

Modified: tuscany/java/sca/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java?rev=819066&r1=819065&r2=819066&view=diff
==============================================================================
--- tuscany/java/sca/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java (original)
+++ tuscany/java/sca/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java Fri Sep 25 23:35:55 2009
@@ -43,32 +43,31 @@
     
     private Node node;
 
-    /**
-     * Test scope containers.
-     * 
-     * The request scope container isn't hooked up for some reason so the code below
-     * that tests request scope is commented out.
-     * Code could be added to test session scope once it is supported in a standalone environment.
-     * 
-     * @throws InterruptedException Test failed
-     */
+    @Before
+    public void setUp() throws Exception {
+        String location = ContributionLocationHelper.getContributionLocation("scopes.composite");
+        node = NodeFactory.newInstance().createNode("scopes.composite", new Contribution("c1", location));
+        node.start();
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        node.stop();
+    }
+
     @Test
     public void testScopes() throws InterruptedException {
 
         Thread[] moduleScopeThreadTable = new Thread[NUM_THREADS];
-        Thread[] requestScopeThreadTable = new Thread[NUM_THREADS];
 
         for (int i = 0; i < NUM_THREADS; i++) {
             moduleScopeThreadTable[i] = new ModuleScopeTestThread();
-            requestScopeThreadTable[i] = new RequestScopeTestThread();
         }
         for (int j = 0; j < NUM_THREADS; j++) {
             moduleScopeThreadTable[j].start();
-            requestScopeThreadTable[j].start();
         }
         for (int k = 0; k < NUM_THREADS; k++) {
             moduleScopeThreadTable[k].join();
-            requestScopeThreadTable[k].join();
         }
     }
 
@@ -85,29 +84,6 @@
         }
     }
 
-    private class RequestScopeTestThread extends Thread {
-
-        public void run() {
-            StateVerifier requestScopeService = node.getService(StateVerifier.class, "RequestScopeComponent");
-            for (int i = 1; i <= ITERATIONS; i++) {
-                requestScopeService.setState(i);
-                if (!requestScopeService.checkState(i)) {
-                    fail("The request scope service lost its state on iteration " + i);
-                }
-            }
-        }
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        String location = ContributionLocationHelper.getContributionLocation("scopes.composite");
-        node = NodeFactory.newInstance().createNode("scopes.composite", new Contribution("c1", location));
-        node.start();
-    }
 
-    @After
-    public void tearDown() throws Exception {
-        node.stop();
-    }
 
 }