Author: dgolovin
Date: 2008-06-06 21:03:38 -0400 (Fri, 06 Jun 2008)
New Revision: 8623
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
Log:
simple test for HQL editor preference page added
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-06-07
00:37:56 UTC (rev 8622)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2008-06-07
01:03:38 UTC (rev 8623)
@@ -11,7 +11,8 @@
Bundle-Localization: plugin
Export-Package: org.hibernate.eclipse.console.test,
org.hibernate.eclipse.console.test.mappingproject,
- org.hibernate.eclipse.console.test.xpl
+ org.hibernate.eclipse.console.test.xpl,
+ org.hibernate.eclipse.hqleditor.preferences
Require-Bundle: org.junit,
org.eclipse.jdt.core,
org.eclipse.core.resources,
@@ -31,7 +32,8 @@
org.eclipse.ui.views,
org.jboss.tools.hibernate.ui.view,
org.eclipse.ui.editors,
- org.eclipse.debug.core
+ org.eclipse.debug.core,
+ org.jboss.tools.tests;bundle-version="2.0.0"
Eclipse-LazyStart: true
Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
Eclipse-RegisterBuddy: org.hibernate.eclipse
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-06-07
00:37:56 UTC (rev 8622)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2008-06-07
01:03:38 UTC (rev 8623)
@@ -3,6 +3,7 @@
import java.io.IOException;
import org.hibernate.eclipse.console.test.mappingproject.HibernateAllMappingTests;
+import org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePageTest;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -19,18 +20,19 @@
suite.addTestSuite( ConsoleConfigurationTest.class );
suite.addTestSuite( JavaFormattingTest.class );
suite.addTestSuite( RefactoringTest.class );
-
+
suite.addTestSuite( HibernateAllMappingTests.class );
+ suite.addTestSuite(HQLEditorPreferencePageTest.class);
// core tests
//Properties properties = new Properties();
//properties.load(ConsolePluginAllTests.class.getResourceAsStream("plugintest-hibernate.properties"));
-
+
//System.getProperties().putAll(properties);
-
+
//suite.addTest(org.hibernate.tool.ToolAllTests.suite() );
+
-
return suite;
}
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
(rev 0)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java 2008-06-07
01:03:38 UTC (rev 8623)
@@ -0,0 +1,47 @@
+package org.hibernate.eclipse.hqleditor.preferences;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+import junit.framework.TestCase;
+/**
+ * TODO Get rid of copy paste code
+ *
+ * @author eskimo
+ *
+ */
+public class HQLEditorPreferencePageTest extends TestCase {
+
+ public void testHQLEditorPreferencePageShow() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ HQLEditorPreferencePage.class.getName());
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ Object selectedPage = prefDialog.getSelectedPage();
+ assertTrue("Selected page is not an instance of HQLEditorPreferencePage",
selectedPage instanceof HQLEditorPreferencePage);
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testHQLEditorPreferencePagePerformOk() {
+ PreferenceDialog prefDialog =
+ WorkbenchUtils.createPreferenceDialog(
+ HQLEditorPreferencePage.class.getName());
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ HQLEditorPreferencePage selectedPage =
(HQLEditorPreferencePage)prefDialog.getSelectedPage();
+ selectedPage.performOk();
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+}
Property changes on:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date