Author: dgolovin
Date: 2009-02-27 02:38:11 -0500 (Fri, 27 Feb 2009)
New Revision: 13867
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java
Log:
increase test coverage
Modified:
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 2009-02-27
07:27:52 UTC (rev 13866)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamPreferencesPageTest.java 2009-02-27
07:38:11 UTC (rev 13867)
@@ -11,63 +11,33 @@
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.seam.ui.preferences.SeamValidatorPreferencePage;
import org.jboss.tools.test.util.WorkbenchUtils;
+import org.jboss.tools.tests.PreferencePageTest;
-import junit.framework.TestCase;
-
/**
* @author eskimo
*
*/
-public class SeamPreferencesPageTest extends TestCase {
+public class SeamPreferencesPageTest extends PreferencePageTest {
/**
* 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();
- }
+ doDefaultTest(SeamPreferencePage.SEAM_PREFERENCES_ID, SeamPreferencePage.class);
}
/**
* Test that preference page is showed up without errors
*/
public void testShowSeamValidationPreferencePage() {
-
- PreferenceDialog prefDialog =
- WorkbenchUtils.createPreferenceDialog(
- SeamValidatorPreferencePage.PREF_ID);
-
- try {
- prefDialog.setBlockOnOpen(false);
- prefDialog.open();
-
- Object selectedPage = prefDialog.getSelectedPage();
- assertTrue("Selected page is not an instance of
SeamValidatorPreferencePage", selectedPage instanceof SeamValidatorPreferencePage);
- } finally {
- prefDialog.close();
- }
+ doDefaultTest(SeamValidatorPreferencePage.PREF_ID, SeamValidatorPreferencePage.class);
}
public void testJiraJbide1490 () {
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java 2009-02-27
07:27:52 UTC (rev 13866)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/preferences/VpeEditorPreferencesPageTest.java 2009-02-27
07:38:11 UTC (rev 13867)
@@ -14,39 +14,16 @@
import org.eclipse.jface.preference.PreferenceDialog;
import org.jboss.tools.test.util.WorkbenchUtils;
+import org.jboss.tools.tests.PreferencePageTest;
import org.jboss.tools.vpe.editor.preferences.ELVariablesPreferencePage;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
-public class VpeEditorPreferencesPageTest extends TestCase {
+public class VpeEditorPreferencesPageTest extends PreferencePageTest {
public void testVpeEditorPreferencesPageShow() {
- PreferenceDialog prefDialog =
- WorkbenchUtils.createPreferenceDialog(
- VpeEditorPreferencesPage.ID);
-
- try {
- prefDialog.setBlockOnOpen(false);
- prefDialog.open();
-
- Object selectedPage = prefDialog.getSelectedPage();
- assertTrue("Selected page is not an instance of
org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage", selectedPage
instanceof VpeEditorPreferencesPage); //$NON-NLS-1$
- } finally {
- prefDialog.close();
- }
+ doDefaultTest(VpeEditorPreferencesPage.ID, VpeEditorPreferencesPage.class);
//$NON-NLS-1$
}
public void testVpeEditorELPreferencesPageShow() {
- PreferenceDialog prefDialog =
- WorkbenchUtils.createPreferenceDialog(
- ELVariablesPreferencePage.ID);
-
- try {
- prefDialog.setBlockOnOpen(false);
- prefDialog.open();
-
- Object selectedPage = prefDialog.getSelectedPage();
- assertTrue("Selected page is not an instance of
org.jboss.tools.vpe.editor.preferences.ELVariablesPreferencePage", selectedPage
instanceof ELVariablesPreferencePage); //$NON-NLS-1$
- } finally {
- prefDialog.close();
- }
+ doDefaultTest(ELVariablesPreferencePage.ID, ELVariablesPreferencePage.class);
//$NON-NLS-1$
}
}