KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > TestConfig


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces;
17
18 import java.io.IOException JavaDoc;
19 import java.util.Properties JavaDoc;
20
21
22 /**
23  * DOCUMENT ME!
24  * @author Manfred Geiler (latest modification by $Author: matze $)
25  * @author Anton Koinov
26  * @version $Revision: 1.7 $ $Date: 2004/10/13 11:50:59 $
27  */

28 public class TestConfig
29 {
30     //~ Static fields/initializers -----------------------------------------------------------------
31

32     private static final String JavaDoc TEST_PROP_FILE = "test.properties";
33     private static final Properties JavaDoc _configProps = new Properties JavaDoc();
34
35     static
36     {
37         try
38         {
39             _configProps.load(
40                 Thread.currentThread().getContextClassLoader().getResourceAsStream(TEST_PROP_FILE));
41         }
42         catch (IOException JavaDoc e)
43         {
44             throw new RuntimeException JavaDoc(e);
45         }
46     }
47
48     //~ Constructors -------------------------------------------------------------------------------
49

50     private TestConfig()
51     {
52         // disable
53
}
54
55     //~ Methods ------------------------------------------------------------------------------------
56

57     public static String JavaDoc getContextPath()
58     {
59         return _configProps.getProperty("servletContextPath");
60     }
61 }
62
Popular Tags