Author: vyemialyanchyk
Date: 2010-03-16 14:49:29 -0400 (Tue, 16 Mar 2010)
New Revision: 20853
Added:
branches/hibernatetools-multiversion/hibernatetools/tests/
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
Removed:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
Modified:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/.classpath
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/mapping/interceptor/StatefulInterceptor.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - initial step
Copied:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test
(from rev 20798, trunk/hibernatetools/tests/org.hibernate.eclipse.console.test)
Modified:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/.classpath
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/.classpath 2010-03-12
13:16:53 UTC (rev 20798)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/.classpath 2010-03-16
18:49:29 UTC (rev 20853)
@@ -4,7 +4,7 @@
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib"
path="lib/hibernate-tools-tests.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/hsqldb.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/hsqldb.jar" sourcepath="C:/Bin/hsqldb"/>
<classpathentry exported="true" kind="lib"
path="lib/jaxen-1.1-beta-7.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/jmock-2.5.1/bsh-core-2.0b4.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/jmock-2.5.1/cglib-2.1_3-src.jar"/>
Deleted:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-03-12
13:16:53 UTC (rev 20798)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-03-16
18:49:29 UTC (rev 20853)
@@ -1,62 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.hibernate.eclipse.console.test
-Bundle-Version: 3.3.0.qualifier
-Bundle-ClassPath: org.hibernate.eclipse.console.test.test/,
- lib/hibernate-tools-tests.jar,
- lib/hsqldb.jar,
- lib/jaxen-1.1-beta-7.jar,
- lib/jmock-2.5.1/bsh-core-2.0b4.jar,
- lib/jmock-2.5.1/cglib-2.1_3-src.jar,
- lib/jmock-2.5.1/cglib-nodep-2.1_3.jar,
- lib/jmock-2.5.1/hamcrest-core-1.1.jar,
- lib/jmock-2.5.1/hamcrest-library-1.1.jar,
- lib/jmock-2.5.1/jmock-2.5.1.jar,
- lib/jmock-2.5.1/jmock-junit3-2.5.1.jar,
- lib/jmock-2.5.1/jmock-junit4-2.5.1.jar,
- lib/jmock-2.5.1/jmock-legacy-2.5.1.jar,
- lib/jmock-2.5.1/jmock-script-2.5.1.jar,
- lib/jmock-2.5.1/objenesis-1.0.jar
-Bundle-Vendor: %Bundle-Vendor.0
-Bundle-Localization: plugin
-Export-Package: org.hibernate.eclipse.console.test,
- org.hibernate.eclipse.console.test.project,
- org.hibernate.eclipse.console.test.project.xpl,
- org.hibernate.eclipse.console.test.utils,
- org.hibernate.eclipse.hqleditor.preferences,
- org.jmock,
- org.jmock.api,
- org.jmock.integration.junit3,
- org.jmock.integration.junit4,
- org.jmock.internal,
- org.jmock.internal.matcher,
- org.jmock.lib,
- org.jmock.lib.action,
- org.jmock.lib.concurrent,
- org.jmock.lib.concurrent.internal,
- org.jmock.lib.legacy,
- org.jmock.lib.script,
- org.jmock.syntax
-Require-Bundle: org.junit,
- org.eclipse.jdt.core,
- org.eclipse.jdt.launching,
- org.eclipse.ui,
- org.eclipse.jdt.ui,
- org.eclipse.core.runtime,
- org.eclipse.ui.ide,
- org.hibernate.eclipse,
- org.hibernate.eclipse.mapper,
- org.eclipse.jface.text,
- org.hibernate.eclipse.console,
- org.apache.ant,
- org.eclipse.ui.views,
- org.jboss.tools.hibernate.ui,
- org.jboss.tools.tests,
- org.eclipse.jdt.apt.core,
- org.eclipse.debug.ui,
- org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0"
-Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
-Eclipse-RegisterBuddy: org.hibernate.eclipse
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
Copied:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
(from rev 20806,
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF)
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
(rev 0)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-03-16
18:49:29 UTC (rev 20853)
@@ -0,0 +1,61 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.hibernate.eclipse.console.test
+Bundle-Version: 3.3.0.qualifier
+Bundle-ClassPath: org.hibernate.eclipse.console.test.test/,
+ lib/hibernate-tools-tests.jar,
+ lib/hsqldb.jar,
+ lib/jaxen-1.1-beta-7.jar,
+ lib/jmock-2.5.1/bsh-core-2.0b4.jar,
+ lib/jmock-2.5.1/cglib-2.1_3-src.jar,
+ lib/jmock-2.5.1/cglib-nodep-2.1_3.jar,
+ lib/jmock-2.5.1/hamcrest-core-1.1.jar,
+ lib/jmock-2.5.1/hamcrest-library-1.1.jar,
+ lib/jmock-2.5.1/jmock-2.5.1.jar,
+ lib/jmock-2.5.1/jmock-junit3-2.5.1.jar,
+ lib/jmock-2.5.1/jmock-junit4-2.5.1.jar,
+ lib/jmock-2.5.1/jmock-legacy-2.5.1.jar,
+ lib/jmock-2.5.1/jmock-script-2.5.1.jar,
+ lib/jmock-2.5.1/objenesis-1.0.jar
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Export-Package: org.hibernate.eclipse.console.test,
+ org.hibernate.eclipse.console.test.project,
+ org.hibernate.eclipse.console.test.project.xpl,
+ org.hibernate.eclipse.console.test.utils,
+ org.hibernate.eclipse.hqleditor.preferences,
+ org.jmock,
+ org.jmock.api,
+ org.jmock.integration.junit3,
+ org.jmock.integration.junit4,
+ org.jmock.internal,
+ org.jmock.internal.matcher,
+ org.jmock.lib,
+ org.jmock.lib.action,
+ org.jmock.lib.concurrent,
+ org.jmock.lib.concurrent.internal,
+ org.jmock.lib.legacy,
+ org.jmock.lib.script,
+ org.jmock.syntax
+Require-Bundle: org.junit,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.ui,
+ org.eclipse.jdt.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.ide,
+ org.hibernate.eclipse,
+ org.hibernate.eclipse.mapper,
+ org.eclipse.jface.text,
+ org.hibernate.eclipse.console,
+ org.apache.ant,
+ org.eclipse.ui.views,
+ org.jboss.tools.hibernate.ui,
+ org.eclipse.jdt.apt.core,
+ org.eclipse.debug.ui,
+ org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0"
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
+Eclipse-RegisterBuddy: org.hibernate.eclipse
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/mapping/interceptor/StatefulInterceptor.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/mapping/interceptor/StatefulInterceptor.java 2010-03-12
13:16:53 UTC (rev 20798)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/mapping/interceptor/StatefulInterceptor.java 2010-03-16
18:49:29 UTC (rev 20853)
@@ -7,7 +7,6 @@
import java.util.List;
import org.hibernate.EmptyInterceptor;
-import org.hibernate.Session;
import org.hibernate.type.Type;
public class StatefulInterceptor extends EmptyInterceptor {
Modified:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2010-03-12
13:16:53 UTC (rev 20798)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2010-03-16
18:49:29 UTC (rev 20853)
@@ -8,7 +8,6 @@
import junit.framework.TestCase;
import org.eclipse.core.runtime.FileLocator;
-import org.hibernate.SessionFactory;
import org.hibernate.console.ConcoleConfigurationAdapter;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
@@ -130,13 +129,11 @@
int factoryClosing = 0;
public int queryCreated;
- public void sessionFactoryClosing(ConsoleConfiguration configuration,
- SessionFactory aboutToCloseFactory) {
+ public void sessionFactoryClosing(ConsoleConfiguration configuration) {
factoryClosing++;
}
- public void sessionFactoryBuilt(ConsoleConfiguration ccfg,
- SessionFactory builtSessionFactory) {
+ public void sessionFactoryBuilt(ConsoleConfiguration ccfg) {
factoryBuilt++;
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2010-03-12
13:16:53 UTC (rev 20798)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2010-03-16
18:49:29 UTC (rev 20853)
@@ -29,11 +29,11 @@
added.add(root);
}
- public void sessionFactoryBuilt(ConsoleConfiguration ccfg, SessionFactory builtFactory)
{
+ public void sessionFactoryBuilt(ConsoleConfiguration ccfg) {
fail(ConsoleTestMessages.KnownConfigurationsTest_no_sf_should_be_build);
}
- public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory
closingFactory) {
+ public void sessionFactoryClosing(ConsoleConfiguration configuration) {
fail(ConsoleTestMessages.KnownConfigurationsTest_no_sf_should_be_closed);
}
Deleted:
branches/hibernatetools-multiversion/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 2010-03-12
13:16:53 UTC (rev 20798)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java 2010-03-16
18:49:29 UTC (rev 20853)
@@ -1,47 +0,0 @@
-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); //$NON-NLS-1$
- } 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();
- }
- }
-
-}
Copied:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
(from rev 20806,
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java)
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java
(rev 0)
+++
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePageTest.java 2010-03-16
18:49:29 UTC (rev 20853)
@@ -0,0 +1,58 @@
+package org.hibernate.eclipse.hqleditor.preferences;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+import junit.framework.TestCase;
+/**
+ * TODO Get rid of copy paste code
+ *
+ * @author eskimo
+ *
+ */
+public class HQLEditorPreferencePageTest extends TestCase {
+
+ public static Shell getActiveShell() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ }
+
+ public static PreferenceDialog createPreferenceDialog(String pageId) {
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
+ getActiveShell(), pageId, new String[] {pageId}, null);
+ dialog.setBlockOnOpen(false);
+ return dialog;
+ }
+
+ public void testHQLEditorPreferencePageShow() {
+ PreferenceDialog prefDialog =
+ 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); //$NON-NLS-1$
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+ public void testHQLEditorPreferencePagePerformOk() {
+ PreferenceDialog prefDialog =
+ createPreferenceDialog(HQLEditorPreferencePage.class.getName());
+
+ try {
+ prefDialog.setBlockOnOpen(false);
+ prefDialog.open();
+
+ HQLEditorPreferencePage selectedPage =
(HQLEditorPreferencePage)prefDialog.getSelectedPage();
+ selectedPage.performOk();
+ } finally {
+ prefDialog.close();
+ }
+ }
+
+}