Author: nash
Date: Wed Mar 19 06:16:42 2008
New Revision: 638822

URL: http://svn.apache.org/viewvc?rev=638822&view=rev
Log:
Fix TUSCANY-2090 (add test case for TUSCANY-2077)

Added:
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
    
incubator/tuscany/java/sca/itest/conversations/src/main/resources/ConversationUniqueId.composite
    
incubator/tuscany/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/Record.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest;
+
+import java.io.Serializable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Record implements Serializable {
+    public String id;
+    public String conversationId;
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/TestResult.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest;
+
+import java.util.Hashtable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TestResult {
+    public static Hashtable<Object, Boolean> results = new Hashtable<Object, 
Boolean>();
+    private static int completed = 0;
+    public static synchronized void updateCompleted() {
+        ++completed;
+    }
+    
+    public static synchronized int getCompleted() {
+        return completed;
+    }
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Alpha.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational;
+
+import org.osoa.sca.annotations.OneWay;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
[EMAIL PROTECTED]
+public interface Alpha {
+    @OneWay
+    void run(int param);
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Beta.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational;
+
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
[EMAIL PROTECTED]
+public interface Beta {
+    CallableReference<Gamma> getRef(int param);
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/Gamma.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational;
+
+import org.apache.tuscany.sca.itest.Record;
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.EndsConversation;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+public interface Gamma {
+    void start(int param);
+
+    boolean hasNext();
+
+    Record next();
+
+    @EndsConversation
+    void stop();
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/AlphaImpl.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational.impl;
+
+import org.apache.tuscany.sca.itest.Record;
+import org.apache.tuscany.sca.itest.TestResult;
+import org.apache.tuscany.sca.itest.conversational.Alpha;
+import org.apache.tuscany.sca.itest.conversational.Beta;
+import org.apache.tuscany.sca.itest.conversational.Gamma;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
[EMAIL PROTECTED](Alpha.class)
[EMAIL PROTECTED]("COMPOSITE")
+public class AlphaImpl implements Alpha {
+    @Reference
+    public Beta beta;
+    
+    @Context
+    protected ComponentContext componentContext;
+    
+    public void run(int param) {
+        CallableReference<Gamma> gammaRef = null;
+        boolean testPassed = true;
+        try {
+            gammaRef = beta.getRef(param);
+            while (gammaRef.getService().hasNext()) {
+                Record record = gammaRef.getService().next();
+                if 
(!record.conversationId.equals(gammaRef.getConversation().getConversationID())) 
{
+                    // Record returned is not from this conversation.
+                    testPassed = false;
+                }
+            }
+        } catch (Exception ex) {
+            testPassed = false;
+            ex.printStackTrace();
+        } finally {
+            TestResult.updateCompleted();
+            if (gammaRef != null) {
+                TestResult.results.put(gammaRef.getConversation()
+                        .getConversationID(), testPassed);
+                gammaRef.getService().stop();
+            }
+        }
+    }
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/BetaImpl.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational.impl;
+
+import org.apache.tuscany.sca.itest.conversational.Beta;
+import org.apache.tuscany.sca.itest.conversational.Gamma;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
[EMAIL PROTECTED](Beta.class)
[EMAIL PROTECTED]("COMPOSITE")
+public class BetaImpl implements Beta {
+    @Context
+    protected ComponentContext componentContext;
+
+    @Reference
+    public Gamma gamma;
+
+    public CallableReference<Gamma> getRef(int param) {
+        ServiceReference<Gamma> gammaRef = componentContext
+                .getServiceReference(Gamma.class, "gamma");
+        Gamma g = gammaRef.getService();
+        g.start(param);
+        return gammaRef;
+    }
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/GammaImpl.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational.impl;
+
+import java.util.ArrayList;
+
+import org.apache.tuscany.sca.itest.Record;
+import org.apache.tuscany.sca.itest.conversational.Gamma;
+import org.osoa.sca.annotations.ConversationID;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * @version $Rev$ $Date$
+ */
+
[EMAIL PROTECTED](Gamma.class)
[EMAIL PROTECTED]("CONVERSATION")
+public class GammaImpl implements Gamma {
+    @ConversationID
+    public String conversationId;
+
+    private ArrayList<Record> list;
+    
+    public void start(int param) {
+        list = new ArrayList<Record>();
+        fillList(param, conversationId);
+    }
+
+    public boolean hasNext() {
+        return !list.isEmpty();
+    }
+
+    public Record next() {
+        return list.remove(0);
+    }
+
+    public void stop() {
+        list = null;
+    }
+    
+    private void fillList(int param, String cid) {
+        for (int i = 0; i < param; i++) {
+            Record record = new Record();
+            record.id = "id_" + i;
+            record.conversationId = cid;
+            list.add(record);
+        }
+    }
+}

Added: 
incubator/tuscany/java/sca/itest/conversations/src/main/resources/ConversationUniqueId.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/main/resources/ConversationUniqueId.composite?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/main/resources/ConversationUniqueId.composite
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/main/resources/ConversationUniqueId.composite
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0";
+    targetNamespace="http://conversations";
+    name="ConversationUniqueIdTest">
+
+    <component name="Alpha">
+        <implementation.java 
class="org.apache.tuscany.sca.itest.conversational.impl.AlphaImpl"/>
+        <service name="Alpha">
+            <binding.sca />
+        </service>
+        <reference name="beta" target="Beta">
+            <binding.sca/>
+        </reference>
+    </component>
+
+    <component name="Beta">
+        <implementation.java 
class="org.apache.tuscany.sca.itest.conversational.impl.BetaImpl"/>
+        <service name="Beta">
+            <binding.sca />
+        </service>
+        <reference name="gamma" target="Gamma">
+            <binding.sca />
+        </reference>
+    </component>
+
+    <component name="Gamma">
+        <implementation.java 
class="org.apache.tuscany.sca.itest.conversational.impl.GammaImpl"/>
+        <service name="Gamma">
+            <binding.sca/>
+        </service>
+    </component>
+</composite>

Added: 
incubator/tuscany/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java?rev=638822&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
 (added)
+++ 
incubator/tuscany/java/sca/itest/conversations/src/test/java/org/apache/tuscany/sca/itest/conversational/ConversationUniqueIdTestCase.java
 Wed Mar 19 06:16:42 2008
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.tuscany.sca.itest.conversational;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.itest.TestResult;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ConversationUniqueIdTestCase {
+
+    private SCADomain domain;
+
+    @Before
+    public void setUp() throws Exception {
+        domain = SCADomain.newInstance("ConversationUniqueId.composite");
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        if (domain != null) {
+            domain.close();
+        }
+    }
+
+    @Test
+    public void testConversationUniqueId() {
+        Alpha alpha = domain.getService(Alpha.class, "Alpha");
+        int numConversations = 3;
+        
+        for(int i = 0; i < numConversations; ++i) {
+            alpha.run(5);
+        }
+        
+        // Wait for the conversations to complete
+        while (TestResult.getCompleted() < numConversations) {
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+            }
+        }
+        
+        Assert.assertEquals(TestResult.results.size(), numConversations);
+        for(Boolean value : TestResult.results.values()) {
+            Assert.assertTrue(value);
+        }
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to