1 19 20 package org.netbeans.test.j2ee.addmethod; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 import org.netbeans.jellytools.*; 25 import org.netbeans.jellytools.actions.OpenAction; 26 import org.netbeans.jellytools.nodes.Node; 27 import org.netbeans.jemmy.JemmyException; 28 import org.netbeans.jemmy.Waitable; 29 import org.netbeans.jemmy.Waiter; 30 import org.netbeans.test.j2ee.*; 31 import org.netbeans.test.j2ee.lib.Utils; 32 33 37 public abstract class AddMethodBase extends JellyTestCase { 38 39 protected String beanName; 40 protected String editorPopup; 41 protected String dialogTitle; 42 protected boolean isDDModified = false; 43 protected String toSearchInEditor; 44 protected boolean saveFile = false; 45 46 47 public AddMethodBase(String name) { 48 super(name); 49 } 50 51 protected void waitForEditorText(final EditorOperator editor, final String toSearchInEditor) { 52 try { 53 new Waiter(new Waitable() { 54 public Object actionProduced(Object obj) { 55 return editor.contains(toSearchInEditor)?Boolean.TRUE:null; 56 } 57 public String getDescription() { 58 return("Editor contains "+ toSearchInEditor); } 60 }).waitAction(null); 61 } catch (InterruptedException ie) { 62 throw new JemmyException("Interrupted.", ie); 63 } 64 } 65 66 protected void compareFiles() throws IOException { 67 new org.netbeans.jemmy.EventTool().waitNoEvent(2000); 68 Utils utils = new Utils(this); 69 String beanNames[] = { beanName+"Bean.java", 70 beanName+"Local.java", 71 beanName+"LocalBusiness.java", 72 beanName+"LocalHome.java", 73 beanName+"Remote.java", 74 beanName+"RemoteBusiness.java", 75 beanName+"RemoteHome.java", 76 }; 77 utils.assertFiles(new File (EJBValidation.EJB_PROJECT_PATH + File.separator + "src" + File.separator + "java" + File.separator + "test"), beanNames, getName()+"_"); 78 String ddNames[] = { "ejb-jar.xml", 79 "sun-ejb-jar.xml" 80 }; 81 utils.assertFiles(new File (EJBValidation.EJB_PROJECT_PATH + File.separator + "src" + File.separator + "conf"), ddNames, isDDModified?getName()+"_":""); 82 83 } 84 } 85 | Popular Tags |