Author: dgolovin
Date: 2009-02-09 16:38:23 -0500 (Mon, 09 Feb 2009)
New Revision: 13550
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestWizardsProject.java
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/VRuleTipFactory.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FasesConfigEditorTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
workspace/dgolovin/org.jboss.tools.project.examples.rf.demo/rf-demo-projects.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-3500 enable JSF UI Tests in build
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -167,6 +167,8 @@
return true;
}
+ // FIXME Size of string buffer should be set to size of file by default
+ // to avoid StringBuffer extension on each append
public static String readStream(InputStream is) {
StringBuffer sb = new StringBuffer("");
try {
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultRedirectHandler.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -71,7 +71,7 @@
public XEntityData[] getEntityData(XModelObject object) {
XAction a = getTrueAction(object);
- return (a == null) ? null : a.getEntityData(getTrueSource(object));
+ return (a == null) ? new XEntityData[0] :
a.getEntityData(getTrueSource(object));
}
public void executeHandler(XModelObject object, Properties p) throws XModelException
{
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/jst/web/tld/TLDToPaletteHelper.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -79,9 +79,8 @@
// String info = TLDUtil.getTagDescription(tag);
StringBuffer sb = new StringBuffer();
sb.append("<b>Syntax:</b><br><code>");
- if (empty) sb.append("<" + name + " />"); else
sb.append("<" + name +
"></code><br><code></" + name +
">");
- sb.append("</code><br>");
- sb.append("<b>Attributes:</b><br><code>");
+ if (empty) sb.append("<").append(name).append("
/>"); else
sb.append("<").append(name).append("></code><br><code></").append(name).append(">");
+
sb.append("</code><br><b>Attributes:</b><br><code>");
int k = 0;
XModelObject[] as = tag.getChildren();
for (int i = 0; i < as.length; i++) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/FavoritesClassController.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -49,7 +49,7 @@
StringBuffer buffer = new StringBuffer();
Iterator i = list.iterator();
while (i.hasNext()) {
- buffer.append((String)i.next()+",");
+ buffer.append((String)i.next()).append(",");
}
return buffer.toString();
}
Modified:
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/VRuleTipFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/VRuleTipFactory.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/VRuleTipFactory.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -19,7 +19,7 @@
VResultTemplate[] ts = f.getTemplates();
if(ts == null) return null;
StringBuffer sb = new StringBuffer();
- sb.append("<html><body>" + rule.getDescription() +
"<br>");
+ sb.append("<html><body>").append(rule.getDescription()).append("<br>");
for (int i = 0; i < ts.length; i++) {
int si = ts[i].getSignificance();
sb.append(" ");
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2009-02-09 18:45:54
UTC (rev 13549)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2009-02-09 21:38:23
UTC (rev 13550)
@@ -14,5 +14,7 @@
org.jboss.tools.jsf.ui;bundle-version="2.0.0",
org.jboss.tools.jst.web.ui;bundle-version="2.0.0",
org.jboss.tools.jst.jsp;bundle-version="2.0.0",
- org.jboss.tools.common.model.ui;bundle-version="2.0.0"
+ org.jboss.tools.common.model.ui;bundle-version="2.0.0",
+ org.eclipse.ui.ide;bundle-version="3.4.1"
Bundle-Localization: plugin
+Bundle-ClassPath: jsf-ui-test.jar
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties 2009-02-09 18:45:54 UTC
(rev 13549)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/build.properties 2009-02-09 21:38:23 UTC
(rev 13550)
@@ -1,5 +1,6 @@
-source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .,\
- plugin.properties
+ plugin.properties,\
+ jsf-ui-test.jar,\
+ projects/
+source.jsf-ui-test.jar = src/
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FasesConfigEditorTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FasesConfigEditorTest.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FasesConfigEditorTest.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -2,15 +2,35 @@
import junit.framework.TestCase;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
+import org.jboss.tools.jsf.ui.editor.FacesConfigEditor;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
public class FasesConfigEditorTest extends TestCase {
+ IProject testWizards = null;
+
+ @Override
+ protected void setUp() throws Exception {
+ testWizards = new TestWizardsProject().importProject();
+ }
+
/**
* Opens faces config editor on imported project and checks
* that it is opened and have three tabs in it
*/
public void testFacesConfigEditorIsOpened() {
- // assert editor is opened
- // assert it is FacesConfigEditor instance
- fail("Not implemented yet");
+ IEditorPart facesConfigEditor =
WorkbenchUtils.openEditor("/TestWizards/WebContent/WEB-INF/faces-config.xml");
+ System.out.println(facesConfigEditor.getClass().getName());
+ assertTrue(facesConfigEditor instanceof EditorPartWrapper);
+ EditorPartWrapper facesConfigEditorWrap = (EditorPartWrapper)facesConfigEditor;
+ assertTrue(facesConfigEditorWrap.getEditor() instanceof FacesConfigEditor);
}
+
+ @Override
+ protected void tearDown() throws Exception {
+ WorkbenchUtils.closeAllEditors();
+ }
}
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.ui.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JSFUiAllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("JSF UI tests");
-
- suite.addTestSuite(CssClassNewWizardTest.class);
- suite.addTestSuite(CssFileNewWizardTest.class);
- suite.addTestSuite(FacesConfigNewWizardTest.class);
- suite.addTestSuite(FasesConfigEditorTest.class);
- suite.addTestSuite(HtmlFileNewWizardTest.class);
- suite.addTestSuite(JsFileNewWizardTest.class);
- suite.addTestSuite(JspFileNewWizardTest.class);
- suite.addTestSuite(PropertiesNewWizardTest.class);
- suite.addTestSuite(XhtmlFileNewWizardTest.class);
-
- return suite;
- }
-}
\ No newline at end of file
Copied:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
(from rev 13549,
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java)
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class JsfUiAllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("JSF UI tests");
+
+ suite.addTestSuite(CssClassNewWizardTest.class);
+ suite.addTestSuite(CssFileNewWizardTest.class);
+ suite.addTestSuite(FacesConfigNewWizardTest.class);
+ suite.addTestSuite(FasesConfigEditorTest.class);
+ suite.addTestSuite(HtmlFileNewWizardTest.class);
+ suite.addTestSuite(JsFileNewWizardTest.class);
+ suite.addTestSuite(JspFileNewWizardTest.class);
+ suite.addTestSuite(PropertiesNewWizardTest.class);
+ suite.addTestSuite(XhtmlFileNewWizardTest.class);
+
+ return new TestWizardsProject(suite);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestWizardsProject.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestWizardsProject.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestWizardsProject.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -0,0 +1,32 @@
+package org.jboss.tools.jsf.ui.test;
+
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+public class TestWizardsProject extends ProjectImportTestSetup {
+
+ public static final String NAME = "TestWizards";
+ public static final String BUNDLE_NAME = "org.jboss.tools.jsf.ui.test";
+ public static final String PATH = "/projects/TestWizards";
+
+ public TestWizardsProject(Test test) {
+ super(test, BUNDLE_NAME, PATH, NAME);
+ }
+
+ public TestWizardsProject() {
+ super(null, BUNDLE_NAME, PATH, NAME);
+ }
+
+ @Override
+ public IProject importProject() throws Exception {
+ IProject testWizards =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember(NAME);
+
+ if(testWizards==null) {
+ testWizards = super.importProject();
+ }
+ return testWizards;
+ }
+}
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestWizardsProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/WizardTest.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -24,7 +24,7 @@
public abstract class WizardTest extends TestCase {
protected String id;
protected IProject project;
-
+ protected boolean projectRemovalRequired = false;
protected WizardDialog dialog;
public WizardTest(String id){
@@ -35,38 +35,9 @@
protected void setUp() throws Exception {
super.setUp();
- project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("TestWizards");
- if(project == null) {
- ProjectImportTestSetup setup = new ProjectImportTestSetup(
- this,
- "org.jboss.tools.jsf.ui.test",
- "projects/TestWizards",
- "TestWizards");
- project = setup.importProject();
- }
- this.project = project.getProject();
- JobUtils.waitForIdle();
+ project = new TestWizardsProject().importProject();
+
}
-
- @Override
- protected void tearDown() throws Exception {
- if(dialog != null)
- dialog.close();
-
- boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
- try {
- JobUtils.waitForIdle();
- if(project != null){
- project.close(new NullProgressMonitor());
- project.delete(true, new NullProgressMonitor());
- project = null;
- JobUtils.waitForIdle();
- }
- } finally {
- ResourcesUtils.setBuildAutomatically(saveAutoBuild);
- }
-
- }
public void wizardIsCreated() {
IWizard wizard = WorkbenchUtils.findWizardByDefId(id);
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -23,4 +23,4 @@
public void testXhtmlFileNewWizardValidation2() {
validateFolderAndName();
}
-}
+}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2009-02-09
18:45:54 UTC (rev 13549)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2009-02-09
21:38:23 UTC (rev 13550)
@@ -38,8 +38,6 @@
suite.addTestSuite(SeamFacetInstallDelegateTest.class);
suite.addTest(SeamValidatorsAllTests.suite());
suite.addTest(SeamRefactoringAllTests.suite());
-
- // Seam 2 tests can't run on hudson for now ;(
suite.addTestSuite(Seam2FacetInstallDelegateTest.class);
return suite;
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2009-02-09 18:45:54 UTC
(rev 13549)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2009-02-09 21:38:23 UTC
(rev 13550)
@@ -419,4 +419,10 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.jsf.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
Modified:
workspace/dgolovin/org.jboss.tools.project.examples.rf.demo/rf-demo-projects.xml
===================================================================
---
workspace/dgolovin/org.jboss.tools.project.examples.rf.demo/rf-demo-projects.xml 2009-02-09
18:45:54 UTC (rev 13549)
+++
workspace/dgolovin/org.jboss.tools.project.examples.rf.demo/rf-demo-projects.xml 2009-02-09
21:38:23 UTC (rev 13550)
@@ -1,5 +1,4 @@
<projects>
-
<project>
<category>RichFaces</category>
<name>RichFaces 3.2.2.SP1 Demo Application for JBoss AS 4.2.X</name>