Author: dgolovin
Date: 2007-12-28 20:47:41 -0500 (Fri, 28 Dec 2007)
New Revision: 5477
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/widget/
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/widget/editor/
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/build.properties
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/wizard/SeamProjectNewWizardTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1490
1. JUnit test for JBIDE-1490 was added
2. Javadoc comments were added
3. Coding style was improved to reduce amount of Checkstyle violations
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/build.properties
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/build.properties 2007-12-29 01:43:27 UTC
(rev 5476)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/build.properties 2007-12-29 01:47:41 UTC
(rev 5477)
@@ -1,9 +1,11 @@
bin.includes = META-INF/,\
seam-ui.jar,\
- projects/
+ projects/,\
+ seam/
source.seam-ui.jar = src/
jars.compile.order = seam-ui.jar
src.includes = src/,\
build.properties,\
META-INF/,\
- projects/
+ projects/,\
+ seam/
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 2007-12-29
01:43:27 UTC (rev 5476)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2007-12-29
01:47:41 UTC (rev 5477)
@@ -14,6 +14,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.seam.ui.test.preferences.SeamPreferencesPageTest;
import org.jboss.tools.seam.ui.test.hyperlink.SeamViewHyperlinkPartitionerTest;
import org.jboss.tools.seam.ui.test.view.SeamComponentsViewTest;
import org.jboss.tools.seam.ui.test.wizard.SeamFormNewWizardTest;
@@ -30,6 +31,7 @@
suite.addTestSuite(SeamComponentsViewTest.class);
suite.addTestSuite(SeamProjectNewWizardTest.class);
suite.addTestSuite(SeamFormNewWizardTest.class);
+ suite.addTestSuite(SeamPreferencesPageTest.class);
suite.addTestSuite(SeamViewHyperlinkPartitionerTest.class);
return suite;
}
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java 2007-12-29
01:47:41 UTC (rev 5477)
@@ -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.seam.ui.test.preferences;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.ui.preferences.SeamPreferencePage;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * @author eskimo
+ *
+ */
+
+public class SeamPreferencesPageTest extends TestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ // TODO Auto-generated method stub
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+ }
+
+ /**
+ * Test that preference page is showed up without errors
+ */
+ public void testShowSeamPreferencePage() {
+
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ SeamPreferencePage.SEAM_PREFERENCES_ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of SeamPreferencePage",
selectedPage instanceof SeamPreferencePage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testJiraJbide1490 () {
+ SeamRuntime[] seamRts = SeamRuntimeManager.getInstance().getRuntimes();
+
+ for (SeamRuntime seamRuntime : seamRts) {
+ SeamRuntimeManager.getInstance().removeRuntime(seamRuntime);
+ }
+
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ SeamPreferencePage.SEAM_PREFERENCES_ID);
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+ SeamPreferencePage selectedPage = (SeamPreferencePage)prefDialog.getSelectedPage();
+ selectedPage.performOk();
+ } finally {
+ prefDialog.close();
+ }
+
+ }
+
+}
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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 2007-12-29
01:43:27 UTC (rev 5476)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2007-12-29
01:47:41 UTC (rev 5477)
@@ -75,7 +75,7 @@
* first page of New Seam Project Wizard must enable Finish button.
* See
http://jira.jboss.com/jira/browse/JBIDE-1111
*/
- public void testSeamProjectNewWizardAllowsToFinishAtFirstPage() {
+ public void testJiraJbide1111() {
// Check Finish button
boolean canFinish = wizard.canFinish();
assertFalse("Finish button is enabled at first wizard page before all requerd
fileds are valid.", canFinish);