1 package org.sapia.ubik.rmi.interceptor; 2 3 import junit.framework.TestCase; 4 5 6 14 public class MultiDispatcherTest extends TestCase { 15 19 public MultiDispatcherTest(String arg0) { 20 super(arg0); 21 } 22 23 public void testAdd() throws Exception { 24 MultiDispatcher d = new MultiDispatcher(); 25 TestInterceptor t = new TestInterceptor(); 26 d.addInterceptor(TestEvent.class, t); 27 } 28 29 public void testMultiAdd() throws Exception { 30 MultiDispatcher d = new MultiDispatcher(); 31 TestInterceptor t1 = new TestInterceptor(); 32 TestInterceptor t2 = new TestInterceptor(); 33 d.addInterceptor(TestEvent.class, t1); 34 d.addInterceptor(TestEvent.class, t2); 35 } 36 37 public void testDispatch() throws Exception { 38 MultiDispatcher d = new MultiDispatcher(); 39 TestInterceptor t1 = new TestInterceptor(); 40 TestInterceptor t2 = new TestInterceptor(); 41 d.addInterceptor(TestEvent.class, t1); 42 d.addInterceptor(TestEvent.class, t2); 43 d.dispatch(new TestEvent()); 44 super.assertEquals(1, t1.count); 45 super.assertEquals(1, t2.count); 46 } 47 } 48 | Popular Tags |