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.ActionNoBlock; 26 import org.netbeans.jellytools.actions.OpenAction; 27 import org.netbeans.jellytools.nodes.Node; 28 import org.netbeans.jemmy.JemmyException; 29 import org.netbeans.jemmy.Waitable; 30 import org.netbeans.jemmy.Waiter; 31 import org.netbeans.jemmy.operators.*; 32 import org.netbeans.jemmy.util.PNGEncoder; 33 import org.netbeans.test.j2ee.*; 34 35 39 public class SendMessageTest extends AddMethodBase { 40 41 42 public SendMessageTest(String name) { 43 super(name); 44 } 45 46 47 public static void main(java.lang.String [] args) { 48 junit.textui.TestRunner.run(new SendMessageTest("testSendMessage1InSB")); 50 } 51 52 public void setUp() { 53 System.out.println("######## "+getName()+" #######"); 54 } 55 56 public void testSendMessage1InSB() throws IOException { 57 beanName = "TestingSession"; 58 editorPopup = Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres.Bundle", "LBL_EnterpriseActionGroup") 59 +"|"+Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres.Bundle", "LBL_SendJMSMessageAction"); 60 toSearchInEditor = "sendJMSMessageToTestingMessageDestination"; 61 isDDModified = true; 62 saveFile = true; 63 addMethod(); 64 } 65 66 protected void addMethod() throws IOException { 67 EditorOperator editor = new EditorWindowOperator().getEditor(beanName+"Bean.java"); 68 editor.select(11); 69 70 new ActionNoBlock(null,editorPopup).perform(editor); 72 NbDialogOperator dialog = new NbDialogOperator(Bundle.getStringTrimmed("org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entres.Bundle", "LBL_SelectMessageDestination")); 73 JComboBoxOperator combo=new JComboBoxOperator(dialog, 0); 74 combo.selectItem("TestingEntApp-EJBModule"); 75 dialog.ok(); 76 77 if (saveFile) 78 editor.save(); 79 80 waitForEditorText(editor, toSearchInEditor); 81 82 compareFiles(); 83 } 84 85 } 86 | Popular Tags |