JBoss Tools SVN: r43259 - in trunk/seam: plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-27 20:02:01 -0400 (Mon, 27 Aug 2012)
New Revision: 43259
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetOnExistingProjectTest.java
Log:
https://issues.jboss.org/browse/JBIDE-12491 JBT Doesn't place the JDBC Driver correctly
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -242,10 +242,15 @@
String HIBERNATE_HBM2DDL_AUTO = "hibernate.hbm2ddl.auto"; //$NON-NLS-1$
/**
- * Driver file name
+ * Driver file names
*/
- String JDBC_DRIVER_JAR_PATH = "driver.file"; //$NON-NLS-1$
+ String JDBC_DRIVER_JAR_PATHS_ARRAY = "driver.files.array"; //$NON-NLS-1$
+ /**
+ * Driver file name
+ */
+ String JDBC_DRIVER_JAR_NAME = "driver.file"; //$NON-NLS-1$
+
// TODO: should be moved to org.jboss.tools.seam.ui.wizard.IParameter
// why is this a property when it is always derivable from sesion_bean_package_name ?
String SESSION_BEAN_PACKAGE_PATH = "action.package.path"; //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam23FacetInstallDelegate.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -191,7 +191,7 @@
* @param destFolder
*/
public static void copyDBDriverToProject(IProject project, IDataModel model, File destFolder) {
- Object drvrs = model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
+ Object drvrs = model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY);
if(drvrs!=null) {
String[] drvrsStrings = (String[])drvrs;
if(drvrsStrings.length>0) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -882,8 +882,8 @@
if(serverRuntimeName!=null) {
ejbFilterSet.addFilter("runtimeName", serverRuntimeName); //$NON-NLS-1$
}
- if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH) != null) {
- File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY) != null) {
+ File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY))[0]);
ejbFilterSet.addFilter("driverJar", " " + driver.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
viewFilterSetCollection.addFilterSet(getDriverFilterSet(model));
} else {
@@ -915,8 +915,8 @@
}
public static FilterSet getDriverFilterSet(IDataModel model) {
- if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH) != null) {
- File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY) != null) {
+ File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY))[0]);
FilterSet dbTypeFilterSet = new FilterSet();
dbTypeFilterSet.addFilter("database.type", driver.getName());
return dbTypeFilterSet;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -72,7 +72,8 @@
names.add(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
names.add(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
- names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
+ names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY);
+ names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_NAME);
// Code generation group
names.add(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core.project.facet;
+import java.io.File;
import java.util.Properties;
import org.eclipse.core.resources.IProject;
@@ -99,8 +100,12 @@
DriverInstance i = DriverManager.getInstance().getDriverInstanceByID(props.get(
"org.eclipse.datatools.connectivity.driverDefinitionID").toString()); //$NON-NLS-1$
if(i != null) {
- model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
- i.getJarListAsArray());
+ String[] drivers = i.getJarListAsArray();
+ model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY, drivers);
+ if(drivers.length>0) {
+ File file = new File(drivers[0]);
+ model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_NAME, file.getName());
+ }
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -216,8 +216,8 @@
ejbFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
ejbFilterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
- if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH) != null) {
- File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY) != null) {
+ File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY))[0]);
ejbFilterSet.addFilter("driverJar", " " + driver.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} else {
ejbFilterSet.addFilter("driverJar", ""); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -423,7 +423,7 @@
if (server != null) {
IDeployableServer jbs = (IDeployableServer) server.loadAdapter(IDeployableServer.class, new NullProgressMonitor());
if (jbs != null) {
- String[] driverJars = (String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
+ String[] driverJars = (String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY);
if(driverJars!=null) {
String configFolder = jbs.getConfigDirectory();
if(model.getStringProperty(ISeamFacetDataModelProperties.SEAM_LIBRARY_PROVIDER).equals(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES)){
Modified: trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/tests/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -202,7 +202,8 @@
config.setStringProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.entity.beans");
config.setStringProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.test.beans");
config.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "noop-connection");
- config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH, new String[] { "noop-driver.jar" });
+ config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY, new String[] { "noop-driver.jar" });
+ config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_NAME, "noop-driver.jar");
config.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, true);
config.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING, true);
return config;
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetOnExistingProjectTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetOnExistingProjectTest.java 2012-08-27 22:13:54 UTC (rev 43258)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetOnExistingProjectTest.java 2012-08-28 00:02:01 UTC (rev 43259)
@@ -75,7 +75,8 @@
config.setStringProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.entity.beans");
config.setStringProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.test.beans");
config.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "noop-connection");
- config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH, new String[] { "noop-driver.jar" });
+ config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATHS_ARRAY, new String[] { "noop-driver.jar" });
+ config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_NAME, "noop-driver.jar");
config.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, true);
return config;
}
12 years, 4 months
JBoss Tools SVN: r43258 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-08-27 18:13:54 -0400 (Mon, 27 Aug 2012)
New Revision: 43258
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java
Log:
Failed tests: testELExprPartitioner(org.jboss.tools.seam.ui.test.el.ELExprPartitionerTest) https://issues.jboss.org/browse/JBIDE-12477
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java 2012-08-27 19:13:53 UTC (rev 43257)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java 2012-08-27 22:13:54 UTC (rev 43258)
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.QualifiedName;
import org.jboss.tools.jst.text.ext.hyperlink.ELHyperlink;
import org.jboss.tools.jst.text.ext.hyperlink.ELHyperlinkDetector;
+import org.jboss.tools.jst.text.ext.hyperlink.ELVarListHyperlink;
import org.jboss.tools.jst.text.ext.test.HyperlinkTestUtil;
import org.jboss.tools.jst.text.ext.test.HyperlinkTestUtil.TestHyperlink;
import org.jboss.tools.jst.text.ext.test.HyperlinkTestUtil.TestRegion;
@@ -134,7 +135,13 @@
regionList.add(new TestRegion("possibilitie", new TestHyperlink[]{new TestHyperlink(ELHyperlink.class, "Open 'NumberGuess.getPossibilities() - org.jboss.seam.example.numberguess'", "NumberGuess.java")}));
regionList.add(new TestRegion("#{", new TestHyperlink[]{}));
- regionList.add(new TestRegion("_localVariabl", new TestHyperlink[]{new TestHyperlink(ELHyperlink.class, "Open 'Iterator.next() - java.util'")}));
+ regionList.add(new TestRegion("_localVariabl",
+ new TestHyperlink[]{
+ new TestHyperlink(ELHyperlink.class, "Open Definition of '_localVariable' in 'giveup.jspx'"),
+ new TestHyperlink(ELHyperlink.class, "Open 'Iterator.next() - java.util'")
+
+ }));
+
regionList.add(new TestRegion("intValu", new TestHyperlink[]{new TestHyperlink(ELHyperlink.class, "Open 'Integer.intValue() - java.lang'")}));
HyperlinkTestUtil.checkRegions(project, PAGE_NAME, regionList, new ELHyperlinkDetector());
12 years, 4 months
JBoss Tools SVN: r43257 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core: src/org/jboss/tools/cdi/seam/config/core/xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-27 15:13:53 -0400 (Mon, 27 Aug 2012)
New Revision: 43257
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java
Log:
https://issues.jboss.org/browse/JBIDE-12468 Re-organization of the "common" component
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF 2012-08-27 18:57:43 UTC (rev 43256)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/META-INF/MANIFEST.MF 2012-08-27 19:13:53 UTC (rev 43257)
@@ -25,7 +25,8 @@
org.eclipse.wst.sse.core;bundle-version="1.1.600",
org.eclipse.jdt.ui;bundle-version="3.7.0",
org.apache.ant;bundle-version="1.7.1",
- org.jboss.tools.common.validation
+ org.jboss.tools.common.validation,
+ org.jboss.tools.common.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java 2012-08-27 18:57:43 UTC (rev 43256)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java 2012-08-27 19:13:53 UTC (rev 43257)
@@ -19,7 +19,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.Messages;
+import org.jboss.tools.common.core.Messages;
import org.jboss.tools.common.xml.SAXValidator;
import org.jboss.tools.common.xml.XMLEntityResolverImpl;
import org.xml.sax.Attributes;
@@ -31,7 +31,6 @@
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
/**
*
12 years, 4 months
JBoss Tools SVN: r43256 - trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-08-27 14:57:43 -0400 (Mon, 27 Aug 2012)
New Revision: 43256
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-12469 Creation of org.jboss.tools.common.core component
fix for compilation errors in openshift.egit.test plugin.
package import was replaced to tools.common dependency.
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF 2012-08-27 13:49:39 UTC (rev 43255)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF 2012-08-27 18:57:43 UTC (rev 43256)
@@ -11,7 +11,7 @@
org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
org.eclipse.core.filesystem;bundle-version="1.3.100",
org.junit;bundle-version="[4.8.2,5.0.0)",
- org.jboss.tools.openshift.egit.core;bundle-version="1.0.0"
+ org.jboss.tools.openshift.egit.core;bundle-version="1.0.0",
+ org.jboss.tools.common;bundle-version="3.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Import-Package: org.jboss.tools.common.util
12 years, 4 months
JBoss Tools SVN: r43255 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-08-27 09:49:39 -0400 (Mon, 27 Aug 2012)
New Revision: 43255
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml
Log:
https://issues.jboss.org/browse/JBIDE-3225 - component content test for h:commandButton with inner text was added.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp 2012-08-27 13:21:09 UTC (rev 43254)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp 2012-08-27 13:49:39 UTC (rev 43255)
@@ -7,21 +7,33 @@
<body>
<f:view>
- <h1><h:outputText value="commandButton" /></h1>
+ <DIV id="div1">
+ <h:commandButton value="commandButton1" />
+ <h:commandButton value="commandButton2" type="button" />
+ <h:commandButton value="commandButton3" type="reset" />
+ <h:commandButton value="commandButton4" type="submit" />
+ <h:commandButton value="commandButton5" image="" />
+ <h:commandButton value="commandButton6" type="" />
+</DIV>
- <h:form id="commandButtonForm">
+<DIV id="div2">
+<h:commandButton value="cb1"> </h:commandButton>
+<h:commandButton value="cb2" type="button"> </h:commandButton>
+<h:commandButton value="cb3" type="reset"> </h:commandButton>
+<h:commandButton value="cb4" type="submit"> </h:commandButton>
+<h:commandButton value="cb5" image=""> </h:commandButton>
+<h:commandButton value="cb6" type=""> </h:commandButton>
+</DIV>
- <h:commandButton value="commandButton" id="commandButton1" />
+<DIV id="div3">
+<h:commandButton value="cb1"> with some text </h:commandButton>
+<h:commandButton value="cb2" type="button"> with some text </h:commandButton>
+<h:commandButton value="cb3" type="reset"> with some text </h:commandButton>
+<h:commandButton value="cb4" type="submit"> with some text </h:commandButton>
+<h:commandButton value="cb5" image=""> with some text </h:commandButton>
+<h:commandButton value="cb6" type=""> with some text </h:commandButton>
+</DIV>
- <h:commandButton value="commandButton1" id="commandButton2" type="button" />
-
- <h:commandButton value="commandButton3" id="commandButton3" type="reset" />
-
- <h:commandButton value="commandButton4" id="commandButton4" type="submit" />
-
- <h:commandButton value="commandButton5" id="commandButton5" image="" />
-
- </h:form>
</f:view>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml 2012-08-27 13:21:09 UTC (rev 43254)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp.xml 2012-08-27 13:49:39 UTC (rev 43255)
@@ -1,17 +1,106 @@
<tests>
- <test id="commandButton1">
- <input type="button" value="commandButton"/>
+ <test id="div1">
+ <DIV ID="div1" STYLE="-moz-user-modify: read-write;">
+ <INPUT TYPE="button" VALUE="commandButton1" />
+ <INPUT TYPE="button" VALUE="commandButton2" />
+ <INPUT TYPE="reset" VALUE="commandButton3" />
+ <INPUT TYPE="submit" VALUE="commandButton4" />
+ <INPUT TYPE="image" SRC="/.*ve/unresolved_image.gif/" />
+ <INPUT TYPE="" VALUE="commandButton6" />
+ </DIV>
</test>
- <test id="commandButton2">
- <input type="button" value="commandButton1" />
+
+ <test id="div2">
+ <DIV ID="div2" STYLE="-moz-user-modify: read-write;">
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="button" VALUE="cb1" />
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="button" VALUE="cb2" />
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="reset" VALUE="cb3" />
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="cb4" />
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="image" SRC="/.*ve/unresolved_image.gif/" />
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="" VALUE="cb6" />
+ </DIV>
+ </DIV>
</test>
- <test id="commandButton3">
- <input type="reset" value="commandButton3" />
+
+ <test id="div3">
+ <DIV ID="div3" STYLE="-moz-user-modify: read-write;">
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ with some text
+ </SPAN>
+ </DIV>
+ <INPUT TYPE="button" VALUE="cb1" />
+
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ with some text
+ </SPAN>
+ </DIV>
+ <INPUT TYPE="button" VALUE="cb2" />
+
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ with some text
+ </SPAN>
+ </DIV>
+ <INPUT TYPE="reset" VALUE="cb3" />
+
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ with some text
+ </SPAN>
+ </DIV>
+ <INPUT TYPE="submit" VALUE="cb4" />
+
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ with some text
+ </SPAN>
+ </DIV>
+ <INPUT TYPE="image" SRC="/.*ve/unresolved_image.gif/" />
+
+ </DIV>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ with some text
+ </SPAN>
+ </DIV>
+ <INPUT TYPE="" VALUE="cb6" />
+
+ </DIV>
+ </DIV>
</test>
- <test id="commandButton4">
- <input type="submit" value="commandButton4" />
- </test>
- <test id="commandButton5">
- <input type="image" SRC="/.*ve/unresolved_image.gif/" />
- </test>
</tests>
\ No newline at end of file
12 years, 4 months
JBoss Tools SVN: r43254 - in trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test: src/org/jboss/tools/portlet/ui/bot/matcher/browser and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-27 09:21:09 -0400 (Mon, 27 Aug 2012)
New Revision: 43254
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/
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/PageSourceMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/property/ProjectPropertyDialogCloseTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java
Log:
Merge from 3.3 branch - mainly waiting conditions.
Property changes on: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test:43068-43105,43246
Modified: 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 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/BrowserUrlMatcher.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -2,9 +2,13 @@
import java.util.Arrays;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Checks if the URL of the page laoded in the browser is one of the accepted URLs.
@@ -15,11 +19,21 @@
public class BrowserUrlMatcher extends AbstractSWTMatcher<String[]> {
private String realURL;
-
+
+ private long timeout;
+
+ public BrowserUrlMatcher(TaskDuration duration){
+ timeout = duration.getTimeout();
+ }
+
@Override
public boolean matchesSafely(String[] acceptedURL) {
- realURL = SWTBotFactory.getBot().browser().getUrl();
- return Arrays.asList(acceptedURL).contains(realURL);
+ try {
+ SWTBotFactory.getBot().waitUntil(new BrowserContainsUrlCondition(acceptedURL, realURL), timeout);
+ return true;
+ } catch (TimeoutException e){
+ return false;
+ }
}
@Override
@@ -27,4 +41,31 @@
description.appendText("are the only allowed loaded URLs but it was:");
description.appendValue(realURL);
}
+
+ private class BrowserContainsUrlCondition extends DefaultCondition {
+
+ private String[] acceptedURL;
+
+ private String realURL;
+
+ public BrowserContainsUrlCondition(String[] acceptedURL, String realURL) {
+ this.acceptedURL = acceptedURL;
+ this.realURL = realURL;
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ try {
+ realURL = SWTBotFactory.getBot().browser().getUrl();
+ return Arrays.asList(acceptedURL).contains(realURL);
+ } catch (WidgetNotFoundException e){
+ return false;
+ }
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return null;
+ }
+ }
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/PageSourceMatcher.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -1,8 +1,15 @@
package org.jboss.tools.portlet.ui.bot.matcher.browser;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
+import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
-import org.jboss.tools.portlet.ui.bot.task.browser.LoadBrowserPageTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
/**
* Checks if the given page contains specified text.
@@ -12,20 +19,41 @@
*/
public class PageSourceMatcher extends AbstractSWTMatcher<String> {
+ private String pageText;
+
private String url;
- private String pageText;
+ private long timeout;
- public PageSourceMatcher(String url) {
+ public PageSourceMatcher() {
super();
+ timeout = 0;
+ }
+
+ public PageSourceMatcher(TaskDuration timeout) {
+ super();
+ this.timeout = timeout.getTimeout();
+ }
+
+ public PageSourceMatcher(String url, TaskDuration duration) {
+ this();
this.url = url;
+ this.timeout = duration.getTimeout();
}
-
+
@Override
public boolean matchesSafely(String item) {
- performInnerTask(new LoadBrowserPageTask(url));
- pageText = getBot().browser().getText();
- return pageText.contains(item);
+ SWTBotBrowserExt browser = SWTBotFactory.getBot().browserExt();
+ if (url != null){
+ browser.loadUrlToBrowser(url, SWTBotFactory.getBot());
+ }
+
+ try {
+ SWTBotFactory.getBot().waitUntil(new PageContainsTextCondition(browser, item), timeout);
+ return true;
+ } catch (TimeoutException e){
+ return false;
+ }
}
@Override
@@ -33,4 +61,33 @@
description.appendText("is on the page, but there was instead: ");
description.appendValue(pageText);
}
+
+ private class PageContainsTextCondition extends DefaultCondition {
+
+ private SWTBotBrowserExt browser;
+
+ private String expectedText;
+
+ public PageContainsTextCondition(SWTBotBrowserExt browser, String item) {
+ this.browser = browser;
+ this.expectedText = item;
+ }
+
+ @Override
+ public boolean test() throws Exception {
+ pageText = browser.getText();
+ if ("".equals(expectedText)){
+ return pageText.equals(expectedText);
+ }
+ System.out.println(pageText);
+ Pattern p = Pattern.compile(expectedText, Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
+ Matcher m = p.matcher(pageText);
+ return m.matches();
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return null;
+ }
+ }
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/browser/portlet/PortletLoadsInJBPortalMatcher.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -4,6 +4,7 @@
import org.jboss.tools.portlet.ui.bot.entity.PortletDefinition;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
import org.jboss.tools.portlet.ui.bot.matcher.browser.PageSourceMatcher;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Check if the given portlet can be loaded in EPP 4.x runtime.
@@ -17,11 +18,17 @@
private PageSourceMatcher pageMatcher;
+ private TaskDuration duration;
+
+ public PortletLoadsInJBPortalMatcher(TaskDuration duration){
+ this.duration = duration;
+ }
+
@Override
public boolean matchesSafely(PortletDefinition portletTitle) {
- pageMatcher = new PageSourceMatcher(PORTAL_URL + portletTitle.getPage());
+ pageMatcher = new PageSourceMatcher(PORTAL_URL + portletTitle.getPage(), duration);
pageMatcher.setBot(getBot());
- return pageMatcher.matchesSafely("<span class=\"portlet-titlebar-title\">" + portletTitle.getDisplayName() + "</span>");
+ return pageMatcher.matchesSafely(".*<span class=(.?\")?portlet-titlebar-title(.?\")?>" + portletTitle.getDisplayName() + "</span>.*");
}
@Override
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/console/ConsoleOutputMatcher.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -2,6 +2,7 @@
import org.hamcrest.Description;
import org.jboss.tools.portlet.ui.bot.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
/**
* Checks if the console contains specified text.
@@ -17,6 +18,10 @@
wrappedMatcher = new org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher();
}
+ public ConsoleOutputMatcher(TaskDuration duration) {
+ wrappedMatcher = new org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher(duration);
+ }
+
@Override
public boolean matchesSafely(String item) {
return wrappedMatcher.matchesSafely(item);
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/factory/PortletMatchersFactory.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -3,6 +3,7 @@
import org.jboss.tools.portlet.ui.bot.entity.PortletDefinition;
import org.jboss.tools.portlet.ui.bot.matcher.SWTMatcher;
import org.jboss.tools.portlet.ui.bot.matcher.browser.portlet.PortletLoadsInJBPortalMatcher;
+import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
public class PortletMatchersFactory {
@@ -11,6 +12,6 @@
}
public static SWTMatcher<PortletDefinition> canLoadAt4xRuntime(){
- return new PortletLoadsInJBPortalMatcher();
+ return new PortletLoadsInJBPortalMatcher(TaskDuration.NORMAL);
}
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/matcher/perspective/OpenPerspectiveTask.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -1,7 +1,13 @@
package org.jboss.tools.portlet.ui.bot.matcher.perspective;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.widgetIsEnabled;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
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.TaskDuration;
import org.jboss.tools.ui.bot.ext.gen.IPerspective;
/**
@@ -12,6 +18,8 @@
*/
public class OpenPerspectiveTask extends AbstractSWTTask {
+ private static final Logger log = Logger.getLogger(OpenPerspectiveTask.class);
+
private IPerspective perspective;
public OpenPerspectiveTask(IPerspective name) {
@@ -21,6 +29,32 @@
@Override
public void perform() {
+ activateWorkbenchShell();
+ log.info("Opening perspective");
+ log.info("All shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info(shell.getText() + ": " + shell);
+ log.info("Is active: " + shell.isActive());
+ }
+ getBot().waitUntil(widgetIsEnabled(getBot().menu("Window")), TaskDuration.NORMAL.getTimeout());
SWTBotFactory.getOpen().perspective(perspective);
}
+
+ public void activateWorkbenchShell(){
+ SWTBotShell[] shells = getBot().shells();
+ if (shells.length == 1){
+ log.info("Only one shell present, assuming it's workbench and activating");
+ shells[0].activate();
+ } else {
+ log.info("More than one shell present");
+ for (SWTBotShell shell : shells){
+ log.info(shell.getText());
+ }
+ }
+ }
+
+ @Override
+ public SWTBot getBot() {
+ return SWTBotFactory.getBot();
+ }
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/property/ProjectPropertyDialogCloseTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/property/ProjectPropertyDialogCloseTask.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/property/ProjectPropertyDialogCloseTask.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -1,10 +1,11 @@
package org.jboss.tools.portlet.ui.bot.task.dialog.property;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
+
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.portlet.ui.bot.task.wait.WaitWhileTask;
import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
-import org.jboss.tools.ui.bot.ext.condition.ShellIsActiveCondition;
import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
public class ProjectPropertyDialogCloseTask extends AbstractSWTTask {
@@ -13,7 +14,7 @@
public void perform() {
SWTBotShell activeShell = getBot().activeShell();
getBot().button("OK").click();
- performInnerTask(new WaitWhileTask(new ShellIsActiveCondition(activeShell), TaskDuration.NORMAL));
+ getBot().waitUntil(shellCloses(activeShell), TaskDuration.NORMAL.getTimeout());
performInnerTask(new WaitWhileTask(new NonSystemJobRunsCondition(), TaskDuration.LONG));
}
}
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -1,10 +1,14 @@
package org.jboss.tools.portlet.ui.bot.task.server;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
-import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellIsActive;
+
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.portlet.ui.bot.entity.WorkspaceFile;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.portlet.ui.bot.task.workspace.FileContextMenuSelectingTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.logging.WidgetsLogger;
/**
* Marks a file as deployable for the specified server (it works only if there is just one server defined)
@@ -14,6 +18,8 @@
*/
public class MarkFileAsDeployableTask extends AbstractSWTTask {
+ private static final Logger log = Logger.getLogger(MarkFileAsDeployableTask.class);
+
private WorkspaceFile workspaceFile;
public MarkFileAsDeployableTask(WorkspaceFile file) {
@@ -22,8 +28,30 @@
@Override
public void perform() {
+ log.info("Marking " + workspaceFile.getFileName() + " as deployable");
+ log.info("Logging all shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info("Shell: " + shell.getText() + ", is active: " + shell.isActive());
+ }
performInnerTask(new FileContextMenuSelectingTask(workspaceFile, "Mark as Deployable"));
- // for the confirmation dialog select OK (the dialog is native and normal swtbot functions do now work)
- KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
+
+ log.info("Waiting for confirmation shell to appear");
+ log.info("Logging all shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info("Shell: " + shell.getText() + ", is active: " + shell.isActive());
+ }
+ SWTBotFactory.getBot().waitUntil(shellIsActive("Really mark these resources as deployable?"));
+ SWTBotFactory.getBot().shell("Really mark these resources as deployable?").activate();
+ log.info("Logging all widgets:");
+ log.info("Logging all shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info("Shell: " + shell.getText() + ", is active: " + shell.isActive());
+ }
+ WidgetsLogger.log();
+ getBot().button("OK").click();
+
+ log.info("Waiting for confirmation shell to disappear");
+ SWTBotFactory.getBot().waitWhile(shellIsActive("Really mark these resources as deployable?"));
}
}
+
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -1,6 +1,9 @@
package org.jboss.tools.portlet.ui.bot.task.wizard;
+import org.apache.log4j.Logger;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.wizards.SWTBotNewObjectWizard;
/**
@@ -10,6 +13,8 @@
*
*/
public class WizardOpeningTask extends AbstractSWTTask {
+
+ private static final Logger log = Logger.getLogger(WizardOpeningTask.class);
private String category;
@@ -32,9 +37,29 @@
@Override
public void perform() {
+ activateWorkbenchShell();
+ log.info("Opening wizard");
+ log.info("All shells: ");
+ for (SWTBotShell shell : SWTBotFactory.getBot().shells()){
+ log.info(shell.getText() + ": " + shell);
+ log.info("Is active: " + shell.isActive());
+ }
new SWTBotNewObjectWizard().open(name, getGroupPath());
}
+ private void activateWorkbenchShell(){
+ SWTBotShell[] shells = getBot().shells();
+ if (shells.length == 1){
+ log.info("Only one shell present, assuming it's workbench and activating");
+ shells[0].activate();
+ } else {
+ log.info("More than one shell present");
+ for (SWTBotShell shell : shells){
+ log.info(shell.getText());
+ }
+ }
+ }
+
private String[] getGroupPath() {
if (category == null){
return new String[0];
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/HotDeploymentGateinTemplate.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -7,6 +7,7 @@
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.condition.TaskDuration;
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;
@@ -31,7 +32,7 @@
doPerform(new ConsoleClearingTask());
doPerform(createPortlet());
- assertThatInWorkspace("undeploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher());
- assertThatInWorkspace("deploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher());
+ assertThatInWorkspace("undeploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher(TaskDuration.LONG));
+ assertThatInWorkspace("deploy, ctxPath=/" + getProjectName(), new ConsoleOutputMatcher(TaskDuration.LONG));
}
}
Modified: 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 2012-08-27 13:13:42 UTC (rev 43253)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/RunAsLoadsPortalURLTemplate.java 2012-08-27 13:21:09 UTC (rev 43254)
@@ -11,6 +11,7 @@
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.jboss.tools.ui.bot.ext.condition.TaskDuration;
import org.junit.Test;
/**
@@ -32,7 +33,7 @@
doPerform(createJavaPortletTask());
doPerform(runOnServerTask());
- doAssertThatInWorkspace(getExpectedURLs(), new BrowserUrlMatcher());
+ doAssertThatInWorkspace(getExpectedURLs(), new BrowserUrlMatcher(TaskDuration.NORMAL));
}
private SWTTask createJavaPortletTask() {
12 years, 4 months
JBoss Tools SVN: r43253 - in trunk/jsf/tests: org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516 and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-08-27 09:13:42 -0400 (Mon, 27 Aug 2012)
New Revision: 43253
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
Log:
https://issues.jboss.org/browse/JBIDE-3225 - JUNITS for h:commandButton were updated
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml 2012-08-27 13:08:22 UTC (rev 43252)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml 2012-08-27 13:13:42 UTC (rev 43253)
@@ -1,53 +1,70 @@
<tests>
-<test id="custom_tags">
-<DIV ID="custom_tags" STYLE="-moz-user-modify: read-write;" >
-<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+ <test id="custom_tags">
+ <DIV ID="custom_tags" STYLE="-moz-user-modify: read-write;">
+ <DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
<!-- h:inputHidden id="currentPage" replace, because if on page two fields, two elements with equal id has been used, but should be used only one -->
-<TABLE BORDER="0" STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-only;">
-<TBODY>
-<TR>
-<TD>
-<INPUT TYPE="submit" VALUE="<<" STYLE="-moz-user-modify: read-only;"/>
+<TABLE BORDER="0"
+ STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="<<" />
-</TD>
-<TD>
-<INPUT TYPE="submit" VALUE="<" STYLE="-moz-user-modify: read-only;"/>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="<" />
-</TD>
-<TD>
-<INPUT TYPE="submit" VALUE=">" STYLE="-moz-user-modify: read-only;"/>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE=">" />
-</TD>
-<TD>
-<INPUT TYPE="submit" VALUE=">>" STYLE="-moz-user-modify: read-only;"/>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE=">>" />
-</TD>
-</TR>
-</TBODY>
-</TABLE>
-</DIV>
-<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
-<SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
-<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
-Hello, Custom Tags!
-</SPAN>
-</SPAN>
-</DIV>
-<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
-<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
-$
-</SPAN>
-<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
-100
-</SPAN>
-</DIV>
-<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
-<SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
-<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
-Echo custom tag
-</SPAN>
-</SPAN>
-</DIV>
-</DIV>
-</test>
+ </DIV>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ <DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+ <SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ Hello, Custom Tags!
+ </SPAN>
+ </SPAN>
+ </DIV>
+ <DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ $
+ </SPAN>
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ 100
+ </SPAN>
+ </DIV>
+ <DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+ <SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ Echo custom tag
+ </SPAN>
+ </SPAN>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml 2012-08-27 13:08:22 UTC (rev 43252)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5516/jbide5516.xhtml.xml 2012-08-27 13:13:42 UTC (rev 43253)
@@ -1,30 +1,46 @@
<tests>
-<test id="jbide5516">
-<DIV ID="jbide5516">
-<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
-<TABLE BORDER="0" STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-only;">
-<TBODY>
-<TR>
-<TD>
-<INPUT TYPE="submit" VALUE="1" STYLE="-moz-user-modify: read-only;"/>
+ <test id="jbide5516">
+ <DIV ID="jbide5516">
+ <DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+ <TABLE BORDER="0" STYLE="margin-right: auto; margin-left: auto;">
+ <TBODY>
+ <TR>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="1" />
-</TD>
-<TD>
-<INPUT TYPE="submit" VALUE="2" STYLE="-moz-user-modify: read-only;"/>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="2" />
-</TD>
-<TD>
-<INPUT TYPE="submit" VALUE="3" STYLE="-moz-user-modify: read-only;"/>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="3" />
-</TD>
-<TD>
-<INPUT TYPE="submit" VALUE="4" STYLE="-moz-user-modify: read-only;"/>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV CLASS="vpe-text">
+ <DIV CLASS="vpe-text">
+ </DIV>
+ <INPUT TYPE="submit" VALUE="4" />
-</TD>
-</TR>
-</TBODY>
-</TABLE>
-</DIV>
-</DIV>
-</test>
+ </DIV>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </DIV>
+ </test>
</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml 2012-08-27 13:08:22 UTC (rev 43252)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/toolBar.xhtml.xml 2012-08-27 13:13:42 UTC (rev 43253)
@@ -57,8 +57,7 @@
<INPUT CLASS="barsearch" />
</TD>
<TD CLASS="dr-toolbar-int rich-toolbar-item" STYLE="">
- <INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"
- STYLE="-moz-user-modify: read-only;" />
+ <INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"/>
</TD>
</TR>
</TBODY>
@@ -267,8 +266,7 @@
</TD>
<TD CLASS="dr-toolbar-int rich-toolbar-item"
STYLE="color: PaleVioletRed; font-size: medium; font-style: italic; background-color: FloralWhite; font-family: Arial TUR; font-weight: bolder;">
- <INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"
- STYLE="-moz-user-modify: read-only;" />
+ <INPUT TYPE="button" CLASS="barsearchbutton" VALUE="Search"/>
</TD>
</TR>
12 years, 4 months
JBoss Tools SVN: r43252 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-08-27 09:08:22 -0400 (Mon, 27 Aug 2012)
New Revision: 43252
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
https://issues.jboss.org/browse/JBIDE-3225 - adding text for h:commandButton
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java 2012-08-27 12:00:59 UTC (rev 43251)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JSF.java 2012-08-27 13:08:22 UTC (rev 43252)
@@ -34,7 +34,9 @@
public static final String ATTR_FOR = "for"; //$NON-NLS-1$
public static final String ATTR_ID = "id";//$NON-NLS-1$
-
+
+ public static final String ATTR_IMAGE = "image"; //$NON-NLS-1$
+
public static final String ATTR_ITEM_LABEL = "itemLabel"; //$NON-NLS-1$
public static final String ATTR_ITEM_VALUE = "itemValue"; //$NON-NLS-1$
@@ -60,6 +62,8 @@
public static final String ATTR_LAYOUT = "layout"; //$NON-NLS-1$
public static final String ATTR_TITLE = "title"; //$NON-NLS-1$
+
+ public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
public static final String ATTR_LANG = "lang"; //$NON-NLS-1$
@@ -68,4 +72,9 @@
public static final String ATTR_DEFAULT = "default"; //$NON-NLS-1$
public static final String CUSTOM_COMPONENT_ATTR_PREFIX="cc.attrs."; //$NON-NLS-1$
+
+ public static final String ATTR_SRC = "src"; //$NON-NLS-1$
+
+ public static final String VALUE_BUTTON = "button"; //$NON-NLS-1$
+
}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfCommandButton.java 2012-08-27 13:08:22 UTC (rev 43252)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jsf.vpe.jsf.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class JsfCommandButton extends VpeAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+ nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
+
+ if (sourceElement.hasAttribute(JSF.ATTR_STYLE)) {
+ input.setAttribute(JSF.ATTR_STYLE, sourceElement.getAttribute(JSF.ATTR_STYLE));
+ }
+ if (sourceElement.hasAttribute(JSF.ATTR_STYLE_CLASS)) {
+ input.setAttribute(HTML.ATTR_CLASS, sourceElement.getAttribute(JSF.ATTR_STYLE_CLASS));
+ }
+ if (sourceElement.hasAttribute(JSF.ATTR_DISABLED)) {
+ String disabled = sourceElement.getAttribute(JSF.ATTR_DISABLED);
+ if ("true".equalsIgnoreCase(disabled)) { //$NON-NLS-1$
+ input.setAttribute(JSF.ATTR_DISABLED, JSF.ATTR_DISABLED);
+ }
+ }
+ if (sourceElement.hasAttribute(JSF.ATTR_DIR)) {
+ input.setAttribute(JSF.ATTR_DIR, sourceElement.getAttribute(JSF.ATTR_DIR));
+ }
+ if (sourceElement.hasAttribute(JSF.ATTR_IMAGE)) {
+// 1) attr: +image -> type=image
+ input.setAttribute(JSF.ATTR_TYPE,JSF.ATTR_IMAGE);
+ input.setAttribute(JSF.ATTR_SRC,
+ VpeStyleUtil.addFullPathToImgSrc(
+ sourceElement.getAttribute(JSF.ATTR_IMAGE), pageContext, true));
+ } else if (sourceElement.hasAttribute(JSF.ATTR_TYPE)) {
+// 2) attr: +type -> type=type
+ input.setAttribute(JSF.ATTR_TYPE, sourceElement.getAttribute(JSF.ATTR_TYPE));
+ if (sourceElement.hasAttribute(JSF.ATTR_VALUE)) {
+ input.setAttribute(JSF.ATTR_VALUE, sourceElement.getAttribute(JSF.ATTR_VALUE));
+ }
+ } else {
+// 3) attr: -type -> type=button
+ input.setAttribute(JSF.ATTR_TYPE, JSF.VALUE_BUTTON);
+ if (sourceElement.hasAttribute(JSF.ATTR_VALUE)) {
+ input.setAttribute(JSF.ATTR_VALUE, sourceElement.getAttribute(JSF.ATTR_VALUE));
+ }
+ }
+
+ /*
+ * https://issues.jboss.org/browse/JBIDE-3225
+ * Components should render usual text inside
+ */
+ VpeCreationData creationData = VisualDomUtil.createTemplateWithTextContainer(
+ sourceElement, input, HTML.TAG_DIV, visualDocument);
+
+ return creationData;
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2012-08-27 12:00:59 UTC (rev 43251)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2012-08-27 13:08:22 UTC (rev 43252)
@@ -211,105 +211,18 @@
</vpe:tag>
<vpe:tag name="h:commandButton" case-sensitive="yes">
- <!--
- This is a very big if-statement. Its goal is to add support of
- 'disabled property' DO NOT FORGET TO EDIT 'ELSE' PART IN FUTURE
- MODIFICATIONS
- -->
- <vpe:if test="(@disabled='true')">
- <vpe:if test="not(attrpresent('image'))">
- <vpe:if test="(@type='')">
- <vpe:template children="no" modify="no">
- <input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
- class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}"
- disabled='disabled' />
- <vpe:resize>
+ <vpe:template children="yes" modify="no"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfCommandButton">
+ <vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- </vpe:dnd>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
- <vpe:if test="not(@type='')">
- <vpe:template children="no" modify="no">
- <input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
- class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}"
- disabled='disabled' />
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- </vpe:dnd>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
- </vpe:if>
- <vpe:if test="attrpresent('image')">
- <vpe:template children="no" modify="no">
- <input type="image" src="{src(@image)}" class="{@styleClass}"
- style="{@style}" title="{tagstring()}" disabled='disabled' />
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
- </vpe:if>
- <!--else-->
- <vpe:if test="not(attrpresent('image'))">
- <vpe:if test="(@type='')">
- <vpe:template children="no" modify="no">
- <input type="button" value="{iif(@value='',' ',jsfvalue(@value))}"
- class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}" />
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:dnd>
+ </vpe:resize>
+ <vpe:dnd>
<vpe:drag start-enable="yes" />
- </vpe:dnd>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
- <vpe:if test="not(@type='')">
- <vpe:template children="no" modify="no">
- <input type="{@type}" value="{iif(@value='',' ',jsfvalue(@value))}"
- class="{@styleClass}" style="{@style}" title="{tagstring()}" dir="{@dir}" />
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- </vpe:dnd>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
- </vpe:if>
- <vpe:if test="attrpresent('image')">
- <vpe:template children="no" modify="no">
- <input type="image" src="{src(@image)}" class="{@styleClass}"
- style="{@style}" title="{tagstring()}" />
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:textFormatting use-default-formats="yes">
- </vpe:textFormatting>
- </vpe:template>
- </vpe:if>
- <!--end-of-else-->
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ </vpe:textFormatting>
+ </vpe:template>
</vpe:tag>
<!-- Проблема с вложенным параметром (31 of 4) -->
12 years, 4 months
JBoss Tools SVN: r43251 - branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-27 08:00:59 -0400 (Mon, 27 Aug 2012)
New Revision: 43251
Modified:
branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
Log:
OpenShift SWTBot tests: git directory fix
Modified: branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
===================================================================
--- branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-27 12:00:39 UTC (rev 43250)
+++ branches/jbosstools-3.3.x/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-27 12:00:59 UTC (rev 43251)
@@ -21,7 +21,9 @@
public void cleanUpProject() {
File gitDir = new File(System.getProperty("user.home") + "/git");
- if (gitDir.exists() && gitDir.isDirectory()
+ boolean exists = gitDir.exists() ? true : gitDir.mkdir();
+
+ if (exists && gitDir.isDirectory()
&& gitDir.listFiles().length > 0) {
for (File file : gitDir.listFiles()) {
if (file.getName().contains(
12 years, 4 months
JBoss Tools SVN: r43250 - trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer.
by jbosstools-commits@lists.jboss.org
Author: sbunciak
Date: 2012-08-27 08:00:39 -0400 (Mon, 27 Aug 2012)
New Revision: 43250
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
Log:
OpenShift SWTBot tests: git directory fix
Modified: trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-27 10:27:03 UTC (rev 43249)
+++ trunk/openshift/tests/org.jboss.tools.openshift.ui.bot.test/src/org/jboss/tools/openshift/ui/bot/test/explorer/CreateApp.java 2012-08-27 12:00:39 UTC (rev 43250)
@@ -21,7 +21,9 @@
public void cleanUpProject() {
File gitDir = new File(System.getProperty("user.home") + "/git");
- if (gitDir.exists() && gitDir.isDirectory()
+ boolean exists = gitDir.exists() ? true : gitDir.mkdir();
+
+ if (exists && gitDir.isDirectory()
&& gitDir.listFiles().length > 0) {
for (File file : gitDir.listFiles()) {
if (file.getName().contains(
12 years, 4 months