Author: akazakov
Date: 2012-01-10 20:37:14 -0500 (Tue, 10 Jan 2012)
New Revision: 37751
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
Removed:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamActionNewWizardTest.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/ISeamUiConstants.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10606 Seam Generate Entities wizard problem
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/ISeamUiConstants.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/ISeamUiConstants.java 2012-01-10
22:20:21 UTC (rev 37750)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/ISeamUiConstants.java 2012-01-11
01:37:14 UTC (rev 37751)
@@ -20,7 +20,8 @@
NEW_SEAM_PROJECT_WIZARD_ID =
"org.jboss.tools.seam.ui.wizards.SeamProjectWizard", //$NON-NLS-1$
NEW_SEAM_FORM_WIZARD_ID = "org.jboss.tools.seam.ui.wizard.SeamFormWizard",
//$NON-NLS-1$
NEW_SEAM_ACTION_WIZARD_ID =
"org.jboss.tools.seam.ui.wizard.SeamActionWizard", //$NON-NLS-1$
- NEW_SEAM_CONVERSATION_WIZARD_ID =
"org.jboss.tools.seam.ui.wizard.SeamConversationWizard",
- NEW_SEAM_ENTITY_WIZARD_ID =
"org.jboss.tools.seam.ui.wizard.SeamEntityWizard",
+ NEW_SEAM_CONVERSATION_WIZARD_ID =
"org.jboss.tools.seam.ui.wizard.SeamConversationWizard", //$NON-NLS-1$
+ NEW_SEAM_ENTITY_WIZARD_ID =
"org.jboss.tools.seam.ui.wizard.SeamEntityWizard", //$NON-NLS-1$
+ NEW_GENERATE_SEAM_ENTITY_WIZARD_ID
="org.jboss.tools.seam.ui.wizard.SeamGenerateEnitiesWizard", //$NON-NLS-1$
SEAM_COMPONENTS_VIEW_ID =
"org.jboss.tools.seam.ui.views.SeamComponentsNavigator"; //$NON-NLS-1$
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java 2012-01-10
22:20:21 UTC (rev 37750)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java 2012-01-11
01:37:14 UTC (rev 37751)
@@ -18,7 +18,6 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
@@ -172,6 +171,20 @@
return PathHelper.pathOrNull(reverseEngineeringSettings.getText() );
}
+ /**
+ * @return the projectEditor
+ */
+ public IFieldEditor getProjectEditor() {
+ return projectEditor;
+ }
+
+ /**
+ * @return the rootSeamProject
+ */
+ public IProject getRootSeamProject() {
+ return rootSeamProject;
+ }
+
private static String getConsoleConfigurationName(String seamWebProjectName) {
if(seamWebProjectName==null || seamWebProjectName.trim().length()==0) {
return null;
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2012-01-10
22:20:21 UTC (rev 37750)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2012-01-11
01:37:14 UTC (rev 37751)
@@ -38,9 +38,9 @@
import org.jboss.tools.seam.ui.test.wizard.PackageNamesTest;
import org.jboss.tools.seam.ui.test.wizard.Seam20XCreateTestProjectTest;
import org.jboss.tools.seam.ui.test.wizard.Seam20XProjectNamesTest;
-import org.jboss.tools.seam.ui.test.wizard.SeamActionNewWizardTest;
import org.jboss.tools.seam.ui.test.wizard.SeamCreateTestProjectTest;
import org.jboss.tools.seam.ui.test.wizard.SeamFormNewWizardTest;
+import org.jboss.tools.seam.ui.test.wizard.SeamNewWizardTest;
import org.jboss.tools.seam.ui.test.wizard.SeamProjectNamesTest;
import org.jboss.tools.seam.ui.test.wizard.SeamProjectNewWizardTest;
import org.jboss.tools.test.util.JobUtils;
@@ -64,7 +64,9 @@
suite.addTest(SeamComponentsViewAllTests.suite());
suite.addTest(SeamProjectNewWizardTest.suite());
- suite.addTest(new ProjectImportTestSetup(new TestSuite(SeamActionNewWizardTest.class),
"org.jboss.tools.seam.base.test", new String[]{"projects/Test1-ear",
"projects/Test1-ejb", "projects/Test1"}, new
String[]{"Test1-ear", "Test1-ejb", "Test1"}));
+ TestSuite wizards = new TestSuite("Seam Wizards tests");
+ wizards.addTestSuite(SeamNewWizardTest.class);
+ suite.addTest(new ProjectImportTestSetup(wizards,
"org.jboss.tools.seam.base.test", new String[]{"projects/Test1-ear",
"projects/Test1-ejb", "projects/Test1"}, new
String[]{"Test1-ear", "Test1-ejb", "Test1"}));
suite.addTestSuite(SeamFormNewWizardTest.class);
suite.addTestSuite(SeamPreferencesPageTest.class);
Deleted:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamActionNewWizardTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamActionNewWizardTest.java 2012-01-10
22:20:21 UTC (rev 37750)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamActionNewWizardTest.java 2012-01-11
01:37:14 UTC (rev 37751)
@@ -1,51 +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.seam.ui.test.wizard;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.seam.ui.ISeamUiConstants;
-import org.jboss.tools.seam.ui.wizard.ISeamParameter;
-import org.jboss.tools.seam.ui.wizard.SeamBaseWizardPage;
-import org.jboss.tools.test.util.WorkbenchUtils;
-
-/**
- * @author eskimo
- *
- */
-public class SeamActionNewWizardTest extends TestCase {
-
- /**
- *
https://jira.jboss.org/jira/browse/JBIDE-3752
- */
- public void testSeamActionNewWizardInstanceIsInitialized() {
- IWizard
- aWizard = WorkbenchUtils.findWizardByDefId(
- ISeamUiConstants.NEW_SEAM_ACTION_WIZARD_ID);
-
- WizardDialog dialog = new WizardDialog(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- aWizard);
- dialog.setBlockOnOpen(false);
- dialog.open();
- try {
- SeamBaseWizardPage page = (SeamBaseWizardPage)dialog.getSelectedPage();
-
- page.getEditor(ISeamParameter.SEAM_PROJECT_NAME).setValue("Test1-ear");
- assertEquals("Seam web parent project was not initialized for Seam EAR
project.", "Test1", page.getRootSeamProject());
- } finally {
- dialog.close();
- }
- }
-}
\ No newline at end of file
Copied:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
(from rev 37745,
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamActionNewWizardTest.java)
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java 2012-01-11
01:37:14 UTC (rev 37751)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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.seam.ui.test.wizard;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.seam.ui.ISeamUiConstants;
+import org.jboss.tools.seam.ui.wizard.ISeamParameter;
+import org.jboss.tools.seam.ui.wizard.SeamBaseWizardPage;
+import org.jboss.tools.seam.ui.wizard.SeamGenerateEntitiesWizardPage;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * @author eskimo
+ */
+public class SeamNewWizardTest extends TestCase {
+
+ /**
+ *
https://jira.jboss.org/jira/browse/JBIDE-3752
+ */
+ public void testSeamActionNewWizardInstanceIsInitialized() {
+ testSeamBaseNewWizardInstanceIsInitialized(ISeamUiConstants.NEW_SEAM_ACTION_WIZARD_ID);
+ }
+
+ public void testSeamConversationNewWizardInstanceIsInitialized() {
+ testSeamBaseNewWizardInstanceIsInitialized(ISeamUiConstants.NEW_SEAM_CONVERSATION_WIZARD_ID);
+ }
+
+ public void testSeamFormNewWizardInstanceIsInitialized() {
+ testSeamBaseNewWizardInstanceIsInitialized(ISeamUiConstants.NEW_SEAM_FORM_WIZARD_ID);
+ }
+
+ public void testSeamEntityNewWizardInstanceIsInitialized() {
+ testSeamBaseNewWizardInstanceIsInitialized(ISeamUiConstants.NEW_SEAM_ENTITY_WIZARD_ID);
+ }
+
+ public void testSeamBaseNewWizardInstanceIsInitialized(String wizardId) {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId(wizardId);
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ SeamBaseWizardPage page = (SeamBaseWizardPage)dialog.getSelectedPage();
+
+ page.getEditor(ISeamParameter.SEAM_PROJECT_NAME).setValue("Test1-ear");
+ assertEquals("Seam web parent project was not initialized for Seam EAR
project.", "Test1", page.getRootSeamProject());
+ } finally {
+ dialog.close();
+ }
+ }
+
+ /**
+ *
https://jira.jboss.org/jira/browse/JBIDE-10606
+ */
+ public void testSeamGenerateEntitiesNewWizardInstanceIsInitialized() {
+ IWizard
+ aWizard =
WorkbenchUtils.findWizardByDefId(ISeamUiConstants.NEW_GENERATE_SEAM_ENTITY_WIZARD_ID);
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ SeamGenerateEntitiesWizardPage page =
(SeamGenerateEntitiesWizardPage)dialog.getSelectedPage();
+
+ page.getProjectEditor().setValue("Test1-ear");
+ assertEquals("Seam web parent project was not initialized for Seam EAR
project.", "Test1", page.getRootSeamProject());
+ } finally {
+ dialog.close();
+ }
+ }
+}
\ No newline at end of file