1 package org.jboss.cache.marshall; 2 3 import junit.framework.TestCase; 4 import org.jboss.cache.GlobalTransaction; 5 6 9 public class MethodCallFactoryTest extends TestCase 10 { 11 public void testVarArgsMethod() 12 { 13 GlobalTransaction gtx = new GlobalTransaction(); 14 MethodCall c = MethodCallFactory.create(MethodDeclarations.commitMethod, gtx); 15 16 assertEquals(gtx, c.getArgs()[0]); 17 } 18 19 public void testObjectArrayMethod() 20 { 21 GlobalTransaction gtx = new GlobalTransaction(); 22 MethodCall c = MethodCallFactory.create(MethodDeclarations.commitMethod, new Object []{gtx}); 23 24 assertEquals(gtx, c.getArgs()[0]); 25 } 26 27 public void testMultipleArrayElems() 28 { 29 GlobalTransaction gtx = new GlobalTransaction(); 30 MethodCall c = MethodCallFactory.create(MethodDeclarations.commitMethod, new Object []{gtx, gtx, gtx}); 31 32 assertEquals(gtx, c.getArgs()[0]); 33 assertEquals(gtx, c.getArgs()[1]); 34 assertEquals(gtx, c.getArgs()[2]); 35 36 assertEquals(3, c.getArgs().length); 37 } 38 39 } 40 | Popular Tags |