1 8 package test.deployment; 9 10 import junit.framework.TestCase; 11 import test.annotation.DefaultValueTest; 12 import org.codehaus.aspectwerkz.transform.inlining.deployer.Deployer; 13 14 17 public class HotDeployedTest extends TestCase { 18 19 static int HIT = 0; 20 21 public void target() { 22 HIT++; 23 } 24 25 public void testDeployment() { 26 target(); 28 assertEquals(1, HIT); 29 assertEquals(1, HotdeployableAspect.HIT); 30 31 Deployer.undeploy(HotdeployableAspect.class); 33 34 target(); 35 assertEquals(2, HIT); 36 assertEquals(1, HotdeployableAspect.HIT); 37 38 Deployer.deploy(HotdeployableAspect.class); 40 target(); 41 assertEquals(3, HIT); 42 assertEquals(2, HotdeployableAspect.HIT); 43 } 44 45 46 47 48 public static void main(String [] args) { 49 junit.textui.TestRunner.run(suite()); 50 } 51 52 public static junit.framework.Test suite() { 53 return new junit.framework.TestSuite(HotDeployedTest.class); 54 } 55 56 } 57 | Popular Tags |