KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > verifier > tests > wsclients > WSClientTest


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 package com.sun.enterprise.tools.verifier.tests.wsclients;
25
26 import com.sun.enterprise.deployment.*;
27 import com.sun.enterprise.deployment.util.ModuleDescriptor;
28 import com.sun.enterprise.tools.verifier.*;
29 import com.sun.enterprise.tools.verifier.tests.*;
30 import com.sun.enterprise.util.io.FileUtils;
31
32 import java.io.File JavaDoc;
33 import java.lang.ClassLoader JavaDoc;
34
35
36 /**
37  * Superclass for all EJB tests, contains common services.
38  *
39  * @version
40  */

41 /*
42  * @class.setup_props: ;
43  */

44
45 /*
46  * @testName: check
47  * @assertion_ids: ;
48  * @test_Strategy:
49  * @class.testArgs: Additional arguments (if any) to be passed when execing the client
50  */

51
52 public abstract class WSClientTest extends VerifierTest implements VerifierCheck, WSClientCheck {
53         
54     /**
55      * <p>
56      * run an individual test against the deployment descriptor for the
57      * archive the verifier is performing compliance tests against.
58      * </p>
59      *
60      * @param descriptor deployment descriptor for the archive
61      * @return result object containing the result of the individual test
62      * performed
63      */

64     public Result check(Descriptor descriptor) {
65         return check((ServiceReferenceDescriptor) descriptor);
66     }
67    
68     /**
69      * @param descriptor deployment descriptor for the archive file
70      * @return result object containing the result of the individual test
71      * performed
72      */

73     public abstract Result check(ServiceReferenceDescriptor descriptor);
74     
75     protected String JavaDoc getAbstractArchiveUri(ServiceReferenceDescriptor desc) {
76         String JavaDoc archBase = getVerifierContext().getAbstractArchive().
77                 getArchiveUri();
78         final ModuleDescriptor moduleDescriptor = desc.getBundleDescriptor().
79                 getModuleDescriptor();
80         if (moduleDescriptor.isStandalone()) {
81             return archBase; // it must be a stand-alone module; no such physical dir exists
82
} else {
83             return archBase + File.separator +
84                     FileUtils.makeFriendlyFileName(moduleDescriptor.getArchiveUri());
85         }
86     }
87
88 }
89
Popular Tags