Author: rupertlssmith
Date: Tue Aug  7 02:44:59 2007
New Revision: 563434

URL: http://svn.apache.org/viewvc?view=rev&rev=563434
Log:
Interop tests put into a working state.

Added:
    incubator/qpid/branches/M2/dotnet/TestClient/
    incubator/qpid/branches/M2/dotnet/TestClient/Program.cs
    incubator/qpid/branches/M2/dotnet/TestClient/Properties/
    incubator/qpid/branches/M2/dotnet/TestClient/Properties/AssemblyInfo.cs
    incubator/qpid/branches/M2/dotnet/TestClient/TestClient.csproj
    incubator/qpid/branches/M2/dotnet/TestClient/default.build
Modified:
    
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs
    
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs
    incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestClient.cs
    
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
    incubator/qpid/branches/M2/dotnet/Qpid.NET.sln
    incubator/qpid/branches/M2/dotnet/default.build

Modified: 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs?view=diff&rev=563434&r1=563433&r2=563434
==============================================================================
--- 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs
 (original)
+++ 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs
 Tue Aug  7 02:44:59 2007
@@ -163,7 +163,7 @@
 
             // Generate a report message containing the count of the number of 
messages passed.
             IMessage report = channel.CreateMessage();
-            report.Headers.SetString("CONTROL_TYPE", "REPORT");
+            //report.Headers.SetString("CONTROL_TYPE", "REPORT");
             report.Headers.SetInt("MESSAGE_COUNT", messageCount);
 
             return report;

Modified: 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs?view=diff&rev=563434&r1=563433&r2=563434
==============================================================================
--- 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs
 (original)
+++ 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs
 Tue Aug  7 02:44:59 2007
@@ -185,14 +185,14 @@
             log.Debug("public IMessage getReport(IChannel channel): called");
     
             // Close the test connections.
-            foreach (IConnection con in connection)
+            /*foreach (IConnection con in connection)
             {
-                con.Stop();
-            }
+                con.Close();
+            }*/
     
             // Generate a report message containing the count of the number of 
messages passed.
             IMessage report = channel.CreateMessage();
-            report.Headers.SetString("CONTROL_TYPE", "REPORT");
+            //report.Headers.SetString("CONTROL_TYPE", "REPORT");
             report.Headers.SetInt("MESSAGE_COUNT", messageCount);
     
             return report;

Modified: 
incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestClient.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestClient.cs?view=diff&rev=563434&r1=563433&r2=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestClient.cs 
(original)
+++ incubator/qpid/branches/M2/dotnet/Qpid.Client.Tests/interop/TestClient.cs 
Tue Aug  7 02:44:59 2007
@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.Text;
+using System.Threading;
 using Apache.Qpid.Messaging;
 using Apache.Qpid.Client.Qms;
 using log4net;
@@ -28,7 +29,7 @@
     /// <tr><td> Configure and look up test cases by name. <td> [EMAIL 
PROTECTED] InteropClientTestCase}
     /// </table>
     /// </summary>
-    class TestClient
+    public class TestClient
     {
         private static ILog log = LogManager.GetLogger(typeof(TestClient));
 
@@ -39,7 +40,7 @@
         public static string DEFAULT_VIRTUAL_HOST = "";
 
         /// <summary> Defines the default identifying name of this test 
client. </summary>
-        public static string DEFAULT_CLIENT_NAME = ".net";
+        public static string DEFAULT_CLIENT_NAME = "dotnet";
 
         /// <summary> Holds the URL of the broker to run the tests on. 
</summary>
         public static string brokerUrl;
@@ -59,6 +60,8 @@
 
         private IChannel channel;
 
+        /// <summary> Monitor to wait for termination events on. </summary>
+        private static object terminationMonitor = new Object();
 
         /// <summary>
         /// Creates a new interop test client, listenting to the specified 
broker and virtual host, with the specified
@@ -70,7 +73,7 @@
         /// <param name="clientName">  The client name to use. </param>
         public TestClient(string brokerUrl, string virtualHost, string 
clientName)
         {
-            log.Debug("public TestClient(string brokerUrl = " + brokerUrl + ", 
string virtualHost = " + virtualHost
+            log.Info("public TestClient(string brokerUrl = " + brokerUrl + ", 
string virtualHost = " + virtualHost
                 + ", string clientName = " + clientName + "): called");
 
             // Retain the connection parameters.
@@ -127,6 +130,12 @@
                 log.Error("The test client was unable to start.", e);
                 System.Environment.Exit(1);
             }
+
+            // Wait for a signal on the termination monitor before quitting.
+            lock (terminationMonitor)
+            {
+                Monitor.Wait(terminationMonitor);
+            }
         }
 
         /// <summary>
@@ -134,7 +143,7 @@
         /// </summary>
         private void Start()
         {
-            log.Debug("private void Start(): called");
+            log.Info("private void Start(): called");
 
             // Use a class path scanner to find all the interop test case 
implementations.
             ArrayList testCaseClasses = new ArrayList();
@@ -150,9 +159,12 @@
             {
                 InteropClientTestCase testCase = 
(InteropClientTestCase)Activator.CreateInstance(testClass);
                 testCases.Add(testCase.GetName(), testCase);
+
+                log.Info("Found test case: " + testClass);
             }
 
             // Open a connection to communicate with the coordinator on.
+            log.Info("brokerUrl = " + brokerUrl);
             IConnection connection = CreateConnection(brokerUrl, virtualHost);
 
             channel = connection.CreateChannel(false, 
AcknowledgeMode.AutoAcknowledge);
@@ -161,8 +173,8 @@
             string responseQueueName = channel.GenerateUniqueName();
             channel.DeclareQueue(responseQueueName, false, true, true);
 
-            channel.Bind(responseQueueName, ExchangeNameDefaults.DIRECT, 
"iop.control." + clientName);
-            channel.Bind(responseQueueName, ExchangeNameDefaults.DIRECT, 
"iop.control");
+            channel.Bind(responseQueueName, ExchangeNameDefaults.TOPIC, 
"iop.control." + clientName);
+            channel.Bind(responseQueueName, ExchangeNameDefaults.TOPIC, 
"iop.control");
 
             IMessageConsumer consumer = 
channel.CreateConsumerBuilder(responseQueueName)
                 .Create();
@@ -189,7 +201,7 @@
         /// <returns> A JMS conneciton. </returns>
         public static IConnection CreateConnection(string brokerUrl, string 
virtualHost)
         {
-            log.Debug("public static Connection createConnection(string 
brokerUrl = " + brokerUrl + ", string virtualHost = " 
+            log.Info("public static Connection createConnection(string 
brokerUrl = " + brokerUrl + ", string virtualHost = " 
                 + virtualHost + "): called");
 
             // Create a connection to the broker.
@@ -207,7 +219,7 @@
         /// <param name="message"> The incoming message. </param>
         public void OnMessage(IMessage message)
         {
-            log.Debug("public void OnMessage(IMessage message = " + message + 
"): called");
+            log.Info("public void OnMessage(IMessage message = " + message + 
"): called");
 
             try
             {
@@ -225,7 +237,7 @@
 
                     if (testCaseName != null)
                     {
-                        log.Debug("Got an invite to test: " + testCaseName);
+                        log.Info("Got an invite to test: " + testCaseName);
 
                         // Check if the requested test case is available.
                         InteropClientTestCase testCase = 
(InteropClientTestCase)testCases[testCaseName];
@@ -239,11 +251,13 @@
                     }
                     else
                     {
-                        log.Debug("Got a compulsory invite.");
+                        log.Info("Got a compulsory invite.");
 
                         enlist = true;
                     }
 
+                    log.Info("enlist = " + enlist);
+
                     if (enlist)
                     {
                         // Reply with the client name in an Enlist message.
@@ -254,14 +268,14 @@
                         enlistMessage.CorrelationId = message.CorrelationId;
 
                         Send(enlistMessage, message.ReplyToRoutingKey);
-                    }
+                    }                    
                 }
                 else if ("ASSIGN_ROLE" == controlType)
                 {
                     // Assign the role to the current test case.
                     string roleName = message.Headers.GetString("ROLE");
     
-                    log.Debug("Got a role assignment to role: " + roleName);
+                    log.Info("Got a role assignment to role: " + roleName);
     
                     Roles role;
 
@@ -287,14 +301,14 @@
                 {
                     if ("START" == controlType)
                     {
-                        log.Debug("Got a start notification.");
+                        log.Info("Got a start notification.");
 
                         // Start the current test case.
                         currentTestCase.Start();
                     }
                     else
                     {
-                        log.Debug("Got a status request.");
+                        log.Info("Got a status request.");
                     }
 
                     // Generate the report from the test case and reply with 
it as a Report message.
@@ -321,7 +335,7 @@
             {
                 // Log a warning about this, but otherwise ignore it.
                 log.Warn("A QpidException occurred whilst handling a 
message.");
-                log.Debug("Got QpidException whilst handling message: " + 
message, e);
+                log.Info("Got QpidException whilst handling message: " + 
message, e);
             }
         }
 

Modified: 
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs?view=diff&rev=563434&r1=563433&r2=563434
==============================================================================
--- 
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
 (original)
+++ 
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
 Tue Aug  7 02:44:59 2007
@@ -30,6 +30,8 @@
 {
     public abstract class AbstractQmsMessage : AMQMessage, IMessage
     {
+        private static ILog log = 
LogManager.GetLogger(typeof(AbstractQmsMessage));
+
         protected bool _redelivered;
 
         protected ByteBuffer _data;
@@ -452,6 +454,8 @@
         private Dest ReadReplyToHeader()
         {
            string replyToEncoding = ContentHeaderProperties.ReplyTo;
+           
+           //log.Info("replyToEncoding = " + replyToEncoding);
 
            if ( replyToEncoding == null )
            {
@@ -469,7 +473,9 @@
 
               // Extract the exchange name and routing key from the split 
replyto field.
               string exchangeName = split[0];
-              string routingKey = split[1];
+
+              string[] split2 = split[1].Split('/');
+              string routingKey = split2[3];
 
               return new Dest(exchangeName, routingKey);
            }

Modified: incubator/qpid/branches/M2/dotnet/Qpid.NET.sln
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/Qpid.NET.sln?view=diff&rev=563434&r1=563433&r2=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/Qpid.NET.sln (original)
+++ incubator/qpid/branches/M2/dotnet/Qpid.NET.sln Tue Aug  7 02:44:59 2007
@@ -24,6 +24,8 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TopicListener", 
"TopicListener\TopicListener.csproj", "{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", 
"TestClient\TestClient.csproj", "{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU

Added: incubator/qpid/branches/M2/dotnet/TestClient/Program.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/TestClient/Program.cs?view=auto&rev=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/TestClient/Program.cs (added)
+++ incubator/qpid/branches/M2/dotnet/TestClient/Program.cs Tue Aug  7 02:44:59 
2007
@@ -0,0 +1,10 @@
+namespace TopicListener
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            Apache.Qpid.Client.Tests.interop.TestClient.Main(args);
+        }
+    }
+}

Added: incubator/qpid/branches/M2/dotnet/TestClient/Properties/AssemblyInfo.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/TestClient/Properties/AssemblyInfo.cs?view=auto&rev=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/TestClient/Properties/AssemblyInfo.cs 
(added)
+++ incubator/qpid/branches/M2/dotnet/TestClient/Properties/AssemblyInfo.cs Tue 
Aug  7 02:44:59 2007
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TestClient")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("J.P. Morgan Chase & Co.")]
+[assembly: AssemblyProduct("TestClient")]
+[assembly: AssemblyCopyright("Copyright © J.P. Morgan Chase & Co. 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed 
to COM
+[assembly: Guid("1c2db1cd-239f-495a-b6b4-c815ea534489")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: incubator/qpid/branches/M2/dotnet/TestClient/TestClient.csproj
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/TestClient/TestClient.csproj?view=auto&rev=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/TestClient/TestClient.csproj (added)
+++ incubator/qpid/branches/M2/dotnet/TestClient/TestClient.csproj Tue Aug  7 
02:44:59 2007
@@ -0,0 +1,89 @@
+<Project DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>TestClient</RootNamespace>
+    <AssemblyName>TestClient</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' 
">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\bin\net-2.0\debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 
'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\bin\net-2.0\release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Qpid.Buffer.Tests\Qpid.Buffer.Tests.csproj">
+      <Project>{74640962-99D0-4D06-B57A-9CD66517CF52}</Project>
+      <Name>Qpid.Buffer.Tests</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
+      <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
+      <Name>Qpid.Buffer</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Client.Tests\Qpid.Client.Tests.csproj">
+      <Project>{BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}</Project>
+      <Name>Qpid.Client.Tests</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
+      <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
+      <Name>Qpid.Client</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Codec\Qpid.Codec.csproj">
+      <Project>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</Project>
+      <Name>Qpid.Codec</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Common.Tests\Qpid.Common.Tests.csproj">
+      <Project>{F83624B0-762B-4D82-900D-FF4C1B36E36E}</Project>
+      <Name>Qpid.Common.Tests</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
+      <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
+      <Name>Qpid.Common</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
+      <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
+      <Name>Qpid.Messaging</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Sasl.Tests\Qpid.Sasl.Tests.csproj">
+      <Project>{587B3520-EBB9-41ED-B019-E96116B651CE}</Project>
+      <Name>Qpid.Sasl.Tests</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
+      <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
+      <Name>Qpid.Sasl</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets 
below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

Added: incubator/qpid/branches/M2/dotnet/TestClient/default.build
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/TestClient/default.build?view=auto&rev=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/TestClient/default.build (added)
+++ incubator/qpid/branches/M2/dotnet/TestClient/default.build Tue Aug  7 
02:44:59 2007
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<project name="TestClient" default="build">
+    <!--
+               Properties that come from master build file
+               - build.dir: root directory for build
+               - build.debug: true if building debug release
+               - build.defines: variables to define during build
+    -->
+
+    <target name="build">
+        <csc target="exe" 
+                               define="${build.defines}" 
+            debug="${build.debug}"
+            unsafe="true"
+                               
output="${build.dir}/${project::get-name()}.exe">
+                       
+                       <sources>
+                          <include name="**/*.cs" />
+         </sources>
+         <references>
+            <include name="${build.dir}\Apache.Qpid.Client.Tests.dll"/>
+         </references>
+        </csc>
+    </target>
+</project>
+

Modified: incubator/qpid/branches/M2/dotnet/default.build
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/default.build?view=diff&rev=563434&r1=563433&r2=563434
==============================================================================
--- incubator/qpid/branches/M2/dotnet/default.build (original)
+++ incubator/qpid/branches/M2/dotnet/default.build Tue Aug  7 02:44:59 2007
@@ -34,6 +34,7 @@
    <fileset id='other.builds'>
       <include name="TopicListener/default.build" />   
       <include name="TopicPublisher/default.build" />  
+      <include name="TestClient/default.build" />      
    </fileset>
    <!--
       Prepare environment for a debug build


Reply via email to