KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > tests > connector > cci > ConnectionInterfaceImpl


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  * ConnectionInterfaceImpl.java
25  *
26  * Created on October 2, 2000, 10:58 AM
27  */

28
29 package com.sun.enterprise.tools.verifier.tests.connector.cci;
30
31 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorCheck;
32 import com.sun.enterprise.tools.verifier.Result;
33 import com.sun.enterprise.tools.verifier.tests.*;
34 import com.sun.enterprise.deployment.ConnectorDescriptor;
35
36 /**
37  * Test if the connection-impl-class implements the connection-interface
38  * interface
39  *
40  * @author Jerome Dochez
41  * @version
42  */

43 public class ConnectionInterfaceImpl extends ConnectionTest implements ConnectorCheck {
44
45   /**
46    * <p>
47    * Test if the connection-impl-class implements the
48    * connection-interface interface
49    * </p>
50    *
51    * @paramm descriptor deployment descriptor for the rar file
52    * @return result object containing the result of the individual test
53    * performed
54    */

55   public Result check(ConnectorDescriptor descriptor) {
56     Result result = getInitializedResult();
57     ComponentNameConstructor compName =
58       getVerifierContext().getComponentNameConstructor();
59     if(isCCIImplemented(descriptor, result))
60     {
61       Class JavaDoc c = testConnectionImpl(descriptor, result);
62       // failure to load the class are handled in the superclass
63
if (c!=null) {
64         // now check it does implement the interface
65
String JavaDoc interfaceName = getConnectionInterface(descriptor, result);
66         testImplementationOf(c, interfaceName, result);
67       }
68     }
69     else
70     {
71       // test is NA
72
result.addNaDetails(smh.getLocalString
73           ("tests.componentNameConstructor",
74            "For [ {0} ]",
75            new Object JavaDoc[] {compName.toString()}));
76       result.notApplicable(smh.getLocalString
77           ("com.sun.enterprise.tools.verifier.tests.connector.cci.notApp",
78            "The CCI interfaces do not seem to be implemented by this resource adapter"));
79     }
80     return result;
81   }
82 }
83
Popular Tags