Author: dgolovin
Date: 2008-01-22 20:10:43 -0500 (Tue, 22 Jan 2008)
New Revision: 5895
Added:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
Log:
Add test for we.ui wizards
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2008-01-22
21:21:13 UTC (rev 5894)
+++
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2008-01-23
01:10:43 UTC (rev 5895)
@@ -23,6 +23,7 @@
public static Test suite() {
TestSuite suite = new TestSuite(JstWebUiAllTests.class.getName());
suite.addTestSuite(WebViewsTest.class);
+ suite.addTestSuite(WebWizardsTest.class);
return suite;
}
}
Added:
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
(rev 0)
+++
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java 2008-01-23
01:10:43 UTC (rev 5895)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * 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.jst.web.ui.test;
+
+import junit.framework.TestCase;
+
+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.wizard.newfile.NewHTMLFileWizard;
+import org.jboss.tools.common.model.ui.wizard.newfile.NewJSPFileWizard;
+import org.jboss.tools.common.model.ui.wizard.newfile.NewPropertiesFileWizard;
+import org.jboss.tools.common.model.ui.wizard.newfile.NewXHTMLFileWizard;
+import org.jboss.tools.common.model.ui.wizards.standard.DefaultStandardStep;
+import org.jboss.tools.common.util.WorkbenchUtils;
+import org.jboss.tools.jst.web.ui.wizards.newfile.NewCSSFileWizard;
+import org.jboss.tools.jst.web.ui.wizards.newfile.NewJSFileWizard;
+import org.jboss.tools.jst.web.ui.wizards.newfile.NewTLDFileWizard;
+import org.jboss.tools.jst.web.ui.wizards.newfile.NewWebFileWizard;
+
+/**
+ * @author eskimo
+ *
+ */
+public class WebWizardsTest extends TestCase {
+
+ private 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();
+ }
+ }
+
+ public void testNewCssWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewCSSFileWizard.class.getName());
+ }
+
+ public void testNewJsWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewJSFileWizard.class.getName());
+ }
+
+ public void testNewWebWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewWebFileWizard.class.getName());
+ }
+
+ public void testNewJspWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewJSPFileWizard.class.getName());
+ }
+
+ public void testNewXhtmlWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewXHTMLFileWizard.class.getName());
+ }
+
+ public void testNewHtmlWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewHTMLFileWizard.class.getName());
+ }
+
+ public void testNewPropertiesWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewPropertiesFileWizard.class.getName());
+ }
+
+ public void testNewTldWizardInstanceIsCreated() {
+ testNewWizardInstanceIsCreated(NewTLDFileWizard.class.getName());
+ }
+}
Property changes on:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/WebWizardsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain