Author |
Message
|
ninjaprogrammer |
Posted: Wed Mar 02, 2011 6:56 am Post subject: Unit Testing in .net |
|
|
Novice
Joined: 01 Mar 2011 Posts: 10
|
Im using the lateest version of XMS (2.0.0.4) and im trying to find some way of clearing the Queue each time i run a unit test. I want to make sure that there is no duff messags on the Queue before i start each test.
Is ther a simple way of doing it or do need to read all the messages off one at a time.
I want to do this using the XMS .net API's not using RfhUTIL or similiar as the test all needto be part of a automated build process. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 7:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
ninjaprogrammer |
Posted: Wed Mar 02, 2011 7:27 am Post subject: |
|
|
Novice
Joined: 01 Mar 2011 Posts: 10
|
I had read about these on other pot but unsure how i shouild call them using .net and indeed which namespace i need to include. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 7:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You could also just run a command shell and send CLEAR QLOCAL to runmqsc.
Also, remember, just because you want to run an automated task, doesn't mean you have to use a full programming language to do it. shell scripting can be very useful. |
|
Back to top |
|
 |
ninjaprogrammer |
Posted: Wed Mar 02, 2011 8:00 am Post subject: |
|
|
Novice
Joined: 01 Mar 2011 Posts: 10
|
runmqsc is not included as part of the client tools. Is there a similiar version for the client tools. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 02, 2011 8:13 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ninjaprogrammer wrote: |
runmqsc is not included as part of the client tools. Is there a similiar version for the client tools. |
Try support pack MO72 (mqsc).  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 8:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
you didn't mention anything about client install before...
There is a supportPac that provides a client runmqsc.
Regardless, you can use basic MQ .NET methods to write PCF fields into a message, even if the .NET classes do not provide a helper method for the CLEAR command. |
|
Back to top |
|
 |
ninjaprogrammer |
Posted: Thu Mar 03, 2011 3:28 am Post subject: |
|
|
Novice
Joined: 01 Mar 2011 Posts: 10
|
mqjeff wrote: |
Regardless, you can use basic MQ .NET methods to write PCF fields into a message, even if the .NET classes do not provide a helper method for the CLEAR command. |
Cant find any examples on howthis might be done wtht eh wonderfull google have you got any sample code that i can look at. As my limit of MQextends to the Sample code thats provided with the client tools V7.014 |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 03, 2011 4:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I am confused. I thought you were a ninja programmer? Surely you don't need sample code?
I don't use .NET. I assume it has methods like the java classes do to Write Integers and Write Characters and etc. to the body of the message. You can use those to write the appropriate fields of the PCF message in the appropriate order.
There should be at least C language samples for constructing PCF messages that you can find. It should be a SMOP to turn those into .NET C# code. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Mar 04, 2011 12:18 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
|