Author: dgeraskov
Date: 2011-07-22 08:18:13 -0400 (Fri, 22 Jul 2011)
New Revision: 33135
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9392
Opened query page view creates jdbc connection. Need to close it before
Modified:
trunk/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 2011-07-22
11:21:06 UTC (rev 33134)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2011-07-22
12:18:13 UTC (rev 33135)
@@ -5,6 +5,10 @@
import junit.framework.TestCase;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
@@ -18,6 +22,7 @@
import org.hibernate.console.QueryInputModel;
import org.hibernate.console.QueryPage;
import org.hibernate.eclipse.console.test.launchcfg.TestConsoleConfigurationPreferences;
+import org.hibernate.eclipse.console.views.QueryPageTabView;
import org.hibernate.impl.AbstractQueryImpl;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.KeyValue;
@@ -152,6 +157,13 @@
model.addParameter(paramA);
model.addParameter(paramB);
model.addParameter(paramOrdered);
+
+ //fix for
https://issues.jboss.org/browse/JBIDE-9392
+ //the view calls jdbc connection
+ IWorkbenchPage activePage =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IViewPart view = activePage.findView(QueryPageTabView.ID);
+ activePage.hideView(view);
+
QueryPage qp = consoleCfg.executeHQLQuery("select count(*) from java.awt.Button
where 1 in ( ?, :a, :b )", model); //$NON-NLS-1$
assertNotNull(qp);
try{