[jbosstools-commits] JBoss Tools SVN: r42687 - in trunk/central/tests/org.jboss.tools.central.test.ui.bot: resources and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Jul 24 02:26:15 EDT 2012


Author: rhopp
Date: 2012-07-24 02:26:14 -0400 (Tue, 24 Jul 2012)
New Revision: 42687

Removed:
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/eap6.swtbot.test.properties
Modified:
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/as7.swtbot.test.properties
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/settings.xml
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java
   trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java
Log:
=Deleted EAP configuration as there is no on hudson

Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/pom.xml	2012-07-24 06:26:14 UTC (rev 42687)
@@ -85,13 +85,13 @@
 							<artifactId>org.jboss.tools.community.project.examples.feature.feature.group</artifactId>
 							<version>0.0.0</version>
 						</dependency>
-<!-- 						<dependency> -->
-<!-- 							<type>p2-installable-unit</type> -->
-<!-- 							<artifactId>org.jboss.tools.maven.project.examples.feature.feature.group</artifactId> -->
-<!-- 							<version>0.0.0</version> -->
-<!-- 						</dependency> -->
 						<dependency>
 							<type>p2-installable-unit</type>
+							<artifactId>org.jboss.tools.maven.project.examples.feature.feature.group</artifactId>
+							<version>0.0.0</version>
+						</dependency>
+						<dependency>
+							<type>p2-installable-unit</type>
 							<artifactId>org.jboss.tools.openshift.express.feature.feature.group</artifactId>
 							<version>0.0.0</version>
 						</dependency>

Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/as7.swtbot.test.properties
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/as7.swtbot.test.properties	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/as7.swtbot.test.properties	2012-07-24 06:26:14 UTC (rev 42687)
@@ -1 +1 @@
-SERVER=AS,7.1,default,${jbosstools.test.jbossas.home}
\ No newline at end of file
+SERVER=AS,7.1,default,/home/rhopp/Runtimes/jboss-as-7.1.1.Final
\ No newline at end of file

Deleted: trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/eap6.swtbot.test.properties
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/eap6.swtbot.test.properties	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/server_properties/eap6.swtbot.test.properties	2012-07-24 06:26:14 UTC (rev 42687)
@@ -1 +0,0 @@
-SERVER=EAP,6.0,default,/home/rhopp/Runtimes/jboss-eap-6.0-ER6/jboss-eap-6.0
\ No newline at end of file

Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/settings.xml
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/settings.xml	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/resources/settings.xml	2012-07-24 06:26:14 UTC (rev 42687)
@@ -50,7 +50,7 @@
 			<repositories>
 				<repository>
 					<id>jboss-eap</id>
-					<url>http://download.lab.bos.redhat.com/rel-eng/repos/jb-eap-6-rhel-6-build/JBEAP-6.0.0-ER6.1/442736/maven/</url>
+					<url>http://maven.repository.redhat.com/techpreview/all/</url>
 					<releases>
 						<enabled>true</enabled>
 					</releases>
@@ -62,7 +62,7 @@
 			<pluginRepositories>
 				<pluginRepository>
 					<id>jboss-eap-maven-plugin-repository</id>
-					<url>http://download.lab.bos.redhat.com/rel-eng/repos/jb-eap-6-rhel-6-build/JBEAP-6.0.0-ER6.1/442736/maven/</url>
+					<url>http://maven.repository.redhat.com/techpreview/all/</url>
 					<releases>
 						<enabled>true</enabled>
 					</releases>
@@ -78,7 +78,7 @@
 			<repositories>
 				<repository>
 					<id>jboss-eap</id>
-					<url>file:///home/rhopp/repositories/jboss-eap-6.0.0.ER5-maven-repository</url>
+					<url>file:///home/rhopp/repositories/jboss-eap-6.0.0-maven-repository</url>
 					<releases>
 						<enabled>true</enabled>
 					</releases>
@@ -90,7 +90,7 @@
 			<pluginRepositories>
 				<pluginRepository>
 					<id>jboss-eap-maven-plugin-repository</id>
-					<url>file:///home/rhopp/repositories/jboss-eap-6.0.0.ER5-maven-repository</url>
+					<url>file:///home/rhopp/repositories/jboss-eap-6.0.0.CR1-maven-repository</url>
 					<releases>
 						<enabled>true</enabled>
 					</releases>
@@ -107,7 +107,7 @@
 				<repository>
 					<id>jboss-wfk-repository</id>
 					<name>JBoss WFK Maven Repository</name>
-					<url>file:///home/rhopp/repositories/jboss-wfk-2.0.0.ER5-maven-repository</url>
+					<url>file:///home/rhopp/repositories/jboss-wfk-2.0.0-maven-repository</url>
 					<layout>default</layout>
 					<releases>
 						<enabled>true</enabled>
@@ -123,7 +123,7 @@
 				<pluginRepository>
 					<id>jboss-wfk-repository-group</id>
 					<name>JBoss WFK Maven Repository</name>
-					<url>file:///home/rhopp/repositories/jboss-wfk-2.0.0.ER5-maven-repository</url>
+					<url>file:///home/rhopp/repositories/jboss-wfk-2.0.0-maven-repository</url>
 					<layout>default</layout>
 					<releases>
 						<enabled>true</enabled>

Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CentralAllBotTests.java	2012-07-24 06:26:14 UTC (rev 42687)
@@ -16,3 +16,4 @@
 public class CentralAllBotTests {
 
 }
+	
\ No newline at end of file

Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/CreateProjectsWithServerTest.java	2012-07-24 06:26:14 UTC (rev 42687)
@@ -99,11 +99,6 @@
 	}
 	
 	@Test
-	public void dummyTest(){
-		
-	}
-	
-	@Test
 	public void createProjectsSectionTest(){
 		//Dynamic web project
 		bot.hyperlink(IDELabel.JBossCentralEditor.DYNAMIC_WEB_PROJECT).click();
@@ -118,6 +113,7 @@
 		bot.waitForShell(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD);
 		bot.waitWhile(new NonSystemJobRunsCondition());
 		assertTrue("New OpenShift Express Application window should have appeared", bot.activeShell().getText().equals(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD));
+		bot.waitWhile(new NonSystemJobRunsCondition());
 		//assertTrue("New OpenShift Express Application window should have appeared", bot.shell(IDELabel.JBossCentralEditor.OPENSHIFT_APP_WIZARD).isActive());
 		bot.activeShell().close();
 		bot.waitWhile(new NonSystemJobRunsCondition());

Modified: trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java
===================================================================
--- trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java	2012-07-24 05:37:25 UTC (rev 42686)
+++ trunk/central/tests/org.jboss.tools.central.test.ui.bot/src/org/jboss/tools/central/test/ui/bot/EmptyTestForHudson.java	2012-07-24 06:26:14 UTC (rev 42687)
@@ -1,17 +1,120 @@
 package org.jboss.tools.central.test.ui.bot;
 
+import java.io.FileNotFoundException;
+
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.SWTFormsBotExt;
 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.ServerType;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.wizards.SWTBotWizard;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 
- at Require(server=@org.jboss.tools.ui.bot.ext.config.Annotations.Server(type=ServerType.JbossAS))
+ at Require
 public class EmptyTestForHudson extends SWTTestExt {
 	
 	
+	@BeforeClass
+	public static void setup() throws FileNotFoundException{
+		util.closeAllEditors(false);
+		util.closeAllViews();
+		bot.menu("Window").menu("Preferences").click();
+		bot.waitForShell("Preferences");
+		bot.tree().getTreeItem("Maven").select();
+		bot.checkBox("Download repository index updates on startup").deselect();
+		bot.clickButton("OK");
+		bot.menu("Help").menu(IDELabel.JBossCentralEditor.JBOSS_CENTRAL).click();
+		util.waitForAll();
+	}
+	
 	@Test
-	public void isRuntimeTest(){
-		assertTrue(jbt.isServerRuntimeDefined());
+	public void testTest(){
+		checkExample(null, IDELabel.JBossCentralEditor.RICHFACES_PROJECT, true);
+		checkExample(null, IDELabel.JBossCentralEditor.SPRING_MVC_PROJECT, true);
+		SWTFormsBotExt formsBot = SWTBotFactory.getFormsBot();
+		formsBot.formTextWithText("Helloworld").click();
+		bot.sleep(TIME_10S);
 	}
+	
+	
+	
+	/**
+	 * 
+	 * @param formsBot formBot==null => link is of type HyperLink else it is of type FormText
+	 * @param formText
+	 * @param readme true if readme should be shown
+	 */
+	
+	private void checkExample(SWTFormsBotExt formsBot, String formText, boolean readme){
+		checkExample(formsBot, formText, readme, null);
+	}
+	
+	/**
+	 * Checks example
+	 * @param formsBot bot for Forms
+	 * @param formText text to be clicked at
+	 * @param readme true if readme is supposed to show, false otherwise
+	 * @param readmeFileName 
+	 */
+	
+	private void checkExample(SWTFormsBotExt formsBot, String formText, boolean readme, String readmeFileName){
+		problems.show();
+		if (formsBot==null){
+			bot.hyperlink(formText).click();
+		}else{
+			try{
+				formsBot.formTextWithText(formText).click();
+			}catch(WidgetNotFoundException wnfex){
+				throw new WidgetNotFoundException("Could not found widget of type Hyperlink and text " +
+						formText, wnfex);
+			}
+		}
+		bot.waitForShell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE);
+		/*SWTBotWizard wizard = new SWTBotWizard(bot.shell(IDELabel.JBossCentralEditor.PROJECT_EXAMPLE).widget);
+		wizard.next();
+		if (wizard.canNext()){
+			bot.comboBox(2).setSelection(1);
+			try{
+				bot.link();
+				fail("There is something wrong with maven repo. Message: \n"+bot.link().getText());
+			}catch (WidgetNotFoundException ex){
+				//everything fine
+			}
+			wizard.next();
+		}
+		wizard.finishWithWait();
+		String readmeText = bot.checkBox(1).getText();
+		assertFalse("Quick fix should not be enabled (Everything should be fine)", bot.checkBox(0).isEnabled());
+		if (readme){
+			assertTrue("Show readme checkbox should be enabled", bot.checkBox(1).isEnabled());
+			assertTrue("Show readme checkbox should be checked by default", bot.checkBox(1).isChecked());
+			if (readmeFileName != null){
+				assertTrue(readmeText.toLowerCase().contains(readmeFileName));
+				bot.clickButton("Finish");
+				assertTrue("Cheat Sheets view should be opened right now", bot.activeView().getTitle().equals("Cheat Sheets"));
+				bot.activeView().close();
+			}else if (readmeText.contains("cheatsheet.xml")){
+				bot.clickButton("Finish");
+				assertTrue("Cheat Sheets view should be opened right now", bot.activeView().getTitle().equals("Cheat Sheets"));
+				bot.activeView().close();
+			}else if (readmeText.toLowerCase().contains("readme.md") || readmeText.toLowerCase().contains("readme.txt")){
+				bot.clickButton("Finish");
+				assertTrue("Readme should have opened in Text Editor", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.editors.text.TextEditor")); //because readmes are opening in browser now.. It's a bug. Jira is created.
+				bot.activeEditor().close();
+			}else if (readmeText.toLowerCase().contains("readme.htm")){
+				bot.clickButton("Finish");
+				assertTrue("Readme should have opened in Internal Browser", bot.activeEditor().getReference().getEditor(false).getClass().getName().contains("org.eclipse.ui.internal.browser.WebBrowserEditor"));
+			}
+		}else{
+			bot.clickButton("Finish");
+		}*/
+		bot.activeShell().close();
+	}
+	
 }



More information about the jbosstools-commits mailing list