1 package com.jcorporate.expresso.core.registry; 2 3 import com.jcorporate.expresso.core.security.SuperUser; 4 import com.jcorporate.expresso.services.test.TestSystemInitializer; 5 import junit.framework.TestCase; 6 7 14 public class TestExpressoThread extends TestCase { 15 private ExpressoThread expressoThread = null; 16 17 protected void setUp() throws Exception { 18 super.setUp(); 19 expressoThread = new ExpressoThread(); 20 RequestRegistry.superUser(SuperUser.SUPER_USER); 22 } 23 24 protected void tearDown() throws Exception { 25 expressoThread = null; 26 RequestRegistry.revertUser(); 28 super.tearDown(); 29 } 30 31 public void testExpressoThreadRequestRegistry() 32 throws InterruptedException { 33 ExpressoThreadTestModel model = new ExpressoThreadTestModel(); 34 model.start(); 35 model.join(5000); if (model.isAlive()) { 39 fail("Test Thread Model didn't end in 5 seconds"); 40 } 41 42 assertEquals(TestSystemInitializer.getTestContext(), 43 model.getDataContext()); 44 45 assertEquals(SuperUser.SUPER_USER, model.getUser()); 46 } 47 48 } 49 | Popular Tags |