1 /*
2 * @(#)PriorityTest.java
3 *
4 * JFoxMQ the open source JMS MOM.
5 *
6 * Corpyright 2002-2003 Huihoo Power, Inc. All Rights Reserved. This software
7 * is licensed under LGPL license.
8 *
9 * For more information, please visit: http://www.huihoo.org
10 */
11
12 package org.huihoo.jfox.ms.jms.message;
13
14 import javax.jms.JMSException;
15
16 import junit.framework.TestCase;
17
18 /***
19 * <p>
20 * JUnit test case for the {@link org.huihoo.jfoxms.jms.message.Priority).
21 * </p>
22 *
23 * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter.Cheng</a>
24 * @version Revision: 1.1 Date: 2002-12-02 20:09:11
25 */
26
27 public class PriorityTest extends TestCase {
28
29 private Priority priority1;
30 private Priority priority2;
31 private Priority priority3;
32
33 /***
34 * Constructor for PriorityTest.
35 *
36 * @param arg0
37 */
38 public PriorityTest(String arg0) {
39 super(arg0);
40 }
41
42 /***
43 * @see TestCase#setUp()
44 */
45 protected void setUp() {
46 priority1 = new Priority();
47 try {
48 priority2 = new Priority(2);
49 } catch (JMSException e) {
50 e.printStackTrace();
51 System.out.println(e.getMessage());
52 }
53 try {
54 priority3 = new Priority(3);
55 } catch (JMSException e) {
56 e.printStackTrace();
57 System.out.println(e.getMessage());
58 }
59 }
60
61 public static void main(String[] args) {
62 junit.textui.TestRunner.run(PriorityTest.class);
63 }
64
65 /***
66 * Test for void Priority()
67 */
68 public void testPriority() {
69 String expected = "Priority 0";
70 assertEquals(expected, priority1.toString());
71 }
72
73 /*
74 * Test for void Priority(int)
75 */
76 public void testPriorityI() {
77 String expected = "Priority 2";
78 assertEquals(expected, priority2.toString());
79 }
80
81 /***
82 * Test for int getDefaultPriority()
83 */
84 public void testGetPriority() {
85 int expected = 3;
86 assertEquals(expected, priority3.getPriority());
87 }
88 }
This page was automatically generated by Maven