JBoss Tools SVN: r39619 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot: task/editor and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-03-19 11:44:06 -0400 (Mon, 19 Mar 2012)
New Revision: 39619
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/editor/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/editor/CloseAllEditors.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/HotJavaPortletDeploymentRuntime5x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/HotJSFPortletDeploymentRuntime5x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/HotSeamPortletDeploymentRuntime5x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentRuntime5xTemplate.java
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/JSFPortletTestSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/SeamPortletTestSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java
Log:
Created hot deployment tests
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/editor/CloseAllEditors.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/editor/CloseAllEditors.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/editor/CloseAllEditors.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -0,0 +1,25 @@
+package org.jboss.tools.portlet.ui.bot.task.editor;
+
+import java.util.List;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+
+/**
+ * Closes all editors.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class CloseAllEditors extends AbstractSWTTask {
+
+ @Override
+ public void perform() {
+ List<? extends SWTBotEditor> editors = SWTBotFactory.getBot().editors();
+
+ for (SWTBotEditor editor : editors){
+ editor.close();
+ }
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletWizardPageFillingTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletWizardPageFillingTask.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JSFPortletWizardPageFillingTask.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -0,0 +1,26 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss;
+
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+
+/**
+ * JSF portlet specific information in Create Portlet wizard.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class JSFPortletWizardPageFillingTask extends AbstractSWTTask implements WizardPageFillingTask {
+
+ private String name;
+
+ @Override
+ public void perform() {
+ if (name != null){
+ getBot().textWithLabel("Name:").setText(name);
+ }
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2012-03-19 15:41:27 UTC (rev 39618)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -4,6 +4,7 @@
import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletProject;
import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletRuntime5x;
+import org.jboss.tools.portlet.ui.bot.test.core.HotJavaPortletDeploymentRuntime5x;
import org.jboss.tools.portlet.ui.bot.test.core.LoadJavaPortletInBrowserRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.core.RunJavaPortletOnServer;
import org.jboss.tools.portlet.ui.bot.test.example.JSFPortletExampleRuntime4x;
@@ -15,11 +16,13 @@
import org.jboss.tools.portlet.ui.bot.test.jsf.CreateJSFPortletProject;
import org.jboss.tools.portlet.ui.bot.test.jsf.CreateJSFPortletRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.jsf.CreateJSFPortletRuntime5x;
+import org.jboss.tools.portlet.ui.bot.test.jsf.HotJSFPortletDeploymentRuntime5x;
import org.jboss.tools.portlet.ui.bot.test.jsf.LoadJSFPortletInBrowserRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.jsf.RunJSFPortletOnServer;
import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletProject;
import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletRuntime5x;
+import org.jboss.tools.portlet.ui.bot.test.seam.HotSeamPortletDeploymentRuntime5x;
import org.jboss.tools.portlet.ui.bot.test.seam.RunSeamPortletOnServer;
import org.jboss.tools.portlet.ui.bot.test.server.RunAsLoadsPortalURLRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.server.RunAsLoadsPortalURLRuntime5x;
@@ -34,15 +37,18 @@
CreateJavaPortletRuntime5x.class,
RunJavaPortletOnServer.class,
LoadJavaPortletInBrowserRuntime4x.class,
+ HotJavaPortletDeploymentRuntime5x.class,
CreateJSFPortletProject.class,
CreateJSFPortletRuntime4x.class,
CreateJSFPortletRuntime5x.class,
RunJSFPortletOnServer.class,
LoadJSFPortletInBrowserRuntime4x.class,
+ HotJSFPortletDeploymentRuntime5x.class,
CreateSeamPortletProject.class,
CreateSeamPortletRuntime4x.class,
CreateSeamPortletRuntime5x.class,
RunSeamPortletOnServer.class,
+ HotSeamPortletDeploymentRuntime5x.class,
JavaPortletExampleRuntime4x.class,
JSFPortletExampleRuntime4x.class,
SeamPortletExampleRuntime4x.class,
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/HotJavaPortletDeploymentRuntime5x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/HotJavaPortletDeploymentRuntime5x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/HotJavaPortletDeploymentRuntime5x.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -0,0 +1,36 @@
+package org.jboss.tools.portlet.ui.bot.test.core;
+
+import static org.jboss.tools.portlet.ui.bot.test.core.CreateJavaPortletProject.PROJECT_NAME;
+
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JavaPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JavaPortletWizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.template.CreateJavaPortletTemplate;
+import org.jboss.tools.portlet.ui.bot.test.template.HotDeploymentRuntime5xTemplate;
+
+/**
+ * Creates a java portlet and checks if the project is re-deployed.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class HotJavaPortletDeploymentRuntime5x extends HotDeploymentRuntime5xTemplate {
+
+ @Override
+ protected String getProjectName() {
+ return CreateJavaPortletProject.PROJECT_NAME;
+ }
+
+ @Override
+ protected AbstractPortletCreationTask createPortlet() {
+ JavaPortletWizardPageFillingTask task = new JavaPortletWizardPageFillingTask();
+ task.setProject(PROJECT_NAME);
+ task.setPackageName(CreateJavaPortletTemplate.PACKAGE_NAME);
+ task.setClassName("HotDeployedJavaPortlet");
+
+ JavaPortletCreationTask wizardTask = new JavaPortletCreationTask();
+ wizardTask.addWizardPage(task);
+ return wizardTask;
+ }
+
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java 2012-03-19 15:41:27 UTC (rev 39618)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/JavaPortletTestSuite.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -10,7 +10,8 @@
CreateJavaPortletRuntime4x.class,
CreateJavaPortletRuntime5x.class,
RunJavaPortletOnServer.class,
- LoadJavaPortletInBrowserRuntime4x.class
+ LoadJavaPortletInBrowserRuntime4x.class,
+ HotJavaPortletDeploymentRuntime5x.class
})
public class JavaPortletTestSuite {
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/HotJSFPortletDeploymentRuntime5x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/HotJSFPortletDeploymentRuntime5x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/HotJSFPortletDeploymentRuntime5x.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -0,0 +1,33 @@
+package org.jboss.tools.portlet.ui.bot.test.jsf;
+
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JSFPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JSFPortletWizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.template.HotDeploymentRuntime5xTemplate;
+
+/**
+ * Creates a java portlet and checks if the project is re-deployed.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class HotJSFPortletDeploymentRuntime5x extends HotDeploymentRuntime5xTemplate {
+
+ @Override
+ protected String getProjectName() {
+ return CreateJSFPortletProject.PROJECT_NAME;
+ }
+
+ @Override
+ protected AbstractPortletCreationTask createPortlet() {
+ JSFPortletWizardPageFillingTask jsfPage = new JSFPortletWizardPageFillingTask();
+ jsfPage.setName("hotDeployment");
+
+ JSFPortletCreationTask wizard = new JSFPortletCreationTask();
+ wizard.addWizardPage(new WizardPageDefaultsFillingTask());
+ wizard.addWizardPage(jsfPage);
+ wizard.addWizardPage(new WizardPageDefaultsFillingTask());
+ return wizard;
+ }
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/JSFPortletTestSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/JSFPortletTestSuite.java 2012-03-19 15:41:27 UTC (rev 39618)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/JSFPortletTestSuite.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -10,7 +10,8 @@
CreateJSFPortletRuntime4x.class,
CreateJSFPortletRuntime5x.class,
RunJSFPortletOnServer.class,
- LoadJSFPortletInBrowserRuntime4x.class
+ LoadJSFPortletInBrowserRuntime4x.class,
+ HotJSFPortletDeploymentRuntime5x.class
})
public class JSFPortletTestSuite {
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/HotSeamPortletDeploymentRuntime5x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/HotSeamPortletDeploymentRuntime5x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/HotSeamPortletDeploymentRuntime5x.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -0,0 +1,33 @@
+package org.jboss.tools.portlet.ui.bot.test.seam;
+
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JSFPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JSFPortletWizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.template.HotDeploymentRuntime5xTemplate;
+
+/**
+ * Creates a java portlet and checks if the project is re-deployed.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class HotSeamPortletDeploymentRuntime5x extends HotDeploymentRuntime5xTemplate {
+
+ @Override
+ protected String getProjectName() {
+ return CreateSeamPortletProject.PROJECT_NAME;
+ }
+
+ @Override
+ protected AbstractPortletCreationTask createPortlet() {
+ JSFPortletWizardPageFillingTask jsfPage = new JSFPortletWizardPageFillingTask();
+ jsfPage.setName("hotDeployment");
+
+ JSFPortletCreationTask wizard = new JSFPortletCreationTask();
+ wizard.addWizardPage(new WizardPageDefaultsFillingTask());
+ wizard.addWizardPage(jsfPage);
+ wizard.addWizardPage(new WizardPageDefaultsFillingTask());
+ return wizard;
+ }
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/SeamPortletTestSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/SeamPortletTestSuite.java 2012-03-19 15:41:27 UTC (rev 39618)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/SeamPortletTestSuite.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -9,7 +9,8 @@
CreateSeamPortletProject.class,
CreateSeamPortletRuntime4x.class,
CreateSeamPortletRuntime5x.class,
- RunSeamPortletOnServer.class
+ RunSeamPortletOnServer.class,
+ HotSeamPortletDeploymentRuntime5x.class
})
public class SeamPortletTestSuite {
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java 2012-03-19 15:41:27 UTC (rev 39618)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreateJavaPortletTemplate.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -25,7 +25,7 @@
public static final String CLASS_NAME = "UITestingJavaPortlet";
- protected static final String PACKAGE_NAME = "org.jboss.tools.tests.ui.portlet";
+ public static final String PACKAGE_NAME = "org.jboss.tools.tests.ui.portlet";
protected static final String SOURCE_FILE_NAME = "src";
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentRuntime5xTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentRuntime5xTemplate.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentRuntime5xTemplate.java 2012-03-19 15:44:06 UTC (rev 39619)
@@ -0,0 +1,37 @@
+package org.jboss.tools.portlet.ui.bot.test.template;
+
+import static org.jboss.tools.portlet.ui.bot.matcher.WorkspaceAssert.assertThatInWorkspace;
+
+import org.jboss.tools.portlet.ui.bot.matcher.console.ConsoleOutputMatcher;
+import org.jboss.tools.portlet.ui.bot.task.console.ConsoleClearingTask;
+import org.jboss.tools.portlet.ui.bot.task.editor.CloseAllEditors;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.AbstractPortletCreationTask;
+import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.junit.Test;
+
+/**
+ * Creates a new portlet and checks if the project is hot deployed (undeployed and deployed).
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+@Require(clearWorkspace=false, clearProjects=false, server=@Server(version="5.0", operator=">", state=ServerState.Present))
+public abstract class HotDeploymentRuntime5xTemplate extends SWTTaskBasedTestCase {
+
+ protected abstract String getProjectName();
+
+ protected abstract AbstractPortletCreationTask createPortlet();
+
+ @Test
+ public void hotDeployment(){
+ doPerform(new CloseAllEditors());
+ doPerform(new ConsoleClearingTask());
+ doPerform(createPortlet());
+
+ assertThatInWorkspace("undeploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher());
+ assertThatInWorkspace("deploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher());
+ }
+}
12 years, 7 months
JBoss Tools SVN: r39618 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-03-19 11:41:27 -0400 (Mon, 19 Mar 2012)
New Revision: 39618
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/HibernateBaseTest.java
Log:
Hibernate Base test closing all shells added (for offline Central jobs)
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/HibernateBaseTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/HibernateBaseTest.java 2012-03-19 15:39:56 UTC (rev 39617)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/HibernateBaseTest.java 2012-03-19 15:41:27 UTC (rev 39618)
@@ -22,6 +22,7 @@
eclipse.closeView(IDELabel.View.JBOSS_CENTRAL);
eclipse.closeAllEditors();
util.waitForAll();
+ bot.closeAllShells();
}
@Test
12 years, 7 months
JBoss Tools SVN: r39617 - in trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot: test/generation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-03-19 11:39:56 -0400 (Mon, 19 Mar 2012)
New Revision: 39617
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPADDLGenerationTest.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPAEntitiesGenerationTest.java
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java
Log:
JPA Code generation (Entity/DDL) tests added, Hibernate generation test modified
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java 2012-03-19 15:37:55 UTC (rev 39616)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/suite/CodeGenerationSuite.java 2012-03-19 15:39:56 UTC (rev 39617)
@@ -1,12 +1,17 @@
package org.jboss.tools.hb.ui.bot.suite;
import org.jboss.tools.hb.ui.bot.test.generation.CreateCodeGenerationConfiguration;
+import org.jboss.tools.hb.ui.bot.test.generation.JPADDLGenerationTest;
+import org.jboss.tools.hb.ui.bot.test.generation.JPAEntitiesGenerationTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(RequirementAwareSuite.class)
-(a)SuiteClasses({CreateCodeGenerationConfiguration.class})
+//(a)SuiteClasses({CreateCodeGenerationConfiguration.class})
+//(a)SuiteClasses({JPADDLGenerationTest.class})
+//(a)SuiteClasses({JPAEntitiesGenerationTest.class})
+(a)SuiteClasses({CreateCodeGenerationConfiguration.class,JPADDLGenerationTest.class,JPAEntitiesGenerationTest.class})
public class CodeGenerationSuite {
}
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java 2012-03-19 15:37:55 UTC (rev 39616)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/CreateCodeGenerationConfiguration.java 2012-03-19 15:39:56 UTC (rev 39617)
@@ -18,7 +18,7 @@
* @author jpeterka
*
*/
-@Require(db = @DB, clearProjects = false, perspective = "Hibernate")
+@Require(db = @DB, clearProjects = true, perspective = "Hibernate")
public class CreateCodeGenerationConfiguration extends HibernateBaseTest {
final String prjName = "hibernate35";
@@ -31,8 +31,7 @@
fillExportersTab(dlg);
fillRefreshTab(dlg);
fillCommonTab(dlg);
- runCodeGeneration();
-
+ runCodeGeneration();
}
private SWTBotShell openCodeGenerationDlg() {
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPADDLGenerationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPADDLGenerationTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPADDLGenerationTest.java 2012-03-19 15:39:56 UTC (rev 39617)
@@ -0,0 +1,51 @@
+package org.jboss.tools.hb.ui.bot.test.generation;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.hb.ui.bot.common.ConfigurationFile;
+import org.jboss.tools.hb.ui.bot.common.PersistenceXML;
+import org.jboss.tools.hb.ui.bot.test.HibernateBaseTest;
+import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+@Require(db = @DB, clearProjects = true, perspective = "JPA")
+public class JPADDLGenerationTest extends HibernateBaseTest {
+
+ final String prj = "jpatest35";
+ final String out = "src";
+ final String hbcfg = "hibernate.cfg.xml";
+
+ @Test
+ public void createJPAProject() {
+ importTestProject("/resources/prj/" + prj);
+ createHBConfigurationAndSetPersistence();
+ generateDDLFromEntities();
+ }
+
+ private void createHBConfigurationAndSetPersistence() {
+ ConfigurationFile.create(new String[]{prj,"src"}, hbcfg,false);
+ PersistenceXML.openPersistenceXML(prj);
+ PersistenceXML.setHibernateConfiguration("/" + hbcfg);
+ }
+
+ private void generateDDLFromEntities() {
+ // Select project
+ SWTBotView viewBot = bot.viewByTitle(IDELabel.View.PROJECT_EXPLORER);
+ SWTBotTree tree = viewBot.bot().tree().select(prj);
+
+ // JPA Tools -> Generate Tables From Entities
+ ContextMenuHelper.clickContextMenu(tree, "JPA Tools",
+ "Generate Tables from Entities...");
+
+ // DDL Generation Dialog
+ String outputDir = prj + "/" + out;
+ bot.textWithLabel("Output directory:").setText(outputDir);
+ bot.textWithLabel("File name").setText(out);
+
+ bot.button(IDELabel.Button.FINISH).click();
+ }
+
+}
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPADDLGenerationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPAEntitiesGenerationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPAEntitiesGenerationTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPAEntitiesGenerationTest.java 2012-03-19 15:39:56 UTC (rev 39617)
@@ -0,0 +1,49 @@
+package org.jboss.tools.hb.ui.bot.test.generation;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.hb.ui.bot.common.ConfigurationFile;
+import org.jboss.tools.hb.ui.bot.common.PersistenceXML;
+import org.jboss.tools.hb.ui.bot.test.HibernateBaseTest;
+import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.Test;
+
+@Require(db = @DB, clearProjects = true, perspective = "JPA")
+public class JPAEntitiesGenerationTest extends HibernateBaseTest {
+
+ final String prj = "jpatest35";
+ final String out = "src";
+ final String hbcfg = "hibernate.cfg.xml";
+
+ @Test
+ public void generateJPAEntitiesFromDB() {
+ importTestProject("/resources/prj/" + prj);
+ createHBConfigurationAndSetPersistence();
+ generateEntitiesFromDB();
+ }
+
+ private void createHBConfigurationAndSetPersistence() {
+ ConfigurationFile.create(new String[]{prj,"src"}, hbcfg,false);
+ PersistenceXML.openPersistenceXML(prj);
+ PersistenceXML.setHibernateConfiguration("/" + hbcfg);
+ }
+
+ private void generateEntitiesFromDB() {
+ SWTBotView viewBot = bot.viewByTitle(IDELabel.View.PROJECT_EXPLORER);
+ SWTBotTree tree = viewBot.bot().tree().select(prj);
+
+ // JPA Tools -> Generate Tables From Entities
+ ContextMenuHelper.clickContextMenu(tree, "JPA Tools",
+ "Generate Tables from Entities...");
+
+ // DDL Generation Dialog
+ String outputDir = prj + "/" + out;
+ bot.textWithLabel("Output directory:").setText(outputDir);
+ bot.textWithLabel("File name").setText(out);
+
+ bot.button(IDELabel.Button.FINISH).click();
+ }
+}
\ No newline at end of file
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/test/generation/JPAEntitiesGenerationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 7 months
JBoss Tools SVN: r39616 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-03-19 11:37:55 -0400 (Mon, 19 Mar 2012)
New Revision: 39616
Added:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConsoleConfiguration.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/PersistenceXML.java
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConfigurationFile.java
Log:
Hibernate bot common update, ConsoleConfiguration and PersistenceXML added
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConfigurationFile.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConfigurationFile.java 2012-03-19 15:28:47 UTC (rev 39615)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConfigurationFile.java 2012-03-19 15:37:55 UTC (rev 39616)
@@ -35,7 +35,7 @@
bot.editorByTitle(path[path.length - 1]).show();
}
- public static void create(String[] path, String cfgName) {
+ public static void create(String[] path, String cfgName, boolean createConsole) {
SWTBotExt bot = new SWTBotExt();
SWTEclipseExt eclipse = new SWTEclipseExt();
SWTOpenExt open = new SWTOpenExt(bot);
@@ -61,14 +61,27 @@
bot.comboBoxWithLabel(IDELabel.HBConsoleWizard.CONNECTION_URL).setText(
jdbc);
+ // Username & password
+ String username = TestConfigurator.currentConfig.getDB().username;
+ bot.textWithLabel("Username:").setText(username);
+ String password = TestConfigurator.currentConfig.getDB().password;
+ bot.textWithLabel("Password:").setText(password);
+
// Create console configuration
Matcher<Button> matcher = WidgetMatcherFactory
.withText(IDELabel.HBConsoleWizard.CREATE_CONSOLE_CONFIGURATION);
Button button = bot.widget(matcher);
SWTBotCheckBox cb = new SWTBotCheckBox(button);
- if (!cb.isChecked())
- cb.click();
+ // Create hibernate Console during hibernate configuration
+ if (createConsole) {
+ if (!cb.isChecked())
+ cb.click();
+ }
+ else {
+ if (cb.isChecked())
+ cb.click();
+ }
SWTBotShell shell = bot.activeShell();
bot.button(IDELabel.Button.FINISH).click();
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConsoleConfiguration.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConsoleConfiguration.java 2012-03-19 15:37:55 UTC (rev 39616)
@@ -0,0 +1,5 @@
+package org.jboss.tools.hb.ui.bot.common;
+
+public class ConsoleConfiguration {
+
+}
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/ConsoleConfiguration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/PersistenceXML.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/PersistenceXML.java (rev 0)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/PersistenceXML.java 2012-03-19 15:37:55 UTC (rev 39616)
@@ -0,0 +1,29 @@
+package org.jboss.tools.hb.ui.bot.common;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTOpenExt;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+
+public class PersistenceXML {
+
+ static SWTBotExt bot = new SWTBotExt();
+ static SWTOpenExt open = new SWTOpenExt(bot);
+
+ public static void openPersistenceXML(String prj) {
+ SWTBotView pe = open.viewOpen(ActionItem.View.GeneralProjectExplorer.LABEL);
+ Tree.open(pe.bot(), prj,"JPA Content","persistence.xml");
+ }
+
+ public static void setHibernateConfiguration(String path) {
+ SWTBotEditor editor = bot.editorByTitle("persistence.xml");
+ editor.show();
+ SWTBotMultiPageEditor mpe = new SWTBotMultiPageEditor(editor.getReference(), bot);
+ mpe.activatePage("Hibernate");
+
+ bot.textWithLabel("Configuration file:").setText(path);
+ editor.save();
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/src/org/jboss/tools/hb/ui/bot/common/PersistenceXML.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 7 months
JBoss Tools SVN: r39615 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test: editor/tags and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-03-19 11:28:47 -0400 (Mon, 19 Mar 2012)
New Revision: 39615
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AudioTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CanvasTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DetailsTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/SummaryTagTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java
Log:
Added tests for HTML5 tags <AUDIO>, <CANVAS>, <COMMAND>, <DETAILS> and <SUMMARY>.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2012-03-19 14:23:07 UTC (rev 39614)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -46,14 +46,17 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.AjaxValidatorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ArticleTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.AsideTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.AudioTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.BeanValidatorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CalendarTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.CanvasTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ColumnGroupTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ColumnTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ColumnsTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ComboBoxTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CommandButtonTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CommandLinkTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.CommandTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.CoreHTMLTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataDefinitionTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataGridTagTest;
@@ -61,6 +64,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataOrderedListTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataScrollerTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.DataTableTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.DetailsTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.EditorTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ExtendedDataTableTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.FileUploadTagTest;
@@ -76,6 +80,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.tags.PickListTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ProgressTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.SpacerTagTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.tags.SummaryTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.TogglePanelAndToogleControlTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.ToolbarAndToolbarGroupTagTest;
import org.jboss.tools.vpe.ui.bot.test.editor.tags.TreeTagTest;
@@ -194,7 +199,12 @@
TestNPEinHugeFile.class,
Jbide10020_TestHotKeyForVpeRefresh.class,
ArticleTagTest.class,
- AsideTagTest.class
+ AsideTagTest.class,
+ AudioTagTest.class,
+ CanvasTagTest.class,
+ CommandTagTest.class,
+ DetailsTagTest.class,
+ SummaryTagTest.class
})
public class VPEAllBotTests extends SWTBotTestCase{
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java 2012-03-19 14:23:07 UTC (rev 39614)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/ArticleTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -1,6 +1,6 @@
/*******************************************************************************
- * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,7 +12,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor.tags;
/**
- * Tests Rich Faces Calendar Tag behavior
+ * Tests Article Tag behavior
* @author vlado pakan
*
*/
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java 2012-03-19 14:23:07 UTC (rev 39614)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AsideTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -1,6 +1,6 @@
/*******************************************************************************
- * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,7 +12,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor.tags;
/**
- * Tests Rich Faces Calendar Tag behavior
+ * Tests Aside Tag behavior
* @author vlado pakan
*
*/
@@ -39,9 +39,9 @@
protected void verifyTag() {
// check Problems View for Errors
assertProbelmsViewNoErrors(botExt);
- // visual representation contains ARTICLE tag
+ // visual representation contains ASIDE tag
assertVisualEditorContains(getVisualEditor(), "ASIDE", null, null, getTestPageFileName());
- // visual representation contains ARTICLE_TEXT text
+ // visual representation contains ASIDE_TEXT text
assertVisualEditorContainsNodeWithValue(getVisualEditor(),
AsideTagTest.ASIDE_TEXT, getTestPageFileName());
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AudioTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AudioTagTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AudioTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+/**
+ * Tests AUDIO Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class AudioTagTest extends AbstractTagTest{
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <audio>\n" +
+ " </audio>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains AUDIO tag
+ assertVisualEditorContains(getVisualEditor(), "AUDIO", null, null, getTestPageFileName());
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/AudioTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CanvasTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CanvasTagTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CanvasTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+/**
+ * Tests ASIDE Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class CanvasTagTest extends AbstractTagTest{
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <canvas id=\"myCanvas\"></canvas>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains CANVAS tag
+ assertVisualEditorContains(getVisualEditor(), "CANVAS", null, null, getTestPageFileName());
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CanvasTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandTagTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+/**
+ * Tests Command Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class CommandTagTest extends AbstractTagTest{
+ private static String COMMAND_TEXT = "COMMAND-TEXT";
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <command type=\"command\" label=\"Command Label\" onclick=\"command()\">" +
+ CommandTagTest.COMMAND_TEXT + "</command>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains COMMAND tag
+ assertVisualEditorContains(getVisualEditor(), "COMMAND", null, null, getTestPageFileName());
+ // visual representation contains COMMAND_TEXT text
+ assertVisualEditorContainsNodeWithValue(getVisualEditor(),
+ CommandTagTest.COMMAND_TEXT, getTestPageFileName());
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/CommandTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DetailsTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DetailsTagTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DetailsTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+/**
+ * Tests Details Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class DetailsTagTest extends AbstractTagTest{
+ private static String DETAILS_TEXT = "!@#$ Details text $#@!";
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <details>" + DetailsTagTest.DETAILS_TEXT + "</details>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains DETAILS tag
+ assertVisualEditorContains(getVisualEditor(), "DETAILS", null, null, getTestPageFileName());
+ // visual representation contains DETAILS_TEXT text
+ assertVisualEditorContainsNodeWithValue(getVisualEditor(),
+ DetailsTagTest.DETAILS_TEXT, getTestPageFileName());
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/DetailsTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/SummaryTagTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/SummaryTagTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/SummaryTagTest.java 2012-03-19 15:28:47 UTC (rev 39615)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2012 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor.tags;
+
+/**
+ * Tests Summary Tag behavior
+ * @author vlado pakan
+ *
+ */
+public class SummaryTagTest extends AbstractTagTest{
+ private static String SUMMARY_TEXT = "!@#$ Summary text $#@!";
+ @Override
+ protected void initTestPage() {
+ initTestPage(TestPageType.HTML,
+ "<!DOCTYPE html>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +
+ " <title>Insert title here</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <summary>" + SummaryTagTest.SUMMARY_TEXT + "</summary>\n" +
+ " </body>\n" +
+ "</html>\n");
+ }
+
+ @Override
+ protected void verifyTag() {
+ // check Problems View for Errors
+ assertProbelmsViewNoErrors(botExt);
+ // visual representation contains SUMMARY tag
+ assertVisualEditorContains(getVisualEditor(), "SUMMARY", null, null, getTestPageFileName());
+ // visual representation contains SUMMARY_TEXT text
+ assertVisualEditorContainsNodeWithValue(getVisualEditor(),
+ SummaryTagTest.SUMMARY_TEXT, getTestPageFileName());
+ }
+
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/SummaryTagTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 7 months
JBoss Tools SVN: r39614 - trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-03-19 10:23:07 -0400 (Mon, 19 Mar 2012)
New Revision: 39614
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JavaHBMQueryTest.java
Log:
https://issues.jboss.org/browse/JBIDE-11342
Added check completion proposals are not empty
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JavaHBMQueryTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JavaHBMQueryTest.java 2012-03-19 14:14:59 UTC (rev 39613)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JavaHBMQueryTest.java 2012-03-19 14:23:07 UTC (rev 39614)
@@ -106,6 +106,7 @@
HQLJavaCompletionProposalComputer proposalComputer = new HQLJavaCompletionProposalComputer();
ContentAssistInvocationContext context = new JavaContentAssistInvocationContext(editor.getViewer(), 125, editor);
List<ICompletionProposal> computeCompletionProposals = proposalComputer.computeCompletionProposals(context, null);
+ assertTrue(computeCompletionProposals.size() > 0);
for (ICompletionProposal iCompletionProposal : computeCompletionProposals) {
Class<? extends ICompletionProposal> class1 = iCompletionProposal.getClass();
if (class1.getPackage().getName().indexOf("org.jboss.tools.hibernate") == 0){
12 years, 7 months
JBoss Tools SVN: r39613 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-03-19 10:14:59 -0400 (Mon, 19 Mar 2012)
New Revision: 39613
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java
Log:
Added wait till the jobs are finished
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java 2012-03-19 13:10:46 UTC (rev 39612)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java 2012-03-19 14:14:59 UTC (rev 39613)
@@ -2,6 +2,8 @@
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Performs Run on Server on the specified project.
@@ -21,5 +23,6 @@
public void perform() {
SWTBotFactory.getPackageexplorer().show();
SWTBotFactory.getPackageexplorer().runOnServer(project);
+ getBot().waitWhile(new NonSystemJobRunsCondition(), TaskDuration.NORMAL.getTimeout());
}
}
12 years, 7 months
JBoss Tools SVN: r39612 - trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-03-19 09:10:46 -0400 (Mon, 19 Mar 2012)
New Revision: 39612
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
Log:
Created tests for the URL loaded in browser after Run as...
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2012-03-19 12:27:48 UTC (rev 39611)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/AllTestsSuite.java 2012-03-19 13:10:46 UTC (rev 39612)
@@ -21,6 +21,8 @@
import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletRuntime4x;
import org.jboss.tools.portlet.ui.bot.test.seam.CreateSeamPortletRuntime5x;
import org.jboss.tools.portlet.ui.bot.test.seam.RunSeamPortletOnServer;
+import org.jboss.tools.portlet.ui.bot.test.server.RunAsLoadsPortalURLRuntime4x;
+import org.jboss.tools.portlet.ui.bot.test.server.RunAsLoadsPortalURLRuntime5x;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -47,7 +49,9 @@
JSFPortletExampleRuntime5x.class,
RichFacesPortletExampleRuntime5x.class,
SeamPortletExampleRuntime5x.class,
- JBDS4vs5Compatibility.class
+ JBDS4vs5Compatibility.class,
+ RunAsLoadsPortalURLRuntime4x.class,
+ RunAsLoadsPortalURLRuntime5x.class
})
public class AllTestsSuite {
12 years, 7 months
JBoss Tools SVN: r39611 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-03-19 08:27:48 -0400 (Mon, 19 Mar 2012)
New Revision: 39611
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/externalize.png
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18nHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://issues.jboss.org/browse/JBIDE-11302 - i18n icon was added to the VPE toolbar.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2012-03-19 12:26:45 UTC (rev 39610)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2012-03-19 12:27:48 UTC (rev 39611)
@@ -323,34 +323,6 @@
</visibleWhen>
</command>
</menuContribution>
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.workbench.navigate?after=forwardHistory">
- <command
- commandId="org.jboss.tools.jst.jsp.commands.showSelectionBar"
- icon="icons/selbar.gif"
- id="org.jboss.tools.jst.jsp.toolbars.showSelectionBar"
- style="toggle"
- tooltip="%Toggle.Selection.Bar">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeEditorId">
- <or>
- <equals
- value="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- </equals>
- <equals
- value="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- </equals>
- <equals
- value="org.jboss.tools.jst.jsp.jspeditor.DocBookEditor">
- </equals>
- </or>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
-
<menuContribution
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.source.EditorContext?after=org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem">
<dynamic
@@ -408,24 +380,20 @@
icon="icons/externalize.png"
id="org.jboss.tools.jst.jsp.toolbars.i18"
tooltip="%Externalize.Selected.Property">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeEditorId">
- <or>
- <equals
- value="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor">
- </equals>
- <equals
- value="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor">
- </equals>
- <equals
- value="org.jboss.tools.jst.jsp.jspeditor.DocBookEditor">
- </equals>
- </or>
- </with>
- </visibleWhen>
+ <visibleWhen checkEnabled="false">
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
+ </visibleWhen>
</command>
+ <command
+ commandId="org.jboss.tools.jst.jsp.commands.showSelectionBar"
+ icon="icons/selbar.gif"
+ id="org.jboss.tools.jst.jsp.toolbars.showSelectionBar"
+ style="toggle"
+ tooltip="%Toggle.Selection.Bar">
+ <visibleWhen checkEnabled="false">
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
+ </visibleWhen>
+ </command>
</toolbar>
</menuContribution>
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java 2012-03-19 12:26:45 UTC (rev 39610)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsUtils.java 2012-03-19 12:27:48 UTC (rev 39611)
@@ -87,6 +87,7 @@
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.URIConstants;
+import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -136,6 +137,54 @@
}
/**
+ * Check if the current selected text could be externalized
+ *
+ * @param selection text selection
+ * @return true, if i18n is possible
+ */
+ public static boolean isExternalizeStringsCommandEnabled(ISelection selection) {
+ boolean enabled=false;
+ String stringToUpdate = ""; //$NON-NLS-1$
+ if (isSelectionCorrect(selection)) {
+ String text = ""; //$NON-NLS-1$
+ TextSelection textSelection = null;
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ textSelection = (TextSelection) selection;
+ text = textSelection.getText();
+ Object selectedElement = structuredSelection.getFirstElement();
+ /*
+ * When selected text is empty parse selected element and find a
+ * string to replace..
+ */
+ if ((text.trim().length() == 0)) {
+ if (selectedElement instanceof org.w3c.dom.Text) {
+ /*
+ * ..it could be a plain text
+ */
+ org.w3c.dom.Text textNode = (org.w3c.dom.Text) selectedElement;
+ if (textNode.getNodeValue().trim().length() > 0) {
+ stringToUpdate = textNode.getNodeValue();
+ }
+ } else if (selectedElement instanceof Attr) {
+ /*
+ * ..or an attribute's value
+ */
+ Attr attrNode = (Attr) selectedElement;
+ if (attrNode.getNodeValue().trim().length() > 0) {
+ stringToUpdate = attrNode.getNodeValue();
+ }
+ }
+ } else {
+ stringToUpdate = text;
+ }
+ }
+ if ((stringToUpdate.length() > 0)) {
+ enabled=true;
+ }
+ return enabled;
+ }
+
+ /**
* Find faces config xml file using XModel.
*
* @param model
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18nHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18nHandler.java 2012-03-19 12:26:45 UTC (rev 39610)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18nHandler.java 2012-03-19 12:27:48 UTC (rev 39611)
@@ -49,63 +49,13 @@
if(activeEditor instanceof ITextEditor){
ITextEditor txtEditor = (ITextEditor) activeEditor;
ISelection selection = txtEditor.getSelectionProvider().getSelection();
- enabled = getExternalizeStringsCommandEnabled(selection);
+ enabled = ExternalizeStringsUtils.isExternalizeStringsCommandEnabled(selection);
}
}
if (isEnabled() != enabled) {
setBaseEnabled(enabled);
}
}
-
-// public I18nHandler() {
-// setBaseEnabled(true);
-// }
- /**
- * Calculates the state of ext command
- * @param selection
- * @return
- */
- private static boolean getExternalizeStringsCommandEnabled(ISelection selection) {
- boolean enabled=false;
- String stringToUpdate = ""; //$NON-NLS-1$
- if (ExternalizeStringsUtils.isSelectionCorrect(selection)) {
- String text = ""; //$NON-NLS-1$
- TextSelection textSelection = null;
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- textSelection = (TextSelection) selection;
- text = textSelection.getText();
- Object selectedElement = structuredSelection.getFirstElement();
- /*
- * When selected text is empty parse selected element and find a
- * string to replace..
- */
- if ((text.trim().length() == 0)) {
- if (selectedElement instanceof org.w3c.dom.Text) {
- /*
- * ..it could be a plain text
- */
- org.w3c.dom.Text textNode = (org.w3c.dom.Text) selectedElement;
- if (textNode.getNodeValue().trim().length() > 0) {
- stringToUpdate = textNode.getNodeValue();
- }
- } else if (selectedElement instanceof Attr) {
- /*
- * ..or an attribute's value
- */
- Attr attrNode = (Attr) selectedElement;
- if (attrNode.getNodeValue().trim().length() > 0) {
- stringToUpdate = attrNode.getNodeValue();
- }
- }
- } else {
- stringToUpdate = text;
- }
- }
- if ((stringToUpdate.length() > 0)) {
- enabled=true;
- }
- return enabled;
- }
/**
* the command has been executed, so extract extract the needed information
Added: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/externalize.png
===================================================================
(Binary files differ)
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/editor/mozilla/icons/externalize.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2012-03-19 12:26:45 UTC (rev 39610)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2012-03-19 12:27:48 UTC (rev 39611)
@@ -431,6 +431,12 @@
sourceSelectionChanged(true);
refreshCommands();
/*
+ * Enable/disable "Externalize strings" toolbar icon
+ * after after initialization
+ */
+ visualEditor.updateExternalizeStringsToolbarIconState(
+ sourceEditor.getSelectionProvider().getSelection());
+ /*
* Reset the flag, to enable scroll synchronizing right after init
*/
selectionManager.setUpdateSelectionEventFlag(false);
@@ -1628,6 +1634,12 @@
return;
}
/*
+ * Enable/disable "Externalize strings" toolbar icon
+ * after selection has been changed
+ */
+ visualEditor.updateExternalizeStringsToolbarIconState(
+ sourceEditor.getSelectionProvider().getSelection());
+ /*
* Update Text Formatting Toolbar state
*/
if (editPart.getVisualMode() != VpeEditorPart.SOURCE_MODE) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2012-03-19 12:26:45 UTC (rev 39610)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2012-03-19 12:27:48 UTC (rev 39611)
@@ -33,6 +33,7 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.ProgressEvent;
@@ -62,6 +63,10 @@
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.statushandlers.StatusAdapter;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsDialog;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsUtils;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsWizard;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeController;
@@ -123,7 +128,8 @@
public static final String ICON_TEXT_FORMATTING = "icons/text-formatting.gif"; //$NON-NLS-1$
public static final String ICON_BUNDLE_AS_EL= "icons/bundle-as-el.gif"; //$NON-NLS-1$
public static final String ICON_SCROLL_LOCK= "icons/scroll_lock.gif"; //$NON-NLS-1$
-
+ public static final String ICON_EXTERNALIZE_STRINGS= "icons/externalize.png"; //$NON-NLS-1$
+
private XulRunnerEditor xulRunnerEditor;
private nsIDOMElement contentArea;
private nsIDOMNode headNode;
@@ -150,6 +156,7 @@
private Action showTextFormattingAction;
private Action showBundleAsELAction;
private Action scrollLockAction;
+ private Action externalizeStringsAction;
static {
/*
@@ -449,27 +456,28 @@
/*
* Create EXTERNALIZE STRINGS tool bar item
*/
-// externalizeStringsAction = new Action(JstUIMessages.EXTERNALIZE_STRINGS,
-// IAction.AS_PUSH_BUTTON) {
-// @Override
-// public void run() {
-// /*
-// * Externalize strings action.
-// * Show a dialog to add properties key and value.
-// * When selection is correct show the dialog
-// * otherwise the toolbar icon will be disabled.
-// */
-// ExternalizeStringsDialog dlg = new ExternalizeStringsDialog(
-// PlatformUI.getWorkbench().getDisplay().getActiveShell(),
-// new ExternalizeStringsWizard(controller.getSourceEditor(),
-// controller.getPageContext().getBundle()));
-// dlg.open();
-// }
-// };
-// externalizeStringsAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
-// ICON_EXTERNALIZE_STRINGS));
-// externalizeStringsAction.setToolTipText(JstUIMessages.EXTERNALIZE_STRINGS);
-// toolBarManager.add(externalizeStringsAction);
+ externalizeStringsAction = new Action(JstUIMessages.EXTERNALIZE_STRINGS,
+ IAction.AS_PUSH_BUTTON) {
+
+ @Override
+ public void run() {
+ /*
+ * Externalize strings action.
+ * Show a dialog to add properties key and value.
+ * When selection is correct show the dialog
+ * otherwise the toolbar icon will be disabled.
+ */
+ ExternalizeStringsDialog dlg = new ExternalizeStringsDialog(
+ PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ new ExternalizeStringsWizard(controller.getSourceEditor(),
+ controller.getPageContext().getBundle()));
+ dlg.open();
+ }
+ };
+ externalizeStringsAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
+ ICON_EXTERNALIZE_STRINGS));
+ externalizeStringsAction.setToolTipText(JstUIMessages.EXTERNALIZE_STRINGS);
+ toolBarManager.add(externalizeStringsAction);
updateToolbarItemsAccordingToPreferences();
toolBarManager.update(true);
@@ -487,7 +495,7 @@
showNonVisualTagsAction = null;
showTextFormattingAction = null;
showBundleAsELAction = null;
-// externalizeStringsAction = null;
+ externalizeStringsAction = null;
}
});
return verBar;
@@ -1029,6 +1037,20 @@
return dropDownMenu;
}
+ /**
+ * Update Externalize Strings toolbar icon state.
+ * <p>
+ * Enables the button when suitable text is selected.
+ * Disabled otherwise.
+ */
+ public void updateExternalizeStringsToolbarIconState(ISelection selection) {
+ if (ExternalizeStringsUtils.isExternalizeStringsCommandEnabled(selection)) {
+ externalizeStringsAction.setEnabled(true);
+ } else {
+ externalizeStringsAction.setEnabled(false);
+ }
+ }
+
public void updateToolbarItemsAccordingToPreferences() {
String prefsOrientation = JspEditorPlugin
.getDefault().getPreferenceStore().getString(
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java 2012-03-19 12:26:45 UTC (rev 39610)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java 2012-03-19 12:27:48 UTC (rev 39611)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor.toolbar;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
-
-/**
- * @author mareshkau
- *
- */
-public class VPEPropertyTester extends PropertyTester{
-
- public boolean test(Object receiver, String property, Object[] args,
- Object expectedValue) {
- return !JspEditorPlugin.getDefault().getPreferenceStore()
- .getBoolean(IVpePreferencesPage.SHOW_VISUAL_TOOLBAR);
- }
-}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/toolbar/VPEPropertyTester.java 2012-03-19 12:27:48 UTC (rev 39611)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.toolbar;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VPEPropertyTester extends PropertyTester{
+
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+ return !JspEditorPlugin.getDefault().getPreferenceStore()
+ .getBoolean(IVpePreferencesPage.SHOW_VISUAL_TOOLBAR);
+ }
+}
12 years, 7 months
JBoss Tools SVN: r39610 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test: src/org/jboss/tools/portlet/ui/bot/matcher/browser and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-03-19 08:26:45 -0400 (Mon, 19 Mar 2012)
New Revision: 39610
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/PortletServerTestSuite.launch
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/Facets.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/PortletServerTestSuite.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime4x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime5x.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunPortletOnServerTemplate.java
Log:
Created tests for the URL loaded in browser after Run as...
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/PortletServerTestSuite.launch
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/PortletServerTestSuite.launch (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/launchers/PortletServerTestSuite.launch 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/PortletServerTestSuite.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="DISPLAY" value=":${string_prompt:display number:0}"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.portlet.ui.bot.test.server.PortletServerTestSuite"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.portlet.ui.bot.test"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dswtbot.test.properties.file=${file_prompt:"Please choose a SWTBot configuration file":${workspace_loc}/org.jboss.tools.portlet.ui.bot.test/resources/generated_config_files} -Xmx1024m -XX:MaxPermSize=256m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,28 @@
+package org.jboss.tools.portlet.ui.bot.matcher.browser;
+
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+
+/**
+ * Checks the URL of the page laoded in the browser.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class BrowserUrlMatcher extends AbstractSWTMatcher<String> {
+
+ private String realURL;
+
+ @Override
+ public boolean matchesSafely(String expectedURL) {
+ realURL = SWTBotFactory.getBot().browser().getUrl();
+ return expectedURL.equals(realURL);
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText("is loaded in browser but it was: ");
+ description.appendValue(realURL);
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/Facets.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/Facets.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/Facets.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,19 @@
+package org.jboss.tools.portlet.ui.bot.task.facet;
+
+import org.jboss.tools.portlet.ui.bot.entity.FacetDefinition;
+
+public class Facets {
+
+ public static final FacetDefinition JAVA_FACET = new FacetDefinition("Java", null, "1.6");
+
+ public static final FacetDefinition JSF_FACET = new FacetDefinition("JavaServer Faces");
+
+ private static final String JBOSS_FACET_CATEGORY = "JBoss Portlets";
+
+ public static final FacetDefinition CORE_PORTLET_FACET = new FacetDefinition("JBoss Core Portlet", JBOSS_FACET_CATEGORY);
+
+ public static final FacetDefinition JSF_PORTLET_FACET = new FacetDefinition("JBoss JSF Portlet", JBOSS_FACET_CATEGORY);
+
+ public static final FacetDefinition SEAM_PORTLET_FACET = new FacetDefinition("JBoss Seam Portlet", JBOSS_FACET_CATEGORY);
+
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java 2012-03-19 11:16:28 UTC (rev 39609)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -5,6 +5,7 @@
import java.util.List;
import org.jboss.tools.portlet.ui.bot.entity.FacetDefinition;
+import org.jboss.tools.portlet.ui.bot.task.facet.Facets;
import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
@@ -28,8 +29,8 @@
@Override
public List<FacetDefinition> getRequiredFacets() {
List<FacetDefinition> facets = new ArrayList<FacetDefinition>();
- facets.add(JAVA_FACET);
- facets.add(CORE_PORTLET_FACET);
+ facets.add(Facets.JAVA_FACET);
+ facets.add(Facets.CORE_PORTLET_FACET);
return facets;
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java 2012-03-19 11:16:28 UTC (rev 39609)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -5,6 +5,7 @@
import java.util.List;
import org.jboss.tools.portlet.ui.bot.entity.FacetDefinition;
+import org.jboss.tools.portlet.ui.bot.task.facet.Facets;
import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossJSFPortletCapabilitiesWizardPageFillingTask;
@@ -31,10 +32,10 @@
@Override
public List<FacetDefinition> getRequiredFacets() {
List<FacetDefinition> facets = new ArrayList<FacetDefinition>();
- facets.add(JAVA_FACET);
- facets.add(JSF_FACET);
- facets.add(CORE_PORTLET_FACET);
- facets.add(JSF_PORTLET_FACET);
+ facets.add(Facets.JAVA_FACET);
+ facets.add(Facets.JSF_FACET);
+ facets.add(Facets.CORE_PORTLET_FACET);
+ facets.add(Facets.JSF_PORTLET_FACET);
return facets;
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java 2012-03-19 11:16:28 UTC (rev 39609)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/seam/CreateSeamPortletProject.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -6,6 +6,7 @@
import java.util.List;
import org.jboss.tools.portlet.ui.bot.entity.FacetDefinition;
+import org.jboss.tools.portlet.ui.bot.task.facet.Facets;
import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossJSFPortletCapabilitiesWizardPageFillingTask;
@@ -41,12 +42,12 @@
@Override
public List<FacetDefinition> getRequiredFacets() {
List<FacetDefinition> facets = new ArrayList<FacetDefinition>();
- facets.add(JAVA_FACET);
- facets.add(JSF_FACET);
+ facets.add(Facets.JAVA_FACET);
+ facets.add(Facets.JSF_FACET);
facets.add(new FacetDefinition("Seam", null, configuredState.getSeam().version));
- facets.add(CORE_PORTLET_FACET);
- facets.add(JSF_PORTLET_FACET);
- facets.add(SEAM_PORTLET_FACET);
+ facets.add(Facets.CORE_PORTLET_FACET);
+ facets.add(Facets.JSF_PORTLET_FACET);
+ facets.add(Facets.SEAM_PORTLET_FACET);
return facets;
}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/PortletServerTestSuite.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/PortletServerTestSuite.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/PortletServerTestSuite.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,14 @@
+package org.jboss.tools.portlet.ui.bot.test.server;
+
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+(a)RunWith(RequirementAwareSuite.class)
+(a)Suite.SuiteClasses({
+ RunAsLoadsPortalURLRuntime4x.class,
+ RunAsLoadsPortalURLRuntime5x.class
+ })
+public class PortletServerTestSuite {
+
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime4x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime4x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime4x.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,15 @@
+package org.jboss.tools.portlet.ui.bot.test.server;
+
+import org.jboss.tools.portlet.ui.bot.test.template.RunAsLoadsPortalURLTemplate;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+
+@Require(server=@Server(version="4.3", state=ServerState.Running))
+public class RunAsLoadsPortalURLRuntime4x extends RunAsLoadsPortalURLTemplate {
+
+ @Override
+ public String getExpectedURL() {
+ return "http://localhost:8080/portal";
+ }
+}
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime5x.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime5x.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/server/RunAsLoadsPortalURLRuntime5x.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,15 @@
+package org.jboss.tools.portlet.ui.bot.test.server;
+
+import org.jboss.tools.portlet.ui.bot.test.template.RunAsLoadsPortalURLTemplate;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+
+@Require(server=@Server(version="5.0", operator=">", state=ServerState.Running))
+public class RunAsLoadsPortalURLRuntime5x extends RunAsLoadsPortalURLTemplate {
+
+ @Override
+ public String getExpectedURL() {
+ return "http://localhost:8080/portal/classic/";
+ }
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java 2012-03-19 11:16:28 UTC (rev 39609)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -34,18 +34,6 @@
@Require(server=(a)Server(state=ServerState.Present, type=ServerType.EPP))
public abstract class CreatePortletProjectTemplate extends SWTTaskBasedTestCase {
- protected static final FacetDefinition JAVA_FACET = new FacetDefinition("Java", null, "1.6");
-
- protected static final FacetDefinition JSF_FACET = new FacetDefinition("JavaServer Faces");
-
- protected static final String JBOSS_FACET_CATEGORY = "JBoss Portlets";
-
- protected static final FacetDefinition CORE_PORTLET_FACET = new FacetDefinition("JBoss Core Portlet", JBOSS_FACET_CATEGORY);
-
- protected static final FacetDefinition JSF_PORTLET_FACET = new FacetDefinition("JBoss JSF Portlet", JBOSS_FACET_CATEGORY);
-
- public static final FacetDefinition SEAM_PORTLET_FACET = new FacetDefinition("JBoss Seam Portlet", JBOSS_FACET_CATEGORY);
-
protected static final String WEB_INF = "WebContent/WEB-INF/";
protected static final String FACES_CONFIG_XML = WEB_INF + "faces-config.xml";
Added: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java (rev 0)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -0,0 +1,66 @@
+package org.jboss.tools.portlet.ui.bot.test.template;
+
+import org.jboss.tools.portlet.ui.bot.matcher.browser.BrowserUrlMatcher;
+import org.jboss.tools.portlet.ui.bot.task.SWTTask;
+import org.jboss.tools.portlet.ui.bot.task.facet.Facets;
+import org.jboss.tools.portlet.ui.bot.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.task.server.RunninngProjectOnServerTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.DynamicWebProjectCreationTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.DynamicWebProjectWizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.junit.Test;
+
+/**
+ * Creates a java portlet and checks the loaded URL in browser after Run as...
+ *
+ * This test is ran only once - no need to run it specially for java, jsf and seam portlet.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public abstract class RunAsLoadsPortalURLTemplate extends SWTTaskBasedTestCase {
+
+ private static final String PROJECT_NAME = "runAsURLTestProject";
+
+ public abstract String getExpectedURL();
+
+ @Test
+ public void runAsLoadsPortalURL(){
+ doPerform(createJavaPortletTask());
+ doPerform(runOnServerTask());
+
+ doAssertThatInWorkspace(getExpectedURL(), new BrowserUrlMatcher());
+ }
+
+ private SWTTask createJavaPortletTask() {
+ DynamicWebProjectCreationTask wizardTask = new DynamicWebProjectCreationTask();
+ wizardTask.addWizardPage(dynamicWebProjectTask());
+ wizardTask.addWizardPage(new WizardPageDefaultsFillingTask());
+ wizardTask.addWizardPage(new WizardPageDefaultsFillingTask());
+ wizardTask.addWizardPage(new JBossPortletCapabilitiesWizardPageFillingTask(JBossPortletCapabilitiesWizardPageFillingTask.Type.RUNTIME_PROVIDER));
+ return wizardTask;
+ }
+
+ private DynamicWebProjectWizardPageFillingTask dynamicWebProjectTask(){
+ DynamicWebProjectWizardPageFillingTask task = new DynamicWebProjectWizardPageFillingTask();
+ task.setProjectName(PROJECT_NAME);
+ task.setWebModuleVersion("2.5");
+ task.setServerName(SWTTestExt.configuredState.getServer().name);
+ task.setSelectFacetsTask(getFacets());
+ return task;
+ }
+
+ private FacetsSelectionTask getFacets() {
+ FacetsSelectionTask task = new FacetsSelectionTask();
+ task.addFacet(Facets.JAVA_FACET);
+ task.addFacet(Facets.CORE_PORTLET_FACET);
+ return task;
+ }
+
+ private SWTTask runOnServerTask() {
+ return new RunninngProjectOnServerTask(PROJECT_NAME);
+ }
+}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunPortletOnServerTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunPortletOnServerTemplate.java 2012-03-19 11:16:28 UTC (rev 39609)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunPortletOnServerTemplate.java 2012-03-19 12:26:45 UTC (rev 39610)
@@ -6,10 +6,6 @@
import org.jboss.tools.portlet.ui.bot.task.console.ConsoleClearingTask;
import org.jboss.tools.portlet.ui.bot.task.server.RunninngProjectOnServerTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
-import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
-import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
import org.junit.Test;
/**
@@ -19,7 +15,6 @@
* @author Lucia Jelinkova
*
*/
-@Require(clearWorkspace=false, clearProjects=false, server=(a)Server(state=ServerState.Running, type=ServerType.EPP))
public abstract class RunPortletOnServerTemplate extends SWTTaskBasedTestCase {
protected abstract String getProjectName();
12 years, 7 months