KickJava   Java API By Example, From Geeks To Geeks.

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


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  * InteractionExistence.java
25  *
26  * Created on October 5, 2000, 10:24 AM
27  */

28
29 package com.sun.enterprise.tools.verifier.tests.connector.cci;
30
31 import java.io.File JavaDoc;
32 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorCheck;
33 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorTest;
34 import com.sun.enterprise.tools.verifier.tests.*;
35 import com.sun.enterprise.tools.verifier.Result;
36 import com.sun.enterprise.tools.verifier.Verifier;
37 import com.sun.enterprise.deployment.ConnectorDescriptor;
38
39
40 /**
41  * Test if a javax.resource.cci.Interfaction implementation has been provided in
42  * the rar file
43  *
44  * @author Jerome Dochez
45  * @version
46  */

47 public class InteractionExistence
48     extends ConnectionFactoryTest
49     implements ConnectorCheck
50 {
51
52     /** <p>
53      * Test if a javax.resource.cci.Interfaction implementation has been
54      * provided in the rar file
55      * </p>
56      *
57      * @paramm descriptor deployment descriptor for the rar file
58      * @return result object containing the result of the individual test
59      * performed
60      */

61     public Result check(ConnectorDescriptor descriptor) {
62                 
63         Result result = getInitializedResult();
64     ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
65         if (isCCIImplemented(descriptor, result)) {
66             //File jarFile = Verifier.getJarFile(descriptor.getModuleDescriptor().getArchiveUri());
67
// File f=Verifier.getArchiveFile(descriptor.getModuleDescriptor().getArchiveUri());
68
findImplementorOf(descriptor, "javax.resource.cci.Interaction", result);
69         } else {
70         result.addNaDetails(smh.getLocalString
71                   ("tests.componentNameConstructor",
72                    "For [ {0} ]",
73                    new Object JavaDoc[] {compName.toString()}));
74         result.notApplicable(smh.getLocalString
75                 (getClass().getName() + ".notapp",
76                  "NotApplicable : The CCI interfaces do not seem to be implemented by this resource adapter"));
77         }
78         return result;
79     }
80 }
81
Popular Tags