KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > framework > internal > orchestrator > OrchestratorClientTest


1 /*
2  * ========================================================================
3  *
4  * Copyright 2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * ========================================================================
19  */

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 JavaDoc 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 JavaDoc e)
53         {
54             throw new AssertionFailedError("Failed to stop orchestrator ["
55                 + e.getMessage() + "]");
56         }
57     }
58     
59     public void testPrepareTestWhenOrchestratorStarted() throws Throwable JavaDoc
60     {
61         client.setTest("testXXX");
62         assertEquals("testXXX", client.getTest());
63     }
64 }
65
Popular Tags