Missed a few in the refactor

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-03-09 07:15:58 +00:00
parent c40f989966
commit 8bbca4d6cb
17 changed files with 108 additions and 93 deletions

View File

@ -206,15 +206,15 @@
<Compile Include="src\test\csharp\ActiveMQ\OpenWire\EndianTest.cs"/> <Compile Include="src\test\csharp\ActiveMQ\OpenWire\EndianTest.cs"/>
<Compile Include="src\test\csharp\ActiveMQ\TestMain.cs"/> <Compile Include="src\test\csharp\ActiveMQ\TestMain.cs"/>
<Compile Include="src\test\csharp\CommonAssemblyInfo.cs"/> <Compile Include="src\test\csharp\CommonAssemblyInfo.cs"/>
<Compile Include="src\test\csharp\JMS\AsyncConsumeTest.cs"/> <Compile Include="src\test\csharp\NMS\AsyncConsumeTest.cs"/>
<Compile Include="src\test\csharp\JMS\BadConsumeTest.cs"/> <Compile Include="src\test\csharp\NMS\BadConsumeTest.cs"/>
<Compile Include="src\test\csharp\JMS\BytesMessageTest.cs"/> <Compile Include="src\test\csharp\NMS\BytesMessageTest.cs"/>
<Compile Include="src\test\csharp\JMS\ConsumerTest.cs"/> <Compile Include="src\test\csharp\NMS\ConsumerTest.cs"/>
<Compile Include="src\test\csharp\JMS\JMSPropertyTest.cs"/> <Compile Include="src\test\csharp\NMS\JMSPropertyTest.cs"/>
<Compile Include="src\test\csharp\JMS\JMSTestSupport.cs"/> <Compile Include="src\test\csharp\NMS\JMSTestSupport.cs"/>
<Compile Include="src\test\csharp\JMS\MapMessageTest.cs"/> <Compile Include="src\test\csharp\NMS\MapMessageTest.cs"/>
<Compile Include="src\test\csharp\JMS\MessageTest.cs"/> <Compile Include="src\test\csharp\NMS\MessageTest.cs"/>
<Compile Include="src\test\csharp\JMS\TextMessage.cs"/> <Compile Include="src\test\csharp\NMS\TextMessage.cs"/>
<Compile Include="src\test\csharp\JMS\TransactionTest.cs"/> <Compile Include="src\test\csharp\NMS\TransactionTest.cs"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,56 +1,55 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
using System; using System;
using System.Collections; using System.Collections;
using ActiveMQ.OpenWire; using ActiveMQ.OpenWire;
using ActiveMQ.Commands; using ActiveMQ.Commands;
using JMS;
namespace ActiveMQ.Commands
namespace ActiveMQ.Commands {
{ //
// // Marshalling code for Open Wire Format for ActiveMQObjectMessage
// Marshalling code for Open Wire Format for ActiveMQObjectMessage //
// //
// // NOTE!: This file is autogenerated - do not modify!
// NOTE!: This file is autogenerated - do not modify! // if you need to make a change, please see the Groovy scripts in the
// if you need to make a change, please see the Groovy scripts in the // activemq-core module
// activemq-core module //
// public class ActiveMQObjectMessage : ActiveMQMessage
public class ActiveMQObjectMessage : ActiveMQMessage {
{ public const byte ID_ActiveMQObjectMessage = 26;
public const byte ID_ActiveMQObjectMessage = 26;
public override string ToString() {
public override string ToString() { return GetType().Name + "["
return GetType().Name + "[" + " ]";
+ " ]";
}
}
public override byte GetDataStructureType() {
public override byte GetDataStructureType() { return ID_ActiveMQObjectMessage;
return ID_ActiveMQObjectMessage; }
}
// Properties
// Properties
}
} }
}

View File

@ -16,7 +16,6 @@
*/ */
using ActiveMQ.Commands; using ActiveMQ.Commands;
using ActiveMQ.Transport; using ActiveMQ.Transport;
using JMS;
using System; using System;
namespace ActiveMQ.Transport namespace ActiveMQ.Transport

View File

@ -16,7 +16,6 @@
*/ */
using ActiveMQ.Commands; using ActiveMQ.Commands;
using ActiveMQ.Transport; using ActiveMQ.Transport;
using JMS;
using System; using System;
namespace ActiveMQ.Transport namespace ActiveMQ.Transport

View File

@ -20,7 +20,6 @@ using System.Collections;
using ActiveMQ.Commands; using ActiveMQ.Commands;
using ActiveMQ.Transport; using ActiveMQ.Transport;
using JMS;
namespace ActiveMQ.Transport namespace ActiveMQ.Transport
{ {

View File

@ -16,7 +16,6 @@
*/ */
using ActiveMQ.Commands; using ActiveMQ.Commands;
using ActiveMQ.Transport; using ActiveMQ.Transport;
using JMS;
using System; using System;
namespace ActiveMQ.Transport namespace ActiveMQ.Transport

View File

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
using JMS;
using NUnit.Framework; using NUnit.Framework;
using System; using System;
using System.IO; using System.IO;

View File

@ -20,7 +20,8 @@ using System;
using System.Threading; using System.Threading;
namespace JMS
namespace NMS
{ {
[TestFixture] [TestFixture]
public class AsyncConsumeTest : JMSTestSupport public class AsyncConsumeTest : JMSTestSupport
@ -43,7 +44,7 @@ namespace JMS
[Test] [Test]
public void TestAsynchronousConsume() public void TestAsynchronousConsume()
{ {
// lets create an async consumer // lets create an async consumer
// START SNIPPET: demo // START SNIPPET: demo
IMessageConsumer consumer = session.CreateConsumer(this.Destination); IMessageConsumer consumer = session.CreateConsumer(this.Destination);
@ -87,3 +88,4 @@ namespace JMS
} }
} }

View File

@ -19,7 +19,8 @@ using NUnit.Framework;
using System; using System;
namespace JMS
namespace NMS
{ {
[TestFixture] [TestFixture]
public class BadConsumeTest : JMSTestSupport public class BadConsumeTest : JMSTestSupport
@ -54,3 +55,4 @@ namespace JMS
} }
} }

View File

@ -19,7 +19,8 @@ using NUnit.Framework;
using System; using System;
namespace JMS
namespace NMS
{ {
[ TestFixture ] [ TestFixture ]
public class BytesMessageTest : JMSTestSupport public class BytesMessageTest : JMSTestSupport
@ -66,3 +67,4 @@ namespace JMS
} }

View File

@ -18,7 +18,8 @@ using NMS;
using NUnit.Framework; using NUnit.Framework;
namespace JMS
namespace NMS
{ {
[TestFixture] [TestFixture]
public class ConsumerTest : JMSTestSupport public class ConsumerTest : JMSTestSupport
@ -62,7 +63,7 @@ namespace JMS
message.Properties["color"] = "red"; message.Properties["color"] = "red";
producer.Send(message); producer.Send(message);
IMessage m = consumer.Receive(receiveTimeout ); IMessage m = consumer.Receive(receiveTimeout);
Assert.IsNotNull(m); Assert.IsNotNull(m);
Assert.AreEqual("1st", ((ITextMessage)m).Text); Assert.AreEqual("1st", ((ITextMessage)m).Text);
@ -89,3 +90,4 @@ namespace JMS
} }

View File

@ -20,7 +20,8 @@ using NUnit.Framework;
using System; using System;
namespace JMS
namespace NMS
{ {
[ TestFixture ] [ TestFixture ]
public class JMSPropertyTest : JMSTestSupport public class JMSPropertyTest : JMSTestSupport
@ -136,3 +137,4 @@ namespace JMS
} }

View File

@ -21,7 +21,8 @@ using System;
/// <summary> /// <summary>
/// useful base class for test cases /// useful base class for test cases
/// </summary> /// </summary>
namespace JMS
namespace NMS
{ {
[ TestFixture ] [ TestFixture ]
public abstract class JMSTestSupport public abstract class JMSTestSupport
@ -59,7 +60,7 @@ namespace JMS
Assert.IsNotNull(connection != null, "no session created"); Assert.IsNotNull(connection != null, "no session created");
Console.WriteLine("Connected."); Console.WriteLine("Connected.");
} }
virtual protected void Disconnect() virtual protected void Disconnect()
{ {
@ -88,7 +89,7 @@ namespace JMS
// Should only need to wait for first message to arrive due to the way // Should only need to wait for first message to arrive due to the way
// prefetching works. // prefetching works.
IMessage msg = consumer.Receive(receiveTimeout); IMessage msg = consumer.Receive(receiveTimeout);
while (msg!= null) while (msg != null)
{ {
msg = consumer.ReceiveNoWait(); msg = consumer.ReceiveNoWait();
} }
@ -105,14 +106,15 @@ namespace JMS
IMessage request = CreateMessage(); IMessage request = CreateMessage();
producer.Send(request); producer.Send(request);
IMessage message = consumer.Receive(receiveTimeout); IMessage message = consumer.Receive(receiveTimeout);
Assert.IsNotNull(message, "No message returned!"); Assert.IsNotNull(message, "No message returned!");
AssertValidMessage(message); AssertValidMessage(message);
} }
} }
protected virtual IConnectionFactory CreateConnectionFactory() { protected virtual IConnectionFactory CreateConnectionFactory()
{
return new ActiveMQ.ConnectionFactory(new Uri("tcp://localhost:61616")); return new ActiveMQ.ConnectionFactory(new Uri("tcp://localhost:61616"));
} }
@ -126,7 +128,7 @@ namespace JMS
IMessageProducer producer = session.CreateProducer(destination); IMessageProducer producer = session.CreateProducer(destination);
return producer; return producer;
} }
protected virtual IMessageConsumer CreateConsumer() protected virtual IMessageConsumer CreateConsumer()
{ {
IMessageConsumer consumer = session.CreateConsumer(destination); IMessageConsumer consumer = session.CreateConsumer(destination);
@ -157,7 +159,8 @@ namespace JMS
public IDestination Destination public IDestination Destination
{ {
get { get {
if( destination == null ) { if (destination == null)
{
destination = CreateDestination(); destination = CreateDestination();
Assert.IsNotNull(destination, "No destination available!"); Assert.IsNotNull(destination, "No destination available!");
Console.WriteLine("Using destination: " + destination); Console.WriteLine("Using destination: " + destination);
@ -172,3 +175,4 @@ namespace JMS
} }
} }

View File

@ -19,7 +19,8 @@ using NUnit.Framework;
using System; using System;
namespace JMS
namespace NMS
{ {
[ TestFixture ] [ TestFixture ]
public class MapMessageTest : JMSTestSupport public class MapMessageTest : JMSTestSupport
@ -112,7 +113,7 @@ namespace JMS
Assert.AreEqual(j, mapMessage.Body.GetShort("j"), "map entry: j"); Assert.AreEqual(j, mapMessage.Body.GetShort("j"), "map entry: j");
Assert.AreEqual(k, mapMessage.Body.GetInt("k"), "map entry: k"); Assert.AreEqual(k, mapMessage.Body.GetInt("k"), "map entry: k");
Assert.AreEqual(l, mapMessage.Body.GetLong("l"), "map entry: l"); Assert.AreEqual(l, mapMessage.Body.GetLong("l"), "map entry: l");
} }
protected string ToHex(long value) protected string ToHex(long value)
@ -122,3 +123,4 @@ namespace JMS
} }
} }

View File

@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
using JMS;
using NMS; using NMS;
using NUnit.Framework; using NUnit.Framework;
using System; using System;
namespace tests
namespace NMS
{ {
[ TestFixture ] [ TestFixture ]
public class MessageTest : JMSTestSupport public class MessageTest : JMSTestSupport
@ -119,3 +119,4 @@ namespace tests
} }
} }

View File

@ -19,7 +19,8 @@ using NUnit.Framework;
using System; using System;
namespace JMS
namespace NMS
{ {
[ TestFixture ] [ TestFixture ]
public class TextMessage : JMSTestSupport public class TextMessage : JMSTestSupport
@ -62,3 +63,4 @@ namespace JMS
} }

View File

@ -19,7 +19,8 @@ using NUnit.Framework;
using System; using System;
using System.Collections; using System.Collections;
namespace JMS
namespace NMS
{ {
[TestFixture] [TestFixture]
public class TransactionTest : JMSTestSupport public class TransactionTest : JMSTestSupport
@ -43,7 +44,7 @@ namespace JMS
base.TearDown(); base.TearDown();
} }
[Test] [Test]
public void TestSendRollback() public void TestSendRollback()
{ {
@ -249,3 +250,4 @@ namespace JMS
} }
} }