KickJava   Java API By Example, From Geeks To Geeks.

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


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  * ConnectionFactoryExistence.java
25  *
26  * Created on September 28, 2000, 4:59 PM
27  */

28
29 package com.sun.enterprise.tools.verifier.tests.connector.cci;
30
31 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorTest;
32 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorCheck;
33 import com.sun.enterprise.tools.verifier.Result;
34 import com.sun.enterprise.deployment.ConnectorDescriptor;
35 import com.sun.enterprise.tools.verifier.tests.*;
36 import com.sun.enterprise.tools.verifier.tests.*;
37
38
39 /**
40  * Verify that the interface declared in the deployment descriptor
41  * connectionfactory-interface is actually contained in the archive
42  *
43  * @author Jerome Dochez
44  * @version
45  */

46 public class ConnectionFactoryInterfaceExistence extends ConnectionFactoryTest implements ConnectorCheck
47 {
48
49
50     /**
51      * <p>
52      * Verify that the interface declared in the deployment descriptor
53      * connectionfactory-interface is actually contained in the archive
54      * </p>
55      *
56      * @paramm descriptor deployment descriptor for the rar file
57      * @return result object containing the result of the individual test
58      * performed
59      */

60     public Result check(ConnectorDescriptor descriptor) {
61         
62       Result result = getInitializedResult();
63       ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
64       if(isCCIImplemented(descriptor, result))
65       {
66         /*String interfaceName = descriptor.getConnectionFactoryInterface();
67         if (interfaceName == null) {
68           result.addErrorDetails(smh.getLocalString
69               ("tests.componentNameConstructor",
70                "For [ {0} ]",
71                new Object[] {compName.toString()}));
72           result.failed(smh.getLocalString
73               (getClass().getName() + ".nonexist",
74                "Error: The deployment descriptor for the resource adapter do not define a connectionfactory-interface"));
75         }*/

76         isClassLoadable("javax.resource.cci.ConnectionFactory", result);
77       }
78       else
79       {
80         result.addNaDetails(smh.getLocalString
81             ("tests.componentNameConstructor",
82              "For [ {0} ]",
83              new Object JavaDoc[] {compName.toString()}));
84         result.notApplicable(smh.getLocalString
85             ("com.sun.enterprise.tools.verifier.tests.connector.cci.notApp",
86              "The CCI interfaces do not seem to be implemented by this resource adapter"));
87       }
88       return result;
89     }
90 }
91
Popular Tags