KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > verifier > ServerXmlTest


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * ServerXmlTest.java
26  *
27   */

28
29 package com.sun.enterprise.admin.verifier;
30
31 //import com.sun.enterprise.tools.verifier.Result;
32
import com.sun.enterprise.admin.util.LocalStringsManager;
33 import com.sun.enterprise.tools.verifier.*;
34
35 // Logging
36
import java.util.logging.Logger JavaDoc;
37 import java.util.logging.Level JavaDoc;
38 import com.sun.logging.LogDomains;
39
40
41
42 /**
43  * ServerXmlTest which is the superclass of all TestCases returns Results Object with Result Class Set
44  *
45  */

46
47 public class ServerXmlTest {
48     
49     // Logging
50
static Logger JavaDoc _logger = LogDomains.getLogger(LogDomains.APPVERIFY_LOGGER);
51     
52     public com.sun.enterprise.util.LocalStringManagerImpl smh = StringManagerHelper.getLocalStringsManager();
53     public boolean debug = false;
54     
55     /** Creates a new instance of ServerXmlTest */
56     public ServerXmlTest() {
57         // set the local strings manager
58
try {
59             //StringManagerHelper.setLocalStringsManager(Class.forName(getClass().getName()));
60
StringManagerHelper.setLocalStringsManager(Class.forName("com.sun.enterprise.admin.verifier.ServerXmlTest"));
61             smh = StringManagerHelper.getLocalStringsManager();
62         }
63         catch (ClassNotFoundException JavaDoc e) {
64             // Logging
65
_logger.log(Level.FINE, "serverxmlverifier.class_notfound_exception", e);
66         }
67
68     }
69     
70     protected Result getInitializedResult() {
71         if (debug) {
72             // Logging
73
_logger.log(Level.INFO,
74             "\n********************************************************** \n " +
75             smh.getLocalString("which.class.called.string", getClass() + " called \n",
76             new Object JavaDoc[] {getClass()}) +
77             "\n**********************************************************");
78             
79         }
80
81         Result result = new Result();
82         result.init(getClass());
83         if (debug) {
84                 // Logging
85
_logger.log(Level.INFO,
86                 smh.getLocalString
87                 ("test.string" + ".assertion",
88                 "Assertion from resource file is: [ {0} ]",
89                 new Object JavaDoc[] {result.getAssertion()}));
90         }
91         return result;
92     }
93         
94 }
95
Popular Tags