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.AbstractTwoServerDeploymentTest.TwoServerTestSetup;
13:
14: import java.io.IOException;
15:
16: public abstract class SpringTwoServerTestSetup extends
17: TwoServerTestSetup {
18:
19: protected SpringTwoServerTestSetup(Class testClass,
20: String tcConfigFile, String context) {
21: super (testClass, tcConfigFile, context);
22: }
23:
24: public DeploymentBuilder makeDeploymentBuilder() throws IOException {
25: return addSpringVariant(getServerManager()
26: .makeDeploymentBuilder());
27: }
28:
29: public DeploymentBuilder makeDeploymentBuilder(String warFileName) {
30: return addSpringVariant(getServerManager()
31: .makeDeploymentBuilder(warFileName));
32: }
33:
34: private DeploymentBuilder addSpringVariant(DeploymentBuilder builder) {
35: // All spring tests need these I guess
36: builder.addDirectoryOrJARContainingClass(LogFactory.class); // commons-logging
37: builder.addDirectoryOrJARContainingClass(Logger.class); // log4j
38:
39: return builder
40: .addDirectoryOrJARContainingClassOfSelectedVersion(
41: BeanFactory.class,
42: new String[] { TestConfigObject.SPRING_VARIANT }); // springframework
43: }
44:
45: }
|