1 20 package org.apache.cactus.framework.internal.orchestrator; 21 22 import junit.framework.AssertionFailedError; 23 import junit.framework.TestCase; 24 25 public class OrchestratorClientTest extends TestCase 26 { 27 private OrchestratorClient client; 28 private Orchestrator orchestrator; 29 30 protected void setUp() 31 { 32 orchestrator = new Orchestrator(7777); 33 client = new OrchestratorClient(); 34 try 35 { 36 orchestrator.start(); 37 } 38 catch (Throwable t) 39 { 40 throw new AssertionFailedError("Failed to start orchestrator [" 41 + t.getMessage() + "]"); 42 43 } 44 } 45 46 protected void tearDown() 47 { 48 try 49 { 50 orchestrator.stop(); 51 } 52 catch (InterruptedException e) 53 { 54 throw new AssertionFailedError("Failed to stop orchestrator [" 55 + e.getMessage() + "]"); 56 } 57 } 58 59 public void testPrepareTestWhenOrchestratorStarted() throws Throwable 60 { 61 client.setTest("testXXX"); 62 assertEquals("testXXX", client.getTest()); 63 } 64 } 65 | Popular Tags |