Author: dgolovin
Date: 2008-12-04 21:26:10 -0500 (Thu, 04 Dec 2008)
New Revision: 12292
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
Log:
fix test errors in seam ui tests
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-12-04
21:47:05 UTC (rev 12291)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-12-05
02:26:10 UTC (rev 12292)
@@ -44,9 +44,9 @@
IProject project = null;
static String PROJECT_NAME = "TestSeamSettingsPreferencesPage";
- static String MODEL_PACKAGE_NAME = "org.domain." + PROJECT_NAME +
".entity";
- static String ACTION_PACKAGE_NAME = "org.domain." + PROJECT_NAME +
".session";
- static String TEST_PACKAGE_NAME = "org.domain." + PROJECT_NAME +
".test";
+ static String MODEL_PACKAGE_NAME = ("org.domain." + PROJECT_NAME +
".entity").toLowerCase();
+ static String ACTION_PACKAGE_NAME = ("org.domain." + PROJECT_NAME +
".session").toLowerCase();
+ static String TEST_PACKAGE_NAME = ("org.domain." + PROJECT_NAME +
".test").toLowerCase();
static String RUNTIME_NAME = "Seam 1.2.0 Seam Settings Page Test";
public SeamSettingsPreferencesPageTest() {
@@ -108,13 +108,13 @@
assertEquals("Seam settings version 1.1 property is not set",
pref.get(ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION, ""),
ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION_1_1);
assertEquals("Seam runtime property is not set",
pref.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, ""), RUNTIME_NAME);
assertEquals("Seam deployment type property is not set",
pref.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, ""),
ISeamFacetDataModelProperties.DEPLOY_AS_WAR);
- assertEquals("Model package name property is not set",
pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, ""),
MODEL_PACKAGE_NAME);
+ assertEquals("Model package name property is not set",
MODEL_PACKAGE_NAME,pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
""));
assertEquals("Model source folder property is not set",
pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, ""),
"/" + PROJECT_NAME + "/src");
- assertEquals("Action package name property is not set",
pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, ""),
ACTION_PACKAGE_NAME);
+ assertEquals("Action package name property is not set", ACTION_PACKAGE_NAME,
pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, ""));
assertEquals("Action source folder property is not set",
pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, ""),
"/" + PROJECT_NAME + "/src");
assertEquals("Seam 'create tests' property is not set",
pref.get(ISeamFacetDataModelProperties.TEST_CREATING, ""), "true");
assertEquals("Test project property is not set",
pref.get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, ""), PROJECT_NAME);
- assertEquals("Test package name property is not set",
pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, ""),
TEST_PACKAGE_NAME);
+ assertEquals("Test package name property is not set", TEST_PACKAGE_NAME,
pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, ""));
assertEquals("Test source folder property is not set",
pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, ""), "/" +
PROJECT_NAME + "/src");
assertEquals("View folder property is not set",
pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, ""), "/" +
PROJECT_NAME);
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java 2008-12-04
21:47:05 UTC (rev 12291)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/PackageNamesTest.java 2008-12-05
02:26:10 UTC (rev 12292)
@@ -19,6 +19,7 @@
import org.jboss.tools.common.util.WorkbenchUtils;
import org.jboss.tools.seam.ui.ISeamUiConstants;
import org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage;
+import org.jboss.tools.test.util.JobUtils;
/**
* @author dazarov
* JBIDE-3254 tests
@@ -85,21 +86,26 @@
private SeamInstallWizardPage startCreateSeamWizard(String projectName){
wizard =
(NewProjectDataModelFacetWizard)WorkbenchUtils.findWizardByDefId(ISeamUiConstants.NEW_SEAM_PROJECT_WIZARD_ID);
+ wizard.getDataModel().setStringProperty("IProjectCreationPropertiesNew.PROJECT_NAME",
projectName);
+
WizardDialog dialog = new WizardDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
wizard);
- wizard.getDataModel().setStringProperty("IProjectCreationPropertiesNew.PROJECT_NAME",
projectName);
+
dialog.create();
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ // delay is needed to wait for dialog initialization is finished
+ // such as default runtime and configuration for seam wizard
+ JobUtils.delay(2000);
startSeamPrjWzPg = wizard.getStartingPage();
assertNotNull("Cannot create seam start wizard page", startSeamPrjWzPg);
-
IWizardPage webModuleWizPg = wizard.getNextPage(startSeamPrjWzPg);
assertNotNull("Cannot create dynamic web project wizard
page",webModuleWizPg);
IWizardPage jsfCapabilitiesWizPg = wizard.getNextPage(webModuleWizPg);
assertNotNull("Cannot create JSF capabilities wizard
page",jsfCapabilitiesWizPg);
SeamInstallWizardPage seamWizPg =
(SeamInstallWizardPage)wizard.getNextPage(jsfCapabilitiesWizPg);
assertNotNull("Cannot create seam facet wizard page",seamWizPg);
-
return seamWizPg;
}
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-12-04
21:47:05 UTC (rev 12291)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-12-05
02:26:10 UTC (rev 12292)
@@ -34,6 +34,7 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.ui.ISeamUiConstants;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.framework.Bundle;
/**
@@ -65,20 +66,26 @@
@Override
protected void setUp() throws Exception {
super.setUp();
+
+ }
+
+ /**
+ *
+ */
+ public void testSeamProjectNewWizardInstanceIsCreated() {
wizard =
(NewProjectDataModelFacetWizard)WorkbenchUtils.findWizardByDefId(ISeamUiConstants.NEW_SEAM_PROJECT_WIZARD_ID);
WizardDialog dialog = new WizardDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
wizard);
dialog.create();
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ JobUtils.delay(2000);
+ boolean canFinish = wizard.canFinish();
+ assertFalse("Finish button is enabled at first wizard page before all requerd
fileds are valid.", canFinish);
startSeamPrjWzPg = wizard.getStartingPage();
wizard.getDataModel().setStringProperty("IProjectCreationPropertiesNew.PROJECT_NAME","testName");
assertNotNull("Cannot create seam start wizard page", startSeamPrjWzPg);
- }
-
- /**
- *
- */
- public void testSeamProjectNewWizardInstanceIsCreated() {
IWizardPage webModuleWizPg = wizard.getNextPage(startSeamPrjWzPg);
assertNotNull("Cannot create dynamic web project wizard
page",webModuleWizPg);
IWizardPage jsfCapabilitiesWizPg = wizard.getNextPage(webModuleWizPg);
@@ -94,10 +101,18 @@
* See
http://jira.jboss.com/jira/browse/JBIDE-1111
*/
public void testJiraJbide1111() {
+ wizard =
(NewProjectDataModelFacetWizard)WorkbenchUtils.findWizardByDefId(ISeamUiConstants.NEW_SEAM_PROJECT_WIZARD_ID);
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ wizard);
+ dialog.create();
+ dialog.setBlockOnOpen(false);
+
+ startSeamPrjWzPg = wizard.getStartingPage();
+ wizard.getDataModel().setStringProperty("IProjectCreationPropertiesNew.PROJECT_NAME","testName");
+ assertNotNull("Cannot create seam start wizard page", startSeamPrjWzPg);
// Check Finish button
- boolean canFinish = wizard.canFinish();
- assertFalse("Finish button is enabled at first wizard page before all requerd
fileds are valid.", canFinish);
- wizard.performCancel();
+
// Create JBoss AS Runtime, Server, HSQL DB Driver
try {
@@ -120,21 +135,21 @@
} catch (IOException e) {
fail("Cannot create Seam Runtime to test New Seam Project Wizard. " +
e.getMessage());
}
+ dialog.open();
+ JobUtils.delay(2000);
- try {
- setUp();
- } catch (Exception e) {
- fail("Cannot create New Seam Project Wizard. " + e.getMessage());
- }
-
// Check Finish button
- canFinish = wizard.canFinish();
+ boolean canFinish = wizard.canFinish();
assertFalse("Finish button is enabled at first wizard page before user entered the
project name.", canFinish);
-
+ wizard.performCancel();
+
// Set project name
IDataModel model = wizard.getDataModel();
model.setProperty(IFacetDataModelProperties.FACET_PROJECT_NAME,
"testSeamProjectNewWizardAllowsToFinishAtFirstPageProjectName");
+ dialog.open();
+ JobUtils.delay(2000);
+
// Check Finish button
canFinish = wizard.canFinish();
assertTrue("Finish button is disabled at first wizard page in spite of created
JBoss AS Runtime, Server, DB Connection and Seam Runtime and valid project name.",
canFinish);