1 /* 2 * @(#)ExpirationTest.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.Expiration). 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:43:11 25 */ 26 27 public class ExpirationTest extends TestCase { 28 29 private Expiration expiration1; 30 private Expiration expiration2; 31 private Expiration expiration3; 32 33 /*** 34 * Constructor for ExpirationTest. 35 * 36 * @param arg0 37 */ 38 public ExpirationTest(String arg0) { 39 super(arg0); 40 } 41 42 public static void main(String[] args) { 43 junit.textui.TestRunner.run(ExpirationTest.class); 44 } 45 46 /*** 47 * @see TestCase#setUp() 48 */ 49 protected void setUp() { 50 expiration1 = new Expiration(); 51 try { 52 expiration2 = new Expiration(1000); 53 } catch (JMSException e) { 54 e.printStackTrace(); 55 System.out.println(e.getMessage()); 56 } 57 try { 58 expiration3 = new Expiration(8000); 59 } catch (JMSException e) { 60 e.printStackTrace(); 61 System.out.println(e.getMessage()); 62 } 63 } 64 65 /*** 66 * Test for void Expiration() 67 */ 68 public void testExpiration() { 69 String expected = "Expiration value : 0"; 70 assertEquals(expected, expiration1.toString()); 71 } 72 73 /*** 74 * Test for void Expiration(long) 75 */ 76 public void testExpirationJ() { 77 String expected = "Expiration value : 1000"; 78 assertEquals(expected, expiration2.toString()); 79 } 80 81 /*** 82 * Test for long getExpiration() 83 */ 84 public void testGetExpiration() { 85 long expected = 8000; 86 assertEquals(expected, expiration3.getExpiration()); 87 } 88 }

This page was automatically generated by Maven