Author: mareshkau
Date: 2009-02-20 11:56:35 -0500 (Fri, 20 Feb 2009)
New Revision: 13705
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java
Removed:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/dialogs/VpeResourcesDialogTest.java
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/beans/
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/jbide/
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/.classpath
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-3793, tests for vpe ui(dialog and pref page) was
moved from vpe non-ui tests to vpe ui tests
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF 2009-02-20 16:56:22 UTC
(rev 13704)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/META-INF/MANIFEST.MF 2009-02-20 16:56:35 UTC
(rev 13705)
@@ -8,20 +8,11 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.junit,
- org.jboss.tools.common,
org.jboss.tools.vpe,
- org.jboss.tools.jst.jsp,
- org.jboss.tools.vpe.ui.test,
org.jboss.tools.jsf.vpe.jsf.test,
- org.jboss.tools.jsf.vpe.richfaces.test,
- org.jboss.tools.common.model,
- org.jboss.tools.jsf.vpe.richfaces,
- org.jboss.tools.vpe.xulrunner,
- org.mozilla.xpcom,
- org.jboss.tools.tests;bundle-version="2.0.0",
org.jboss.tools.common.model.ui;bundle-version="2.0.0",
org.eclipse.jface.text;bundle-version="3.4.0"
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.vpe.editor.preferences,
org.jboss.tools.vpe.editor.template,
org.jboss.tools.vpe.test
Deleted:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/dialogs/VpeResourcesDialogTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/dialogs/VpeResourcesDialogTest.java 2009-02-20
16:56:22 UTC (rev 13704)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/dialogs/VpeResourcesDialogTest.java 2009-02-20
16:56:35 UTC (rev 13705)
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor.dialogs;
-
-import java.util.Properties;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.swt.widgets.Shell;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryDialog;
-import org.jboss.tools.common.model.ui.wizards.query.IQueryDialog;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.vpe.resref.VpeResourcesDialog;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-
-import junit.framework.TestCase;
-
-public class VpeResourcesDialogTest extends TestCase {
-
- private final String BUNDLE_NAME = "org.jboss.tools.vpe.test";
//$NON-NLS-1$
- private final String PROJECT_PATH = "resources/TestProject"; //$NON-NLS-1$
- private final String PROJECT_NAME = "TestProject"; //$NON-NLS-1$
- private final String FILE_NAME = "hello.jsp"; //$NON-NLS-1$
-
- private IProject project;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- project = (IProject) ResourcesPlugin.getWorkspace().getRoot()
- .findMember(PROJECT_NAME);
- if (project == null) {
- ProjectImportTestSetup setup = new ProjectImportTestSetup(this,
- BUNDLE_NAME, PROJECT_PATH, PROJECT_NAME);
- project = setup.importProject();
- }
- this.project = project.getProject();
-
- JobUtils.waitForIdle();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- 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 testVpeResourcesDialogOpen() throws Throwable {
-
- IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME,
- PROJECT_NAME);
-
- assertNotNull("Specified file does not exist: fileName = " + FILE_NAME
//$NON-NLS-1$
- + "; projectName = " + PROJECT_NAME, file); //$NON-NLS-1$
-
- VpeResourcesDialog dialog = new VpeResourcesDialog();
- Properties p = new Properties();
- p.setProperty("help", "VpeResourcesDialog"); //$NON-NLS-1$
//$NON-NLS-2$
- p.put("file", file); //$NON-NLS-1$
- p.put("model", PreferenceModelUtilities.getPreferenceModel()); //$NON-NLS-1$
- dialog.setObject(p);
- Shell shell =
ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- IQueryDialog dialogWindow = new AbstractQueryDialog(shell);
-
- dialogWindow.setView(dialog.getView());
- dialogWindow.getDialog().create();
- dialog.getView().setDialog(dialogWindow.getDialog());
- dialogWindow.getDialog().setBlockOnOpen(false);
- dialogWindow.getDialog().open();
- int code = dialogWindow.getDialog().getReturnCode();
-
- /*
- * Assert that window has been created.
- */
- assertEquals(0, code);
-
- dialogWindow.getDialog().close();
- }
-
-
-}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2009-02-20
16:56:22 UTC (rev 13704)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2009-02-20
16:56:35 UTC (rev 13705)
@@ -12,16 +12,12 @@
import java.util.ArrayList;
import java.util.List;
-
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.jboss.tools.jsf.vpe.jsf.test.JsfComponentTest;
import org.jboss.tools.jsf.vpe.jsf.test.JsfTestPlugin;
import org.jboss.tools.tests.ImportBean;
-import org.jboss.tools.vpe.editor.dialogs.VpeResourcesDialogTest;
-import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPageTest;
import org.jboss.tools.vpe.editor.template.VpeTemplateManagerTest;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
@@ -40,8 +36,6 @@
suite.addTestSuite(TemplateLoadingTest.class);
suite.addTestSuite(TemplateSchemeValidateTest.class);
suite.addTestSuite(TemplatesExpressionParsingTest.class);
- suite.addTestSuite(VpeEditorPreferencesPageTest.class);
- suite.addTestSuite(VpeResourcesDialogTest.class);
suite.addTestSuite(VpeTemplateManagerTest.class);
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
ImportBean importBean = new ImportBean();
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/.classpath
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/.classpath 2009-02-20 16:56:22 UTC (rev
13704)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/.classpath 2009-02-20 16:56:35 UTC (rev
13705)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF 2009-02-20 16:56:22
UTC (rev 13704)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF 2009-02-20 16:56:35
UTC (rev 13705)
@@ -19,9 +19,11 @@
org.jboss.tools.jst.firstrun,
org.eclipse.wst.server.core,
org.eclipse.jface.text,
+ org.jboss.tools.common.model.ui;bundle-version="2.0.0",
org.jboss.tools.tests;bundle-version="2.0.0";visibility:=reexport
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: org.jboss.tools.vpe.ui.test
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/plugin.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/plugin.xml 2009-02-20 16:56:22 UTC (rev
13704)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/plugin.xml 2009-02-20 16:56:35 UTC (rev
13705)
@@ -2,4 +2,12 @@
<?eclipse version="3.2"?>
<plugin>
<extension-point id="org.jboss.tools.vpe.ui.tests" name="Visual Page
Editor Junit Test" schema="schema/vpe.tests.exsd"/>
+ <extension
+ point="org.jboss.tools.vpe.ui.tests">
+ <tests
+ description="UI tests of VPE components"
+ name="UI tests of VPE"
+ testSuite="org.jboss.tools.vpe.ui.test.VpeUiTests">
+ </tests>
+ </extension>
</plugin>
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeUiTests.java 2009-02-20
16:56:35 UTC (rev 13705)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test;
+
+import org.jboss.tools.vpe.ui.test.dialog.VpeResourcesDialogTest;
+import org.jboss.tools.vpe.ui.test.preferences.VpeEditorPreferencesPageTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeUiTests {
+
+ public static Test suite(){
+ TestSuite suite = new TestSuite("UI Tests for vpe"); //$NON-NLS-1$
+ suite.addTestSuite(VpeResourcesDialogTest.class);
+ suite.addTestSuite(VpeEditorPreferencesPageTest.class);
+ return suite;
+ }
+}
Copied:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java
(from rev 13697,
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/dialogs/VpeResourcesDialogTest.java)
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java 2009-02-20
16:56:35 UTC (rev 13705)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test.dialog;
+
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryDialog;
+import org.jboss.tools.common.model.ui.wizards.query.IQueryDialog;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.vpe.resref.VpeResourcesDialog;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+
+import junit.framework.TestCase;
+
+public class VpeResourcesDialogTest extends TestCase {
+
+ private final String BUNDLE_NAME = "org.jboss.tools.vpe.test";
//$NON-NLS-1$
+ private final String PROJECT_PATH = "resources/TestProject"; //$NON-NLS-1$
+ private final String PROJECT_NAME = "TestProject"; //$NON-NLS-1$
+ private final String FILE_NAME = "hello.jsp"; //$NON-NLS-1$
+
+ private IProject project;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ project = (IProject) ResourcesPlugin.getWorkspace().getRoot()
+ .findMember(PROJECT_NAME);
+ if (project == null) {
+ ProjectImportTestSetup setup = new ProjectImportTestSetup(this,
+ BUNDLE_NAME, PROJECT_PATH, PROJECT_NAME);
+ project = setup.importProject();
+ }
+ this.project = project.getProject();
+
+ JobUtils.waitForIdle();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ 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 testVpeResourcesDialogOpen() throws Throwable {
+
+ IFile file = (IFile) TestUtil.getComponentPath(FILE_NAME,
+ PROJECT_NAME);
+
+ assertNotNull("Specified file does not exist: fileName = " + FILE_NAME
//$NON-NLS-1$
+ + "; projectName = " + PROJECT_NAME, file); //$NON-NLS-1$
+
+ VpeResourcesDialog dialog = new VpeResourcesDialog();
+ Properties p = new Properties();
+ p.setProperty("help", "VpeResourcesDialog"); //$NON-NLS-1$
//$NON-NLS-2$
+ p.put("file", file); //$NON-NLS-1$
+ p.put("model", PreferenceModelUtilities.getPreferenceModel()); //$NON-NLS-1$
+ dialog.setObject(p);
+ Shell shell =
ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ IQueryDialog dialogWindow = new AbstractQueryDialog(shell);
+
+ dialogWindow.setView(dialog.getView());
+ dialogWindow.getDialog().create();
+ dialog.getView().setDialog(dialogWindow.getDialog());
+ dialogWindow.getDialog().setBlockOnOpen(false);
+ dialogWindow.getDialog().open();
+ int code = dialogWindow.getDialog().getReturnCode();
+
+ /*
+ * Assert that window has been created.
+ */
+ assertEquals(0, code);
+
+ dialogWindow.getDialog().close();
+ }
+
+
+}
Copied:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java
(from rev 13697,
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/preferences/VpeEditorPreferencesPageTest.java)
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java 2009-02-20
16:56:35 UTC (rev 13705)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test.preferences;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.jboss.tools.test.util.WorkbenchUtils;
+import org.jboss.tools.vpe.editor.preferences.ELVariablesPreferencePage;
+import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
+
+public class VpeEditorPreferencesPageTest extends TestCase {
+ public void testVpeEditorPreferencesPageShow() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ VpeEditorPreferencesPage.ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of
org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage", selectedPage
instanceof VpeEditorPreferencesPage); //$NON-NLS-1$
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testVpeEditorELPreferencesPageShow() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ ELVariablesPreferencePage.ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of
org.jboss.tools.vpe.editor.preferences.ELVariablesPreferencePage", selectedPage
instanceof ELVariablesPreferencePage); //$NON-NLS-1$
+ } finally {
+ prefDialog.close();
+ }
+ }
+}