1 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 ; 36 import java.util.Map ; 37 import java.util.HashMap ; 38 import java.util.Iterator ; 39 40 public class WebServiceInfoProviderTest extends TestCase { 41 42 public WebServiceInfoProviderTest(String name) { 43 super(name); 44 } 45 46 public void testWSInfos() throws RepositoryException { 47 try { 48 Map map = new HashMap (); 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 list = impl.getWebServiceInfo(WEB_XML_FILE, map); 56 Iterator hItr = list.iterator(); 57 while ( hItr.hasNext() ) { 58 Object 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 EJB_XML_FILE = 73 "/tmp/com/sun/enterprise/admin/wsmgmt/sun-ejb-jar.xml"; 74 private final static String WEB_XML_FILE = 75 "/tmp/com/sun/enterprise/admin/wsmgmt/sun-web.xml"; 76 private final static String 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 args[]) { 82 junit.textui.TestRunner.run(WebServiceInfoProviderTest.class); 83 } 84 } 85 | Popular Tags |