Author: arnaudsimon
Date: Thu Sep 11 04:39:47 2008
New Revision: 694220

URL: http://svn.apache.org/viewvc?rev=694220&view=rev
Log:
qpid-1277: added tests and fixed rangeSet + future issue because of the 
nonvariant nature of C# generics 

Added:
    incubator/qpid/trunk/qpid/dotnet/client-010/log.xml
    incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/
    incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/Admin.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/TestCase.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/test/test.config
Modified:
    incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs
    
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Future.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Range.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/RangeSet.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Session.cs
    
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs
    
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs
    incubator/qpid/trunk/qpid/dotnet/client-010/default.build
    incubator/qpid/trunk/qpid/dotnet/client-010/gentool/Invoker.tpl
    incubator/qpid/trunk/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Channel.cs Thu 
Sep 11 04:39:47 2008
@@ -21,7 +21,6 @@
 using System;
 using org.apache.qpid.transport.network;
 using org.apache.qpid.transport.util;
-using SessionDelegate=org.apache.qpid.transport.SessionDelegate;
 
 namespace org.apache.qpid.transport
 {
@@ -162,7 +161,7 @@
             method(m);
         }
 
-        public override Future<T> invoke<T>(Method m, Future<T> future)
+        public override Future invoke(Method m, Future future)
         {
             throw new Exception("UnsupportedOperation");
         }

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs 
(original)
+++ 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs 
Thu Sep 11 04:39:47 2008
@@ -20,14 +20,22 @@
 */
 namespace org.apache.qpid.transport
 {
-       
-       
-       /// <summary> 
-       /// ChannelDelegate
-       /// 
-       /// </summary>
-
-    class ChannelDelegate : MethodDelegate<Channel>
+    /// <summary> 
+    /// ChannelDelegate
+    /// 
+    /// </summary>
+    internal class ChannelDelegate : MethodDelegate<Channel>
     {
+        public override void sessionDetached(Channel channel, SessionDetached 
closed)
+        {
+            channel.closed();
+        }
+
+        public override void sessionDetach(Channel channel, SessionDetach dtc)
+        {
+            channel.Session.closed();
+            channel.sessionDetached(dtc.getName(), SessionDetachCode.NORMAL);
+            channel.closed();
+        }
     }
 }
\ No newline at end of file

Modified: incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Future.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Future.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Future.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Future.cs Thu 
Sep 11 04:39:47 2008
@@ -24,9 +24,9 @@
     /// <summary> 
     /// Future
     /// </summary>
-    public interface Future<T>
+    public interface Future
     {
-        T Result
+        Struct Result
         {
             get; set;
         }

Modified: incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Range.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Range.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Range.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Range.cs Thu 
Sep 11 04:39:47 2008
@@ -32,66 +32,66 @@
 
     public sealed class Range
     {
-        private int lower;
-        private int upper;
+        private int _lower;
+        private int _upper;
 
         public Range(int lower, int upper)
         {
-            this.lower = lower;
-            this.upper = upper;
+            _lower = lower;
+            _upper = upper;
         }
 
         public int Lower
         {
-            get { return lower; }
-            set { lower = value; }
+            get { return _lower; }
+            set { _lower = value; }
         }
         public int Upper
         {
-            get { return upper; }
-            set { upper = value; }
+            get { return _upper; }
+            set { _upper = value; }
         }
 
         public bool includes(int value)
         {
-            return Serial.le(lower, value) && Serial.le(value, upper);
+            return Serial.le(_lower, value) && Serial.le(value, _upper);
         }
 
         public bool includes(Range range)
         {
-            return includes(range.lower) && includes(range.upper);
+            return includes(range._lower) && includes(range._upper);
         }
 
         public bool intersects(Range range)
         {
-            return (includes(range.lower) || includes(range.upper) ||
-                    range.includes(lower) || range.includes(upper));
+            return (includes(range._lower) || includes(range._upper) ||
+                    range.includes(_lower) || range.includes(_upper));
         }
 
         public bool touches(Range range)
         {
             return (intersects(range) ||
-                    includes(range.upper + 1) || includes(range.lower - 1) ||
-                    range.includes(upper + 1) || range.includes(lower - 1));
+                    includes(range._upper + 1) || includes(range._lower - 1) ||
+                    range.includes(_upper + 1) || range.includes(_lower - 1));
         }
 
         public Range span(Range range)
         {
-            return new Range(Serial.min(lower, range.lower), Serial.max(upper, 
range.upper));
+            return new Range(Serial.min(_lower, range._lower), 
Serial.max(_upper, range._upper));
         }
 
         public List<Range> subtract(Range range)
         {
             List<Range> result = new List<Range>();
 
-            if (includes(range.lower) && Serial.le(lower, range.lower - 1))
+            if (includes(range._lower) && Serial.le(_lower, range._lower - 1))
             {
-                result.Add(new Range(lower, range.lower - 1));
+                result.Add(new Range(_lower, range._lower - 1));
             }
 
-            if (includes(range.upper) && Serial.le(range.upper + 1, upper))
+            if (includes(range._upper) && Serial.le(range._upper + 1, _upper))
             {
-                result.Add(new Range(range.upper + 1, upper));
+                result.Add(new Range(range._upper + 1, _upper));
             }
 
             if (result.Count == 0 && !range.includes(this))
@@ -104,14 +104,14 @@
 
         public Range intersect(Range range)
         {
-            int l = Serial.max(lower, range.lower);
-            int r = Serial.min(upper, range.upper);
+            int l = Serial.max(_lower, range._lower);
+            int r = Serial.min(_upper, range._upper);
             return Serial.gt(l, r) ? null : new Range(l, r);
         }
 
         public String toString()
         {
-            return "[" + lower + ", " + upper + "]";
+            return "[" + _lower + ", " + _upper + "]";
         }
     }
 }
\ No newline at end of file

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/RangeSet.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/RangeSet.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/RangeSet.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/RangeSet.cs 
Thu Sep 11 04:39:47 2008
@@ -27,127 +27,124 @@
 
 namespace org.apache.qpid.transport
 {
-       
-       
-       /// <summary> 
+    /// <summary> 
     /// RangeSet
-       /// </summary>
-
-    public sealed class RangeSet : IEnumerable<Range> 
-       {
-                   private readonly LinkedList<Range> ranges = new 
LinkedList<Range>();
+    /// </summary>
+    public sealed class RangeSet : IEnumerable<Range>
+    {
+        private readonly List<Range> _ranges = new List<Range>();
 
-           IEnumerator IEnumerable.GetEnumerator()
-           {
-               return GetEnumerator();
-           }
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return GetEnumerator();
+        }
 
-           public IEnumerator<Range> GetEnumerator()
-           {
-               return ranges.GetEnumerator();
-           }
+        public IEnumerator<Range> GetEnumerator()
+        {
+            return _ranges.GetEnumerator();
+        }
 
 
-           public int size()
-    {
-               return ranges.Count;
-    }
+        public int size()
+        {
+            return _ranges.Count;
+        }
 
-   
 
-    public Range getFirst()
-    {
-        return ranges.First.Value;
-    }
+        public Range getFirst()
+        {
+            return _ranges[0];
+        }
 
-    public bool includes(Range range)
-    {
-        foreach (Range r in this)
+        public bool includes(Range range)
         {
-            if (r.includes(range))
+            foreach (Range r in this)
             {
-                return true;
+                if (r.includes(range))
+                {
+                    return true;
+                }
             }
-        }
 
-        return false;
-    }
+            return false;
+        }
 
-    public bool includes(int n)
-    {
-        foreach (Range r in this)
+        public bool includes(int n)
         {
-            if (r.includes(n))
+            foreach (Range r in this)
             {
-                return true;
+                if (r.includes(n))
+                {
+                    return true;
+                }
             }
-        }
 
-        return false;
-    }
+            return false;
+        }
 
-    public void add(Range range)
-    {
-         foreach (Range r in ranges)
+        public void add(Range range)
         {
-            if (range.touches(r))
+            for (int i = 0; i < _ranges.Count; i++)
             {
-                ranges.Remove(r);
-                range = range.span(r);
-            }
-            else if (Serial.lt(range.Upper, r.Lower ))
-            {                               
-                ranges.AddBefore(ranges.Find(r), range);
-                return;
+                Range r = _ranges[i];
+                if (range.touches(r))
+                {
+                    _ranges.Remove(r);
+                    range = range.span(r);
+                }
+                else if (Serial.lt(range.Upper, r.Lower))
+                {
+                    _ranges.Insert(i - 1 , range);
+                    return;
+                }
             }
+            _ranges.Add(range);
         }
-        ranges.AddLast(range);
-    }
-
-    public void add(int lower, int upper)
-    {
-        add(new Range(lower, upper));
-    }
 
-    public void add(int value)
-    {
-        add(value, value);
-    }
+        public void add(int lower, int upper)
+        {
+            add(new Range(lower, upper));
+        }
 
-    public void clear()
-    {
-        ranges.Clear();
-    }
+        public void add(int value)
+        {
+            add(value, value);
+        }
 
-    public RangeSet copy()
-    {
-        RangeSet copy = new RangeSet();
-        foreach( Range r in ranges)
+        public void clear()
         {
-            copy.ranges.AddLast(r);
-        }        
-        return copy;
-    }
+            _ranges.Clear();
+        }
 
-    public String toString()
-    {
-        StringBuilder str = new StringBuilder();
-        str.Append("{");
-        bool first = true;
-        foreach (Range range in ranges)
+        public RangeSet copy()
         {
-            if (first)
+            RangeSet copy = new RangeSet();
+            foreach (Range r in _ranges)
             {
-                first = false;
+                copy._ranges.Add(r);
             }
-            else
+            return copy;
+        }
+
+        public String toString()
+        {
+            StringBuilder str = new StringBuilder();
+            str.Append("{");
+            bool first = true;
+            foreach (Range range in _ranges)
             {
-                str.Append(", ");
+                if (first)
+                {
+                    first = false;
+                }
+                else
+                {
+                    str.Append(", ");
+                }
+                str.Append(range);
             }
-            str.Append(range);
+            str.Append("}");
+            return str.ToString();
         }
-        str.Append("}");
-        return str.ToString();
     }
-       }
 }
\ No newline at end of file

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Session.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Session.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Session.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/Session.cs Thu 
Sep 11 04:39:47 2008
@@ -22,6 +22,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Threading;
+using common.org.apache.qpid.transport.util;
 using org.apache.qpid.transport;
 using org.apache.qpid.transport.util;
 using Frame = org.apache.qpid.transport.network.Frame;
@@ -77,7 +78,7 @@
         private int _maxComplete = - 1;
         private bool _needSync = false;
         private bool _closed;
-        private readonly Dictionary<int, Future<Struct>> _results = new 
Dictionary<int, Future<Struct>>();
+        private readonly Dictionary<int, Future> _results = new 
Dictionary<int, Future>();
         private readonly List<ExecutionException> _exceptions = new 
List<ExecutionException>();
 
 
@@ -383,7 +384,7 @@
 
         public void result(int command, Struct result)
         {
-            Future<Struct> future;
+            Future future;
             lock (_results)
             {
                 if (_results.ContainsKey(command))
@@ -422,7 +423,7 @@
             }
         }
 
-        public override Future<T> invoke<T>(Method m, Future<T> future)
+        public override Future invoke(Method m, Future future)     
         {
             lock (_commands)
             {
@@ -430,7 +431,7 @@
                 int command = _commandsOut;
                 lock (_results)
                 {
-                    _results.Add(command, (Future<Struct>) future);
+                    _results.Add(command, future);
                 }
                 invoke(m);
             }
@@ -493,7 +494,7 @@
             }
             lock (_results)
             {
-                foreach (Future<Struct> result in _results.Values)
+                foreach (Future result in _results.Values)
                 {
                     lock (result)
                     {

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs
 (original)
+++ 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs
 Thu Sep 11 04:39:47 2008
@@ -168,8 +168,7 @@
                 log.debug("Receiver thread terminating");
             }
             catch (Exception t)
-            {
-                Console.WriteLine(t);
+            {                
                 if (ExceptionReading != null)
                 {
                     ExceptionReading(this, new ExceptionArgs(t));

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs
 (original)
+++ 
incubator/qpid/trunk/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs
 Thu Sep 11 04:39:47 2008
@@ -5,12 +5,12 @@
 
 namespace common.org.apache.qpid.transport.util
 {
-    public class ResultFuture<T> : Future<T> where T : Struct 
+    public class ResultFuture : Future
     {
         const long _timeout = 60000;
         private Struct _result;
         private Session _session;
-        private static readonly Logger log = 
Logger.get(typeof(ResultFuture<T>));
+        private static readonly Logger log = Logger.get(typeof(ResultFuture));
 
         public Struct get(long timeout)
         {
@@ -32,9 +32,9 @@
            return _result;
         }
 
-        public T Result
+        public Struct Result
         {
-            get { return (T) get(_timeout); }
+            get { return get(_timeout); }
             set
             {
                 lock (this)

Modified: incubator/qpid/trunk/qpid/dotnet/client-010/default.build
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/default.build?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/default.build (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/default.build Thu Sep 11 
04:39:47 2008
@@ -155,6 +155,11 @@
             <buildfiles refid="tests.builds" />
         </nant>
         
+        <!-- copy config files over to the output dir -->
+        <copy todir="${build.dir}" file="test/test.config"/>
+        <copy todir="${build.dir}" file="log.xml"/>
+
+        
     </target>
     
     <!-- Runs all 'pure unit' tests. -->

Modified: incubator/qpid/trunk/qpid/dotnet/client-010/gentool/Invoker.tpl
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/gentool/Invoker.tpl?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/gentool/Invoker.tpl (original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/gentool/Invoker.tpl Thu Sep 11 
04:39:47 2008
@@ -9,7 +9,7 @@
 public abstract class Invoker {
 
     protected abstract void invoke(Method method);
-    public abstract Future<T> invoke<T>(Method method, Future<T> resultClass);
+    public abstract Future invoke(Method method, Future resultClass);
 
 ${
 from dotnetgenutil import *
@@ -25,9 +25,9 @@
       rname = cname(result["struct"])
     else:
       rname = cname(result, "@type")
-    jresult = "Future<%s>" % rname
+    jresult = "Future" 
     jreturn = "return "
-    jclass = ", new ResultFuture<%s>()" % rname
+    jclass = ", new ResultFuture()" 
     jinvoke = "invoke"
   else:
     jinvoke = "invoke"

Added: incubator/qpid/trunk/qpid/dotnet/client-010/log.xml
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/log.xml?rev=694220&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/log.xml (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/log.xml Thu Sep 11 04:39:47 2008
@@ -0,0 +1,26 @@
+<log4net>
+  <appender name="Console" type="log4net.Appender.ConsoleAppender">
+    <layout type="log4net.Layout.PatternLayout">
+      <!-- Pattern to output the caller's file name and line number -->
+      <conversionPattern value="%5level [%thread] (%file:%line) - 
%message%newline" />
+    </layout>
+  </appender>
+
+  <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
+    <file value="logs/mylogfile.log" />
+    <appendToFile value="true" />
+    <maximumFileSize value="8192KB" />
+    <maxSizeRollBackups value="2" />
+
+    <layout type="log4net.Layout.PatternLayout">
+      <conversionPattern value="%date [%thread] %-5level %ndc - 
%message%newline" />
+      <!--<conversionPattern value="%level %thread %logger - %message%newline" 
/>-->
+    </layout>
+  </appender>
+
+  <root>
+    <level value="DEBUG" />
+    <appender-ref ref="Console" />
+    <appender-ref ref="RollingFile" />
+  </root>
+</log4net>

Added: incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/Admin.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/Admin.cs?rev=694220&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/Admin.cs (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/Admin.cs Thu Sep 
11 04:39:47 2008
@@ -0,0 +1,90 @@
+/*
+*
+* 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.
+*
+*/
+
+using NUnit.Framework;
+using org.apache.qpid.client;
+using org.apache.qpid.transport;
+using org.apache.qpid.transport.util;
+
+namespace test.interop
+{
+    public class Admin:TestCase
+    {
+        private static readonly Logger _log = Logger.get(typeof(Admin));
+
+        [Test]
+        public void createSession()
+        {
+            _log.debug("Running: createSession");
+            ClientSession ssn = Client.createSession(0);
+            ssn.close();            
+            // This test fails if an exception is thrown 
+        }
+
+        [Test]
+        public void queueLifecycle()
+        {
+            _log.debug("Running: queueLifecycle");
+            ClientSession ssn = Client.createSession(0);
+            ssn.queueDeclare("queue1", null, null);
+            ssn.sync();
+            ssn.queueDelete("queue1");
+            ssn.sync();
+            try
+            {
+                ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
+                ssn.sync();
+            }
+            catch (SessionException e)
+            {
+              // as expected
+            }           
+            // This test fails if an exception is thrown 
+        }
+
+        [Test]
+        public void exchangeCheck()
+        {
+            _log.debug("Running: exchangeCheck");           
+            ClientSession ssn = Client.createSession(0);            
+            ExchangeQueryResult query = (ExchangeQueryResult) 
ssn.exchangeQuery("amq.direct").Result;
+            Assert.IsFalse(query.getNotFound());
+            Assert.IsTrue(query.getDurable());
+            query = (ExchangeQueryResult)ssn.exchangeQuery("amq.topic").Result;
+            Assert.IsFalse(query.getNotFound());
+            Assert.IsTrue(query.getDurable());           
+            query = (ExchangeQueryResult) ssn.exchangeQuery("foo").Result;     
      
+            Assert.IsTrue(query.getNotFound());
+        }
+
+        [Test]
+        public void exchangeBind()
+        {
+            _log.debug("Running: exchangeBind");       
+            ClientSession ssn = Client.createSession(0);
+            ssn.queueDeclare("queue1", null, null);
+            ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
+            // This test fails if an exception is thrown 
+        }
+
+
+    }
+}

Added: incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/TestCase.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/TestCase.cs?rev=694220&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/TestCase.cs (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/test/interop/TestCase.cs Thu 
Sep 11 04:39:47 2008
@@ -0,0 +1,93 @@
+/*
+*
+* 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.
+*
+*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml;
+using log4net.Config;
+using NUnit.Framework;
+using org.apache.qpid.client;
+
+namespace test.interop
+{
+    [TestFixture]
+
+    public class TestCase
+    {       
+        private readonly Dictionary<string,string> _properties = new 
Dictionary<string, string>();
+        private  Client _client;
+
+        [TestFixtureSetUp] 
+        public void Init()
+        {
+            XmlConfigurator.Configure(new FileInfo(".\\log.xml"));
+            // populate default properties
+            _properties.Add("UserName", "guest");
+            _properties.Add("Password", "guest");
+            _properties.Add("Host", "192.168.1.14");
+            _properties.Add("Port", "5673");
+            _properties.Add("VirtualHost", "test");
+             //Read the test config file  
+            XmlTextReader reader = new 
XmlTextReader(Environment.CurrentDirectory + ".\\test.config");
+            while (reader.Read())
+            {
+                XmlNodeType nType = reader.NodeType;               
+                // if node type is an element
+                if (reader.NodeType == XmlNodeType.Element && 
reader.Name.Equals("add"))
+                {
+                    Console.WriteLine("Element:" + reader.Name.ToString());
+                    if (_properties.ContainsKey(reader.GetAttribute("key")))
+                    {
+                        _properties[reader.GetAttribute("key")] = 
reader.GetAttribute("value");
+                    }
+                    else
+                    {
+                        _properties.Add(reader.GetAttribute("key"), 
reader.GetAttribute("value"));    
+                    }
+                    
+                }               
+            }
+            // create a client and connect to the broker
+            _client = new Client();
+            _client.connect(Properties["Host"], 
Convert.ToInt16(Properties["Port"]), Properties["VirtualHost"],
+                           Properties["UserName"], Properties["Password"]);    
       
+   
+        }
+
+        [TestFixtureTearDown]
+        public void Cleanup()
+        {
+         _client.close();
+        }
+
+        public Client Client
+        {
+            get{ return _client;}
+        }
+
+        public Dictionary<string,string> Properties
+        {
+            get { return _properties; }
+        }        
+
+    }
+}

Added: incubator/qpid/trunk/qpid/dotnet/client-010/test/test.config
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/test/test.config?rev=694220&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/test/test.config (added)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/test/test.config Thu Sep 11 
04:39:47 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+  <appSettings>
+    <add key="UserMame" value="guest"/>
+    <add key="Password" value="password"/>
+    <add key="Host" value="192.168.1.14"/>
+    <add key="Port" value="5673"/>
+    <add key="VirtualHost" value="test"/>
+  </appSettings>
+</configuration>
\ No newline at end of file

Modified: 
incubator/qpid/trunk/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs?rev=694220&r1=694219&r2=694220&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs 
(original)
+++ incubator/qpid/trunk/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs 
Thu Sep 11 04:39:47 2008
@@ -1,4 +1,23 @@
-
+/*
+*
+* 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.
+*
+*/
 using System;
 using NUnit.Framework;
 using org.apache.qpid.transport.util;


Reply via email to