01: package org.objectweb.celtix.systest.securebasic;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: import org.objectweb.celtix.systest.common.ClientServerSetupBase;
07: import org.objectweb.celtix.systest.common.ClientServerTestBase;
08:
09: public class SecureBasicUtils extends ClientServerTestBase {
10:
11: private static final String BACK_TO_SRC_DIR = "../../../../../../../src/test/java/org/objectweb/celtix/systest/securebasic/";
12:
13: public static boolean startServer(String configFileLocation,
14: String beanId, String securityConfigurer,
15: ClientServerSetupBase cssb, Class clazz) {
16:
17: Map<String, String> props = new HashMap<String, String>();
18:
19: if (configFileLocation != null) {
20: props.put("celtix.config.file", configFileLocation);
21: }
22: if (securityConfigurer != null) {
23: props.put(beanId, securityConfigurer);
24: }
25: assertTrue("server did not launch correctly", cssb
26: .launchServer(clazz, props, null));
27: return true;
28: }
29:
30: protected static String getTestDir(Object obj) {
31: return obj.getClass().getResource(".").getPath()
32: + BACK_TO_SRC_DIR;
33: }
34:
35: }
|