1 19 20 package org.netbeans.modules.websvc.core.client.wizard; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 import org.netbeans.api.project.FileOwnerQuery; 25 import org.netbeans.api.project.Project; 26 import org.netbeans.junit.MockServices; 27 import org.netbeans.junit.NbTestCase; 28 import org.netbeans.modules.websvc.core.ClientCreator; 29 import org.netbeans.modules.websvc.core.ClientWizardProperties; 30 import org.netbeans.modules.websvc.core.CreatorProvider; 31 import org.netbeans.modules.websvc.core.testutils.RepositoryImpl; 32 import org.openide.WizardDescriptor; 33 import org.openide.WizardDescriptor.Panel; 34 import org.openide.filesystems.FileObject; 35 import org.openide.filesystems.FileUtil; 36 37 41 public class WebServiceClientCreatorTest extends NbTestCase { 42 43 private WizardDescriptor wd; 44 45 public WebServiceClientCreatorTest(String testName) { 46 super(testName); 47 } 48 49 protected void setUp() throws Exception { 50 clearWorkDir(); 51 } 52 53 protected void tearDown() throws Exception { 54 } 55 56 public void testJ2SEonJdk6() throws Exception { 57 System.setProperty("websvc.core.test.repo.root", this.getWorkDirPath()); 58 MockServices.setServices(RepositoryImpl.class); 59 File projectRoot = new File (getDataDir(), "projects/j2se_16"); 60 FileObject projectDir = FileUtil.toFileObject(FileUtil.normalizeFile(projectRoot)); 61 Project p = FileOwnerQuery.getOwner(projectDir); 62 assert p != null : "null Project"; 63 wd = new WizardDescriptor(new Panel[] {new WebServiceClientWizardDescriptor()}); 64 65 wd.putProperty(ClientWizardProperties.JAX_VERSION, ClientWizardProperties.JAX_WS); 66 wd.putProperty(ClientWizardProperties.WSDL_FILE_PATH, FileUtil.normalizeFile(new File (getDataDir(), "wsdl/MyWebService.wsdl")).getAbsolutePath()); 67 wd.putProperty(ClientWizardProperties.WSDL_PACKAGE_NAME, "client.jaxws"); 68 ClientCreator creator = CreatorProvider.getClientCreator(p, wd); 69 if (creator!=null) { 70 try { 71 creator.createClient(); 72 } catch (IOException ex) { 73 ex.printStackTrace(); 74 } 75 ((JaxWsClientCreator)creator).task.waitFinished(); 76 } 77 79 } 80 81 84 public void testCreate() { 85 88 } 97 98 101 public void testGetJavaSourceGroups() { 102 104 110 } 113 114 } 115 | Popular Tags |