1 19 package org.netbeans.test.j2ee.wizard; 20 21 import java.io.File ; 22 import java.io.FilenameFilter ; 23 import java.util.ArrayList ; 24 import java.util.Arrays ; 25 import java.util.Iterator ; 26 import java.util.List ; 27 import junit.framework.Test; 28 import junit.framework.TestSuite; 29 import junit.textui.TestRunner; 30 import org.netbeans.api.project.Project; 31 import org.netbeans.jellytools.JellyTestCase; 32 import org.netbeans.jellytools.NewFileNameLocationStepOperator; 33 import org.netbeans.jellytools.NewFileWizardOperator; 34 import org.netbeans.jellytools.OutputOperator; 35 import org.netbeans.jellytools.ProjectsTabOperator; 36 import org.netbeans.jemmy.EventTool; 37 import org.netbeans.jemmy.operators.JCheckBoxOperator; 38 import org.netbeans.jemmy.operators.JComboBoxOperator; 39 import org.netbeans.jemmy.operators.JRadioButtonOperator; 40 import org.netbeans.jemmy.operators.JTextFieldOperator; 41 import org.netbeans.junit.NbTestCase; 42 import org.netbeans.junit.NbTestSuite; 43 import org.netbeans.test.j2ee.lib.ContentComparator; 44 import org.netbeans.test.j2ee.lib.FilteringLineDiff; 45 import org.netbeans.test.j2ee.lib.J2eeProjectSupport; 46 import org.netbeans.test.j2ee.lib.Reporter; 47 import org.netbeans.test.j2ee.lib.Ejb; 48 import org.netbeans.test.j2ee.lib.Utils; 49 import org.netbeans.test.j2ee.lib.WebSvc; 50 51 60 public class NewFileWizardsTest extends JellyTestCase { 61 62 private static boolean CREATE_GOLDEN_FILES = Boolean.getBoolean("org.netbeans.test.j2ee.wizard.golden"); 63 65 private static final String DEF_EJB_MOD = 66 "../../org.netbeans.test.j2ee.wizard.NewProjectWizardsTest/" + 67 "testDefaultNewEJBModWizard/def EJB Mod"; 68 private static final String DEF_WEB_MOD = 69 "../../org.netbeans.test.j2ee.wizard.NewProjectWizardsTest/" + 70 "testDefaultNewWebModWizard/def Web app"; 71 private static final String BAD_EJB_MOD = 72 "../../org.netbeans.test.j2ee.wizard.NewProjectWizardsTest/" + 73 "testNewEJBModWizard/BadModule"; 74 public static final String MULTI_EJB = System.getProperty("xtest.tmpdir") + 75 File.separator + "MultiSrcRootEjb"; 76 public static final String MULTI_WEB = System.getProperty("xtest.tmpdir") + 77 File.separator + "MultiSrcRootWar"; 78 79 private Reporter reporter; 80 private String version; 81 82 public NewFileWizardsTest(String testName) { 83 this(testName, "1.4"); 84 } 85 86 public NewFileWizardsTest(String testName, String version) { 87 super(testName); 88 this.version = version; 89 } 90 91 public static void main(String [] args) { 92 TestRunner.run(suite()); 93 } 94 95 public static Test suite() { 96 TestSuite suite = new NbTestSuite(NewFileWizardsTest.class); 97 return suite; 98 } 99 100 public void setUp() throws Exception { 101 reporter = Reporter.getReporter((NbTestCase) this); 102 } 103 104 public void tearDown() throws Exception { 105 reporter.close(); 106 } 107 108 111 public void testNewWebSvcWizardInEjb() throws Exception { 112 webSvcTest(DEF_EJB_MOD + version, "DefaultWSinEjb", "websvc", null); 113 } 114 115 118 public void testMsgHandlerInEjb() throws Exception { 119 msgHandlerTest(DEF_EJB_MOD + version, "MsgHandler", "handler", null); 120 } 121 122 125 public void testNewWebSvcWizardInWeb() throws Exception { 126 webSvcTest(DEF_WEB_MOD + version, "DefaultWSinWeb", "websvc", null); 127 } 128 129 132 public void testNewWebSvcWizardInWeb5() throws Exception { 133 webSvcTest5(DEF_WEB_MOD + version, "DefaultWSinWeb5", "websvc", null); 134 } 135 136 139 public void testNewWebSvcWizardInEjb5() throws Exception { 140 webSvcTest5(DEF_EJB_MOD + version, "DefaultWSinEjb5", "websvc", null); 141 } 142 143 146 public void testMsgHandlerInWeb() throws Exception { 147 msgHandlerTest(DEF_WEB_MOD + version, "MsgHandler", "handler", null); 148 } 149 150 153 public void testLocalSessionBean() throws Exception { 154 ejbTest("Session Bean", DEF_EJB_MOD + version, "LocalSession", 155 "ejbs.local", true, false, true, null); 156 } 157 158 161 public void testRemoteSessionBean() throws Exception { 162 ejbTest("Session Bean", DEF_EJB_MOD + version, "RemoteSession", 163 "ejbs.remote", false, true, true, null); 164 } 165 166 169 public void testLocalRemoteSessionBean() throws Exception { 170 ejbTest("Session Bean", DEF_EJB_MOD + version, "LocalAndRemoteSession", 171 "ejbs", true, true, true, null); 172 } 173 174 177 public void testLocalStatefulSessionBean() throws Exception { 178 ejbTest("Session Bean", DEF_EJB_MOD + version, "LocalStatefulSession", 179 "stateful.ejbs.local", true, false, false, null); 180 } 181 182 185 public void testRemoteStatefulSessionBean() throws Exception { 186 ejbTest("Session Bean", DEF_EJB_MOD + version, "RemoteStatefulSession", 187 "stateful.ejbs.remote", false, true, false, null); 188 } 189 190 193 public void testLocalRemoteStatefulSessionBean() throws Exception { 194 ejbTest("Session Bean", DEF_EJB_MOD + version, "LocalAndRemoteStatefulSession", 195 "stateful.ejbs", true, true, false, null); 196 } 197 198 202 public void testLocalEntityBean() throws Exception { 203 ejbTest("Entity Bean", DEF_EJB_MOD + version, "LocalEntity", 204 "ejbs.entity.local", true, false, true, null); 205 } 206 207 211 public void testRemoteEntityBean() throws Exception { 212 ejbTest("Entity Bean", DEF_EJB_MOD + version, "RemoteEntity", 213 "ejbs.entity.remote", false, true, true, null); 214 } 215 216 220 public void testLocalRemoteEntityBean() throws Exception { 221 ejbTest("Entity Bean", DEF_EJB_MOD + version, "LocalAndRemoteEntity", 222 "ejbs.entity", true, true, true, null); 223 } 224 225 229 public void testLocalBeanEntityBean() throws Exception { 230 ejbTest("Entity Bean", BAD_EJB_MOD + version, "LocalBeanEntity", 231 "ejbs.entity.bean.local", true, false, false, null); 232 } 233 234 238 public void testRemoteBeanEntityBean() throws Exception { 239 ejbTest("Entity Bean", BAD_EJB_MOD + version, "RemoteBeanEntity", 240 "ejbs.entity.bean.remote", false, true, false, null); 241 } 242 243 247 public void testLocalRemoteBeanEntityBean() throws Exception { 248 ejbTest("Entity Bean", BAD_EJB_MOD + version, "LocalAndRemoteBeanEntity", 249 "ejbs.entity.bean", true, true, false, null); 250 } 251 252 255 public void testQueueMdbBean() throws Exception { 256 ejbTest("Message-Driven Bean", DEF_EJB_MOD + version, "QueueMdb", 257 "ejbs.mdb", false, false, true, null); 258 } 259 260 263 public void testTopicMdbBean() throws Exception { 264 ejbTest("Message-Driven Bean", DEF_EJB_MOD + version, "TopicMdb", 265 "ejbs.mdb", false, false, false, null); 266 } 267 268 271 public void testPersistenceUnitInEjb() throws Exception { 272 puTest(DEF_EJB_MOD + version, "ejbPu"); 273 } 274 275 278 public void testPersistenceUnitInWeb() throws Exception { 279 puTest(DEF_WEB_MOD + version, "webPu"); 280 } 281 282 285 public void testEntityClassInEjb() throws Exception { 286 entityClassTest(DEF_EJB_MOD + version, "EjbEntity", 287 "ejb.entity", null); 288 } 289 290 293 public void testEntityClassInWeb() throws Exception { 294 entityClassTest(DEF_WEB_MOD + version, "WebEntity", 295 "web.entity", null); 296 } 297 298 301 public void testServiceLocatorInEjb() throws Exception { 302 serviceLocatorTest(DEF_EJB_MOD + version, "ServiceLocator", 303 "locator", false, null); 304 } 305 306 309 public void testCachingServiceLocatorInEjb() throws Exception { 310 serviceLocatorTest(DEF_EJB_MOD + version, "CachingServiceLocator", 311 "locator.cache", true, null); 312 } 313 314 317 public void testServiceLocatorInWeb() throws Exception { 318 serviceLocatorTest(DEF_WEB_MOD + version, "ServiceLocator", 319 "locator", false, null); 320 } 321 322 325 public void testCachingServiceLocatorInWeb() throws Exception { 326 serviceLocatorTest(DEF_WEB_MOD + version, "CachingServiceLocator", 327 "locator.cache", true, null); 328 } 329 330 333 public void testWSDLinWeb() throws Exception { 334 wsdlFileTest(DEF_WEB_MOD + version, "web_wsdl", "web/WEB-INF/wsdl", null); 335 } 336 337 340 public void testWSDLinEjb() throws Exception { 341 wsdlFileTest(DEF_EJB_MOD + version, "ejb_wsdl", "src/conf/wsdl", null); 342 } 343 344 348 public void testBuildDefaultNewEJBMod() { 349 tearDownProject("def EJB Mod" + version); 350 } 351 352 356 public void testBuildDefaultNewWebMod() { 357 tearDownProject("def Web app" + version); 358 } 359 360 364 public void testBuildDefaultNewJakartaWebMod() { 365 tearDownProject("Jakarta Web App" + version); 366 } 367 368 371 private void webSvcTest(String prjRoot, String wsName, String wsPkg, 372 String srcRoot) throws Exception { 373 boolean hasMoreSrcRoots = (srcRoot != null); 374 Project p = (hasMoreSrcRoots) 375 ? J2eeProjectSupport.getProject(new File (prjRoot), ".") 376 : J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 377 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 378 "Web Services", "Web Service"); 379 NewFileNameLocationStepOperator nop = WizardUtils.setFileNameLocation( 380 wsName, wsPkg, srcRoot); 381 nop.finish(); 382 new EventTool().waitNoEvent(30000); 385 WebSvc ws = (hasMoreSrcRoots) 386 ? new WebSvc(wsPkg + "." + wsName, p, srcRoot) 387 : new WebSvc(wsPkg + "." + wsName, p); 388 String [] err = ws.checkExistingFiles(); 389 assertTrue(Arrays.asList(err).toString(), err.length == 0); 390 List files = new ArrayList (); 391 File prjDir = (hasMoreSrcRoots) 392 ? new File (prjRoot).getCanonicalFile() 393 : new File (getWorkDir(), prjRoot).getCanonicalFile(); 394 if (wsName.indexOf("Ejb") > 0) { 395 files.add(new File (prjDir, "src/conf/ejb-jar.xml")); 396 files.add(new File (prjDir, "src/conf/sun-ejb-jar.xml")); 397 files.add(new File (prjDir, "src/conf/webservices.xml")); 398 } else { 399 files.add(new File (prjDir, "web/WEB-INF/web.xml")); 400 files.add(new File (prjDir, "web/WEB-INF/sun-web.xml")); 401 files.add(new File (prjDir, "web/WEB-INF/webservices.xml")); 402 } 403 if (!hasMoreSrcRoots) { 404 files.addAll(Arrays.asList( 405 new File (prjDir, "src/java/" + wsPkg.replace('.', '/') + "/") 406 .listFiles(new Filter (wsName)))); 407 } else { 408 files.addAll(Arrays.asList( 409 new File (prjDir, srcRoot + "/" + wsPkg.replace('.', '/') + "/") 410 .listFiles(new Filter (wsName)))); 411 } 412 checkFiles(files); 413 } 414 415 418 private void webSvcTest5(String prjRoot, String wsName, String wsPkg, 419 String srcRoot) throws Exception { 420 Project p = J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 421 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 422 "Web Services", "Web Service"); 423 NewFileNameLocationStepOperator nop = WizardUtils.setFileNameLocation( 424 wsName, wsPkg, srcRoot); 425 nop.finish(); 426 new EventTool().waitNoEvent(30000); 427 List files = new ArrayList (); 428 File prjDir = new File (getWorkDir(), prjRoot).getCanonicalFile(); 429 files.addAll(Arrays.asList( 430 new File (prjDir, "src/java/" + wsPkg.replace('.', '/') + "/") 431 .listFiles(new Filter (wsName)))); 432 checkFiles(files); 433 } 434 435 438 private void msgHandlerTest(String prjRoot, String name, String pkg, String srcRoot) 439 throws Exception { 440 boolean hasMoreSrcRoots = (srcRoot != null); 441 Project p = (hasMoreSrcRoots) 442 ? J2eeProjectSupport.getProject(new File (prjRoot), ".") 443 : J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 444 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 445 "Web Services", "Message Handler"); 446 NewFileNameLocationStepOperator nop = WizardUtils.setFileNameLocation( 447 name, pkg, srcRoot); 448 nop.finish(); 449 List files = new ArrayList (1); 450 File prjDir = (hasMoreSrcRoots) 451 ? new File (prjRoot).getCanonicalFile() 452 : new File (getWorkDir(), prjRoot).getCanonicalFile(); 453 if (!hasMoreSrcRoots) { 454 files.add(new File (prjDir, "src/java/" + pkg.replace('.', '/') + "/" + name + ".java")); 455 } else { 456 files.add(new File (prjDir, srcRoot + "/" + pkg.replace('.', '/') + "/" + name + ".java")); 457 } 458 checkFiles(files); 459 } 460 461 468 private void ejbTest(String type, String prjRoot, String ejbName, String ejbPkg, 469 boolean local, boolean remote, boolean stateless, String srcRoot) throws Exception { 470 boolean hasMoreSrcRoots = (srcRoot != null); 471 Project p = (hasMoreSrcRoots) 472 ? J2eeProjectSupport.getProject(new File (prjRoot), ".") 473 : J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 474 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 475 "Enterprise", type); 476 NewFileNameLocationStepOperator nop = WizardUtils.setFileNameLocation( 477 ejbName, ejbPkg, srcRoot); 478 if (type.equals("Message-Driven Bean")) { 479 if (!stateless) { 480 new JRadioButtonOperator(nop, "Topic").setSelected(true); 481 } 482 } else { 483 if (!stateless) { 484 if (type.equals("Session Bean")) { 485 new JRadioButtonOperator(nop, "Stateful").setSelected(true); 486 } else { 487 new JRadioButtonOperator(nop, "Bean").setSelected(true); 488 } 489 } 490 new JCheckBoxOperator(nop, "Local").setSelected(local); 491 new JCheckBoxOperator(nop, "Remote").setSelected(remote); 492 } 493 nop.finish(); 494 Ejb ejb = (hasMoreSrcRoots) 495 ? new Ejb(ejbPkg + "." + ejbName, p, local, remote, srcRoot) 496 : new Ejb(ejbPkg + "." + ejbName, p, local, remote); 497 if ("1.4".equals(version)) { 498 String [] err = ejb.checkExistingFiles(); 499 assertTrue(Arrays.asList(err).toString(), err.length == 0); 500 } 501 List files = new ArrayList (); 502 File prjDir = (hasMoreSrcRoots) 503 ? new File (prjRoot).getCanonicalFile() 504 : new File (getWorkDir(), prjRoot).getCanonicalFile(); 505 if ("1.4".equals(version)) { 506 files.add(new File (prjDir, "src/conf/ejb-jar.xml")); 507 files.add(new File (prjDir, "src/conf/sun-ejb-jar.xml")); 508 } 509 if (!hasMoreSrcRoots) { 510 files.addAll(Arrays.asList( 511 new File (prjDir, "src/java/" + ejbPkg.replace('.', '/') + "/") 512 .listFiles(new Filter (ejbName)))); 513 } else { 514 files.addAll(Arrays.asList( 515 new File (prjDir, srcRoot + "/" + ejbPkg.replace('.', '/') + "/") 516 .listFiles(new Filter (ejbName)))); 517 } 518 checkFiles(files); 519 } 520 521 524 private void serviceLocatorTest(String prjRoot, String name, String pkg, 525 boolean caching, String srcRoot) throws Exception { 526 boolean hasMoreSrcRoots = (srcRoot != null); 527 Project p = (hasMoreSrcRoots) 528 ? J2eeProjectSupport.getProject(new File (prjRoot), ".") 529 : J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 530 String type = (caching) ? "Caching Service Locator" : "Service Locator"; 531 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 532 "Enterprise", type); 533 NewFileNameLocationStepOperator nop = WizardUtils.setFileNameLocation( 534 name, pkg, srcRoot); 535 nop.finish(); 536 List files = new ArrayList (1); 537 File prjDir = (hasMoreSrcRoots) 538 ? new File (prjRoot).getCanonicalFile() 539 : new File (getWorkDir(), prjRoot).getCanonicalFile(); 540 if (!hasMoreSrcRoots) { 541 files.add(new File (prjDir, "src/java/" + pkg.replace('.', '/') + "/" + name + ".java")); 542 } else { 543 files.add(new File (prjDir, srcRoot + "/" + pkg.replace('.', '/') + "/" + name + ".java")); 544 } 545 checkFiles(files); 546 } 547 548 551 private void wsdlFileTest(String prjRoot, String name, String dir, String srcRoot) 552 throws Exception { 553 Project p = (srcRoot != null) 554 ? J2eeProjectSupport.getProject(new File (prjRoot), ".") 555 : J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 556 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 557 "Web Services", "WSDL"); 558 NewFileNameLocationStepOperator op = new NewFileNameLocationStepOperator(); 559 new EventTool().waitNoEvent(500); 560 op.setObjectName(name); 561 new EventTool().waitNoEvent(1000); 562 JTextFieldOperator jtfo = new JTextFieldOperator(op, 2); 563 jtfo.clearText(); 564 jtfo.typeText(dir); 565 op.finish(); 566 List files = new ArrayList (1); 567 File prjDir = (srcRoot != null) 568 ? new File (prjRoot).getCanonicalFile() 569 : new File (getWorkDir(), prjRoot).getCanonicalFile(); 570 files.add(new File (prjDir, dir + "/" + name + ".wsdl")); 571 checkFiles(files); 572 } 573 574 private void puTest(String prjRoot, String name) throws Exception { 575 Project p = J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 576 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 577 "Persistence", "Persistence Unit"); 578 JTextFieldOperator jtfo = new JTextFieldOperator(nfwo, 0); 579 jtfo.clearText(); 580 jtfo.typeText(name); 581 JComboBoxOperator jcbo = new JComboBoxOperator(nfwo, 1); 582 jcbo.selectItem("sample"); 583 nfwo.finish(); 584 List files = new ArrayList (); 585 File prjDir = new File (getWorkDir(), prjRoot).getCanonicalFile(); 586 files.add(new File (prjDir, "src/conf/persistence.xml")); 587 checkFiles(files); 588 } 589 590 private void entityClassTest(String prjRoot, String name, String pkg, String srcRoot) 591 throws Exception { 592 boolean hasMoreSrcRoots = (srcRoot != null); 593 Project p = (hasMoreSrcRoots) 594 ? J2eeProjectSupport.getProject(new File (prjRoot), ".") 595 : J2eeProjectSupport.getProject(getWorkDir(), prjRoot); 596 NewFileWizardOperator nfwo = WizardUtils.createNewFile(p, 597 "Persistence", "Entity Class"); 598 NewFileNameLocationStepOperator nop = WizardUtils.setFileNameLocation( 599 name, pkg, srcRoot); 600 nop.finish(); 601 List files = new ArrayList (); 602 File prjDir = (hasMoreSrcRoots) 603 ? new File (prjRoot).getCanonicalFile() 604 : new File (getWorkDir(), prjRoot).getCanonicalFile(); 605 if (!hasMoreSrcRoots) { 606 files.addAll(Arrays.asList( 607 new File (prjDir, "src/java/" + pkg.replace('.', '/') + "/") 608 .listFiles(new Filter (name)))); 609 } else { 610 files.addAll(Arrays.asList( 611 new File (prjDir, srcRoot + "/" + pkg.replace('.', '/') + "/") 612 .listFiles(new Filter (name)))); 613 } 614 checkFiles(files); 615 } 616 617 618 623 private void checkFiles(List newFiles) { 624 try { 625 Thread.currentThread().sleep(12500); 627 } catch (InterruptedException ie) { 628 } 630 if (!CREATE_GOLDEN_FILES) { 631 List l = new ArrayList (newFiles.size() / 2); 632 for (Iterator i = newFiles.iterator(); i.hasNext();) { 633 File newFile = (File ) i.next(); 634 File goldenFile = null; 635 try { 636 goldenFile = getGoldenFile(getName() + "_" + version + "/" + newFile.getName() + ".pass"); 637 if (newFile.getName().endsWith(".xml") && !newFile.getName().startsWith("sun-") && !newFile.getName().startsWith("webservices.xml")) { 638 assertTrue(ContentComparator.equalsXML(goldenFile, newFile)); 639 } else { 640 assertFile(newFile, goldenFile, 641 new File (getWorkDirPath(), newFile.getName() + ".diff"), 642 new FilteringLineDiff()); 643 } 644 } catch (Throwable t) { 645 goldenFile = getGoldenFile(getName() + "_" + version + "/" + newFile.getName() + ".pass"); 646 Utils.copyFile(newFile, new File (getWorkDirPath(), newFile.getName() + ".bad")); 647 Utils.copyFile(goldenFile, 648 new File (getWorkDirPath(), newFile.getName() + ".gf")); 649 l.add(newFile.getName()); 650 } 651 } 652 assertTrue("File(s) " + l.toString() + " differ(s) from golden files.", l.isEmpty()); 653 } else { 654 createGoldenFiles(newFiles); 655 } 656 } 657 658 private void createGoldenFiles(List from) { 659 File f = getDataDir();; 660 List names = new ArrayList (); 661 names.add("goldenfiles"); 662 while (!f.getName().equals("test")) { 663 if (!f.getName().equals("sys") && !f.getName().equals("work") &&!f.getName().equals("tests")) { 664 names.add(f.getName()); 665 } 666 f=f.getParentFile(); 667 } 668 for (int i=names.size()-1;i > -1;i--) { 669 f=new File (f,(String )(names.get(i))); 670 } 671 f = new File (f, getClass().getName().replace('.', File.separatorChar)); 672 File destDir = new File (f, getName() + "_" + version); 673 destDir.mkdirs(); 674 for (Iterator i = from.iterator(); i.hasNext();) { 675 File src = (File ) i.next(); 676 Utils.copyFile(src, new File (destDir, src.getName() + ".pass")); 677 } 678 assertTrue("Golden files generated.", false); 679 } 680 681 686 private void tearDownProject(String prjName) { 687 Utils.buildProject(prjName); 688 assertTrue("Project " + prjName + " was not built.", 689 new OutputOperator().getText().indexOf("BUILD SUCCESSFUL (total time:") > -1); 690 } 691 692 693 695 698 public void testOpenEjbMultiRootProject() { 699 assertNotNull(J2eeProjectSupport.openProject(MULTI_EJB)); 700 new ProjectsTabOperator().getProjectRootNode("MultiSrcRootEjb").expand(); 701 } 702 703 706 public void testOpenWebMultiRootProject() { 707 assertNotNull(J2eeProjectSupport.openProject(MULTI_WEB)); 708 new ProjectsTabOperator().getProjectRootNode("MultiSrcRootWar").expand(); 709 } 710 711 715 public void testMultiNewWebSvcWizardInEjb() throws Exception { 716 webSvcTest(MULTI_EJB, "DefaultWSinEjb", "multi.websvc", "src/beans"); 717 } 718 719 723 public void testMultiMsgHandlerInEjb() throws Exception { 724 msgHandlerTest(MULTI_EJB, "MsgHandler", "multi.handler", "src/beans"); 725 } 726 727 731 public void testMultiNewWebSvcWizardInWeb() throws Exception { 732 webSvcTest(MULTI_WEB, "DefaultWSinWeb", "multi.websvc", "src/webservices"); 733 } 734 735 739 public void testMultiMsgHandlerInWeb() throws Exception { 740 msgHandlerTest(MULTI_WEB, "MsgHandler", "multi.handler", "src/webservices"); 741 } 742 743 747 public void testMultiLocalSessionBean() throws Exception { 748 ejbTest("Session Bean", MULTI_EJB, "LocalSession", 749 "multi.ejbs.local", true, false, true, "src/beans"); 750 } 751 752 756 public void testMultiRemoteSessionBean() throws Exception { 757 ejbTest("Session Bean", MULTI_EJB, "RemoteSession", 758 "multi.ejbs.remote", false, true, true, "src/beans"); 759 } 760 761 765 public void testMultiLocalRemoteSessionBean() throws Exception { 766 ejbTest("Session Bean", MULTI_EJB, "LocalAndRemoteSession", 767 "multi.ejbs", true, true, true, "src/beans"); 768 } 769 770 774 public void testMultiLocalStatefulSessionBean() throws Exception { 775 ejbTest("Session Bean", MULTI_EJB, "LocalStatefulSession", 776 "multi.stateful.ejbs.local", true, false, false, "src/beans"); 777 } 778 779 783 public void testMultiRemoteStatefulSessionBean() throws Exception { 784 ejbTest("Session Bean", MULTI_EJB, "RemoteStatefulSession", 785 "multi.stateful.ejbs.remote", false, true, false, "src/beans"); 786 } 787 788 792 public void testMultiLocalRemoteStatefulSessionBean() throws Exception { 793 ejbTest("Session Bean", MULTI_EJB, "LocalAndRemoteStatefulSession", 794 "multi.stateful.ejbs", true, true, false, "src/beans"); 795 } 796 797 802 public void testMultiLocalEntityBean() throws Exception { 803 ejbTest("Entity Bean", MULTI_EJB, "LocalEntity", 804 "multi.ejbs.entity.local", true, false, true, "src/beans"); 805 } 806 807 812 public void testMultiRemoteEntityBean() throws Exception { 813 ejbTest("Entity Bean", MULTI_EJB, "RemoteEntity", 814 "multi.ejbs.entity.remote", false, true, true, "src/beans"); 815 } 816 817 822 public void testMultiLocalRemoteEntityBean() throws Exception { 823 ejbTest("Entity Bean", MULTI_EJB, "LocalAndRemoteEntity", 824 "multi.ejbs.entity", true, true, true, "src/beans"); 825 } 826 827 831 public void testMultiQueueMdbBean() throws Exception { 832 ejbTest("Message-Driven Bean", MULTI_EJB, "QueueMdb", 833 "multi.ejbs.mdb", false, false, true, "src/beans"); 834 } 835 836 840 public void testMultiTopicMdbBean() throws Exception { 841 ejbTest("Message-Driven Bean", MULTI_EJB, "TopicMdb", 842 "multi.ejbs.mdb", false, false, false, "src/beans"); 843 } 844 845 849 public void testMultiServiceLocatorInEjb() throws Exception { 850 serviceLocatorTest(MULTI_EJB, "ServiceLocator", 851 "multi.locator", false, "src/beans"); 852 } 853 854 858 public void testMultiCachingServiceLocatorInEjb() throws Exception { 859 serviceLocatorTest(MULTI_EJB, "CachingServiceLocator", 860 "multi.locator.cache", true, "src/beans"); 861 } 862 863 867 public void testMultiServiceLocatorInWeb() throws Exception { 868 serviceLocatorTest(MULTI_WEB, "ServiceLocator", 869 "multi.locator", false, "src/webservices"); 870 } 871 872 876 public void testMultiCachingServiceLocatorInWeb() throws Exception { 877 serviceLocatorTest(MULTI_WEB, "CachingServiceLocator", 878 "multi.locator.cache", true, "src/webservices"); 879 } 880 881 885 public void testMultiWSDLinWeb() throws Exception { 886 wsdlFileTest(MULTI_WEB, "web_wsdl", "web/WEB-INF/wsdl", ""); 887 } 888 889 893 public void testMultiWSDLinEjb() throws Exception { 894 wsdlFileTest(MULTI_EJB, "ejb_wsdl", "src/conf/wsdl", ""); 895 } 896 897 901 public void testBuildEjbMultiRootProject() { 902 tearDownProject("MultiSrcRootEjb"); 903 } 904 905 909 public void testBuildWebMultiRootProject() { 910 tearDownProject("MultiSrcRootWar"); 911 } 912 913 private class Filter implements FilenameFilter { 914 915 private String start; 916 917 public Filter(String name) { 918 start = name; 919 } 920 921 public boolean accept(File dir, String name) { 922 return name.startsWith(start); 923 } 924 } 925 } 926 | Popular Tags |