1 4 package org.oddjob.arooa; 5 6 import junit.framework.TestCase; 7 8 11 public class LifecycleTest extends TestCase { 12 13 public static class N { 14 } 15 16 public static class O { 17 public void setContext(ArooaContext c) {} 18 } 19 20 public static class P { 21 public boolean setContext(ArooaContext c) { 22 return true; 23 } 24 } 25 26 public static class Q { 27 public boolean setContext(ArooaContext c) { 28 return false; 29 } 30 } 31 public void testContext() { 32 boolean r; 33 34 N n = new N(); 35 36 r = Lifecycle.setContext(n, new ArooaContext()); 37 assertFalse(r); 38 39 O o = new O(); 40 41 r= Lifecycle.setContext(o, new ArooaContext()); 42 assertTrue(r); 43 44 P p = new P(); 45 r = Lifecycle.setContext(p, new ArooaContext()); 46 assertTrue(r); 47 48 Q q = new Q(); 49 r = Lifecycle.setContext(q, new ArooaContext()); 50 assertFalse(r); 51 52 } 53 } 54 | Popular Tags |