Author: dgolovin
Date: 2008-01-23 21:18:58 -0500 (Wed, 23 Jan 2008)
New Revision: 5921
Added:
trunk/common/tests/org.jboss.tools.common.model.ui.test/plugin.xml
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/common/model/ui/test/preferences/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelNewWizardTest.java
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiPreferencesPageTest.java
Removed:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/common/model/ui/test/ModelNewWizardTest.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/preferences/GlobalTemplatePreferencePage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java
trunk/common/tests/org.jboss.tools.common.model.ui.test/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.model.ui.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
Log:
test for preference pages added
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/CompanyPreferencesPage.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -22,6 +22,9 @@
import org.eclipse.ui.*;
public class CompanyPreferencesPage extends PreferencePage implements
IWorkbenchPreferencePage {
+
+ public static final String WEB_PREFERENCES_ID =
"org.jboss.tools.common.model.ui";
+
protected Control contents;
public void createControl(final Composite parent) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/preferences/GlobalTemplatePreferencePage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/preferences/GlobalTemplatePreferencePage.java 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/preferences/GlobalTemplatePreferencePage.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -22,7 +22,10 @@
* @author au
*/
public class GlobalTemplatePreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
- TemplateComponent templateComponent = new TemplateComponent();
+
+ public static final String GLOBAL_TEMPLATES_PREFERENCES_ID =
"org.jboss.tools.common.model.ui.templates";
+
+ TemplateComponent templateComponent = new TemplateComponent();
protected Control createContents(Composite parent) {
return templateComponent.createContents(parent);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/preferences/EditorsPreferencesPage.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -22,6 +22,9 @@
import org.jboss.tools.common.text.xml.ui.xpl.BasePreferenceConstants;
public class EditorsPreferencesPage extends XMOBasedPreferencesPage {
+
+ public static final String EDITOR_PREFERENCES_ID =
"org.jboss.tools.common.xstudio.editors";
+
static String PATH = "%Options%/Struts Studio/Editors";
public EditorsPreferencesPage() {
Modified: trunk/common/tests/org.jboss.tools.common.model.ui.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/META-INF/MANIFEST.MF 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/META-INF/MANIFEST.MF 2008-01-24
02:18:58 UTC (rev 5921)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Model UI Test Plug-in
-Bundle-SymbolicName: org.jboss.tools.common.model.ui.test
+Bundle-SymbolicName: org.jboss.tools.common.model.ui.test;singleton:=true
Bundle-Version: 1.0.0
Require-Bundle: org.junit;visibility:=reexport,
org.eclipse.jface,
@@ -9,4 +9,4 @@
org.eclipse.ui,
org.jboss.tools.common,
org.jboss.tools.common.model.ui
-Export-Package: org.jboss.common.model.ui.test
+Export-Package: org.jboss.tools.common.model.ui.test
Modified: trunk/common/tests/org.jboss.tools.common.model.ui.test/build.properties
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.ui.test/build.properties 2008-01-24
01:43:11 UTC (rev 5920)
+++ trunk/common/tests/org.jboss.tools.common.model.ui.test/build.properties 2008-01-24
02:18:58 UTC (rev 5921)
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml
Added: trunk/common/tests/org.jboss.tools.common.model.ui.test/plugin.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.ui.test/plugin.xml
(rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.ui.test/plugin.xml 2008-01-24 02:18:58
UTC (rev 5921)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.activities">
+ <defaultEnablement
+ id="org.jboss.tools.common.model.ui.templates">
+ </defaultEnablement>
+ </extension>
+
+</plugin>
Property changes on: trunk/common/tests/org.jboss.tools.common.model.ui.test/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/common/model/ui/test/ModelNewWizardTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/common/model/ui/test/ModelNewWizardTest.java 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/common/model/ui/test/ModelNewWizardTest.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -1,45 +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.common.model.ui.test;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.common.model.ui.wizards.standard.DefaultStandardStep;
-import org.jboss.tools.common.util.WorkbenchUtils;
-
-import junit.framework.TestCase;
-
-
-/**
- * @author eskimo
- *
- */
-public class ModelNewWizardTest extends TestCase {
- protected void testNewWizardInstanceIsCreated(String id) {
- IWizard
- aWizard = WorkbenchUtils.findWizardByDefId(
- id);
-
- WizardDialog dialog = new WizardDialog(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- aWizard);
- dialog.setBlockOnOpen(false);
- try {
- dialog.open();
- IWizardPage page = dialog.getCurrentPage();
- assertTrue("Start page is not loaded",page instanceof DefaultStandardStep);
- } finally {
- dialog.close();
- }
- }
-}
Copied:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelNewWizardTest.java
(from rev 5900,
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/common/model/ui/test/ModelNewWizardTest.java)
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelNewWizardTest.java
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelNewWizardTest.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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.common.model.ui.test;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.model.ui.wizards.standard.DefaultStandardStep;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @author eskimo
+ *
+ */
+public class ModelNewWizardTest extends TestCase {
+ protected void testNewWizardInstanceIsCreated(String id) {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId(
+ id);
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ try {
+ dialog.open();
+ IWizardPage page = dialog.getCurrentPage();
+ assertTrue("Start page is not loaded",page instanceof DefaultStandardStep);
+ } finally {
+ dialog.close();
+ }
+ }
+}
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelNewWizardTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.common.model.ui.test;
+
+import junit.framework.TestSuite;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ModelUiAllTests {
+ public TestSuite suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTestSuite(ModelUiPreferencesPageTest.class);
+ return suite;
+ }
+}
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiPreferencesPageTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiPreferencesPageTest.java
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiPreferencesPageTest.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.common.model.ui.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.jboss.tools.common.model.ui.preferences.CompanyPreferencesPage;
+import
org.jboss.tools.common.model.ui.templates.preferences.GlobalTemplatePreferencePage;
+import org.jboss.tools.common.model.ui.texteditors.preferences.EditorsPreferencesPage;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ModelUiPreferencesPageTest extends TestCase {
+
+ public void testWebPreferencesPage() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ CompanyPreferencesPage.WEB_PREFERENCES_ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of CompanyPreferencesPage",
selectedPage instanceof CompanyPreferencesPage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testEditorsPreferencesPage() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ EditorsPreferencesPage.EDITOR_PREFERENCES_ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of EditorsPreferencesPage",
selectedPage instanceof EditorsPreferencesPage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testGlobalTemplatesPreferencesPage() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ GlobalTemplatePreferencePage.GLOBAL_TEMPLATES_PREFERENCES_ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of
GlobalTemplatePreferencePage", selectedPage instanceof
GlobalTemplatePreferencePage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+}
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiPreferencesPageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -16,7 +16,7 @@
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.PlatformUI;
-import org.jboss.common.model.ui.test.ModelNewWizardTest;
+import org.jboss.tools.common.model.ui.test.ModelNewWizardTest;
import org.jboss.tools.common.model.ui.wizard.newfile.NewHTMLFileWizard;
import org.jboss.tools.common.model.ui.wizard.newfile.NewJSPFileWizard;
import org.jboss.tools.common.model.ui.wizard.newfile.NewPropertiesFileWizard;
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-01-24
01:43:11 UTC (rev 5920)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-01-24
02:18:58 UTC (rev 5921)
@@ -135,8 +135,20 @@
* @throws IOException
*/
public static IProject importProject(String bundleName, String templatePath,
- NullProgressMonitor monitor) throws IOException, CoreException,
InvocationTargetException, InterruptedException {
+ IProgressMonitor monitor) throws IOException, CoreException,
InvocationTargetException, InterruptedException {
// TODO Auto-generated method stub
- return importProject(Platform.getBundle(bundleName), templatePath, monitor);
+ return importProject(Platform.getBundle(bundleName), templatePath, monitor==null?new
NullProgressMonitor():monitor);
}
+
+ public static IProject importProject(String bundleName, String templatePath) throws
IOException, CoreException, InvocationTargetException, InterruptedException {
+ // TODO Auto-generated method stub
+ return importProject(Platform.getBundle(bundleName), templatePath, null);
+ }
+
+ public static void deleteProject(String projectName) throws CoreException {
+ IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(projectName);
+ if (member != null) {
+ member.getProject().delete(true, true, null);
+ }
+ }
}