KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > wsmgmt > repository > WebServiceInfoProviderTest


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 package com.sun.enterprise.admin.wsmgmt.repository;
24
25 import com.sun.enterprise.admin.wsmgmt.repository.spi.RepositoryException;
26 import com.sun.enterprise.admin.wsmgmt.repository.spi.WebServiceInfoProvider;
27 import com.sun.enterprise.admin.wsmgmt.repository.spi.WebServiceInfo;
28 import com.sun.enterprise.tools.common.AppServWebServiceInfoProvider;
29 import com.sun.enterprise.config.serverbeans.Domain;
30
31 import junit.framework.TestCase;
32 import junit.framework.TestResult;
33 import junit.framework.TestSuite;
34
35 import java.util.List JavaDoc;
36 import java.util.Map JavaDoc;
37 import java.util.HashMap JavaDoc;
38 import java.util.Iterator JavaDoc;
39
40 public class WebServiceInfoProviderTest extends TestCase {
41    
42     public WebServiceInfoProviderTest(String JavaDoc name) {
43         super(name);
44     }
45
46     public void testWSInfos() throws RepositoryException {
47         try {
48            Map JavaDoc map = new HashMap JavaDoc();
49            map.put( WebServiceInfoProvider.MOD_TYPE_PROP_NAME, "WEB");
50            map.put( WebServiceInfoProvider.WS_XML_LOCATION_PROP_NAME,
51                     WS_XML_FILE);
52            map.put( WebServiceInfoProvider.APP_ID_PROP_NAME, "jaxrpc-simple");
53            map.put( WebServiceInfoProvider.BUNDLE_NAME_PROP_NAME,
54                     "jaxrpc-simple.war");
55            List JavaDoc list = impl.getWebServiceInfo(WEB_XML_FILE, map);
56            Iterator JavaDoc hItr = list.iterator();
57            while ( hItr.hasNext() ) {
58                 Object JavaDoc m = hItr.next();
59                 System.out.println(" Web Service Info " + m.toString());
60            }
61         } catch (RepositoryException re) {
62             re.printStackTrace();
63             throw re;
64         }
65     }
66
67   
68     protected void setUp() {
69         impl = new AppServWebServiceInfoProvider();
70     }
71
72     private final static String JavaDoc EJB_XML_FILE =
73                     "/tmp/com/sun/enterprise/admin/wsmgmt/sun-ejb-jar.xml";
74     private final static String JavaDoc WEB_XML_FILE =
75                     "/tmp/com/sun/enterprise/admin/wsmgmt/sun-web.xml";
76     private final static String JavaDoc WS_XML_FILE =
77                     "/tmp/com/sun/enterprise/admin/wsmgmt/webservices.xml";
78
79     private AppServWebServiceInfoProvider impl = null;
80
81     public static void main(String JavaDoc args[]) {
82         junit.textui.TestRunner.run(WebServiceInfoProviderTest.class);
83     }
84 }
85
Popular Tags