01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.spring.integrationtests;
05:
06: import org.apache.commons.logging.LogFactory;
07: import org.apache.log4j.Logger;
08: import org.springframework.beans.factory.BeanFactory;
09:
10: import com.tc.test.TestConfigObject;
11: import com.tc.test.server.appserver.deployment.DeploymentBuilder;
12: import com.tc.test.server.appserver.deployment.ServerTestSetup;
13:
14: import java.io.IOException;
15:
16: public class SpringServerTestSetup extends ServerTestSetup {
17:
18: public SpringServerTestSetup(Class testClass) {
19: super (testClass);
20: }
21:
22: public DeploymentBuilder makeDeploymentBuilder() throws IOException {
23: return addSpringVariant(getServerManager()
24: .makeDeploymentBuilder());
25: }
26:
27: public DeploymentBuilder makeDeploymentBuilder(String warFileName) {
28: return addSpringVariant(getServerManager()
29: .makeDeploymentBuilder(warFileName));
30: }
31:
32: private DeploymentBuilder addSpringVariant(DeploymentBuilder builder) {
33: // All spring tests need these I guess
34: builder.addDirectoryOrJARContainingClass(LogFactory.class); // commons-logging
35: builder.addDirectoryOrJARContainingClass(Logger.class); // log4j
36:
37: return builder
38: .addDirectoryOrJARContainingClassOfSelectedVersion(
39: BeanFactory.class,
40: new String[] { TestConfigObject.SPRING_VARIANT }); // springframework
41: }
42:
43: }
|