KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > tests > appclient > AppClientName


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 package com.sun.enterprise.tools.verifier.tests.appclient;
24
25 import com.sun.enterprise.deployment.*;
26 import com.sun.enterprise.tools.verifier.*;
27 import com.sun.enterprise.tools.verifier.tests.*;
28
29 /**
30  * AppClient name test.
31  * The AppClient provider must assign a display-name to each AppClient module
32  */

33 public class AppClientName extends AppClientTest implements AppClientCheck {
34
35       
36
37     /**
38      * AppClient name test.
39      * The AppClient provider must assign a display-name to each AppClient module
40      *
41      *
42      * @param descriptor the app-client deployment descriptor
43      *
44      * @return <code>Result</code> the results for this assertion
45      */

46     public Result check(ApplicationClientDescriptor descriptor) {
47     Result result = getInitializedResult();
48     ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
49         // String clientName = descriptor.getName();
50
// get client xml display-name..
51
// fix for bug # 4942905 - api changed in the DOL
52
String JavaDoc clientName = descriptor.getDisplayName();
53
54
55     if (clientName !=null && clientName.length() > 0)
56         {
57         // as long as it's not blank, test should pass
58
result.addGoodDetails(smh.getLocalString
59                        ("tests.componentNameConstructor",
60                     "For [ {0} ]",
61                     new Object JavaDoc[] {compName.toString()}));
62         result.passed(smh.getLocalString(getClass().getName() + ".passed", "AppClient display name is : [ {0} ]", new Object JavaDoc [] {clientName}));
63         } else {
64         // it's blank, test should not pass
65
result.addErrorDetails(smh.getLocalString
66                        ("tests.componentNameConstructor",
67                     "For [ {0} ]",
68                     new Object JavaDoc[] {compName.toString()}));
69         result.failed(smh.getLocalString(getClass().getName() + ".failed", "Error: AppClient display name must not be blank."));
70         }
71     return result;
72     }
73 }
74
Popular Tags