KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > systest > securebasic > SecureBasicUtils


1 package org.objectweb.celtix.systest.securebasic;
2
3 import java.util.HashMap JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import org.objectweb.celtix.systest.common.ClientServerSetupBase;
7 import org.objectweb.celtix.systest.common.ClientServerTestBase;
8
9 public class SecureBasicUtils extends ClientServerTestBase {
10     
11     private static final String JavaDoc BACK_TO_SRC_DIR =
12         "../../../../../../../src/test/java/org/objectweb/celtix/systest/securebasic/";
13     
14     public static boolean startServer(String JavaDoc configFileLocation,
15                                          String JavaDoc beanId,
16                                          String JavaDoc securityConfigurer,
17                                          ClientServerSetupBase cssb,
18                                          Class JavaDoc clazz) {
19         
20         Map JavaDoc<String JavaDoc, String JavaDoc> props = new HashMap JavaDoc<String JavaDoc, String JavaDoc>();
21         
22         if (configFileLocation != null) {
23             props.put("celtix.config.file", configFileLocation);
24         }
25         if (securityConfigurer != null) {
26             props.put(beanId, securityConfigurer);
27         }
28         assertTrue("server did not launch correctly", cssb.launchServer(clazz, props, null));
29         return true;
30     }
31     
32     protected static String JavaDoc getTestDir(Object JavaDoc obj) {
33         return obj.getClass().getResource(".").getPath() + BACK_TO_SRC_DIR;
34     }
35     
36  
37     
38 }
39
Popular Tags