JBoss Tools SVN: r33585 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-04 08:45:40 -0400 (Thu, 04 Aug 2011)
New Revision: 33585
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
Log:
botext: can ignore config files
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java 2011-08-04 10:19:16 UTC (rev 33584)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java 2011-08-04 12:45:40 UTC (rev 33585)
@@ -37,6 +37,7 @@
}
protected static RuntimeBean fromString(String propValue, String url, RuntimeBean bean) throws Exception {
+ bean = fromString(propValue, bean);
if (bean!=null && url!=null) {
String runtimeFile = downloadRuntime(url);
if (runtimeFile!=null) {
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-04 10:19:16 UTC (rev 33584)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-04 12:45:40 UTC (rev 33585)
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map.Entry;
import java.util.Properties;
+import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
@@ -65,6 +66,11 @@
*/
public static final String CONFIGURATIONS_DIR="test.configurations.dir";
/**
+ * regular expression for ignoring property files found in {@link TestConfigurator#CONFIGURATIONS_DIR}
+ * filename matching this will be ignored
+ */
+ public static final String CONFIGURATIONS_IGNORE="test.configurations.ignore";
+ /**
* path to property file which contains either 1 configuration or properties [config name]=[abs path to config property file]
*/
public static final String SWTBOT_TEST_PROPERTIES_FILE = "swtbot.test.properties.file";
@@ -74,6 +80,13 @@
boolean loadDefault = true;
try {
+ Pattern configMatch = Pattern.compile("nomatch");
+ try {
+ configMatch = Pattern.compile(System.getProperty(CONFIGURATIONS_IGNORE, "nomatch"));
+ }
+ catch (Exception ex) {
+ log.error("Error parsing property "+CONFIGURATIONS_IGNORE,ex);
+ }
// try to load from file first
String propFile = System.getProperty(SWTBOT_TEST_PROPERTIES_FILE,
null);
@@ -91,11 +104,12 @@
else {
log.info("Loading property config-files from '"
+ configsDir + "'");
+ final Pattern fMatch = Pattern.compile(configMatch.toString());
File[] propFiles = configsDirFile.listFiles(new FileFilter(){
@Override
public boolean accept(File name) {
- return name.getName().endsWith(".properties");
+ return name.getName().endsWith(".properties") && !fMatch.matcher(name.getName()).matches();
}});
for (File file : propFiles)
{
14 years, 8 months
JBoss Tools SVN: r33584 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-04 06:19:16 -0400 (Thu, 04 Aug 2011)
New Revision: 33584
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ESBBean.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
Log:
swtbot ext: make ESB runtime downloadable too
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ESBBean.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ESBBean.java 2011-08-04 06:50:57 UTC (rev 33583)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ESBBean.java 2011-08-04 10:19:16 UTC (rev 33584)
@@ -4,6 +4,11 @@
public ESBBean() {
this.key = TestConfigurator.Keys.ESB;
}
+
+ public static ESBBean fromString(String propValue, String url) throws Exception {
+ return (ESBBean)fromString(propValue, url, new ESBBean());
+ }
+
public static ESBBean fromString(String propValue) throws Exception {
return (ESBBean)fromString(propValue, new ESBBean());
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java 2011-08-04 06:50:57 UTC (rev 33583)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/RuntimeBean.java 2011-08-04 10:19:16 UTC (rev 33584)
@@ -8,7 +8,13 @@
import java.net.URL;
import org.apache.log4j.Logger;
+import org.jboss.tools.ui.bot.ext.helper.FileHelper;
+/**
+ * Ancestor of all configurable beans, having common methods for parsing property line or downloading runtime
+ * @author lzoubek
+ *
+ */
public class RuntimeBean {
protected static final Logger log = Logger.getLogger(RuntimeBean.class);
protected String key;
@@ -29,12 +35,29 @@
throw new Exception("Cannot parse "+bean.key+" property line",ex);
}
}
+
+ protected static RuntimeBean fromString(String propValue, String url, RuntimeBean bean) throws Exception {
+ if (bean!=null && url!=null) {
+ String runtimeFile = downloadRuntime(url);
+ if (runtimeFile!=null) {
+ File runtimeHomeAbs = new File(bean.runtimeHome).getAbsoluteFile();
+ FileHelper.unzipArchive(new File(runtimeFile), runtimeHomeAbs.getParentFile());
+ }
+ }
+ return bean;
+ }
@Override
public String toString() {
return String.format("%s runtime version=%s, home=%s",this.key,
this.version, this.runtimeHome);
}
- public static String downloadRuntime(String url) {
+
+ /**
+ * Downloads file from given url to temp dir
+ *
+ * @return absolute path to downloaded file
+ */
+ protected static String downloadRuntime(String url) {
BufferedInputStream in = null;
RandomAccessFile raf = null;
String outputFile = System.getProperty("java.io.tmpdir")+System.getProperty("file.separator")+url.replaceAll(".*/", "");
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2011-08-04 06:50:57 UTC (rev 33583)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2011-08-04 10:19:16 UTC (rev 33584)
@@ -72,7 +72,8 @@
printConfig(Keys.RS, remoteSystem);
seam = SeamBean.fromString(getProperty(Keys.SEAM));
printConfig(Keys.SEAM, seam);
- esb = ESBBean.fromString(getProperty(Keys.ESB));
+ esb = ESBBean.fromString(getProperty(Keys.ESB),
+ getProperty(Keys.ESB + TestConfigurator.RUNTIME_URL_SUFFIX));
printConfig(Keys.ESB, esb);
jbpm = JBPMBean.fromString(getProperty(Keys.JBPM));
printConfig(Keys.JBPM, jbpm);
14 years, 8 months
JBoss Tools SVN: r33583 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-04 02:50:57 -0400 (Thu, 04 Aug 2011)
New Revision: 33583
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
Log:
class with constants converted to interface to exclude from code coverage
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2011-08-04 06:46:41 UTC (rev 33582)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2011-08-04 06:50:57 UTC (rev 33583)
@@ -2,7 +2,7 @@
* Copyright (c) 2007 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,
+ * Eclipse License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
@@ -21,267 +21,267 @@
* @author Max Areshkau
* @author yradtsevich
*/
-public class HtmlComponentUtil {
+public interface HtmlComponentUtil {
/**
* @deprecated use {@link HTML#TAG_DL} instead
*/
- public static final String HTML_TAG_DL = "dl"; //$NON-NLS-1$
+ static final String HTML_TAG_DL = "dl"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_BR} instead
*/
- public static final String HTML_TAG_BR = "br"; //$NON-NLS-1$
+ static final String HTML_TAG_BR = "br"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_COLGROUP} instead
*/
- public static final String HTML_TAG_COLGROUP = "colgroup"; //$NON-NLS-1$
+ static final String HTML_TAG_COLGROUP = "colgroup"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_THEAD} instead
*/
- public static final String HTML_TAG_THEAD = "thead"; //$NON-NLS-1$
+ static final String HTML_TAG_THEAD = "thead"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_TFOOT} instead
*/
- public static final String HTML_TAG_TFOOT = "tfoot"; //$NON-NLS-1$
+ static final String HTML_TAG_TFOOT = "tfoot"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_CAPTION} instead
*/
- public static final String HTML_TAG_CAPTION = "caption"; //$NON-NLS-1$
+ static final String HTML_TAG_CAPTION = "caption"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_DT} instead
*/
- public static final String HTML_TAG_DT = "dt"; //$NON-NLS-1$
+ static final String HTML_TAG_DT = "dt"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_DD} instead
*/
- public static final String HTML_TAG_DD = "dd"; //$NON-NLS-1$
+ static final String HTML_TAG_DD = "dd"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_TABLE} instead
*/
- public static final String HTML_TAG_TABLE = "TABLE"; //$NON-NLS-1$
+ static final String HTML_TAG_TABLE = "TABLE"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_TBODY} instead
*/
- public static final String HTML_TAG_TBODY = "TBODY"; //$NON-NLS-1$
+ static final String HTML_TAG_TBODY = "TBODY"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_TR} instead
*/
- public static final String HTML_TAG_TR = "TR"; //$NON-NLS-1$
+ static final String HTML_TAG_TR = "TR"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_TD} instead
*/
- public static final String HTML_TAG_TD = "TD"; //$NON-NLS-1$
+ static final String HTML_TAG_TD = "TD"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_TH} instead
*/
- public static final String HTML_TAG_TH = "TH"; //$NON-NLS-1$
+ static final String HTML_TAG_TH = "TH"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_INPUT} instead
*/
- public static final String HTML_TAG_INPUT = "INPUT"; //$NON-NLS-1$
+ static final String HTML_TAG_INPUT = "INPUT"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_IMG} instead
*/
- public static final String HTML_TAG_IMG = "IMG"; //$NON-NLS-1$
+ static final String HTML_TAG_IMG = "IMG"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_DIV} instead
*/
- public static final String HTML_TAG_DIV = "DIV"; //$NON-NLS-1$
+ static final String HTML_TAG_DIV = "DIV"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_SPAN} instead
*/
- public static final String HTML_TAG_SPAN = "SPAN"; //$NON-NLS-1$
+ static final String HTML_TAG_SPAN = "SPAN"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_A} instead
*/
- public static final String HTML_TAG_A = "A"; //$NON-NLS-1$
+ static final String HTML_TAG_A = "A"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_B} instead
*/
- public static final String HTML_TAG_B = "B"; //$NON-NLS-1$
+ static final String HTML_TAG_B = "B"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_LI} instead
*/
- public static final String HTML_TAG_LI = "LI"; //$NON-NLS-1$
+ static final String HTML_TAG_LI = "LI"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_COLSPAN} instead
*/
- public static final String HTML_TABLE_COLSPAN = "colspan"; //$NON-NLS-1$
+ static final String HTML_TABLE_COLSPAN = "colspan"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_HEIGHT} instead
*/
- public static final String HTML_HEIGHT_ATTR = "height"; //$NON-NLS-1$
+ static final String HTML_HEIGHT_ATTR = "height"; //$NON-NLS-1$
/**
* @deprecated use {@link RichFaces#ATTR_STYLE_CLASS} instead
*/
- public static final String HTML_STYLECLASS_ATTR = "styleClass"; //$NON-NLS-1$
+ static final String HTML_STYLECLASS_ATTR = "styleClass"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_CLASS} instead
*/
- public static final String HTML_CLASS_ATTR = "class"; //$NON-NLS-1$
+ static final String HTML_CLASS_ATTR = "class"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_CELLSPACING} instead
*/
- public static final String HTML_CELLSPACING_ATTR = "cellspacing"; //$NON-NLS-1$
+ static final String HTML_CELLSPACING_ATTR = "cellspacing"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_CELLPADDING} instead
*/
- public static final String HTML_CELLPADDING_ATTR = "cellpadding"; //$NON-NLS-1$
+ static final String HTML_CELLPADDING_ATTR = "cellpadding"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#VALUE_ALIGN_LEFT} instead
*/
- public static final String HTML_ALIGN_LEFT_VALUE = "left"; //$NON-NLS-1$
+ static final String HTML_ALIGN_LEFT_VALUE = "left"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#VALUE_ALIGN_RIGHT} instead
*/
- public static final String HTML_ALIGN_RIGHT_VALUE = "right"; //$NON-NLS-1$
+ static final String HTML_ALIGN_RIGHT_VALUE = "right"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#VALUE_ALIGN_CENTER} instead
*/
- public static final String HTML_ALIGN_CENTER_VALUE = "center"; //$NON-NLS-1$
+ static final String HTML_ALIGN_CENTER_VALUE = "center"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_WIDTH} instead
*/
- public static final String HTML_ATR_WIDTH = "width"; //$NON-NLS-1$
+ static final String HTML_ATR_WIDTH = "width"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_HEIGHT} instead
*/
- public static final String HTML_ATR_HEIGHT = "height"; //$NON-NLS-1$
+ static final String HTML_ATR_HEIGHT = "height"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_SRC} instead
*/
- public static final String HTML_ATR_SRC = "src"; //$NON-NLS-1$
+ static final String HTML_ATR_SRC = "src"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_STYLE} instead
*/
- public static final String HTML_STYLE_ATTR = "style"; //$NON-NLS-1$
+ static final String HTML_STYLE_ATTR = "style"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_SCOPE} instead
*/
- public static final String HTML_SCOPE_ATTR = "scope"; //$NON-NLS-1$
+ static final String HTML_SCOPE_ATTR = "scope"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_BORDER} instead
*/
- public static final String HTML_BORDER_ATTR = "border"; //$NON-NLS-1$
+ static final String HTML_BORDER_ATTR = "border"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_ALIGN} instead
*/
- public static final String HTML_ALIGN_ATTR = "align"; //$NON-NLS-1$
+ static final String HTML_ALIGN_ATTR = "align"; //$NON-NLS-1$
// TODO: move the constant from this class to somewhere
- public static final String FILE_PROTOCOL = "file://"; //$NON-NLS-1$
+ static final String FILE_PROTOCOL = "file://"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_COLSPAN} instead
*/
- public static final String HTML_COLSPAN_ATTR = "colspan"; //$NON-NLS-1$
+ static final String HTML_COLSPAN_ATTR = "colspan"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_ROWSPAN} instead
*/
- public static final String HTML_ROWSPAN_ATTR = "rowspan"; //$NON-NLS-1$
+ static final String HTML_ROWSPAN_ATTR = "rowspan"; //$NON-NLS-1$
/** @deprecated there is no tag with row attribute */
// TODO: remove the attribute from the code
- public static final String HTML_ROW_ATTR = "row"; //$NON-NLS-1$
+ static final String HTML_ROW_ATTR = "row"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_SIZE} instead
*/
- public static final String HTML_SIZE_ATTR = "size"; //$NON-NLS-1$
+ static final String HTML_SIZE_ATTR = "size"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_TYPE} instead
*/
- public static final String HTML_TYPE_ATTR = "type"; //$NON-NLS-1$
+ static final String HTML_TYPE_ATTR = "type"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_READONLY} instead
*/
- public static final String HTML_READONLY_ATTR = "readonly"; //$NON-NLS-1$
+ static final String HTML_READONLY_ATTR = "readonly"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#TAG_BUTTON} instead
*/
- public static final String HTML_TAG_BUTTON = "button"; //$NON-NLS-1$
+ static final String HTML_TAG_BUTTON = "button"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_VALUE} instead
*/
- public static final String HTML_VALUE_ATTR = "value"; //$NON-NLS-1$
+ static final String HTML_VALUE_ATTR = "value"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#STYLE_PARAMETER_BORDER_WIDTH} instead
*/
- public static final String CSS_BORDER_WIDTH = "border-width"; //$NON-NLS-1$
+ static final String CSS_BORDER_WIDTH = "border-width"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#STYLE_PARAMETER_BORDER_STYLE} instead
*/
- public static final String CSS_BORDER_STYLE = "border-style"; //$NON-NLS-1$
+ static final String CSS_BORDER_STYLE = "border-style"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#STYLE_PARAMETER_DISPLAY} instead
*/
- public static final String CSS_DISPLAY = "display"; //$NON-NLS-1$
+ static final String CSS_DISPLAY = "display"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_WIDTH} instead
*/
- public static final String HTML_WIDTH_ATTR = "width"; //$NON-NLS-1$
+ static final String HTML_WIDTH_ATTR = "width"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_VALIGN} instead
*/
- public static final String HTML_ATTR_VALIGN = "valign"; //$NON-NLS-1$
+ static final String HTML_ATTR_VALIGN = "valign"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#STYLE_VALUE_MIDDLE} instead
*/
- public static final String HTML_ATTR_VALIGN_MIDDLE_VALUE = "middle"; //$NON-NLS-1$
+ static final String HTML_ATTR_VALIGN_MIDDLE_VALUE = "middle"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_BACKGROUND} instead
*/
- public static final String HTML_ATTR_BACKGROUND = "background"; //$NON-NLS-1$
+ static final String HTML_ATTR_BACKGROUND = "background"; //$NON-NLS-1$
/**
* @deprecated use {@link HTML#ATTR_DISABLED} instead
*/
- public static final String HTML_ATTR_DISABLED = "disabled"; //$NON-NLS-1$
+ static final String HTML_ATTR_DISABLED = "disabled"; //$NON-NLS-1$
}
14 years, 8 months
JBoss Tools SVN: r33582 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl: template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-04 02:46:41 -0400 (Thu, 04 Aug 2011)
New Revision: 33582
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java
Log:
small refactoring to eliminate package with only two classes
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java 2011-08-04 06:32:57 UTC (rev 33581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java 2011-08-04 06:46:41 UTC (rev 33582)
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.jsf.vpe.jstl;
-
-
-import org.jboss.tools.vpe.editor.util.Constants;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.Element;
-
-
-/**
- * The Class ComponentUtil.
- */
-public class ComponentUtil {
-
- /**
- * Returns value of attribute.
- *
- * @param attributeName the attribute name
- * @param sourceElement the source element
- *
- * @return the attribute
- */
- public static String getAttribute(Element sourceElement, String attributeName) {
- return getAttribute(sourceElement, attributeName, Constants.EMPTY);
- }
-
- /**
- * Returns value of attribute.
- *
- * @param attributeName the attribute name
- * @param sourceElement the source element
- * @param defaultValue the default value
- *
- * @return the attribute
- */
- public static String getAttribute(Element sourceElement, String attributeName, String defaultValue) {
- return sourceElement.hasAttribute(attributeName) ?
- sourceElement.getAttribute(attributeName) : defaultValue;
- }
-
- /**
- * Returns value of attribute.
- *
- * @param attributeName the attribute name
- * @param sourceElement the source element
- *
- * @return the attribute
- */
- public static String getAttribute(nsIDOMElement sourceElement, String attributeName) {
- return sourceElement.hasAttribute(attributeName) ?
- sourceElement.getAttribute(attributeName) : Constants.EMPTY;
- }
-}
\ No newline at end of file
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java (from rev 33581, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java 2011-08-04 06:46:41 UTC (rev 33582)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.jstl.template;
+
+
+/**
+ * Contains JSTL tags and general attributes.
+ *
+ * @author Igor Zhukov
+ */
+public interface Jstl {
+
+ static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel"; //$NON-NLS-1$
+
+ static final String TAG_OUT = "out"; //$NON-NLS-1$
+
+ static final String ATTR_URL = "url"; //$NON-NLS-1$
+
+ static final String ATTR_SELECT = "select"; //$NON-NLS-1$
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java 2011-08-04 06:32:57 UTC (rev 33581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java 2011-08-04 06:46:41 UTC (rev 33582)
@@ -12,7 +12,6 @@
import java.util.List;
-import org.jboss.tools.jsf.vpe.jstl.template.util.JstlUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java 2011-08-04 06:32:57 UTC (rev 33581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java 2011-08-04 06:46:41 UTC (rev 33582)
@@ -12,7 +12,6 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.jboss.tools.jsf.vpe.jstl.template.util.Jstl;
import org.jboss.tools.jst.jsp.util.NodesManagingUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java (from rev 33581, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/JstlUtil.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java 2011-08-04 06:46:41 UTC (rev 33582)
@@ -0,0 +1,36 @@
+package org.jboss.tools.jsf.vpe.jstl.template;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Class encapsulates JSTL utils.
+ *
+ * @author dmaliarevich
+ *
+ */
+public class JstlUtil {
+
+ /**
+ * Gets all children of the source element
+ * including text nodes.
+ *
+ * @param sourceElement
+ * the source element
+ *
+ * @return the children
+ */
+ public static List<Node> getChildren(Element sourceElement) {
+ ArrayList<Node> children = new ArrayList<Node>();
+ NodeList nodeList = sourceElement.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node child = nodeList.item(i);
+ children.add(child);
+ }
+ return children;
+ }
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Author Id Revision Date
Added: svn:eol-style
+ native
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java 2011-08-04 06:32:57 UTC (rev 33581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java 2011-08-04 06:46:41 UTC (rev 33582)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jstl.template;
-import org.jboss.tools.jsf.vpe.jstl.template.util.Jstl;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
14 years, 8 months
JBoss Tools SVN: r33581 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-04 02:32:57 -0400 (Thu, 04 Aug 2011)
New Revision: 33581
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java
Log:
class with constants is converted to interface to exclude from code coverage
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java 2011-08-04 05:15:17 UTC (rev 33580)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java 2011-08-04 06:32:57 UTC (rev 33581)
@@ -17,20 +17,13 @@
*
* @author Igor Zhukov
*/
-public class Jstl {
+public interface Jstl {
- /**
- * The Constructor.
- */
- private Jstl() {
- }
+ static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel"; //$NON-NLS-1$
- /** The Constant ATTR_ADD_CONTROL_LABEL. */
- public static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel"; //$NON-NLS-1$
+ static final String TAG_OUT = "out"; //$NON-NLS-1$
- public static final String TAG_OUT = "out"; //$NON-NLS-1$
+ static final String ATTR_URL = "url"; //$NON-NLS-1$
- public static final String ATTR_URL = "url"; //$NON-NLS-1$
-
- public static final String ATTR_SELECT = "select"; //$NON-NLS-1$
+ static final String ATTR_SELECT = "select"; //$NON-NLS-1$
}
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r33580 - trunk/cdi/tests/org.jboss.tools.cdi.bot.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-04 01:15:17 -0400 (Thu, 04 Aug 2011)
New Revision: 33580
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml
Log:
disable swt-bot test for cdi, because it basically never works
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml 2011-08-04 02:31:56 UTC (rev 33579)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/pom.xml 2011-08-04 05:15:17 UTC (rev 33580)
@@ -9,5 +9,5 @@
<groupId>org.jboss.tools.cdi.tests</groupId>
<artifactId>org.jboss.tools.cdi.bot.test</artifactId>
- <packaging>eclipse-test-plugin</packaging>
+ <packaging>eclipse-plugin</packaging>
</project>
14 years, 8 months
JBoss Tools SVN: r33579 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-08-03 22:31:56 -0400 (Wed, 03 Aug 2011)
New Revision: 33579
Modified:
trunk/build/parent/pom.xml
Log:
revert change to 0.12.0 -- all builds failing in Hudson (but could be unrelated?) -- back to 0.10.0
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2011-08-04 01:03:43 UTC (rev 33578)
+++ trunk/build/parent/pom.xml 2011-08-04 02:31:56 UTC (rev 33579)
@@ -15,7 +15,8 @@
<!-- to build w/ latest 0.13.0-SNAPSHOT, run `mvn install -DtychoVersion=0.13.0-SNAPSHOT`, or uncomment this property:
<tychoVersion>0.13.0-SNAPSHOT</tychoVersion>
-->
- <tychoVersion>0.12.0</tychoVersion>
+ <!-- <tychoVersion>0.12.0</tychoVersion> -->
+ <tychoVersion>0.10.0</tychoVersion>
<scmBranch>trunk</scmBranch>
<BUILD_ALIAS>M3</BUILD_ALIAS>
<memoryOptions1>-Xms512m -Xmx1024m -XX:PermSize=256m</memoryOptions1>
@@ -98,7 +99,8 @@
</plugin>
<plugin>
- <groupId>org.eclipse.tycho</groupId>
+ <!-- TODO: change to org.eclipse.tycho 0.12.0 -->
+ <groupId>org.sonatype.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tychoVersion}</version>
<extensions>true</extensions>
14 years, 8 months
JBoss Tools SVN: r33578 - in trunk/cdi/tests/org.jboss.tools.cdi.ui.test: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-03 21:03:43 -0400 (Wed, 03 Aug 2011)
New Revision: 33578
Added:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/pom.xml
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
Log:
performance fix for CDI UI tests:
1. manual build process without waiting
2. Incremental validation on demand inside main thread
3. 4+ times faster than previous version
4. Stable execution time because of all removed waiting cycles
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-08-04 01:01:20 UTC (rev 33577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/META-INF/MANIFEST.MF 2011-08-04 01:03:43 UTC (rev 33578)
@@ -27,5 +27,6 @@
org.eclipse.ltk.core.refactoring,
org.eclipse.search;bundle-version="3.7.0",
org.jboss.tools.common.el.core;bundle-version="3.3.0",
- org.jboss.tools.jst.web.kb
+ org.jboss.tools.jst.web.kb,
+ org.eclipse.wst.validation;bundle-version="1.2.300"
Export-Package: org.jboss.tools.cdi.ui.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/pom.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/pom.xml 2011-08-04 01:01:20 UTC (rev 33577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/pom.xml 2011-08-04 01:03:43 UTC (rev 33578)
@@ -22,6 +22,7 @@
<groupId>org.sonatype.tycho</groupId>
<artifactId>maven-osgi-test-plugin</artifactId>
<configuration>
+ <product>org.jboss.tools.tests.product</product>
<explodedBundles>
<bundle>org.jboss.tools.cdi.core.test</bundle>
</explodedBundles>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-08-04 01:01:20 UTC (rev 33577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-08-04 01:03:43 UTC (rev 33578)
@@ -13,9 +13,23 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.apache.xerces.impl.validation.ValidationManager;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
+import org.eclipse.jst.jsp.core.internal.contentproperties.JSPFContentPropertiesManager;
import org.eclipse.jst.jsp.core.internal.java.search.JSPIndexManager;
+import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
+import org.eclipse.jst.jsp.core.taglib.TaglibIndex;
+import org.eclipse.wst.sse.core.internal.validate.ValidationMessage;
+import org.eclipse.wst.validation.ValidationFramework;
import org.jboss.tools.cdi.core.test.CDICoreTestSetup;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.ui.test.marker.CDIMarkerResolutionTest;
import org.jboss.tools.cdi.ui.test.perspective.CDIPerspectiveTest;
import org.jboss.tools.cdi.ui.test.preferences.CDIPreferencePageTest;
@@ -23,6 +37,8 @@
import org.jboss.tools.cdi.ui.test.wizard.AddQualifiersToBeanWizardTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIClassWizardFactoryTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIWizardTest;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.test.util.WorkbenchUtils;
/**
* @author Alexey Kazakov
@@ -32,28 +48,50 @@
public static Test suite() {
// it could be done here because it is not needed to be enabled back
JavaModelManager.getIndexManager().shutdown();
+
+ new Job("Shutodwn what is not needed") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ JSPIndexManager.getDefault().stop();
+ } catch (InterruptedException e) {
+ // print it and ignore it
+ e.printStackTrace();
+ }
+ JSPFContentPropertiesManager.shutdown();
+ JavaCore.removeElementChangedListener(TaglibHelperManager.getInstance());
+ TaglibController.shutdown();
+ TaglibIndex.shutdown();
+ return Status.OK_STATUS;
+ }
+ }.schedule(3000);
try {
- JSPIndexManager.getDefault().stop();
- } catch (InterruptedException e) {
- // print it and ignore it
+ ResourcesUtils.setBuildAutomatically(false);
+ ValidationFramework.getDefault().suspendAllValidation(true);
+ } catch (CoreException e) {
e.printStackTrace();
}
-
TestSuite suiteAll = new TestSuite("CDI UI Tests");
+ TestSuite suite = new TestSuite("TCK Tests");
- TestSuite suite = new TestSuite("TCK Tests");
- suite.addTestSuite(CDISearchParticipantTest.class);
suiteAll.addTestSuite(CDIMarkerResolutionTest.class);
-
-
+
suiteAll.addTestSuite(CDIPerspectiveTest.class);
suiteAll.addTestSuite(NewCDIClassWizardFactoryTest.class);
suiteAll.addTestSuite(CDIPreferencePageTest.class);
suiteAll.addTestSuite(NewCDIWizardTest.class);
suiteAll.addTestSuite(CATest.class);
- suiteAll.addTest(new CDICoreTestSetup(suite));
+ suite.addTestSuite(CDISearchParticipantTest.class);
+ suiteAll.addTest(new CDICoreTestSetup(suite) {
+ @Override
+ protected void setUp() throws Exception {
+ tckProject = TCKUITest.importPreparedProject("/");
+ }
+ }
+ );
+
suiteAll.addTestSuite(AddQualifiersToBeanWizardTest.class);
return suiteAll;
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java 2011-08-04 01:03:43 UTC (rev 33578)
@@ -0,0 +1,70 @@
+package org.jboss.tools.cdi.ui.test;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.core.test.tck.TCKTest.JavaFileFilter;
+import org.jboss.tools.cdi.core.test.tck.TCKTest.PageFileFilter;
+import org.jboss.tools.cdi.core.test.tck.TCKTest.XmlFileFilter;
+import org.jboss.tools.cdi.core.test.tck.validation.CoreValidationTest;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.java.IParametedType;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.osgi.framework.Bundle;
+
+public class TCKUITest extends TCKTest {
+ public IProject getTestProject() {
+ try {
+ if(tckProject==null) {
+ tckProject = findTestProject();
+ if(tckProject==null || !tckProject.exists()) {
+ ValidatorManager.setStatus(CoreValidationTest.VALIDATION_STATUS);
+ tckProject = importPreparedProject("/");
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Can't import CDI test project: " + e.getMessage());
+ }
+
+ return tckProject;
+ }
+
+ public static IProject importPreparedProject(String packPath) throws Exception {
+ Bundle b = Platform.getBundle(PLUGIN_ID);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ if(project==null || !project.exists()) {
+ project = ResourcesUtils.importProject(b, PROJECT_PATH);
+ }
+ String projectPath = project.getLocation().toOSString();
+ String resourcePath = FileLocator.resolve(b.getEntry(TCK_RESOURCES_PREFIX)).getFile();
+
+ File from = new File(resourcePath + packPath);
+ if(from.isDirectory()) {
+ File javaSourceTo = new File(projectPath + JAVA_SOURCE_SUFFIX + PACKAGE + packPath);
+ FileUtil.copyDir(from, javaSourceTo, true, true, true, new JavaFileFilter());
+
+ File webContentTo = new File(projectPath + WEB_CONTENT_SUFFIX);
+ FileUtil.copyDir(from, webContentTo, true, true, true, new PageFileFilter());
+
+ File webInfTo = new File(projectPath + WEB_CONTENT_SUFFIX + WEB_INF_SUFFIX);
+ FileUtil.copyDir(from, webInfTo, true, true, true, new XmlFileFilter());
+ }
+ project.build(IncrementalProjectBuilder.CLEAN_BUILD,null);
+ project.build(IncrementalProjectBuilder.FULL_BUILD,null);
+ TestUtil._waitForValidation(project);
+
+ return project;
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/TCKUITest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-08-04 01:01:20 UTC (rev 33577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-08-04 01:03:43 UTC (rev 33578)
@@ -40,6 +40,7 @@
import org.jboss.tools.cdi.ui.marker.MakeMethodBusinessMarkerResolution;
import org.jboss.tools.cdi.ui.marker.MakeMethodPublicMarkerResolution;
import org.jboss.tools.cdi.ui.marker.TestableResolutionWithRefactoringProcessor;
+import org.jboss.tools.cdi.ui.test.TCKUITest;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
@@ -48,7 +49,7 @@
* @author Daniel Azarov
*
*/
-public class CDIMarkerResolutionTest extends ValidationTest {
+public class CDIMarkerResolutionTest extends TCKUITest {
private void checkResolution(IProject project, String[] fileNames, String markerType, String idName, int id, Class<? extends IMarkerResolution> resolutionClass) throws CoreException {
checkResolution(project, fileNames, new String[]{}, markerType, idName, id, resolutionClass);
@@ -59,9 +60,8 @@
assertTrue("File - "+file.getFullPath()+" must be exist",file.exists());
- ValidatorManager.setStatus("TESTING");
copyFiles(project, fileNames);
- TestUtil.waitForValidation();
+ TestUtil.validate(file);
try{
file = project.getFile(fileNames[0]);
@@ -80,8 +80,6 @@
IMarkerResolution resolution = resolutions[j];
if (resolution.getClass().equals(resolutionClass)) {
- ValidatorManager.setStatus("TESTING");
-
if(resolution instanceof TestableResolutionWithRefactoringProcessor){
RefactoringProcessor processor = ((TestableResolutionWithRefactoringProcessor)resolution).getRefactoringProcessor();
@@ -110,7 +108,7 @@
resolution.run(marker);
}
- TestUtil.waitForValidation();
+ TestUtil.validate(file);
file = project.getFile(fileNames[0]);
IMarker[] newMarkers = file.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
@@ -129,7 +127,7 @@
fail("Problem marker with id: "+id+" not found");
}finally{
restoreFiles(project, fileNames);
- TestUtil.waitForValidation();
+ TestUtil.validate(file);
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-08-04 01:01:20 UTC (rev 33577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/CDISearchParticipantTest.java 2011-08-04 01:03:43 UTC (rev 33578)
@@ -30,9 +30,10 @@
import org.jboss.tools.cdi.ui.search.CDIBeanQueryParticipant;
import org.jboss.tools.cdi.ui.search.CDIMatch;
import org.jboss.tools.cdi.ui.search.InjectionPointQueryParticipant;
+import org.jboss.tools.cdi.ui.test.TCKUITest;
import org.jboss.tools.common.EclipseUtil;
-public class CDISearchParticipantTest extends TCKTest {
+public class CDISearchParticipantTest extends TCKUITest {
private static final int FIELD_SEARCH = 1;
private static final int METHOD_SEARCH = 2;
private static final int TYPE_SEARCH = 3;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2011-08-04 01:01:20 UTC (rev 33577)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2011-08-04 01:03:43 UTC (rev 33578)
@@ -224,7 +224,11 @@
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewStereotypeCreationWizard",
PACK_NAME, STEREOTYPE2_NAME);
- JobUtils.waitForIdle(2000);
+ try {
+ context.tck.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
IStereotype s = cdi.getStereotype(PACK_NAME + "." + STEREOTYPE_NAME);
IStereotype d = cdi.getStereotype(CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
@@ -309,8 +313,8 @@
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingCreationWizard",
PACK_NAME, INTERCEPTOR_BINDING2_NAME);
- JobUtils.waitForIdle(2000);
+
try {
NewInterceptorBindingWizardPage page = (NewInterceptorBindingWizardPage)context.page;
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
@@ -342,8 +346,8 @@
public void testNewInterceptorWizard() {
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard",
- PACK_NAME, INTERCEPTOR_NAME);JobUtils.waitForIdle(2000);
- JobUtils.waitForIdle(2000);
+ PACK_NAME, INTERCEPTOR_NAME);
+
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
ICDIAnnotation a = cdi.getInterceptorBinding(PACK_NAME + "." + INTERCEPTOR_BINDING_NAME);
@@ -373,8 +377,8 @@
public void testNewDecoratorWizard() {
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard",
- PACK_NAME, DECORATOR_NAME);JobUtils.waitForIdle(2000);
- JobUtils.waitForIdle(2000);
+ PACK_NAME, DECORATOR_NAME);
+
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
try {
@@ -399,8 +403,8 @@
public void testNewBeanWizard() throws Exception {
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard",
- PACK_NAME, BEAN_NAME);JobUtils.waitForIdle(2000);
- JobUtils.waitForIdle(2000);
+ PACK_NAME, BEAN_NAME);
+
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
try {
@@ -439,8 +443,8 @@
public void testNewAnnotationLiteralWizard() {
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard",
- PACK_NAME, QUALIFIER_NAME + "Literal");JobUtils.waitForIdle(2000);
- JobUtils.waitForIdle(2000);
+ PACK_NAME, QUALIFIER_NAME + "Literal");
+
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
try {
@@ -462,8 +466,8 @@
public void testNewAnnotationLiteralWizardWithMembers() {
WizardContext context = new WizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard",
- PACK_NAME, "NewLiteral");JobUtils.waitForIdle(2000);
- JobUtils.waitForIdle(2000);
+ PACK_NAME, "NewLiteral");
+
ICDIProject cdi = CDICorePlugin.getCDIProject(context.tck, true);
try {
@@ -486,7 +490,6 @@
public void testNewBeansXMLWizard() throws CoreException {
NewBeansXMLWizardContext context = new NewBeansXMLWizardContext();
context.init("org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard");
- JobUtils.waitForIdle(2000);
try {
14 years, 8 months
JBoss Tools SVN: r33577 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-03 21:01:20 -0400 (Wed, 03 Aug 2011)
New Revision: 33577
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.core.test/pom.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
Log:
changed visibility for internal classes of TCKTest
configured tests to run with test product
added required dependencies
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2011-08-04 00:58:39 UTC (rev 33576)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/META-INF/MANIFEST.MF 2011-08-04 01:01:20 UTC (rev 33577)
@@ -19,7 +19,9 @@
org.jboss.tools.jst.web.kb,
org.jboss.tools.jst.jsp.test,
org.jboss.tools.cdi.xml,
- org.eclipse.jst.standard.schemas
+ org.eclipse.jst.standard.schemas,
+ org.eclipse.wst.validation;bundle-version="1.2.0",
+ org.eclipse.wst.common.frameworks;bundle-version="1.2.0"
Export-Package: org.jboss.tools.cdi.core.test,
org.jboss.tools.cdi.core.test.extension,
org.jboss.tools.cdi.core.test.tck,
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/pom.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/pom.xml 2011-08-04 00:58:39 UTC (rev 33576)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/pom.xml 2011-08-04 01:01:20 UTC (rev 33577)
@@ -22,6 +22,7 @@
<groupId>org.sonatype.tycho</groupId>
<artifactId>maven-osgi-test-plugin</artifactId>
<configuration>
+ <product>org.jboss.tools.tests.product</product>
<explodedBundles>
<bundle>org.jboss.tools.cdi.core.test</bundle>
</explodedBundles>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-08-04 00:58:39 UTC (rev 33576)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2011-08-04 01:01:20 UTC (rev 33577)
@@ -58,7 +58,7 @@
// protected static String WEB_CONTENT = PROJECT_PATH + WEB_CONTENT_SUFFIX;
// protected static String WEB_INF = WEB_CONTENT + WEB_INF_SUFFIX;
- static String PACKAGE = "/org/jboss/jsr299/tck";
+ protected static String PACKAGE = "/org/jboss/jsr299/tck";
protected static String TCK_RESOURCES_PREFIX = "/resources/tck";
@@ -204,7 +204,7 @@
assertEquals("There should be the only bean with " + typeName + " type", 1, beans.size());
}
- static class JavaFileFilter implements FileFilter {
+ public static class JavaFileFilter implements FileFilter {
public boolean accept(File pathname) {
String name = pathname.getName();
return (pathname.isDirectory() && !name.endsWith(".svn"))
@@ -218,14 +218,14 @@
}
}
- static class XmlFileFilter implements FileFilter {
+ public static class XmlFileFilter implements FileFilter {
public boolean accept(File pathname) {
String name = pathname.getName();
return (pathname.isDirectory() && !name.endsWith(".svn")) || name.endsWith(".xml");
}
}
- static class PageFileFilter implements FileFilter {
+ public static class PageFileFilter implements FileFilter {
public boolean accept(File pathname) {
String name = pathname.getName();
return (pathname.isDirectory() && !name.endsWith(".svn")) || name.endsWith(".jsp") || name.endsWith(".xhtml");
14 years, 8 months
JBoss Tools SVN: r33576 - in trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test: src/org/jboss/tools/jst/jsp/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-03 20:58:39 -0400 (Wed, 03 Aug 2011)
New Revision: 33576
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
Log:
added utility methods to to validation inside the main thread
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-08-04 00:54:46 UTC (rev 33575)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/META-INF/MANIFEST.MF 2011-08-04 00:58:39 UTC (rev 33576)
@@ -18,7 +18,9 @@
org.jboss.tools.jst.web;bundle-version="3.2.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.jboss.tools.common.model.ui,
- org.jboss.tools.jst.web.kb
+ org.jboss.tools.jst.web.kb,
+ org.eclipse.wst.validation;bundle-version="1.2.300",
+ org.eclipse.wst.common.frameworks;bundle-version="1.2.100"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.jboss.tools.jst.jsp.test,
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-08-04 00:54:46 UTC (rev 33575)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/TestUtil.java 2011-08-04 00:58:39 UTC (rev 33576)
@@ -1,6 +1,18 @@
package org.jboss.tools.jst.jsp.test;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.eclipse.wst.validation.internal.ValManager;
+import org.eclipse.wst.validation.internal.operations.EnabledValidatorsOperation;
+import org.eclipse.wst.validation.internal.operations.ValidatorSubsetOperation;
+import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
+import org.eclipse.wst.validation.internal.plugin.ValidationPlugin;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
import org.jboss.tools.test.util.JobUtils;
@@ -14,6 +26,63 @@
* TestUtil.waitForValidation(project);
* @throws CoreException
*/
+ public static void _waitForValidation(IProject project) throws CoreException{
+
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ ValidationFramework.getDefault().suspendAllValidation(false);
+ try {
+ new EnabledValidatorsOperation(project,false){
+ public void run(IProgressMonitor progressMonitor) throws OperationCanceledException {
+ try {
+ // In order to check whether or not the monitor has been canceled, the monitor must not be null.
+ if (progressMonitor == null)return;
+ IProject project = getProject();
+ if (ValidationFramework.getDefault().isSuspended(project))return;
+ if (ValManager.getDefault().isDisabled(project))return;
+
+ if (!areValidatorsEnabled()) {
+ // save some processing time...
+ return;
+ }
+
+ final WorkbenchReporter reporter = new WorkbenchReporter(getProject(), progressMonitor) {
+ public void addMessage(org.eclipse.wst.validation.internal.provisional.core.IValidator validator, org.eclipse.wst.validation.internal.provisional.core.IMessage message) {
+ super.addMessage(validator, message);
+ System.out.println(message);
+ };
+ };
+
+ try {
+ // Periodically check if the user has canceled the operation
+ checkCanceled(reporter);
+ preValidate(reporter);
+ validate(reporter);
+ } catch (CoreException e) {
+ ValidationPlugin.getPlugin().handleException(e);
+ }
+ } finally {
+ }
+ }
+ }.run(new NullProgressMonitor());
+ } finally {
+ ValidationFramework.getDefault().suspendAllValidation(true);
+ }
+ }
+
+ public static void validate(IResource resource) throws CoreException {
+ validate(resource.getProject(), new IResource[] {resource});
+ }
+
+ public static void validate(IProject project, IResource[] resource) throws CoreException {
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ ValidationFramework.getDefault().suspendAllValidation(false);
+ try {
+ new ValidatorSubsetOperation(project,"java",resource,false).run(new NullProgressMonitor());
+ } finally {
+ ValidationFramework.getDefault().suspendAllValidation(true);
+ }
+ }
+
public static void waitForValidation() throws CoreException{
for (int i = 0; i < 50; i++) {
if(ValidatorManager.getStatus().equals(ValidatorManager.SLEEPING)) {
14 years, 8 months