[jbosstools-commits] JBoss Tools SVN: r43360 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Sat Sep 1 00:12:19 EDT 2012
Author: ldimaggio
Date: 2012-09-01 00:12:18 -0400 (Sat, 01 Sep 2012)
New Revision: 43360
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java
Log:
Updated to handle Windows System.getProperty("file.separator")
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java 2012-08-31 18:07:36 UTC (rev 43359)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorld.java 2012-09-01 04:12:18 UTC (rev 43360)
@@ -1,5 +1,7 @@
package org.jboss.tools.esb.ui.bot.tests.examples;
+import java.io.IOException;
+
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
@@ -7,6 +9,7 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
import org.junit.AfterClass;
import org.junit.Test;
+import org.jboss.tools.test.util.ScreenRecorderExt;
@Require(server=@Server(type=ServerType.SOA,state=ServerState.Running))
public class HelloWorld extends ESBExampleTest {
@@ -32,11 +35,28 @@
assertTrue("Calling JMS Send message failed, unexpected server output :"+text,text.contains("Body: Hello World"));
text = null;
+ ScreenRecorderExt screenRecorderExt = null;
+ try {
+ screenRecorderExt = new ScreenRecorderExt();
+ screenRecorderExt.start("screen_record.mov");
+ }
+ catch (Exception E) {
+ E.printStackTrace();
+ }
+
text = executeClientGetServerOutput(getExampleClientProjectName(),"src","org.jboss.soa.esb.samples.quickstart.helloworld.test","SendEsbMessage.java");
assertFalse ("Test fails due to ESB deployment error: NNNN", text.contains("ERROR [org.apache.juddi.v3.client.transport.wrapper.RequestHandler]"));
assertNotNull("Calling ESB Send message failed, nothing appened to server log",text);
assertTrue("Calling ESB Send message failed, unexpected server output :"+text,text.contains("hello world esb"));
SWTTestExt.servers.removeAllProjectsFromServer();
+
+ try {
+ screenRecorderExt.stop();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
}
}
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java 2012-08-31 18:07:36 UTC (rev 43359)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/tests/examples/HelloWorldFileAction.java 2012-09-01 04:12:18 UTC (rev 43360)
@@ -64,7 +64,7 @@
SWTBotView theSWTBotView = open.viewOpen(ActionItem.View.GeneralNavigator.LABEL);
SWTBotTreeItem theProject = bot.tree(0).getTreeItem(projectName).select();
bot.menu("File").menu("Properties").click();
- baseDir = bot.textWithLabel("Location:").getText() + "/";
+ baseDir = bot.textWithLabel("Location:").getText() + System.getProperty("file.separator");
bot.button("OK").click();
theSWTBotView = open.viewOpen(ActionItem.View.GeneralNavigator.LABEL);
@@ -98,18 +98,23 @@
editor = projectExplorer.openFile(clientProjectName, "src","org.jboss.soa.esb.samples.quickstart.helloworldfileaction.test", "CreateTestFile.java");
theEditor = editor.bot();
-// System.out.println ("DEBUG " + theEditor.styledText().getText() );
+ //System.out.println ("DEBUG " + theEditor.styledText().getText() );
theEditor.styledText().insertText(10, 0, "//");
- theEditor.styledText().insertText(11, 0, "\t\tString inputDirectory = \"" + baseDir + inputDir + "\";\n");
+ theEditor.styledText().insertText(11, 0, "\t\tString inputDirectory = \"" + baseDir + "\" + System.getProperty(\"file.separator\") + \"inputDir\";\n");
theEditor.styledText().insertText(12, 0, "//");
theEditor.styledText().insertText(13, 0, "\t\tString fileName = \"MyInput.dat" + "\";\n");
theEditor.styledText().insertText(14, 0, "//");
theEditor.styledText().insertText(15, 0, "\t\tString fileContents = \"Hello World In A File\";\n");
- // bot.sleep(30000l);
- // System.out.println ("DEBUG " + theEditor.styledText().getText() );
+ theEditor.styledText().insertText(16, 0, "//");
+ theEditor.styledText().insertText(17, 0, "\t\tFile x = new File(inputDirectory + System.getProperty(\"file.separator\") + fileName);\n");
+ theEditor.styledText().insertText(23, 0, "//");
+ theEditor.styledText().insertText(24, 0, "\t\tSystem.out.println(\"Error while writing the file: \" + inputDirectory + System.getProperty(\"file.separator\") + fileName);\n");
+
+ //bot.sleep(30000l);
+ //System.out.println ("DEBUG " + theEditor.styledText().getText() );
editor.save();
-// bot.sleep(30000l);
+ //bot.sleep(30000l);
String text = executeClientGetServerOutput(getExampleClientProjectName(),"src",
"org.jboss.soa.esb.samples.quickstart.helloworldfileaction.test",
More information about the jbosstools-commits
mailing list