KickJava   Java API By Example, From Geeks To Geeks.

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


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  * ConnectionFactoryInterfaceImpl.java
25  *
26  * Created on September 29, 2000, 3:33 PM
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.deployment.ConnectorDescriptor;
34 import com.sun.enterprise.tools.verifier.tests.*;
35
36 /**
37  * Test if the connectionfactory-impl-class implements the connection-factory-interface
38  * interface
39  *
40  * @author Jerome Dochez
41  * @version
42  */

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

54   public Result check(ConnectorDescriptor descriptor) {
55     Result result = getInitializedResult();
56     ComponentNameConstructor compName =
57       getVerifierContext().getComponentNameConstructor();
58     if(isCCIImplemented(descriptor, result))
59     {
60       Class JavaDoc c = testConnectionFactoryImpl(descriptor, result);
61       if(c != null)
62       {
63       result.addGoodDetails(smh.getLocalString
64           ("tests.componentNameConstructor",
65            "For [ {0} ]",
66            new Object JavaDoc[] {compName.toString()}));
67       result.passed(smh.getLocalString
68           ("com.sun.enterprise.tools.verifier.tests.connector.cci.ConnectionFactoryInterfaceImpl.pass1",
69            "The class [ {0} ] as defined in the connectionfactory-impl-class deployment descriptor implements javax.resource.cci.ConnectionFactory",
70            new Object JavaDoc[] {c.getName()}));
71       }
72     }
73     else
74     {
75       // test is NA
76
result.addNaDetails(smh.getLocalString
77           ("tests.componentNameConstructor",
78            "For [ {0} ]",
79            new Object JavaDoc[] {compName.toString()}));
80       result.notApplicable(smh.getLocalString
81           ("com.sun.enterprise.tools.verifier.tests.connector.cci.notApp",
82            "The CCI interfaces do not seem to be implemented by this resource adapter"));
83     }
84     /*Class c = testConnectionFactoryImpl(descriptor, result);
85     // failure to load the class are handled in the superclass
86     if (c!=null) {
87     // now check it does implement the interface
88     String interfaceName = descriptor.getConnectionFactoryInterface();
89     testImplementationOf(c, interfaceName, result);
90     }*/

91     return result;
92   }
93 }
94
Popular Tags