KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > tests > connector > managed > ManagedConnectionFactoryImplEquals


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  * ManagedConnectionFactoryImplEquals.java
25  *
26  * Created on September 27, 2000, 2:55 PM
27  */

28
29 package com.sun.enterprise.tools.verifier.tests.connector.managed;
30
31 import com.sun.enterprise.tools.verifier.Result;
32 import com.sun.enterprise.deployment.ConnectorDescriptor;
33 import com.sun.enterprise.tools.verifier.tests.*;
34 import com.sun.enterprise.tools.verifier.tests.connector.ConnectorCheck;
35
36 /**
37  * Test if the ManagedConnectionFactory implementation override the equals
38  * method
39  *
40  * @author Jerome Dochez
41  * @version
42  */

43 public class ManagedConnectionFactoryImplEquals
44     extends ManagedConnectionFactoryTest
45     implements ConnectorCheck
46     {
47      
48     /** <p>
49      * Test if the ManagedConnectionFactory implementation override the
50      * equals method
51      * </p>
52      *
53      * @paramm descriptor deployment descriptor for the rar file
54      * @return result object containing the result of the individual test
55      * performed
56      */

57     public Result check(ConnectorDescriptor descriptor) {
58         Result result = getInitializedResult();
59         ComponentNameConstructor compName =
60           getVerifierContext().getComponentNameConstructor();
61         // test NA for inboundRA
62
if(!descriptor.getOutBoundDefined())
63         {
64           result.addNaDetails(smh.getLocalString
65               ("tests.componentNameConstructor",
66                "For [ {0} ]",
67                new Object JavaDoc[] {compName.toString()}));
68           result.notApplicable(smh.getLocalString
69               ("com.sun.enterprise.tools.verifier.tests.connector.managed.notApplicableForInboundRA",
70                "Resource Adapter does not provide outbound communication"));
71           return result;
72         }
73         Class JavaDoc mcf = testManagedConnectionFactoryImpl(descriptor, result);
74         if (mcf!=null) {
75             checkMethodImpl(mcf, "equals", new Class JavaDoc[] {Object JavaDoc.class}, "public boolean equals(Object)", result);
76         }
77         return result;
78     }
79 }
80
Popular Tags