1 4 package com.tc.object.tx; 5 6 import junit.framework.TestCase; 7 8 public class WaitInvocationTest extends TestCase { 9 10 public void testCstrs() throws Exception { 11 WaitInvocation wait0 = new WaitInvocation(); 12 assertEquals(WaitInvocation.NO_ARGS, wait0.getSignature()); 13 14 WaitInvocation wait1 = new WaitInvocation(1); 15 assertEquals(WaitInvocation.LONG, wait1.getSignature()); 16 assertEquals(1, wait1.getMillis()); 17 18 WaitInvocation wait2 = new WaitInvocation(2, 3); 19 assertEquals(WaitInvocation.LONG_INT, wait2.getSignature()); 20 assertEquals(2, wait2.getMillis()); 21 assertEquals(3, wait2.getNanos()); 22 23 new WaitInvocation(0); 24 new WaitInvocation(1); 25 new WaitInvocation(Long.MAX_VALUE); 26 27 try { 28 new WaitInvocation(-1); 29 fail("no exception thrown"); 30 } catch (IllegalArgumentException iae) { 31 } 33 34 new WaitInvocation(0, 0); 35 new WaitInvocation(1, 0); 36 new WaitInvocation(Long.MAX_VALUE, 0); 37 new WaitInvocation(Long.MAX_VALUE, Integer.MAX_VALUE); 38 39 try { 40 new WaitInvocation(-1, 0); 41 fail("no exception thrown"); 42 } catch (IllegalArgumentException iae) { 43 } 45 46 try { 47 new WaitInvocation(-1, -1); 48 fail("no exception thrown"); 49 } catch (IllegalArgumentException iae) { 50 } 52 53 try { 54 new WaitInvocation(0, -1); 55 fail("no exception thrown"); 56 } catch (IllegalArgumentException iae) { 57 } 59 } 60 61 } | Popular Tags |