KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > spring > integrationtests > framework > ServerTestSetup


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest.spring.integrationtests.framework;
5
6 import java.io.IOException JavaDoc;
7
8 import junit.extensions.TestSetup;
9 import junit.framework.TestSuite;
10
11 public class ServerTestSetup extends TestSetup {
12
13   private final Class JavaDoc testClass;
14   protected ServerManager sm;
15
16   public ServerTestSetup(Class JavaDoc testClass) {
17     super(new TestSuite(testClass));
18     this.testClass = testClass;
19   }
20
21   protected void setUp() throws Exception JavaDoc {
22     sm = ServerManagerUtil.startAndBind(testClass, isWithPersistentStore());
23   }
24
25   protected void tearDown() throws Exception JavaDoc {
26     ServerManagerUtil.stopAndRelease(sm);
27   }
28
29   public DeploymentBuilder makeDeploymentBuilder() throws IOException JavaDoc {
30     return sm.makeDeploymentBuilder();
31   }
32
33   public DeploymentBuilder makeDeploymentBuilder(String JavaDoc warFileName) {
34     return sm.makeDeploymentBuilder(warFileName);
35   }
36
37   public boolean isWithPersistentStore() {
38     return false;
39   }
40   
41 }
42
Popular Tags