Author: dgeraskov
Date: 2011-08-05 07:23:11 -0400 (Fri, 05 Aug 2011)
New Revision: 33626
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
Close the view if it is opened and dispose
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-08-05
10:38:33 UTC (rev 33625)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2011-08-05
11:23:11 UTC (rev 33626)
@@ -7,7 +7,6 @@
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;
@@ -123,6 +122,15 @@
}
public void testHQLListParameters() throws SecurityException, NoSuchFieldException,
IllegalArgumentException, IllegalAccessException {
+ //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);
+ if (view != null){
+ activePage.hideView(view);
+ view.dispose();
+ }
+
consoleCfg.build();
Configuration c = consoleCfg.getConfiguration();
Mappings mappings = c.createMappings();
@@ -158,11 +166,7 @@
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);
+ //activePage.hideView(view);
QueryPage qp = consoleCfg.executeHQLQuery("select count(*) from java.awt.Button
where 1 in ( ?, :a, :b )", model); //$NON-NLS-1$
assertNotNull(qp);