JBoss Tools SVN: r36499 - in workspace/yradtsevich/browsersim/swt-webkit-browsersim: org.jboss.tools.browsersim.browser.test and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-11-21 11:25:07 -0500 (Mon, 21 Nov 2011)
New Revision: 36499
Added:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.classpath
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.project
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.jdt.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.pde.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/META-INF/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/build.properties
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/BrowserAllTests.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/WebKitTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web apps
- added JUnits for User-Agent setters in WebKit
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test
___________________________________________________________________
Added: svn:ignore
+ bin
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.classpath
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.classpath (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.classpath 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.project
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.project (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.project 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.browsersim.browser.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.jdt.core.prefs 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,8 @@
+#Mon Nov 21 16:31:27 AST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.pde.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/.settings/org.eclipse.pde.core.prefs 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,4 @@
+#Mon Nov 21 16:31:28 AST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/META-INF/MANIFEST.MF 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: BrowserSim WebKit Test
+Bundle-SymbolicName: org.jboss.tools.browsersim.browser.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.junit,
+ org.eclipse.swt,
+ org.jboss.tools.browsersim.browser;bundle-version="1.0.0"
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/build.properties
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/build.properties (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/build.properties 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/BrowserAllTests.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/BrowserAllTests.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/BrowserAllTests.java 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,18 @@
+package org.jboss.tools.browsersim.browser.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Yahor Radtsevich
+ */
+public class BrowserAllTests extends TestSuite {
+ public static Test suite() {
+
+ TestSuite suite = new TestSuite("Tests for Vpe HTML components"); //$NON-NLS-1$
+ // $JUnit-BEGIN$
+ suite.addTestSuite(WebKitTests.class);
+ //$JUnit-END$
+ return suite;
+ }
+}
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/WebKitTests.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/WebKitTests.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser.test/src/org/jboss/tools/browsersim/browser/test/WebKitTests.java 2011-11-21 16:25:07 UTC (rev 36499)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.browsersim.browser.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.BrowserFunction;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.browsersim.browser.AbstractWebKitBrowser;
+import org.jboss.tools.browsersim.browser.WebKitBrowserFactory;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class WebKitTests extends TestCase {
+ private static final String CUSTOM_USER_AGENT = "A Custom User-Agent";
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testWebKitSetDefaultUserAgent() {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ final AbstractWebKitBrowser webKitBrowser = WebKitBrowserFactory.createWebKitBrowser(shell, SWT.NONE);
+ assertNotNull(webKitBrowser);
+ ExpressionExecutor expressionEvaluator = new ExpressionExecutor(webKitBrowser);
+
+ String initialUserAgent = (String) expressionEvaluator.evaluate("navigator.userAgent");
+
+ webKitBrowser.setDefaultUserAgent(CUSTOM_USER_AGENT);
+ String customUserAgent = (String) expressionEvaluator.evaluate("navigator.userAgent");
+ assertEquals(CUSTOM_USER_AGENT, customUserAgent);
+
+ webKitBrowser.setDefaultUserAgent(null);
+ String finalUserAgent = (String) expressionEvaluator.evaluate("navigator.userAgent");
+ assertEquals(initialUserAgent, finalUserAgent);
+
+ expressionEvaluator.dispose();
+ display.dispose();
+ }
+}
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+class ExpressionExecutor {
+ private static final String EXPRESSION_EXECUTOR_RESULT_EXTRACTOR_FUNCTION_NAME = "expressionExecutorResultExtractor";
+ private Browser browser;
+ private ResultExtractorFunction resultExtractorFunction;
+
+ public ExpressionExecutor(Browser browser) {
+ this.browser = browser;
+ resultExtractorFunction = new ResultExtractorFunction(browser, EXPRESSION_EXECUTOR_RESULT_EXTRACTOR_FUNCTION_NAME);
+ }
+
+ public void dispose() {
+ resultExtractorFunction.dispose();
+ }
+
+ public Object evaluate(String expression) {
+ resultExtractorFunction.reset();
+ browser.execute(EXPRESSION_EXECUTOR_RESULT_EXTRACTOR_FUNCTION_NAME + "(eval('" + expression.replace("'", "\\'") + "'))");
+ return resultExtractorFunction.getResult().length > 0 ? resultExtractorFunction.getResult()[0] : null;
+ }
+
+ /**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+ private class ResultExtractorFunction extends BrowserFunction {
+ private Object[] result;
+
+ public ResultExtractorFunction(Browser browser, String name) {
+ super(browser, name);
+ }
+
+ public Object function(Object[] arguments) {
+ result = arguments;
+ return null;
+ }
+
+ public Object[] getResult() {
+ return result;
+ }
+
+ public void reset() {
+ result = null;
+ }
+ }
+}
13 years, 1 month
JBoss Tools SVN: r36498 - in workspace/yradtsevich/browsersim/swt-webkit-browsersim: org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/ui and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-11-21 11:23:19 -0500 (Mon, 21 Nov 2011)
New Revision: 36498
Added:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/AbstractWebKitBrowser.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/PlatformUtil.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/WebKitBrowserFactory.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/
Removed:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/.project
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/ui/BrowserSim.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web apps
- renaming org.jboss.tools.browsersim.webkit to org.jboss.tools.browsersim.browser, part 2
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF 2011-11-21 16:23:19 UTC (rev 36498)
@@ -5,5 +5,5 @@
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.swt;bundle-version="3.7.0",
- org.jboss.tools.browsersim.webkit;bundle-version="1.0.0"
+ org.jboss.tools.browsersim.browser;bundle-version="1.0.0"
Export-Package: org.jboss.tools.browsersim.ui
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/ui/BrowserSim.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/ui/BrowserSim.java 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/ui/BrowserSim.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -44,13 +44,13 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
+import org.jboss.tools.browsersim.browser.AbstractWebKitBrowser;
+import org.jboss.tools.browsersim.browser.WebKitBrowserFactory;
import org.jboss.tools.browsersim.model.Device;
import org.jboss.tools.browsersim.model.DevicesList;
import org.jboss.tools.browsersim.model.DevicesListHolder;
import org.jboss.tools.browsersim.model.DevicesListStorage;
import org.jboss.tools.browsersim.util.ResourcesUtil;
-import org.jboss.tools.browsersim.webkit.AbstractWebKitBrowser;
-import org.jboss.tools.browsersim.webkit.WebKitBrowserFactory;
/**
* @author Yahor Radtsevich (yradtsevich)
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/.project
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/.project 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/.project 2011-11-21 16:23:19 UTC (rev 36498)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.tools.browsersim.webkit</name>
+ <name>org.jboss.tools.browsersim.browser</name>
<comment></comment>
<projects>
</projects>
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/META-INF/MANIFEST.MF 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/META-INF/MANIFEST.MF 2011-11-21 16:23:19 UTC (rev 36498)
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WebKit
-Bundle-SymbolicName: org.jboss.tools.browsersim.webkit;singleton:=true
+Bundle-SymbolicName: org.jboss.tools.browsersim.browser;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-ExtensibleAPI: true
-Export-Package: org.jboss.tools.browsersim.webkit
+Export-Package: org.jboss.tools.browsersim.browser
Require-Bundle: org.eclipse.swt;bundle-version="3.7.0"
Copied: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/AbstractWebKitBrowser.java (from rev 36497, workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/AbstractWebKitBrowser.java)
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/AbstractWebKitBrowser.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/AbstractWebKitBrowser.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.browsersim.browser;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public abstract class AbstractWebKitBrowser extends Browser {
+
+ private String defaultUserAgent;
+
+ public AbstractWebKitBrowser(Composite parent, int style) {
+ super(parent, style | SWT.WEBKIT);
+ }
+
+ @Override
+ protected void checkSubclass() {
+ }
+
+ @Override
+ public boolean setUrl(String url, String postData, String[] headers) {
+ setCustomUserAgent(defaultUserAgent);
+ boolean result = super.setUrl(url, postData, headers);
+ setCustomUserAgent(defaultUserAgent);
+ return result;
+ }
+
+ public void setDefaultUserAgent(String defaultUserAgent) {
+ this.defaultUserAgent = defaultUserAgent;
+ setCustomUserAgent(defaultUserAgent);
+ }
+
+ protected abstract void setCustomUserAgent(String userAgent);
+}
Copied: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/PlatformUtil.java (from rev 36497, workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/PlatformUtil.java)
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/PlatformUtil.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/PlatformUtil.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.browsersim.browser;
+
+import org.eclipse.swt.SWT;
+
+/**
+ * @author "Yahor Radtsevich (yradtsevich)"
+ */
+public class PlatformUtil {
+
+ public static final String CURRENT_PLATFORM;
+ static {
+ String os = getOs();
+ String ws = getWs();
+ String arch = getArch();
+
+ CURRENT_PLATFORM = ws + '.' + os + ("macosx".equals(os) ? "" : '.' + arch);
+ }
+
+
+ /*
+ * Copy of org.eclipse.swt.internal.Library.arch()
+ */
+ private static String getArch() {
+ String osArch = System.getProperty("os.arch"); //$NON-NLS-1$
+ if (osArch.equals ("i386") || osArch.equals ("i686")) return "x86"; //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
+ if (osArch.equals ("amd64")) return "x86_64"; //$NON-NLS-1$ $NON-NLS-2$
+ if (osArch.equals ("IA64N")) return "ia64_32"; //$NON-NLS-1$ $NON-NLS-2$
+ if (osArch.equals ("IA64W")) return "ia64"; //$NON-NLS-1$ $NON-NLS-2$
+ return osArch;
+ }
+
+ /*
+ * Copy of org.eclipse.swt.internal.Library.os()
+ */
+ private static String getOs() {
+ String osName = System.getProperty("os.name"); //$NON-NLS-1$
+ if (osName.equals ("Linux")) return "linux"; //$NON-NLS-1$ $NON-NLS-2$
+ if (osName.equals ("AIX")) return "aix"; //$NON-NLS-1$ $NON-NLS-2$
+ if (osName.equals ("Solaris") || osName.equals ("SunOS")) return "solaris"; //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
+ if (osName.equals ("HP-UX")) return "hpux"; //$NON-NLS-1$ $NON-NLS-2$
+ if (osName.equals ("Mac OS X")) return "macosx"; //$NON-NLS-1$ $NON-NLS-2$
+ if (osName.startsWith ("Win")) return "win32"; //$NON-NLS-1$ $NON-NLS-2$
+ return osName;
+ }
+
+ private static String getWs() {
+ return SWT.getPlatform();
+ }
+}
Copied: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/WebKitBrowserFactory.java (from rev 36497, workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/WebKitBrowserFactory.java)
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/WebKitBrowserFactory.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/WebKitBrowserFactory.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.browsersim.browser;
+
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.browsersim.browser.internal.WebKitBrowser_gtk_linux_x86;
+import org.jboss.tools.browsersim.browser.internal.WebKitBrowser_gtk_linux_x86_64;
+import org.jboss.tools.browsersim.browser.internal.WebKitBrowser_webkit_cocoa_macos;
+import org.jboss.tools.browsersim.browser.internal.WebKitBrowser_win32_win32_x86;
+
+/**
+ * @author "Yahor Radtsevich (yradtsevich)"
+ */
+public class WebKitBrowserFactory {
+ public static AbstractWebKitBrowser createWebKitBrowser(Composite parent, int style) {
+ if (PlatformUtil.CURRENT_PLATFORM.equals("gtk.linux.x86")) {
+ return new WebKitBrowser_gtk_linux_x86(parent, style);
+ } else if (PlatformUtil.CURRENT_PLATFORM.equals("gtk.linux.x86_64")) {
+ return new WebKitBrowser_gtk_linux_x86_64(parent, style);
+ } else if (PlatformUtil.CURRENT_PLATFORM.equals("cocoa.macosx")) {
+ return new WebKitBrowser_webkit_cocoa_macos(parent, style);
+ } else if (PlatformUtil.CURRENT_PLATFORM.equals("win32.win32.x86")) {
+ return new WebKitBrowser_win32_win32_x86(parent, style);
+ }
+
+ throw new SWTError("Unsupported Platform");
+ }
+}
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/internal/WebKitBrowser_gtk_linux_x86.java 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -8,7 +8,7 @@
* Contributor:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-package org.jboss.tools.browsersim.webkit.internal;
+package org.jboss.tools.browsersim.browser.internal;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -16,7 +16,7 @@
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.browsersim.webkit.AbstractWebKitBrowser;
+import org.jboss.tools.browsersim.browser.AbstractWebKitBrowser;
/**
* @author Yahor Radtsevich (yradtsevich)
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/internal/WebKitBrowser_gtk_linux_x86_64.java 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -8,7 +8,7 @@
* Contributor:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-package org.jboss.tools.browsersim.webkit.internal;
+package org.jboss.tools.browsersim.browser.internal;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -16,7 +16,7 @@
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.browsersim.webkit.AbstractWebKitBrowser;
+import org.jboss.tools.browsersim.browser.AbstractWebKitBrowser;
/**
* @author Yahor Radtsevich (yradtsevich)
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/internal/WebKitBrowser_webkit_cocoa_macos.java 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -8,7 +8,7 @@
* Contributor:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-package org.jboss.tools.browsersim.webkit.internal;
+package org.jboss.tools.browsersim.browser.internal;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -16,7 +16,7 @@
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.browsersim.webkit.AbstractWebKitBrowser;
+import org.jboss.tools.browsersim.browser.AbstractWebKitBrowser;
/**
* @author Yahor Radtsevich (yradtsevich)
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/webkit/internal/WebKitBrowser_win32_win32_x86.java 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.browser/src/org/jboss/tools/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -8,7 +8,7 @@
* Contributor:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-package org.jboss.tools.browsersim.webkit.internal;
+package org.jboss.tools.browsersim.browser.internal;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@@ -16,7 +16,7 @@
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.browsersim.webkit.AbstractWebKitBrowser;
+import org.jboss.tools.browsersim.browser.AbstractWebKitBrowser;
/**
* @author Yahor Radtsevich (yradtsevich)
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF 2011-11-21 16:23:19 UTC (rev 36498)
@@ -6,7 +6,7 @@
Bundle-Activator: org.jboss.tools.browsersim.eclipse.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.browsersim.webkit;bundle-version="1.0.0",
+ org.jboss.tools.browsersim.browser;bundle-version="1.0.0",
org.eclipse.core.resources,
org.eclipse.jface.text,
org.eclipse.ui.editors,
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java 2011-11-21 16:21:13 UTC (rev 36497)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java 2011-11-21 16:23:19 UTC (rev 36498)
@@ -17,7 +17,7 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.jboss.tools.browsersim.webkit.PlatformUtil;
+import org.jboss.tools.browsersim.browser.PlatformUtil;
/**
* @author "Yahor Radtsevich (yradtsevich)"
@@ -27,7 +27,7 @@
String pathSeparator = System.getProperty("path.separator");
String classPath = getBundleLocation("org.jboss.tools.browsersim") + "bin/"
- + pathSeparator + getBundleLocation("org.jboss.tools.browsersim.webkit") + "bin/"
+ + pathSeparator + getBundleLocation("org.jboss.tools.browsersim.browser") + "bin/"
+ pathSeparator + getBundleLocation("org.eclipse.swt")
+ pathSeparator + getBundleLocation("org.eclipse.swt." + PlatformUtil.CURRENT_PLATFORM);
String javaCommand = System.getProperty("java.home") + "/bin/java";
13 years, 1 month
JBoss Tools SVN: r36496 - in trunk/build/aggregate: site and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-21 11:18:43 -0500 (Mon, 21 Nov 2011)
New Revision: 36496
Added:
trunk/build/aggregate/bottests-site/site/associate.sites.properties
trunk/build/aggregate/site/associate.sites.properties
trunk/build/aggregate/soa-site/associate.sites.properties
trunk/build/aggregate/webtools-site/associate.sites.properties
Removed:
trunk/build/aggregate/bottests-site/site/aggregateSite.jbosstools.properties
trunk/build/aggregate/site/aggregateSite.jbosstools.properties
trunk/build/aggregate/soa-site/aggregateSite.jbosstools.properties
trunk/build/aggregate/webtools-site/aggregateSite.jbosstools.properties
Modified:
trunk/build/aggregate/bottests-site/site/build.xml
trunk/build/aggregate/site/build.xml
trunk/build/aggregate/soa-site/build.xml
trunk/build/aggregate/webtools-site/build.xml
Log:
refactor associate sites properties file and fix refs to that file in build.xml for soa site (JBIDE-10201)
Deleted: trunk/build/aggregate/bottests-site/site/aggregateSite.jbosstools.properties
===================================================================
--- trunk/build/aggregate/bottests-site/site/aggregateSite.jbosstools.properties 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/bottests-site/site/aggregateSite.jbosstools.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -1,7 +0,0 @@
-# options: Nightly Build (default), Development Milestone, Stable Release
-#update.site.description=Nightly Build
-#update.site.description=Development Milestone
-#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
-
-# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/,http://dl.google.com/eclipse/plugin/3.7/
Copied: trunk/build/aggregate/bottests-site/site/associate.sites.properties (from rev 36494, trunk/build/aggregate/webtools-site/aggregateSite.jbosstools.properties)
===================================================================
--- trunk/build/aggregate/bottests-site/site/associate.sites.properties (rev 0)
+++ trunk/build/aggregate/bottests-site/site/associate.sites.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -0,0 +1,7 @@
+# options: Nightly Build (default), Development Milestone, Stable Release
+#update.site.description=Nightly Build
+#update.site.description=Development Milestone
+#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/,http://download.eclipse.org/bpel/update-site/,http://dl.google.com/eclipse/plugin/3.7/
Modified: trunk/build/aggregate/bottests-site/site/build.xml
===================================================================
--- trunk/build/aggregate/bottests-site/site/build.xml 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/bottests-site/site/build.xml 2011-11-21 16:18:43 UTC (rev 36496)
@@ -28,10 +28,10 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="aggregateSite.properties" value="aggregateSite.jbosstools.properties" />
- <property file="${aggregateSite.properties}" />
+ <property name="associate.sites" value="associate.sites.properties" />
+ <property file="${associate.sites}" />
- <property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml"/>
+ <property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
<target name="init">
<ant antfile="${build.xml}" target="init" />
@@ -46,7 +46,7 @@
</target>
<!-- don't do collect.zips,collect.metadata,create.summary.file -->
- <target name="custom.build" description="aggregate update site extras" depends="init,check.target,add.associate.sites,add.web.content,pack.zip" />
+ <target name="custom.build" description="aggregate update site extras" depends="init,check.target,unpack.content.jar,add.associate.sites,add.web.content,pack.content.jar,pack.zip" />
<target name="get.saxon" unless="saxon.jar.exists">
<!-- or use http://downloads.sourceforge.net/saxon/saxonhe9-3-0-4j.zip ? -->
@@ -345,20 +345,13 @@
<target name="add.associate.sites" if="associate.sites">
<if>
<and>
- <!-- Defined in aggregateSite.properties -->
+ <!-- Defined in associate.sites -->
<isset property="associate.sites" />
<not>
<equals arg1="${associate.sites}" arg2="" />
</not>
</and>
<then>
- <if>
- <available file="${update.site.source.dir}/content.jar" type="file" />
- <then>
- <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
- <delete file="${update.site.source.dir}/content.jar" />
- </then>
- </if>
<!-- counter variable -->
<var name="associate.sites.0" value="" />
<for param="associate.site" list="${associate.sites}" delimiter=",
@@ -391,13 +384,26 @@
</echo>
<copy file="${update.site.source.dir}/content.xml" tofile="${update.site.source.dir}/content.old.xml" overwrite="true" />
<xslt style="remove-uncategorized.xsl" in="${update.site.source.dir}/content.old.xml" out="${update.site.source.dir}/content.xml" />
- <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
- <delete file="${update.site.source.dir}/content.xml" />
- <delete file="${update.site.source.dir}/content.old.xml" />
</then>
</if>
</target>
+ <target name="unpack.content.jar">
+ <if>
+ <available file="${update.site.source.dir}/content.jar" type="file" />
+ <then>
+ <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
+ <delete file="${update.site.source.dir}/content.jar" />
+ </then>
+ </if>
+ </target>
+
+ <target name="pack.content.jar">
+ <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
+ <delete file="${update.site.source.dir}/content.xml" />
+ <delete file="${update.site.source.dir}/content.old.xml" />
+ </target>
+
<target name="unpack.zip">
<unzip src="${output.dir}/target/site_assembly.zip" dest="${update.site.source.dir}" />
</target>
@@ -581,7 +587,7 @@
<target name="collect.metadata" description="collect svn revision info + other metadata (JOB_NAME, BUILD_ID, BUILD_NUMBER, WORKSPACE, HUDSON_SLAVE), zip file names+sizes+md5sums">
<property name="aggregate.zips.dir" value="${output.dir}/zips" />
- <mkdir dir="${aggregate.zips.dir}"/>
+ <mkdir dir="${aggregate.zips.dir}" />
<!-- load file properties (name, size, md5sum) -->
<if>
<available file="${aggregate.zips.dir}/build.properties.file.txt" type="file" />
Deleted: trunk/build/aggregate/site/aggregateSite.jbosstools.properties
===================================================================
--- trunk/build/aggregate/site/aggregateSite.jbosstools.properties 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/site/aggregateSite.jbosstools.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -1,7 +0,0 @@
-# options: Nightly Build (default), Development Milestone, Stable Release
-#update.site.description=Nightly Build
-#update.site.description=Development Milestone
-#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
-
-# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://dl.google.com/eclipse/plugin/3.7/
Copied: trunk/build/aggregate/site/associate.sites.properties (from rev 36494, trunk/build/aggregate/site/aggregateSite.jbosstools.properties)
===================================================================
--- trunk/build/aggregate/site/associate.sites.properties (rev 0)
+++ trunk/build/aggregate/site/associate.sites.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -0,0 +1,7 @@
+# options: Nightly Build (default), Development Milestone, Stable Release
+#update.site.description=Nightly Build
+#update.site.description=Development Milestone
+#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://dl.google.com/eclipse/plugin/3.7/
Modified: trunk/build/aggregate/site/build.xml
===================================================================
--- trunk/build/aggregate/site/build.xml 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/site/build.xml 2011-11-21 16:18:43 UTC (rev 36496)
@@ -28,8 +28,8 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="aggregateSite.properties" value="aggregateSite.jbosstools.properties" />
- <property file="${aggregateSite.properties}" />
+ <property name="associate.sites" value="associate.sites.properties" />
+ <property file="${associate.sites}" />
<property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
@@ -344,7 +344,7 @@
<target name="add.associate.sites" if="associate.sites">
<if>
<and>
- <!-- Defined in aggregateSite.properties -->
+ <!-- Defined in associate.sites -->
<isset property="associate.sites" />
<not>
<equals arg1="${associate.sites}" arg2="" />
Deleted: trunk/build/aggregate/soa-site/aggregateSite.jbosstools.properties
===================================================================
--- trunk/build/aggregate/soa-site/aggregateSite.jbosstools.properties 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/soa-site/aggregateSite.jbosstools.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -1,7 +0,0 @@
-# options: Nightly Build (default), Development Milestone, Stable Release
-#update.site.description=Nightly Build
-#update.site.description=Development Milestone
-#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
-
-# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/
Copied: trunk/build/aggregate/soa-site/associate.sites.properties (from rev 36494, trunk/build/aggregate/bottests-site/site/aggregateSite.jbosstools.properties)
===================================================================
--- trunk/build/aggregate/soa-site/associate.sites.properties (rev 0)
+++ trunk/build/aggregate/soa-site/associate.sites.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -0,0 +1,7 @@
+# options: Nightly Build (default), Development Milestone, Stable Release
+#update.site.description=Nightly Build
+#update.site.description=Development Milestone
+#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/,http://download.eclipse.org/bpel/update-site/
Modified: trunk/build/aggregate/soa-site/build.xml
===================================================================
--- trunk/build/aggregate/soa-site/build.xml 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/soa-site/build.xml 2011-11-21 16:18:43 UTC (rev 36496)
@@ -28,10 +28,10 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="aggregateSite.properties" value="aggregateSite.jbosstools.properties" />
- <property file="${aggregateSite.properties}" />
+ <property name="associate.sites" value="associate.sites.properties" />
+ <property file="${associate.sites}" />
- <property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml"/>
+ <property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
<target name="init">
<ant antfile="${build.xml}" target="init" />
@@ -45,7 +45,7 @@
<antcall target="get.saxon" />
</target>
- <target name="custom.build" description="aggregate update site extras" depends="init,check.target,add.associate.sites,add.web.content,pack.zip,collect.zips,collect.metadata,create.summary.file" />
+ <target name="custom.build" description="aggregate update site extras" depends="init,check.target,unpack.content.jar,add.associate.sites,add.web.content,pack.content.jar,pack.zip,collect.zips,collect.metadata,create.summary.file" />
<target name="get.saxon" unless="saxon.jar.exists">
<!-- or use http://downloads.sourceforge.net/saxon/saxonhe9-3-0-4j.zip ? -->
@@ -344,20 +344,13 @@
<target name="add.associate.sites" if="associate.sites">
<if>
<and>
- <!-- Defined in aggregateSite.properties -->
+ <!-- Defined in associate.sites -->
<isset property="associate.sites" />
<not>
<equals arg1="${associate.sites}" arg2="" />
</not>
</and>
<then>
- <if>
- <available file="${update.site.source.dir}/content.jar" type="file" />
- <then>
- <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
- <delete file="${update.site.source.dir}/content.jar" />
- </then>
- </if>
<!-- counter variable -->
<var name="associate.sites.0" value="" />
<for param="associate.site" list="${associate.sites}" delimiter=",
@@ -390,13 +383,26 @@
</echo>
<copy file="${update.site.source.dir}/content.xml" tofile="${update.site.source.dir}/content.old.xml" overwrite="true" />
<xslt style="remove-uncategorized.xsl" in="${update.site.source.dir}/content.old.xml" out="${update.site.source.dir}/content.xml" />
- <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
- <delete file="${update.site.source.dir}/content.xml" />
- <delete file="${update.site.source.dir}/content.old.xml" />
</then>
</if>
</target>
+ <target name="unpack.content.jar">
+ <if>
+ <available file="${update.site.source.dir}/content.jar" type="file" />
+ <then>
+ <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
+ <delete file="${update.site.source.dir}/content.jar" />
+ </then>
+ </if>
+ </target>
+
+ <target name="pack.content.jar">
+ <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
+ <delete file="${update.site.source.dir}/content.xml" />
+ <delete file="${update.site.source.dir}/content.old.xml" />
+ </target>
+
<target name="unpack.zip">
<unzip src="${output.dir}/target/site_assembly.zip" dest="${update.site.source.dir}" />
</target>
@@ -580,7 +586,7 @@
<target name="collect.metadata" description="collect svn revision info + other metadata (JOB_NAME, BUILD_ID, BUILD_NUMBER, WORKSPACE, HUDSON_SLAVE), zip file names+sizes+md5sums">
<property name="aggregate.zips.dir" value="${output.dir}/zips" />
- <mkdir dir="${aggregate.zips.dir}"/>
+ <mkdir dir="${aggregate.zips.dir}" />
<!-- load file properties (name, size, md5sum) -->
<if>
<available file="${aggregate.zips.dir}/build.properties.file.txt" type="file" />
Deleted: trunk/build/aggregate/webtools-site/aggregateSite.jbosstools.properties
===================================================================
--- trunk/build/aggregate/webtools-site/aggregateSite.jbosstools.properties 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/webtools-site/aggregateSite.jbosstools.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -1,7 +0,0 @@
-# options: Nightly Build (default), Development Milestone, Stable Release
-#update.site.description=Nightly Build
-#update.site.description=Development Milestone
-#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
-
-# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/
Copied: trunk/build/aggregate/webtools-site/associate.sites.properties (from rev 36494, trunk/build/aggregate/soa-site/aggregateSite.jbosstools.properties)
===================================================================
--- trunk/build/aggregate/webtools-site/associate.sites.properties (rev 0)
+++ trunk/build/aggregate/webtools-site/associate.sites.properties 2011-11-21 16:18:43 UTC (rev 36496)
@@ -0,0 +1,7 @@
+# options: Nightly Build (default), Development Milestone, Stable Release
+#update.site.description=Nightly Build
+#update.site.description=Development Milestone
+#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
+
+# associate sites to add to the resulting repo
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/
Modified: trunk/build/aggregate/webtools-site/build.xml
===================================================================
--- trunk/build/aggregate/webtools-site/build.xml 2011-11-21 16:18:16 UTC (rev 36495)
+++ trunk/build/aggregate/webtools-site/build.xml 2011-11-21 16:18:43 UTC (rev 36496)
@@ -28,10 +28,10 @@
<property name="update.site.source.dir" value="${output.dir}/target/site" />
<!-- load properties from default (or alternate) properties file -->
- <property name="aggregateSite.properties" value="aggregateSite.jbosstools.properties" />
- <property file="${aggregateSite.properties}" />
+ <property name="associate.sites" value="associate.sites.properties" />
+ <property file="${associate.sites}" />
- <property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml"/>
+ <property name="web.content.files" value="index.html, **/*.css, README*, *directory.xml" />
<target name="init">
<ant antfile="${build.xml}" target="init" />
@@ -46,7 +46,7 @@
</target>
<!-- don't do collect.zips,collect.metadata,create.summary.file -->
- <target name="custom.build" description="aggregate update site extras" depends="init,check.target,add.associate.sites,add.web.content,pack.zip" />
+ <target name="custom.build" description="aggregate update site extras" depends="init,check.target,unpack.content.jar,add.associate.sites,add.web.content,pack.content.jar,pack.zip" />
<target name="get.saxon" unless="saxon.jar.exists">
<!-- or use http://downloads.sourceforge.net/saxon/saxonhe9-3-0-4j.zip ? -->
@@ -345,20 +345,13 @@
<target name="add.associate.sites" if="associate.sites">
<if>
<and>
- <!-- Defined in aggregateSite.properties -->
+ <!-- Defined in associate.sites -->
<isset property="associate.sites" />
<not>
<equals arg1="${associate.sites}" arg2="" />
</not>
</and>
<then>
- <if>
- <available file="${update.site.source.dir}/content.jar" type="file" />
- <then>
- <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
- <delete file="${update.site.source.dir}/content.jar" />
- </then>
- </if>
<!-- counter variable -->
<var name="associate.sites.0" value="" />
<for param="associate.site" list="${associate.sites}" delimiter=",
@@ -391,13 +384,26 @@
</echo>
<copy file="${update.site.source.dir}/content.xml" tofile="${update.site.source.dir}/content.old.xml" overwrite="true" />
<xslt style="remove-uncategorized.xsl" in="${update.site.source.dir}/content.old.xml" out="${update.site.source.dir}/content.xml" />
- <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
- <delete file="${update.site.source.dir}/content.xml" />
- <delete file="${update.site.source.dir}/content.old.xml" />
</then>
</if>
</target>
+ <target name="unpack.content.jar">
+ <if>
+ <available file="${update.site.source.dir}/content.jar" type="file" />
+ <then>
+ <unzip src="${update.site.source.dir}/content.jar" dest="${update.site.source.dir}" />
+ <delete file="${update.site.source.dir}/content.jar" />
+ </then>
+ </if>
+ </target>
+
+ <target name="pack.content.jar">
+ <zip destfile="${update.site.source.dir}/content.jar" basedir="${update.site.source.dir}" includes="content.xml" />
+ <delete file="${update.site.source.dir}/content.xml" />
+ <delete file="${update.site.source.dir}/content.old.xml" />
+ </target>
+
<target name="unpack.zip">
<unzip src="${output.dir}/target/site_assembly.zip" dest="${update.site.source.dir}" />
</target>
@@ -581,7 +587,7 @@
<target name="collect.metadata" description="collect svn revision info + other metadata (JOB_NAME, BUILD_ID, BUILD_NUMBER, WORKSPACE, HUDSON_SLAVE), zip file names+sizes+md5sums">
<property name="aggregate.zips.dir" value="${output.dir}/zips" />
- <mkdir dir="${aggregate.zips.dir}"/>
+ <mkdir dir="${aggregate.zips.dir}" />
<!-- load file properties (name, size, md5sum) -->
<if>
<available file="${aggregate.zips.dir}/build.properties.file.txt" type="file" />
13 years, 1 month
JBoss Tools SVN: r36494 - in trunk: jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-11-21 11:04:00 -0500 (Mon, 21 Nov 2011)
New Revision: 36494
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MarkerHelper.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/EditingActionsTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/InsertActionsTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/JSFTagsTest.java
Log:
Added FacesConfigEditingTest.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAllBotTests.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -13,6 +13,7 @@
import org.jboss.tools.jsf.ui.bot.test.smoke.CodeCompletionTest;
import org.jboss.tools.jsf.ui.bot.test.smoke.CreateNewJSFProjectTest;
import org.jboss.tools.jsf.ui.bot.test.smoke.FacesConfigCodeCompletionTest;
+import org.jboss.tools.jsf.ui.bot.test.smoke.FacesConfigEditingTest;
import org.jboss.tools.jsf.ui.bot.test.smoke.MarkersTest;
import org.jboss.tools.jsf.ui.bot.test.smoke.OpenOnTest;
import org.jboss.tools.jsf.ui.bot.test.smoke.WebXmlEditorTest;
@@ -45,6 +46,7 @@
JSF2AttributeRenameTest.class,
OpenOnTest.class,
CodeCompletionTest.class,
+ FacesConfigEditingTest.class,
FacesConfigCodeCompletionTest.class,
MarkersTest.class,
WebXmlEditorTest.class,
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.ui.bot.test.smoke;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.Assertions;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+/** Test Editing of faces-config.xml file
+ * @author Vladimir Pakan
+ *
+ */
+public class FacesConfigEditingTest extends JSFAutoTestCase{
+
+ private static final String FACES_CONFIG_FILE_NAME = "faces-config.xml";
+ private SWTBotEditor facesConfigEditor;
+ private String originalContent;
+ private SWTBotEditorExt facesConfigEditorExt;
+ private SWTBotExt botExt;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ facesConfigEditor = eclipse.openFile(VPEAutoTestCase.JBT_TEST_PROJECT_NAME,
+ "WebContent",
+ "WEB-INF",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ originalContent = facesConfigEditor.toTextEditor().getText();
+ facesConfigEditorExt = new SWTBotEditorExt(facesConfigEditor.toTextEditor().getReference(),bot);
+ botExt = new SWTBotExt();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ if (facesConfigEditor != null) {
+ facesConfigEditor.toTextEditor().setText(originalContent);
+ facesConfigEditor.saveAndClose();
+ }
+ super.tearDown();
+ }
+ /**
+ * Test Managed Bean editing
+ */
+ public void testManagedBean(){
+ facesConfigEditorExt.selectPage(IDELabel.FacesConfigEditor.TREE_TAB_LABEL);
+ SWTBot editorBot = facesConfigEditorExt.bot();
+ SWTBotTree tree = editorBot.tree();
+ SWTUtilExt.displayAllBotWidgets(facesConfigEditor.bot());
+ final String managedBeanName = "TestBean";
+ final String managedBeanClass = "TestBeanClass";
+ SWTBotTreeItem tiFacesConfigXml = tree.expandNode(FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ SWTBotTreeItem tiManagedbean = tiFacesConfigXml.getNode(IDELabel.FacesConfigEditor.MANAGED_BEANS_NODE);
+ tiManagedbean.select();
+ bot.sleep(Timing.time1S());
+ // Add managed bean
+ editorBot.button(IDELabel.Button.ADD).click();
+ bot.shell(IDELabel.Shell.NEW_MANAGED_BEAN).activate();
+ bot.textWithLabel(IDELabel.FacesConfigEditor.NEW_MANAGED_BEAN_CLASS_LABEL)
+ .setText(managedBeanClass);
+ bot.textWithLabel(IDELabel.FacesConfigEditor.NEW_MANAGED_BEAN_NAME_LABEL)
+ .setText(managedBeanName);
+ bot.button(IDELabel.Button.FINISH).click();
+ facesConfigEditorExt.save();
+ bot.sleep(Timing.time1S());
+ assertFacesConfigXmlHasNoErrors(botExt);
+ final String selectedNode = tree.selection().get(0,0);
+ assertTrue ("Selected node has to have label '" + managedBeanName +"'\n" +
+ "but has '" + selectedNode + "'.",
+ selectedNode.equals(managedBeanName));
+ Assertions.assertFileExistsInWorkspace(managedBeanClass + ".java",
+ JBT_TEST_PROJECT_NAME,"JavaSource");
+ Assertions.assertSourceEditorContains(facesConfigEditorExt.getText(),
+ "<managed-bean-name>" + managedBeanName + "</managed-bean-name>",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ Assertions.assertSourceEditorContains(facesConfigEditorExt.getText(),
+ "<managed-bean-class>" + managedBeanClass + "</managed-bean-class>",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ SWTUtilExt.displayAllBotWidgets(facesConfigEditor.bot());
+ // Modify Managed Bean
+ editorBot.textWithLabel(IDELabel.FacesConfigEditor.MANAGED_BEAN_CLASS_LABEL)
+ .setText(managedBeanClass + "xxqq");
+ facesConfigEditorExt.save();
+ bot.sleep(Timing.time1S());
+ assertFacesConfigXmlHasErrors(botExt);
+ editorBot.textWithLabel(IDELabel.FacesConfigEditor.MANAGED_BEAN_CLASS_LABEL)
+ .setText(managedBeanClass);
+ facesConfigEditorExt.save();
+ bot.sleep(Timing.time1S());
+ // Delete Managed Bean
+ tiManagedbean.select();
+ editorBot.table().select(managedBeanName);
+ editorBot.button(IDELabel.Button.REMOVE_WITH_DOTS).click();
+ bot.shell(IDELabel.Shell.CONFIRMATION).activate();
+ bot.checkBox(IDELabel.FacesConfigEditor.DELETE_JAVA_SOURCE_CHECK_BOX).select();
+ bot.button(IDELabel.Button.OK).click();
+ boolean managedBeanWasDeleted = false;
+ try{
+ editorBot.table().select(managedBeanName);
+ } catch (WidgetNotFoundException wnfe){
+ managedBeanWasDeleted = true;
+ } catch (IllegalArgumentException iae){
+ managedBeanWasDeleted = true;
+ }
+ assertTrue("Managed bean " + managedBeanName + " was not deleted properly.",
+ managedBeanWasDeleted);
+ Assertions.assertFileNotExistsInWorkspace(managedBeanClass + ".java",
+ JBT_TEST_PROJECT_NAME,"JavaSource");
+ Assertions.assertSourceEditorNotContain(facesConfigEditorExt.getText(),
+ "<managed-bean-name>" + managedBeanName + "</managed-bean-name>",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ Assertions.assertSourceEditorNotContain(facesConfigEditorExt.getText(),
+ "<managed-bean-class>" + managedBeanClass + "</managed-bean-class>",
+ FacesConfigEditingTest.FACES_CONFIG_FILE_NAME);
+ }
+ /**
+ * Asserts if faces-config.xml has no errors
+ * @param botExt
+ */
+ private static void assertFacesConfigXmlHasNoErrors (SWTBotExt botExt){
+
+ SWTBotTreeItem[] errors = ProblemsView.getFilteredErrorsTreeItems(botExt, null, null, FacesConfigEditingTest.FACES_CONFIG_FILE_NAME, null);
+ boolean areThereNoErrors = ((errors == null) || (errors.length == 0));
+ assertTrue("There are errors in Problems view: " +
+ (areThereNoErrors ? "" : errors[0].getText()),
+ areThereNoErrors);
+ }
+ /**
+ * Asserts if faces-config.xml has errors
+ * @param botExt
+ */
+ private static void assertFacesConfigXmlHasErrors (SWTBotExt botExt){
+
+ SWTBotTreeItem[] errors = ProblemsView.getFilteredErrorsTreeItems(botExt, null, null, FacesConfigEditingTest.FACES_CONFIG_FILE_NAME, null);
+ boolean areThereErrors = ((errors != null) && (errors.length > 0));
+ assertTrue("There are missing errors in Problems view for " + FacesConfigEditingTest.FACES_CONFIG_FILE_NAME + " file.",
+ areThereErrors);
+ }
+ // adding Component
+ // adding Custom Converter
+ // adding Render Kit
+ // adding Referenced Bean
+ // adding Validator
+
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/FacesConfigEditingTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Assertions.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -4,8 +4,10 @@
import java.util.Arrays;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.ext.helper.MarkerHelper;
public class Assertions {
/**
@@ -26,4 +28,79 @@
public static void assertControlEnabled(AbstractSWTBot<?> control, boolean enabled) {
assertTrue(control.getClass().getSimpleName()+" "+control.getText()+ " is not in state: isEnabled()="+enabled,enabled == control.isEnabled());
}
+ /**
+ * Asserts that given file exists
+ * @param fileName
+ * @param pathWithinWorkspace
+ */
+ public static void assertFileExistsInWorkspace (String fileName , String... pathWithinWorkspace){
+ assertTrue("File " + fileName + " does not exist.",
+ isExistingFileWithinWorkspace (fileName, pathWithinWorkspace));
+ }
+ /**
+ * Asserts that given file does not exists
+ * @param fileName
+ * @param pathWithinWorkspace
+ */
+ public static void assertFileNotExistsInWorkspace (String fileName , String... pathWithinWorkspace){
+ assertTrue("File " + fileName + " does exist but it has to be deleted.",
+ !isExistingFileWithinWorkspace (fileName, pathWithinWorkspace));
+ }
+ /**
+ * Returns true when specified file exists on the path within workspace
+ * @param fileName
+ * @param pathWithinWorkspace
+ * @return
+ */
+ private static boolean isExistingFileWithinWorkspace(String fileName , String... pathWithinWorkspace){
+ return ResourcesPlugin
+ .getWorkspace()
+ .getRoot()
+ .findMember(MarkerHelper.getPathToResource(fileName, pathWithinWorkspace)) != null;
+ }
+ /**
+ * Asserts if sourceEditorText of file with fileName contains textToContain
+ * @param sourceEditorText
+ * @param textToContain
+ * @param fileName
+ */
+ public static void assertSourceEditorContains (String sourceEditorText, String textToContain, String fileName){
+
+ assertTrue("File " + fileName
+ + " has to contain string '"
+ + textToContain
+ + "' but it doesn't.\nIt is: " + sourceEditorText,
+ sourceEditorText.contains(textToContain));
+
+ }
+ /**
+ * Asserts if sourceEditorText of file with fileName does not contain textToNotContain
+ * @param sourceEditorText
+ * @param textToNotContain
+ * @param fileName
+ */
+ public static void assertSourceEditorNotContain (String sourceEditorText, String textToNotContain, String fileName){
+
+ assertTrue("File " + fileName
+ + " must not contain string '"
+ + textToNotContain
+ + "' but it does.\nIt is: " + sourceEditorText,
+ !sourceEditorText.contains(textToNotContain));
+
+ }
+ /**
+ * Asserts if sourceEditorText of file with fileName equals to expectedText
+ * @param sourceEditorText
+ * @param expectedText
+ * @param fileName
+ */
+ public static void assertSourceEditorIs (String sourceEditorText, String expectedText, String fileName){
+
+ assertTrue("File " + fileName
+ + " has to be '"
+ + expectedText
+ + "' but it doesn't.\nIt is: " + sourceEditorText,
+ sourceEditorText.equals(expectedText));
+
+ }
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MarkerHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MarkerHelper.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/MarkerHelper.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -85,7 +85,7 @@
* @param pathToResource
* @return
*/
- private static IPath getPathToResource (String resourceName, String... pathToResource){
+ public static IPath getPathToResource (String resourceName, String... pathToResource){
IPath path = new Path("/");
if (pathToResource != null){
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -101,6 +101,7 @@
public static final String NEW = "New...";
public static final String CONTINUE = "Continue";
public static final String REMOVE = "Remove";
+ public static final String REMOVE_WITH_DOTS = "Remove...";
public static final String EDIT = "Edit...";
public static final String ADD_WITHOUT_DOTS = "Add";
public static final String EDIT_WITHOUT_DOTS = "Edit";
@@ -166,6 +167,7 @@
public static final String REPOSITORY_LOCATION_PROPERTIES = "Repository Location Properties";
public static final String SECURE_STORAGE = "Secure Storage";
public static final String ADD_JSF_PROJECT_TEMPLATE = "Add JSF Project Template";
+ public static final String NEW_MANAGED_BEAN = "New Managed Bean";
}
public class EntityGroup {
@@ -688,6 +690,11 @@
public static final String SOURCE_TAB_LABEL = "Source";
public static final String TREE_TAB_LABEL = "Tree";
public static final String DIAGRAM_TAB_LABEL = "Diagram";
+ public static final String MANAGED_BEANS_NODE = "Managed Beans";
+ public static final String NEW_MANAGED_BEAN_CLASS_LABEL = "Class:*";
+ public static final String MANAGED_BEAN_CLASS_LABEL = "Managed Bean Class:";
+ public static final String NEW_MANAGED_BEAN_NAME_LABEL = "Name:*";
+ public static final String DELETE_JAVA_SOURCE_CHECK_BOX = "Delete Java Source";
}
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ProblemsView.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -13,6 +13,7 @@
import java.util.LinkedList;
import org.apache.log4j.Logger;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
@@ -103,7 +104,9 @@
SWTBotTreeItem errorsNode = null;
SWTBot problemsBot = null;
if (new SWTEclipseExt().isViewOpened("Problems")) {
- problemsBot = bot.viewByTitle("Problems").bot();
+ SWTBotView problemsView = bot.viewByTitle("Problems");
+ problemsView.show();
+ problemsBot = problemsView.bot();
}else {
problemsBot = SWTEclipseExt.showView(bot,ViewType.PROBLEMS);
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/EditingActionsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/EditingActionsTest.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/EditingActionsTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -20,6 +20,7 @@
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.Timing;
@@ -82,7 +83,7 @@
SWTBotWebBrowser.PASTE_MENU_LABEL);
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<h:inputText/><h:inputText/><h:outputTextvalue=\"outputText\"/><h:inputText/>",
EditingActionsTest.TEST_PAGE);
assertVisualEditorContainsManyNodes(webBrowser, "INPUT", 6, EditingActionsTest.TEST_PAGE_NAME);
@@ -95,7 +96,7 @@
SWTBotWebBrowser.CUT_MENU_LABEL);
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<body><h:inputText/><h:outputTextvalue=\"outputText\"/><h:inputText/><rich:comboBox>",
EditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsManyNodes(webBrowser, "INPUT", 5, EditingActionsTest.TEST_PAGE_NAME);
@@ -109,7 +110,7 @@
SWTBotWebBrowser.PASTE_MENU_LABEL);
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<h:inputText/><h:outputTextvalue=\"outputText\"/><h:inputText/><h:inputText/>",
EditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsManyNodes(webBrowser, "INPUT", 6, EditingActionsTest.TEST_PAGE_NAME);
@@ -124,7 +125,7 @@
}
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<h:outputTextvalue=\"outputText\"/><h:inputText/><rich:comboBox>",
EditingActionsTest.TEST_PAGE_NAME);
if (SWTJBTExt.isRunningOnMacOs()){
@@ -135,7 +136,7 @@
}
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<h:inputText/><h:inputText/><h:outputTextvalue=\"outputText\"/>",
EditingActionsTest.TEST_PAGE_NAME);
if (SWTJBTExt.isRunningOnMacOs()){
@@ -146,7 +147,7 @@
}
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<body><h:inputText/><h:outputTextvalue=\"outputText\"/>",
EditingActionsTest.TEST_PAGE_NAME);
// Check Delete Functionality
@@ -157,7 +158,7 @@
KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_DELETE);
jspEditor.save();
botExt.sleep(Timing.time3S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<body><h:inputText/><h:outputTextvalue=\"outputText\"/><h:inputText/></body>",
EditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsManyNodes(webBrowser, "INPUT", 2, EditingActionsTest.TEST_PAGE_NAME);
@@ -199,10 +200,10 @@
SWTBotWebBrowser.H_OUTPUT_TEXT_TAG_MENU_LABEL);
jspEditor.save();
bot.sleep(Timing.time2S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"h:outputText",
EditingActionsTest.TEST_PAGE_NAME);
- assertSourceEditorNotContain(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorNotContain(stripHTMLSourceText(jspEditor.getText()),
"h:inputText",
EditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsManyNodes(webBrowser, "SPAN", 1, EditingActionsTest.TEST_PAGE_NAME);
@@ -327,7 +328,7 @@
SWTBotWebBrowser.STRIP_TAG_MENU_LABEL);
jspEditor.save();
bot.sleep(Timing.time2S());
- assertSourceEditorNotContain(jspEditor.getText(), "<f:view>", EditingActionsTest.TEST_PAGE_NAME);
+ Assertions.assertSourceEditorNotContain(jspEditor.getText(), "<f:view>", EditingActionsTest.TEST_PAGE_NAME);
// Undo Changes
webBrowser.setFocus();
if (SWTJBTExt.isRunningOnMacOs()){
@@ -338,7 +339,7 @@
}
jspEditor.save();
bot.sleep(Timing.time2S());
- assertSourceEditorContains(jspEditor.getText(), "<f:view>", EditingActionsTest.TEST_PAGE_NAME);
+ Assertions.assertSourceEditorContains(jspEditor.getText(), "<f:view>", EditingActionsTest.TEST_PAGE_NAME);
}
/**
* Tests Select This Tag Menu
@@ -365,7 +366,7 @@
SWTBotWebBrowser.SELECT_THIS_TAG_MENU_LABEL);
jspEditor.save();
bot.sleep(Timing.time2S());
- assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
+ Assertions.assertSourceEditorContains(stripHTMLSourceText(jspEditor.getText()),
"<f:view><h:inputText",
EditingActionsTest.TEST_PAGE_NAME);
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/InsertActionsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/InsertActionsTest.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/InsertActionsTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -12,6 +12,7 @@
package org.jboss.tools.vpe.ui.bot.test.editor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
@@ -67,7 +68,7 @@
jspTextEditor.save();
botExt.sleep(Timing.time3S());
// Check if tag <rich:calendar> was properly added.
- assertSourceEditorContains(jspTextEditor.getText(), "<h:inputText/><rich:calendar>", InsertActionsTest.TEST_PAGE);
+ Assertions.assertSourceEditorContains(jspTextEditor.getText(), "<h:inputText/><rich:calendar>", InsertActionsTest.TEST_PAGE);
assertVisualEditorContains(webBrowser, "SPAN", new String[]{"title"},new String[] {"rich:calendar"},
InsertActionsTest.TEST_PAGE);
assertProbelmsViewNoErrors(botExt);
@@ -88,7 +89,7 @@
jspTextEditor.save();
botExt.sleep(Timing.time3S());
// Check if tag <rich:calendar> was properly added
- assertSourceEditorContains(VPEEditorTestCase.stripHTMLSourceText(jspTextEditor.getText()),
+ Assertions.assertSourceEditorContains(VPEEditorTestCase.stripHTMLSourceText(jspTextEditor.getText()),
"<rich:calendar></rich:calendar><h:inputText/>", InsertActionsTest.TEST_PAGE);
assertVisualEditorContains(webBrowser, "SPAN", new String[]{"title"},new String[] {"rich:calendar"},
InsertActionsTest.TEST_PAGE);
@@ -119,7 +120,7 @@
jspTextEditor.save();
botExt.sleep(Timing.time3S());
// Check if tag <rich:calendar> was properly added
- assertSourceEditorContains(VPEEditorTestCase.stripHTMLSourceText(jspTextEditor.getText()),
+ Assertions.assertSourceEditorContains(VPEEditorTestCase.stripHTMLSourceText(jspTextEditor.getText()),
"<form><rich:calendar></rich:calendar></form>", InsertActionsTest.TEST_PAGE);
assertVisualEditorContains(webBrowser, "FORM", null,null,InsertActionsTest.TEST_PAGE);
assertProbelmsViewNoErrors(botExt);
@@ -141,7 +142,7 @@
jspTextEditor.save();
botExt.sleep(Timing.time3S());
// Check if tag <h:form> was properly added
- assertSourceEditorContains(VPEEditorTestCase.stripHTMLSourceText(jspTextEditor.getText()),
+ Assertions.assertSourceEditorContains(VPEEditorTestCase.stripHTMLSourceText(jspTextEditor.getText()),
"<h:form><h:inputText/></h:form>", InsertActionsTest.TEST_PAGE);
assertVisualEditorContains(webBrowser, "FORM", null,null,InsertActionsTest.TEST_PAGE);
assertProbelmsViewNoErrors(botExt);
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/MinMaxPanesTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -19,6 +19,7 @@
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
+import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
@@ -108,7 +109,7 @@
}
});
bot.sleep(Timing.time2S());
- assertSourceEditorContains(jspTextEditor.getText(), insertTestString, MinMaxPanesTest.TEST_PAGE_NAME);
+ Assertions.assertSourceEditorContains(jspTextEditor.getText(), insertTestString, MinMaxPanesTest.TEST_PAGE_NAME);
}
@Override
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextEditingActionsTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -16,6 +16,7 @@
import org.eclipse.swtbot.swt.finder.utils.Position;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.Timing;
@@ -94,7 +95,7 @@
jspEditor.save();
bot.sleep(Timing.time2S());
String textToContain = TextEditingActionsTest.TEXT_TO_EDIT + textToCutCopy;
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
textToContain,
TextEditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser,
@@ -111,7 +112,7 @@
jspEditor.save();
bot.sleep(Timing.time2S());
jspEditor.deselectAndSetCursorPosition(0, 0);
- assertSourceEditorIs(jspEditor.getText(),
+ Assertions.assertSourceEditorIs(jspEditor.getText(),
TextEditingActionsTest.TEXT_TO_EDIT,
TextEditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser,
@@ -123,7 +124,7 @@
jspEditor.save();
bot.sleep(Timing.time2S());
textToContain = textToCutCopy + TextEditingActionsTest.TEXT_TO_EDIT;
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
textToContain,
TextEditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser,
@@ -245,7 +246,7 @@
jspEditor.save();
bot.sleep(Timing.time2S());
String textToContain = TextEditingActionsTest.TEXT_TO_EDIT + textToCutCopy;
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
textToContain,
TextEditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser,
@@ -263,7 +264,7 @@
SWTBotWebBrowser.CUT_MENU_LABEL);
jspEditor.save();
bot.sleep(Timing.time2S());
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
"\"" + TextEditingActionsTest.TEXT_TO_EDIT + "\"",
TextEditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser,
@@ -285,7 +286,7 @@
jspEditor.save();
bot.sleep(Timing.time2S());
textToContain = textToCutCopy + TextEditingActionsTest.TEXT_TO_EDIT;
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
textToContain,
TextEditingActionsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser,
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -12,6 +12,8 @@
package org.jboss.tools.vpe.ui.bot.test.editor;
import java.awt.event.KeyEvent;
+
+import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
@@ -84,7 +86,7 @@
KeyboardHelper.typeBasicStringUsingAWT(newText);
jspEditor.save();
bot.sleep(Timing.time3S());
- assertSourceEditorContains(jspEditor.getText(), " " + newText + " ", TextSelectionTest.TEST_PAGE_NAME);
+ Assertions.assertSourceEditorContains(jspEditor.getText(), " " + newText + " ", TextSelectionTest.TEST_PAGE_NAME);
jspEditor.setText(TextSelectionTest.PAGE_TEXT);
jspEditor.save();
bot.sleep(Timing.time3S());
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VPEEditorTestCase.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -89,52 +89,8 @@
return editorText.replaceAll("\n", "").replaceAll("\t", "").replaceAll("\b", "")
.replaceAll(" ", "").replaceAll("\r", "").replaceAll("\f", "");
}
+
/**
- * Asserts if sourceEditorText of file with fileName contains textToContain
- * @param sourceEditorText
- * @param textToContain
- * @param fileName
- */
- protected static void assertSourceEditorContains (String sourceEditorText, String textToContain, String fileName){
-
- assertTrue("File " + fileName
- + " has to contain string '"
- + textToContain
- + "' but it doesn't.\nIt is: " + sourceEditorText,
- sourceEditorText.contains(textToContain));
-
- }
- /**
- * Asserts if sourceEditorText of file with fileName does not contain textToNotContain
- * @param sourceEditorText
- * @param textToNotContain
- * @param fileName
- */
- protected static void assertSourceEditorNotContain (String sourceEditorText, String textToNotContain, String fileName){
-
- assertTrue("File " + fileName
- + " must not contain string '"
- + textToNotContain
- + "' but it does.\nIt is: " + sourceEditorText,
- !sourceEditorText.contains(textToNotContain));
-
- }
- /**
- * Asserts if sourceEditorText of file with fileName equals to expectedText
- * @param sourceEditorText
- * @param expectedText
- * @param fileName
- */
- protected static void assertSourceEditorIs (String sourceEditorText, String expectedText, String fileName){
-
- assertTrue("File " + fileName
- + " has to be '"
- + expectedText
- + "' but it doesn't.\nIt is: " + sourceEditorText,
- sourceEditorText.equals(expectedText));
-
- }
- /**
* Asserts if Visual Editor contains node with particular attributes
* @param webBrowser
* @param nodeNameToContain
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/JSFTagsTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/JSFTagsTest.java 2011-11-21 15:35:25 UTC (rev 36493)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/tags/JSFTagsTest.java 2011-11-21 16:04:00 UTC (rev 36494)
@@ -13,6 +13,7 @@
import java.awt.event.KeyEvent;
+import org.jboss.tools.ui.bot.ext.Assertions;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
@@ -148,7 +149,7 @@
new String[]{"title","value"},
new String[]{"h:inputText value: " + insertText,insertText},
JSFTagsTest.TEST_PAGE_NAME);
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
"<h:inputText value=\"" + insertText + "\"",
JSFTagsTest.TEST_PAGE_NAME);
}
@@ -195,7 +196,7 @@
new String[]{"h:inputTextarea value: " + insertText},
JSFTagsTest.TEST_PAGE_NAME);
assertVisualEditorContainsNodeWithValue(webBrowser, insertText, JSFTagsTest.TEST_PAGE_NAME);
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
"<h:inputTextarea value=\"" + insertText + "\"",
JSFTagsTest.TEST_PAGE_NAME);
}
@@ -236,14 +237,14 @@
KeyboardHelper.typeBasicStringUsingAWT(insertText);
jspEditor.save();
bot.sleep(Timing.time3S());
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
"<h:outputText value=\"" + insertText + outputText + "\"",
JSFTagsTest.TEST_PAGE_NAME);
KeyboardHelper.typeKeyCodeUsingAWTRepeately(KeyEvent.VK_RIGHT,outputText.length() + normalText.length());
KeyboardHelper.typeBasicStringUsingAWT(insertText);
jspEditor.save();
bot.sleep(Timing.time3S());
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
normalText + insertText,
JSFTagsTest.TEST_PAGE_NAME);
}
@@ -292,7 +293,7 @@
jspEditor.save();
bot.sleep(Timing.time3S());
assertVisualEditorContainsNodeWithValue(webBrowser, insertText + itemLabel, JSFTagsTest.TEST_PAGE_NAME);
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
"<f:selectItem itemLabel=\"" + insertText + itemLabel + "\"",
JSFTagsTest.TEST_PAGE_NAME);
}
@@ -341,7 +342,7 @@
jspEditor.save();
bot.sleep(Timing.time3S());
assertVisualEditorContainsNodeWithValue(webBrowser, insertText + itemLabel, JSFTagsTest.TEST_PAGE_NAME);
- assertSourceEditorContains(jspEditor.getText(),
+ Assertions.assertSourceEditorContains(jspEditor.getText(),
"<f:selectItem itemLabel=\"" + insertText + itemLabel + "\"",
JSFTagsTest.TEST_PAGE_NAME);
}
13 years, 1 month
JBoss Tools SVN: r36493 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-21 10:35:25 -0500 (Mon, 21 Nov 2011)
New Revision: 36493
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java
Log:
[JBIDE-9927] added embedded cartridges to application details dialog
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java 2011-11-21 14:57:27 UTC (rev 36492)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/common/StringUtils.java 2011-11-21 15:35:25 UTC (rev 36493)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.common;
+import java.util.List;
+
/**
* @author André Dietisheim
*/
@@ -27,4 +29,20 @@
|| value.length() == 0;
}
+ public static <T> String toString(List<T> elements, ToStringConverter<T> converter) {
+ StringBuilder builder = new StringBuilder();
+ for(int i = 0; i < elements.size(); i++) {
+ converter.toString(elements.get(i));
+ builder.append(converter.toString(elements.get(i)));
+ if (i + 1 < elements.size()) {
+ builder.append(", ");
+ }
+ }
+ return builder.toString();
+ }
+
+ public static interface ToStringConverter<T> {
+ public String toString(T object);
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java 2011-11-21 14:57:27 UTC (rev 36492)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationDetailsDialog.java 2011-11-21 15:35:25 UTC (rev 36493)
@@ -29,9 +29,11 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.ui.BrowserUtil;
import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.IEmbeddableCartridge;
import org.jboss.tools.openshift.express.client.utils.RFC822DateUtils;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.common.StringUtils;
/**
* @author André Dietisheim
@@ -47,7 +49,7 @@
@Override
protected Control createContents(Composite parent) {
- Control control = super.createContents(parent);
+ Control control = super.createContents(parent);
setupDialog(parent);
return control;
}
@@ -56,28 +58,43 @@
protected Control createDialogArea(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
- GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).spacing(14, 4).applyTo(container);
Label separator = new Label(container, SWT.HORIZONTAL | SWT.SEPARATOR);
GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(separator);
- createDetails("Name", application.getName(), container);
- createDetails("Type", application.getCartridge().getName(), container);
- createDetails("Creation Time", new ErrorMessageCallable<String>("Creation Time") {
+ createDetails("Name:", application.getName(), container);
+ createDetails("Type:", application.getCartridge().getName(), container);
+ createDetails("Embedded Cartridges:", new ErrorMessageCallable<String>("Embedded Cartridges") {
@Override
public String call() throws Exception {
+ return StringUtils.toString(application.getEmbeddedCartridges(),
+ new StringUtils.ToStringConverter<IEmbeddableCartridge>() {
+
+ @Override
+ public String toString(IEmbeddableCartridge cartridge) {
+ return cartridge.getName();
+ }
+ });
+ }
+
+ }.get(), container);
+ createDetails("Creation Time:", new ErrorMessageCallable<String>("Creation Time") {
+
+ @Override
+ public String call() throws Exception {
return RFC822DateUtils.getString(application.getCreationTime());
}
}.get(), container);
- createDetails("UUID", new ErrorMessageCallable<String>("UUID") {
+ createDetails("UUID:", new ErrorMessageCallable<String>("UUID") {
@Override
public String call() throws Exception {
return application.getUUID();
}
}.get(), container);
- createDetails("Git URL", new ErrorMessageCallable<String>("Git URL") {
+ createDetails("Git URL:", new ErrorMessageCallable<String>("Git URL") {
@Override
public String call() throws Exception {
@@ -86,7 +103,7 @@
}.get(), container);
Label publicUrlLabel = new Label(container, SWT.NONE);
- publicUrlLabel.setText("Public URL");
+ publicUrlLabel.setText("Public URL:");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(publicUrlLabel);
Link publicUrlLink = new Link(container, SWT.WRAP);
String applicationUrl = new ErrorMessageCallable<String>("Public URL") {
@@ -115,7 +132,7 @@
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
true);
}
-
+
private SelectionAdapter onPublicUrl(final String applicationUrl) {
return new SelectionAdapter() {
13 years, 1 month
JBoss Tools SVN: r36492 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-11-21 09:57:27 -0500 (Mon, 21 Nov 2011)
New Revision: 36492
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java
Log:
[JBIDE-9927] fixed duplicate embedding of jenkins
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2011-11-21 14:31:00 UTC (rev 36491)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2011-11-21 14:57:27 UTC (rev 36492)
@@ -188,7 +188,6 @@
}
}, getContainer(), getDataBindingContext());
- model.getSelectedEmbeddableCartridges().add(cartridge);
} catch (Exception e) {
// ignore
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java 2011-11-21 14:31:00 UTC (rev 36491)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java 2011-11-21 14:57:27 UTC (rev 36492)
@@ -18,7 +18,6 @@
import org.eclipse.core.databinding.observable.Diffs;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;
-import org.eclipse.core.runtime.Assert;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.ICartridge;
13 years, 1 month
JBoss Tools SVN: r36491 - in trunk/maven/plugins/org.jboss.tools.maven.ui: src/org/jboss/tools/maven/ui/internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-21 09:31:00 -0500 (Mon, 21 Nov 2011)
New Revision: 36491
Added:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/JBossRepositoriesMarkerResolution.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/MavenDependencyMarkerResolutionGenerator.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
Log:
CODING IN PROGRESS - issue JBIDE-9921: Investigate if we can add quickfixes for missing dependencies/packages based on JDT and M2E error markers
https://issues.jboss.org/browse/JBIDE-9921
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2011-11-21 13:48:13 UTC (rev 36490)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2011-11-21 14:31:00 UTC (rev 36491)
@@ -221,4 +221,14 @@
</newWizardShortcut>
</perspectiveExtension>
</extension>
+
+ <!-- TODO implement marker resolution as part of JBIDE-9921
+ <extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ class="org.jboss.tools.maven.ui.internal.problems.MavenDependencyMarkerResolutionGenerator"
+ markerType="org.eclipse.m2e.core.maven2Problem.dependency">
+ </markerResolutionGenerator>
+ </extension>
+ -->
</plugin>
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/JBossRepositoriesMarkerResolution.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/JBossRepositoriesMarkerResolution.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/JBossRepositoriesMarkerResolution.java 2011-11-21 14:31:00 UTC (rev 36491)
@@ -0,0 +1,72 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.ui.internal.problems;
+
+import static org.eclipse.m2e.core.ui.internal.editing.PomEdits.performOnDOMDocument;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.internal.compiler.util.Util;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.Operation;
+import org.eclipse.m2e.core.ui.internal.editing.PomEdits.OperationTuple;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolution2;
+import org.w3c.dom.Document;
+
+public class JBossRepositoriesMarkerResolution implements IMarkerResolution,
+ IMarkerResolution2 {
+
+ public String getDescription() {
+ return getLabel();
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ public String getLabel() {
+ // TODO Auto-generated method stub
+ return "Add missing JBoss repositories to settings.xml";
+ }
+
+ public void run(IMarker arg0) {
+ Operation addRepos = new AddRepositoriesOperation();
+ File settings = new File(MavenPlugin.getMavenConfiguration().getUserSettingsFile());
+ try {
+ String content = new String(Util.getFileCharContent(settings, null));
+ IDocument settingsDoc = new org.eclipse.jface.text.Document(content);
+ performOnDOMDocument(new OperationTuple(settingsDoc, addRepos));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+
+ class AddRepositoriesOperation implements Operation {
+
+ public void process(Document document) {
+ document.createComment("Changing settings at "+new Date());
+ System.err.println("Resolving repository stuff");
+ }
+
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/MavenDependencyMarkerResolutionGenerator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/MavenDependencyMarkerResolutionGenerator.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/problems/MavenDependencyMarkerResolutionGenerator.java 2011-11-21 14:31:00 UTC (rev 36491)
@@ -0,0 +1,107 @@
+/*************************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.ui.internal.problems;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolutionGenerator2;
+
+@SuppressWarnings("nls")
+public class MavenDependencyMarkerResolutionGenerator implements
+ IMarkerResolutionGenerator2 {
+
+ private static final String MSG_PREFIX = "Missing artifact "; //$NON-NLS-1$
+
+ enum ResolutionType {
+ JBOSS_REPO, EAP_REPO, UNSUPPORTED
+ }
+
+
+ public MavenDependencyMarkerResolutionGenerator() {
+ }
+
+ public IMarkerResolution[] getResolutions(IMarker marker) {
+ ResolutionType type = getResolutionType(marker);
+ switch (type) {
+ case JBOSS_REPO:
+ return new IMarkerResolution[] {
+ new JBossRepositoriesMarkerResolution(),
+ new JBossRepositoriesMarkerResolution() {
+ @Override
+ public String getLabel() {
+ return "Add JBoss repositories to pom.xml";
+ }
+ } };
+ case EAP_REPO:
+ return new IMarkerResolution[] {
+ new JBossRepositoriesMarkerResolution() {
+ @Override
+ public String getLabel() {
+ return "Set up EAP repository";
+ }
+ } };
+ }
+ return new IMarkerResolution[0];
+ }
+
+ public boolean hasResolutions(IMarker marker) {
+ return ResolutionType.UNSUPPORTED != getResolutionType(marker);
+ }
+
+ private ResolutionType getResolutionType(IMarker marker) {
+ ArtifactKey key = getArtifactKey(marker);
+ if (key.getVersion().contains("-redhat")) {
+ return ResolutionType.EAP_REPO;
+ } else if (key.getGroupId().startsWith("org.jboss")) {
+ return ResolutionType.JBOSS_REPO;
+ }
+ return ResolutionType.UNSUPPORTED;
+ }
+
+ private ArtifactKey getArtifactKey(IMarker marker) {
+ ArtifactKey key = null;
+ try {
+ key = (ArtifactKey) marker.getAttribute("artifactKey");
+ if (key == null) {
+ String message = (String) marker.getAttribute("message", null);
+ key = parseMessage(message);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return key;
+ }
+
+ private ArtifactKey parseMessage(String message) {
+ ArtifactKey key = null;
+ if (message != null && message.startsWith(MSG_PREFIX)) {
+ String keyString = message.substring(MSG_PREFIX.length());
+ String[] keyAsArray = keyString.trim().split(":"); //$NON-NLS-1$
+ if (keyAsArray.length > 3) {
+ String artifactId = keyAsArray[0];
+ String groupId = keyAsArray[1];
+ String classifier = null;
+ String version;
+ if (keyAsArray.length > 4) {
+ classifier = keyAsArray[3];
+ version = keyAsArray[4];
+ } else {
+ version = keyAsArray[3];
+ }
+ key = new ArtifactKey(groupId, artifactId, version, classifier);
+ }
+ }
+ return key;
+ }
+
+}
13 years, 1 month
JBoss Tools SVN: r36490 - trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-21 08:48:13 -0500 (Mon, 21 Nov 2011)
New Revision: 36490
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project
Log:
Remove unnecessary linked resources
Modified: trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project 2011-11-21 13:42:23 UTC (rev 36489)
+++ trunk/examples/plugins/org.jboss.tools.project.examples.cheatsheet/.project 2011-11-21 13:48:13 UTC (rev 36490)
@@ -31,11 +31,4 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
- <linkedResources>
- <link>
- <name>lib-org.jboss.tools.jst.jsp_3.3.0.v20111001-0515-H542-M4</name>
- <type>2</type>
- <location>E:/eclipse-3.7.1/plugins/org.jboss.tools.jst.jsp_3.3.0.v20111001-0515-H542-M4</location>
- </link>
- </linkedResources>
</projectDescription>
13 years, 1 month