activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r367748 - in /incubator/activemq/trunk/openwire-dotnet: ./ src/OpenWire.Client/ src/OpenWire.Client/Commands/ tests/OpenWire.Client/ tests/OpenWire.Client/IO/
Date Tue, 10 Jan 2006 19:30:23 GMT
Author: jstrachan
Date: Tue Jan 10 11:30:13 2006
New Revision: 367748

URL: http://svn.apache.org/viewcvs?rev=367748&view=rev
Log:
added compiling (but not working) unit test case

Added:
    incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ClientTest.cs
    incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/IO/
    incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestSupport.cs
Modified:
    incubator/activemq/trunk/openwire-dotnet/OpenWire.build
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQBytesMessage.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMapMessage.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMessage.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQObjectMessage.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQStreamMessage.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQTextMessage.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ConnectionFactory.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs
    incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs
    incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/OpenWire.Client.build

Modified: incubator/activemq/trunk/openwire-dotnet/OpenWire.build
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/OpenWire.build?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/OpenWire.build (original)
+++ incubator/activemq/trunk/openwire-dotnet/OpenWire.build Tue Jan 10 11:30:13 2006
@@ -163,7 +163,7 @@
             <buildfiles refid="tas.win32" />
         </nant>
         <!-- build OpenWire.Client.Tests assembly -->
-        <nant buildfile="tests/OpenWire.Client/OpenWire.Client.build" target="build" />
+        <nant buildfile="tests/OpenWire.Client/OpenWire.Client.build" target="test" />
         <!-- build tests for task assemblies -->
         <nant target="build">
             <buildfiles refid="tas.core.tests"/>

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQBytesMessage.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQBytesMessage.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQBytesMessage.cs
(original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQBytesMessage.cs
Tue Jan 10 11:30:13 2006
@@ -1,12 +1,3 @@
-//
-// Marshalling code for Open Wire Format for ActiveMQBytesMessage
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 using System.Collections;
 

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMapMessage.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMapMessage.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMapMessage.cs
(original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMapMessage.cs
Tue Jan 10 11:30:13 2006
@@ -1,12 +1,3 @@
-//
-// Marshalling code for Open Wire Format for ActiveMQMapMessage
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 using System.Collections;
 

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMessage.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMessage.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMessage.cs
(original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQMessage.cs
Tue Jan 10 11:30:13 2006
@@ -1,12 +1,3 @@
-//
-// Marshalling code for Open Wire Format for ActiveMQMessage
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 using System.Collections;
 

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQObjectMessage.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQObjectMessage.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQObjectMessage.cs
(original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQObjectMessage.cs
Tue Jan 10 11:30:13 2006
@@ -1,12 +1,3 @@
-//
-// Marshalling code for Open Wire Format for ActiveMQObjectMessage
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 using System.Collections;
 

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQStreamMessage.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQStreamMessage.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQStreamMessage.cs
(original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQStreamMessage.cs
Tue Jan 10 11:30:13 2006
@@ -1,12 +1,3 @@
-//
-// Marshalling code for Open Wire Format for ActiveMQStreamMessage
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 using System.Collections;
 

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQTextMessage.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQTextMessage.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQTextMessage.cs
(original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/ActiveMQTextMessage.cs
Tue Jan 10 11:30:13 2006
@@ -1,12 +1,3 @@
-//
-// Marshalling code for Open Wire Format for ActiveMQTextMessage
-//
-//
-// NOTE!: This file is autogenerated - do not modify!
-//        if you need to make a change, please see the Groovy scripts in the
-//        activemq-openwire module
-//
-
 using System;
 using System.Collections;
 
@@ -17,9 +8,14 @@
         public class ActiveMQTextMessage : ActiveMQMessage, ITextMessage {
                 public const byte ID_ActiveMQTextMessage = 28;
 
-
                 private String text;
 
+                public ActiveMQTextMessage() {
+                }
+
+                public ActiveMQTextMessage(String text) {
+                        this.text = text;
+                }
 
                 // TODO generate Equals method
                 // TODO generate GetHashCode method

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ConnectionFactory.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ConnectionFactory.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ConnectionFactory.cs (original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ConnectionFactory.cs Tue
Jan 10 11:30:13 2006
@@ -14,6 +14,14 @@
                 private string password;
                 private string clientId;
 
+                public ConnectionFactory() {
+                }
+
+                public ConnectionFactory(string host, int port) {
+                        this.host = host;
+                        this.port = port; 
+                }
+
                 public IConnection CreateConnection() {
                         return CreateConnection(userName, password); 
                 }

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs (original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs Tue Jan 10 11:30:13
2006
@@ -39,6 +39,20 @@
                 /// </summary>
                 ITopic GetTopic(string name); 
                 
-                
+        
+                /// <summary>
+                /// Creates a new message with an empty body
+                /// </summary>
+                IMessage CreateMessage();
+        
+                /// <summary>
+                /// Creates a new text message with an empty body
+                /// </summary>
+                ITextMessage CreateTextMessage();
+        
+                /// <summary>
+                /// Creates a new text message with the given body
+                /// </summary>
+                ITextMessage CreateTextMessage(string text);
         } 
 }

Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs (original)
+++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs Tue Jan 10 11:30:13
2006
@@ -50,11 +50,23 @@
                 }
 
                 public IQueue GetQueue(string name) {
-                        return new ActiveMQQueue(name);
+                        return new ActiveMQQueue(name); 
                 }
 
                 public ITopic GetTopic(string name) {
                         return new ActiveMQTopic(name); 
+                }
+
+                public IMessage CreateMessage() {
+                        return new ActiveMQMessage(); 
+                }
+
+                public ITextMessage CreateTextMessage() {
+                        return new ActiveMQTextMessage(); 
+                }
+
+                public ITextMessage CreateTextMessage(string text) {
+                        return new ActiveMQTextMessage(text); 
                 }
 
                 // Implementation methods

Added: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ClientTest.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ClientTest.cs?rev=367748&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ClientTest.cs (added)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ClientTest.cs Tue Jan 10
11:30:13 2006
@@ -0,0 +1,33 @@
+using System;
+using System.IO;
+
+using NUnit.Framework;
+
+using OpenWire.Client;
+
+namespace OpenWire.Client {
+
+        [ TestFixture ]
+        public class ClientTest : TestSupport {
+
+                [ Test ]
+                public void SendAndSyncReceive() {
+                        IConnectionFactory factory = new ConnectionFactory("localhost", 61616);
+                        
+                        using (IConnection connection = factory.CreateConnection()) {
+                                ISession session = connection.CreateSession();
+                                IDestination destination = session.GetQueue("FOO.BAR");
+                                IMessageConsumer consumer = session.CreateConsumer(destination);
+                                
+                                IMessageProducer producer = session.CreateProducer(destination);
+                                string expected = "Hello World!";
+                                ITextMessage request = session.CreateTextMessage(expected);
+                                producer.Send(request);
+                                
+                                ITextMessage message = (ITextMessage) consumer.Receive();
+                                
+                                Assert.AreEqual(expected, message.Text); 
+                        } 
+                } 
+        } 
+}

Modified: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/OpenWire.Client.build
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/OpenWire.Client.build?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/OpenWire.Client.build (original)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/OpenWire.Client.build Tue
Jan 10 11:30:13 2006
@@ -1,32 +1,40 @@
-<?xml version="1.0"?>
-<project name="OpenWire.Core" default="build">
-    <!--
-        Required properties:
-            * build.dir             - (path) root level to build to, assemblies will go in
${build.dir}/bin
-            * build.debug           - (true|false) debug build?
-            * current.build.defines - framework-specific build defines
-    -->
-    <target name="build">
-        <!-- build OpenWire.Core -->
-        <csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}"
output="${build.dir}/bin/${project.name}.dll" doc="${build.dir}/bin/${project.name}.xml">
-            <nowarn>
-                <!-- do not report warnings for missing XML comments -->
-                <warning number="1591" />
-                <!-- do not report deprecation warnings -->
-                <warning number="0618" />
-            </nowarn>
-            <sources failonempty="true">
-                <include name="**/*.cs" />
-                <!-- common assembly-level attributes -->
-                <include name="../CommonAssemblyInfo.cs" />               
-            </sources>                       
-            <resources basedir="Resources">
-                <include name="**/*" />
-            </resources>
-            <references>
-                <include name="${build.dir}/bin/log4net.dll"/>
-                <include name="System.Web.dll"/>
-            </references>
-        </csc>
-    </target>
-</project>
+<?xml version="1.0"?>
+<project name="OpenWire.Core" default="test">
+    <!--
+        Required properties:
+            * build.dir             - (path) root level to build to, assemblies will go in
${build.dir}/bin
+            * build.debug           - (true|false) debug build?
+            * current.build.defines - framework-specific build defines
+    -->
+    <target name="build">
+        <!-- build test assembly -->
+        <csc target="library" define="${current.build.defines}" warnaserror="true" debug="${build.debug}"
output="${build.dir}/bin/${project.name}.Tests.dll">
+            <nowarn>
+                <!-- do not report warnings for missing XML comments -->
+                <warning number="1591" />
+                <!-- do not report deprecation warnings -->
+                <warning number="0618" />
+            </nowarn>
+            <sources failonempty="true">
+                <include name="**/*.cs" />
+                <!-- common assembly-level attributes -->
+                <include name="../../src/CommonAssemblyInfo.cs" />
+            </sources>
+            <references>
+                <include name="${lib.framework.dir}/log4net.dll" />
+                <include name="${build.dir}/bin/openwire.dll" />
+                <include name="${lib.framework.dir}/nunit.framework.dll" />
+            </references>
+            <resources failonempty="false" basedir="Resources" dynamicprefix="true" prefix="XML:">
+                <include name="**/*.xml"/>
+            </resources>
+        </csc>
+    </target>
+    <target name="test" depends="build">
+         <nunit2>
+            <formatter type="Plain" />
+            <test assemblyname="${build.dir}/bin/${project.name}.Tests.dll" appconfig="${path::combine(nant.location,
'nant.tests.config')}">
+            </test>
+         </nunit2>
+    </target>
+</project>

Added: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestSupport.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestSupport.cs?rev=367748&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestSupport.cs (added)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestSupport.cs Tue Jan
10 11:30:13 2006
@@ -0,0 +1,13 @@
+using System;
+using System.IO;
+
+using OpenWire.Client;
+
+namespace OpenWire.Client {
+
+        /// <summary>
+        /// useful base class for test cases
+        /// </summary>
+        public abstract class TestSupport {
+        } 
+}



Mime
View raw message