Revision: 5897
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=5897&view=rev
Author: manningr
Date: 2010-09-19 20:09:15 +0000 (Sun, 19 Sep 2010)
Log Message:
-----------
Remove unneeded test classes and replaced one with a mockito mock.
Modified Paths:
--------------
trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/MockApplication.java
trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSession.java
Removed Paths:
-------------
trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/plugin/
trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanel.java
trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanelFactory.java
trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/fw/sql/
Modified: trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/MockApplication.java
===================================================================
--- trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/MockApplication.java 2010-09-19 14:10:32 UTC (rev 5896)
+++ trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/MockApplication.java 2010-09-19 20:09:15 UTC (rev 5897)
@@ -24,8 +24,8 @@
import net.sourceforge.squirrel_sql.client.action.ActionCollection;
import net.sourceforge.squirrel_sql.client.gui.WindowManager;
-import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DesktopStyle;
import net.sourceforge.squirrel_sql.client.gui.db.DataCache;
+import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.DesktopStyle;
import net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrame;
import net.sourceforge.squirrel_sql.client.plugin.IPlugin;
import net.sourceforge.squirrel_sql.client.plugin.IPluginManager;
@@ -34,7 +34,6 @@
import net.sourceforge.squirrel_sql.client.preferences.SquirrelPreferences;
import net.sourceforge.squirrel_sql.client.resources.SquirrelResources;
import net.sourceforge.squirrel_sql.client.session.ISQLEntryPanelFactory;
-import net.sourceforge.squirrel_sql.client.session.MockSQLEntryPanelFactory;
import net.sourceforge.squirrel_sql.client.session.MockSessionManager;
import net.sourceforge.squirrel_sql.client.session.SessionManager;
import net.sourceforge.squirrel_sql.client.session.mainpanel.SQLHistory;
@@ -51,7 +50,6 @@
SquirrelResources resource = null;
SquirrelPreferences prefs = null;
SQLHistory history = null;
- MockSQLEntryPanelFactory sqlEntryPanelFactory = null;
IMessageHandler messageHandler = null;
MockSessionManager sessionHandler = null;
FontInfoStore fontInfoStore = null;
@@ -64,7 +62,6 @@
pluginManager = new PluginManager(this);
actions = new ActionCollection(this);
history = new SQLHistory();
- sqlEntryPanelFactory = new MockSQLEntryPanelFactory();
messageHandler = new MockMessageHandler();
sessionHandler = new MockSessionManager(this);
fontInfoStore = new FontInfoStore();
@@ -152,7 +149,7 @@
}
public ISQLEntryPanelFactory getSQLEntryPanelFactory() {
- return sqlEntryPanelFactory;
+ return null;
}
public SQLHistory getSQLHistory() {
Deleted: trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanel.java
===================================================================
--- trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanel.java 2010-09-19 14:10:32 UTC (rev 5896)
+++ trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanel.java 2010-09-19 20:09:15 UTC (rev 5897)
@@ -1,252 +0,0 @@
-package net.sourceforge.squirrel_sql.client.session;
-
-import java.awt.Font;
-import java.awt.event.MouseListener;
-
-import javax.swing.*;
-import javax.swing.event.CaretListener;
-import javax.swing.event.UndoableEditListener;
-import javax.swing.text.JTextComponent;
-import javax.swing.undo.UndoManager;
-
-import net.sourceforge.squirrel_sql.fw.id.IIdentifier;
-import net.sourceforge.squirrel_sql.client.session.mainpanel.IUndoHandler;
-
-public class MockSQLEntryPanel implements ISQLEntryPanel {
-
- ISession _session = null;
-
- public MockSQLEntryPanel(ISession session) {
- _session = session;
- }
-
- public void addCaretListener(CaretListener lis) {
-
-
- }
-
- public void addMouseListener(MouseListener lis) {
-
-
- }
-
- public void addSQLTokenListener(SQLTokenListener tl) {
-
-
- }
-
- public void addToSQLEntryAreaMenu(JMenu menu) {
-
-
- }
-
- public JMenuItem addToSQLEntryAreaMenu(Action action) {
- return new JMenuItem();
- }
-
- public void addUndoableEditListener(UndoableEditListener listener) {
-
-
- }
-
- public void appendText(String text) {
-
-
- }
-
- public void appendText(String sqlScript, boolean select) {
-
-
- }
-
- public void dispose() {
-
-
- }
-
- public int[] getBoundsOfSQLToBeExecuted() {
-
- return null;
- }
-
- public int getCaretLineNumber() {
-
- return 0;
- }
-
- public int getCaretLinePosition() {
-
- return 0;
- }
-
- public int getCaretPosition() {
-
- return 0;
- }
-
- public boolean getDoesTextComponentHaveScroller() {
-
- return false;
- }
-
- public String getSQLToBeExecuted() {
-
- return null;
- }
-
- public String getSelectedText() {
-
- return null;
- }
-
- public int getSelectionEnd() {
-
- return 0;
- }
-
- public int getSelectionStart() {
-
- return 0;
- }
-
- public String getText() {
-
- return null;
- }
-
- public JTextComponent getTextComponent() {
- return new JTextArea();
- }
-
- public boolean hasFocus() {
-
- return false;
- }
-
- public boolean hasOwnUndoableManager() {
-
- return false;
- }
-
- public void moveCaretToNextSQLBegin() {
-
-
- }
-
- public void moveCaretToPreviousSQLBegin() {
-
-
- }
-
- public void removeCaretListener(CaretListener lis) {
-
-
- }
-
- public void removeMouseListener(MouseListener lis) {
-
-
- }
-
- public void removeSQLTokenListener(SQLTokenListener tl) {
-
-
- }
-
- public void removeUndoableEditListener(UndoableEditListener listener) {
-
-
- }
-
- public void replaceSelection(String sqlScript) {
-
-
- }
-
- public void requestFocus() {
-
-
- }
-
- public void selectCurrentSql() {
-
-
- }
-
- public void setCaretPosition(int pos) {
-
-
- }
-
- public void setFont(Font font) {
-
-
- }
-
- public void setSelectionEnd(int pos) {
-
-
- }
-
- public void setSelectionStart(int pos) {
-
-
- }
-
- public void setTabSize(int tabSize) {
-
-
- }
-
- public void setText(String sqlScript) {
-
-
- }
-
- public void setText(String sqlScript, boolean select) {
-
-
- }
-
- public void addRedoUndoActionsToSQLEntryAreaMenu(Action undo, Action redo) {
-
-
- }
-
- public void setUndoManager(UndoManager manager) {
-
-
- }
-
- public IIdentifier getIdentifier() {
-
- return null;
- }
-
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISQLEntryPanel#getSession()
- */
- public ISession getSession() {
-
- return null;
- }
-
-
- @Override
- public IUndoHandler createUndoHandler()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- @Override
- public String getWordAtCursor()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- @Override
- public JScrollPane createScrollPane(JTextComponent textComponent)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
Deleted: trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanelFactory.java
===================================================================
--- trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanelFactory.java 2010-09-19 14:10:32 UTC (rev 5896)
+++ trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSQLEntryPanelFactory.java 2010-09-19 20:09:15 UTC (rev 5897)
@@ -1,33 +0,0 @@
-package net.sourceforge.squirrel_sql.client.session;
-
-import java.util.HashMap;
-
-public class MockSQLEntryPanelFactory implements ISQLEntryPanelFactory
-{
-
- MockSQLEntryPanel panel = null;
-
- public MockSQLEntryPanelFactory()
- {
-
- }
-
- /**
- * @param session
- * @return
- */
- public ISQLEntryPanel createSQLEntryPanel(ISession session)
- {
- panel = new MockSQLEntryPanel(session);
- return panel;
- }
-
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISQLEntryPanelFactory#createSQLEntryPanel(net.sourceforge.squirrel_sql.client.session.ISession, java.util.HashMap)
- */
- public ISQLEntryPanel createSQLEntryPanel(ISession session, HashMap<String, Object> props)
- {
- return createSQLEntryPanel(session);
- }
-
-}
Modified: trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSession.java
===================================================================
--- trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSession.java 2010-09-19 14:10:32 UTC (rev 5896)
+++ trunk/sql12/squirrelsql-integration-environment/src/test/java/net/sourceforge/squirrel_sql/client/session/MockSession.java 2010-09-19 20:09:15 UTC (rev 5897)
@@ -18,6 +18,8 @@
*/
package net.sourceforge.squirrel_sql.client.session;
+import static org.mockito.Mockito.when;
+
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@@ -31,10 +33,10 @@
import net.sourceforge.squirrel_sql.client.gui.builders.UIFactory;
import net.sourceforge.squirrel_sql.client.gui.db.ISQLAliasExt;
import net.sourceforge.squirrel_sql.client.gui.db.SQLAlias;
+import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget;
+import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.SessionTabWidget;
import net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame;
import net.sourceforge.squirrel_sql.client.gui.session.SessionPanel;
-import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.SessionTabWidget;
-import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget;
import net.sourceforge.squirrel_sql.client.plugin.IPlugin;
import net.sourceforge.squirrel_sql.client.preferences.SquirrelPreferences;
import net.sourceforge.squirrel_sql.client.session.mainpanel.IMainPanelTab;
@@ -47,7 +49,6 @@
import net.sourceforge.squirrel_sql.fw.sql.ISQLConnection;
import net.sourceforge.squirrel_sql.fw.sql.ISQLDatabaseMetaData;
import net.sourceforge.squirrel_sql.fw.sql.ISQLDriver;
-import net.sourceforge.squirrel_sql.fw.sql.MockSQLDriver;
import net.sourceforge.squirrel_sql.fw.sql.QueryTokenizer;
import net.sourceforge.squirrel_sql.fw.sql.SQLConnection;
import net.sourceforge.squirrel_sql.fw.util.ExceptionFormatter;
@@ -55,412 +56,499 @@
import net.sourceforge.squirrel_sql.fw.util.MockMessageHandler;
import net.sourceforge.squirrel_sql.mo.sql.MockDatabaseMetaData;
+import org.mockito.Mockito;
+
import com.mockobjects.sql.MockConnection2;
-public class MockSession implements ISession {
+public class MockSession implements ISession
+{
- ISQLAliasExt sqlAlias = null;
- ISQLDriver sqlDriver = null;
- SQLConnection con = null;
- MockDatabaseMetaData mdata = null;
- MockApplication app = null;
- SessionProperties props = null;
- IMessageHandler messageHandler = null;
- SchemaInfo schemaInfo = null;
- SessionPanel sessionPanel = null;
- SquirrelPreferences prefs = null;
- UidIdentifier id = null;
- boolean closed;
-
- ISQLPanelAPI panelApi = AppTestUtil.getEasyMockSqlPanelApi();
-
- // These tell the Dialect test runner where tables that is creates can be
- // found.
- private String defaultCatalog = "";
- private String defaultSchema = "";
-
- public MockSession() {
- init(true);
- }
-
- public MockSession(String className,
- String jdbcUrl,
- String u,
- String p)
- throws Exception
- {
- System.out.println("Attempting to load class="+className);
- Class.forName(className);
- System.out.println("Getting connection for url="+jdbcUrl);
- Connection c = DriverManager.getConnection(jdbcUrl, u, p);
- sqlDriver = new MockSQLDriver(className, jdbcUrl);
- con = new SQLConnection(c, null, sqlDriver);
- init(false);
- sqlAlias.setUrl(jdbcUrl);
- sqlAlias.setUserName(u);
- sqlAlias.setPassword(p);
- sqlDriver.setDriverClassName(className);
- }
-
- private void init(boolean initConnection) {
- if (initConnection) {
- //MockConnection2 mockCon = getMockConnection();
- con = new SQLConnection(getMockConnection(), null, sqlDriver);
- }
- id = new UidIdentifier();
- messageHandler = new MockMessageHandler();
- props = new SessionProperties();
- props.setLoadSchemasCatalogs(false);
- app = new MockApplication();
- app.getMockSessionManager().setSession(this);
- sqlAlias = new SQLAlias(new UidIdentifier());
- schemaInfo = new SchemaInfo(app);
- schemaInfo.initialLoad(this);
- prefs = app.getSquirrelPreferences();
- try {
- UIFactory.initialize(prefs, app);
- } catch (Throwable e) {
-
- }
- // If we are connecting to a database, then this is fine. However, when
- // using MockObjects, this is problematic since there are many
- // unimplemented methods in the MockObjects implementation that are
- // required by this.
- if (!initConnection) {
- //sessionPanel = new SessionPanel(this);
- }
- }
-
- private MockConnection2 getMockConnection() {
- MockConnection2 result = new MockConnection2();
- sqlDriver = new MockSQLDriver("JUnitTestClassName", "JUnitJDBCURL");
- mdata = new MockDatabaseMetaData();
- mdata.setupDriverName("junit");
- result.setupMetaData(mdata);
- return result;
- }
-
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#getExceptionFormatter()
- */
- public ExceptionFormatter getExceptionFormatter() {
-
- System.err.println("MockSession.getExceptionFormatter: stub not yet implemented");
- return null;
- }
+ ISQLAliasExt sqlAlias = null;
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#setExceptionFormatter(net.sourceforge.squirrel_sql.fw.util.ExceptionFormatter)
- */
- public void setExceptionFormatter(ExceptionFormatter formatter) {
-
- System.err.println("MockSession.setExceptionFormatter: stub not yet implemented");
- }
+ ISQLDriver sqlDriver = Mockito.mock(ISQLDriver.class);
- public boolean isClosed() {
- return closed;
- }
+ SQLConnection con = null;
- public IApplication getApplication() {
- return app;
- }
+ MockDatabaseMetaData mdata = null;
- public ISQLConnection getSQLConnection() {
- return con;
- }
+ MockApplication app = null;
- public ISQLDriver getDriver() {
- return sqlDriver;
- }
+ SessionProperties props = null;
- public ISQLAliasExt getAlias() {
- return sqlAlias;
- }
+ IMessageHandler messageHandler = null;
- public SessionProperties getProperties() {
- return props;
- }
+ SchemaInfo schemaInfo = null;
- public void commit() {
- try {
- con.commit();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
+ SessionPanel sessionPanel = null;
- public void rollback() {
- try {
- con.rollback();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
+ SquirrelPreferences prefs = null;
- public void close() throws SQLException {
- if (!closed) {
- con.close();
- }
- }
+ UidIdentifier id = null;
- public void closeSQLConnection() throws SQLException {
- con.close();
- }
+ boolean closed;
- public void setSessionInternalFrame(SessionInternalFrame sif) {
-
- System.err.println("MockSession.setSessionInternalFrame: stub not yet implemented");
- }
+ ISQLPanelAPI panelApi = AppTestUtil.getEasyMockSqlPanelApi();
- public void reconnect() {
-
- System.err.println("MockSession.reconnect: stub not yet implemented");
- }
+ // These tell the Dialect test runner where tables that it creates can be found.
+ private String defaultCatalog = "";
- public Object getPluginObject(IPlugin plugin, String key) {
-
- System.err.println("MockSession.getPluginObject: stub not yet implemented");
- return null;
- }
+ private String defaultSchema = "";
- public Object putPluginObject(IPlugin plugin, String key, Object obj) {
-
- System.err.println("MockSession.putPluginObject: stub not yet implemented");
- return null;
- }
+ public MockSession()
+ {
+ init(true);
+ }
- public void removePluginObject(IPlugin plugin, String key) {
-
- System.err.println("MockSession.removePluginObject: stub not yet implemented");
- }
+ public MockSession(String className, String jdbcUrl, String u, String p) throws Exception
+ {
+ System.out.println("Attempting to load class=" + className);
+ Class.forName(className);
+ System.out.println("Getting connection for url=" + jdbcUrl);
+ Connection c = DriverManager.getConnection(jdbcUrl, u, p);
+ initMockDriver(className, jdbcUrl);
+ con = new SQLConnection(c, null, sqlDriver);
+ init(false);
+ sqlAlias.setUrl(jdbcUrl);
+ sqlAlias.setUserName(u);
+ sqlAlias.setPassword(p);
+ sqlDriver.setDriverClassName(className);
+ }
- public void setMessageHandler(IMessageHandler handler) {
- messageHandler = handler;
- }
+ private void initMockDriver(String className, String jdbcUrl)
+ {
+ when(sqlDriver.getDriverClassName()).thenReturn(className);
+ when(sqlDriver.getUrl()).thenReturn(jdbcUrl);
+ when(sqlDriver.getName()).thenReturn("MockitoSQLDriver");
+ }
- public IMessageHandler getMessageHandler() {
- return messageHandler;
- }
+ private void init(boolean initConnection)
+ {
+ if (initConnection)
+ {
+ // MockConnection2 mockCon = getMockConnection();
+ con = new SQLConnection(getMockConnection(), null, sqlDriver);
+ }
+ id = new UidIdentifier();
+ messageHandler = new MockMessageHandler();
+ props = new SessionProperties();
+ props.setLoadSchemasCatalogs(false);
+ app = new MockApplication();
+ app.getMockSessionManager().setSession(this);
+ sqlAlias = new SQLAlias(new UidIdentifier());
+ schemaInfo = new SchemaInfo(app);
+ schemaInfo.initialLoad(this);
+ prefs = app.getSquirrelPreferences();
+ try
+ {
+ UIFactory.initialize(prefs, app);
+ }
+ catch (Throwable e)
+ {
- public SessionPanel getSessionSheet() {
- return sessionPanel;
- }
+ }
+ // If we are connecting to a database, then this is fine. However, when
+ // using MockObjects, this is problematic since there are many
+ // unimplemented methods in the MockObjects implementation that are
+ // required by this.
+ if (!initConnection)
+ {
+ // sessionPanel = new SessionPanel(this);
+ }
+ }
- public SessionInternalFrame getSessionInternalFrame() {
-
- System.err.println("MockSession.getSessionInternalFrame: stub not yet implemented");
- return null;
- }
+ private MockConnection2 getMockConnection()
+ {
+ MockConnection2 result = new MockConnection2();
+ initMockDriver("JUnitTestClassName", "JUnitJDBCURL");
+ mdata = new MockDatabaseMetaData();
+ mdata.setupDriverName("junit");
+ result.setupMetaData(mdata);
+ return result;
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.squirrel_sql.client.session.ISession#getSchemaInfo()
- */
- public SchemaInfo getSchemaInfo() {
- return schemaInfo;
- }
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#getExceptionFormatter()
+ */
+ public ExceptionFormatter getExceptionFormatter()
+ {
- public void selectMainTab(int tabIndex) throws IllegalArgumentException {
-
- System.err.println("MockSession.selectMainTab: stub not yet implemented");
- }
+ System.err.println("MockSession.getExceptionFormatter: stub not yet implemented");
+ return null;
+ }
- public int addMainTab(IMainPanelTab tab) {
-
- System.err.println("MockSession.addMainTab: stub not yet implemented");
- return 0;
- }
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#setExceptionFormatter(net.sourceforge.squirrel_sql.fw.util.ExceptionFormatter)
+ */
+ public void setExceptionFormatter(ExceptionFormatter formatter)
+ {
- public void addToStatusBar(JComponent comp) {
-
- System.err.println("MockSession.addToStatusBar: stub not yet implemented");
- }
+ System.err.println("MockSession.setExceptionFormatter: stub not yet implemented");
+ }
- public void removeFromStatusBar(JComponent comp) {
-
- System.err.println("MockSession.removeFromStatusBar: stub not yet implemented");
- }
+ public boolean isClosed()
+ {
+ return closed;
+ }
- public String getTitle() {
-
- System.err.println("MockSession.getTitle: stub not yet implemented");
- return null;
- }
+ public IApplication getApplication()
+ {
+ return app;
+ }
- public String getDatabaseProductName() {
- String result = null;
- try {
- result = con.getSQLMetaData().getDatabaseProductName();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- return result;
- }
+ public ISQLConnection getSQLConnection()
+ {
+ return con;
+ }
- public void addToToolbar(Action action) {
-
- System.err.println("MockSession.addToToolbar: stub not yet implemented");
- }
+ public ISQLDriver getDriver()
+ {
+ return sqlDriver;
+ }
- public void addSeparatorToToolbar() {
-
- System.err.println("MockSession.addSeparatorToToolbar: stub not yet implemented");
- }
+ public ISQLAliasExt getAlias()
+ {
+ return sqlAlias;
+ }
- public IParserEventsProcessor getParserEventsProcessor(
- IIdentifier sqlEntryPanelIdentifier)
- {
-
- System.err.println("MockSession.getParserEventsProcessor: stub not yet implemented");
- return null;
- }
+ public SessionProperties getProperties()
+ {
+ return props;
+ }
- public void setActiveSessionWindow(
- SessionTabWidget activeActiveSessionWindow) {
-
- System.err.println("MockSession.setActiveSessionWindow: stub not yet implemented");
- }
+ public void commit()
+ {
+ try
+ {
+ con.commit();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
- public SessionTabWidget getActiveSessionWindow() {
-
- System.err.println("MockSession.getActiveSessionWindow: stub not yet implemented");
- return null;
- }
+ public void rollback()
+ {
+ try
+ {
+ con.rollback();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
- public ISQLPanelAPI getSQLPanelAPIOfActiveSessionWindow() {
- return panelApi;
- }
+ public void close() throws SQLException
+ {
+ if (!closed)
+ {
+ con.close();
+ }
+ }
- public IObjectTreeAPI getObjectTreeAPIOfActiveSessionWindow() {
-
- System.err.println("MockSession.getObjectTreeAPIOfActiveSessionWindow: stub not yet implemented");
- return null;
- }
+ public void closeSQLConnection() throws SQLException
+ {
+ con.close();
+ }
- public boolean isfinishedLoading() {
-
- System.err.println("MockSession.isfinishedLoading: stub not yet implemented");
- return true;
- }
+ public void setSessionInternalFrame(SessionInternalFrame sif)
+ {
- public void setPluginsfinishedLoading(boolean _finishedLoading) {
-
- System.err.println("MockSession.setPluginsfinishedLoading: stub not yet implemented");
- }
+ System.err.println("MockSession.setSessionInternalFrame: stub not yet implemented");
+ }
- public boolean confirmClose() {
-
- System.err.println("MockSession.confirmClose: stub not yet implemented");
- return false;
- }
+ public void reconnect()
+ {
- public IIdentifier getIdentifier() {
- return id;
- }
+ System.err.println("MockSession.reconnect: stub not yet implemented");
+ }
- public MockDatabaseMetaData getMockDatabaseMetaData() {
- return mdata;
- }
+ public Object getPluginObject(IPlugin plugin, String key)
+ {
- /**
- * @param defaultCatalog the defaultCatalog to set
- */
- public void setDefaultCatalog(String defaultCatalog) {
- this.defaultCatalog = defaultCatalog;
- }
+ System.err.println("MockSession.getPluginObject: stub not yet implemented");
+ return null;
+ }
- /**
- * @return the defaultCatalog
- */
- public String getDefaultCatalog() {
- return defaultCatalog;
- }
+ public Object putPluginObject(IPlugin plugin, String key, Object obj)
+ {
- /**
- * @param defaultSchema the defaultSchema to set
- */
- public void setDefaultSchema(String defaultSchema) {
- this.defaultSchema = defaultSchema;
- }
+ System.err.println("MockSession.putPluginObject: stub not yet implemented");
+ return null;
+ }
- /**
- * @return the defaultSchema
- */
- public String getDefaultSchema() {
- return defaultSchema;
- }
-
- public IQueryTokenizer getQueryTokenizer() {
- return new QueryTokenizer(";", "--", true);
- }
+ public void removePluginObject(IPlugin plugin, String key)
+ {
- public void setQueryTokenizer(IQueryTokenizer tokenizer) {
-
- }
+ System.err.println("MockSession.removePluginObject: stub not yet implemented");
+ }
- /* (non-Javadoc)
- * @see net.sourceforge.squirrel_sql.client.session.ISession#getMetaData()
- */
- public ISQLDatabaseMetaData getMetaData() {
- return con.getSQLMetaData();
- }
+ public void setMessageHandler(IMessageHandler handler)
+ {
+ messageHandler = handler;
+ }
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#showErrorMessage(java.lang.String)
- */
- public void showErrorMessage(String msg) {
-
- System.err.println("MockSession.showErrorMessage: stub not yet implemented");
- }
+ public IMessageHandler getMessageHandler()
+ {
+ return messageHandler;
+ }
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#showErrorMessage(java.lang.Throwable)
- */
- public void showErrorMessage(Throwable th) {
-
- System.err.println("MockSession.showErrorMessage: stub not yet implemented");
- }
+ public SessionPanel getSessionSheet()
+ {
+ return sessionPanel;
+ }
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#showMessage(java.lang.String)
- */
- public void showMessage(String msg) {
-
- System.err.println("MockSession.showMessage: stub not yet implemented");
- }
+ public SessionInternalFrame getSessionInternalFrame()
+ {
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#showMessage(java.lang.Throwable)
- */
- public void showMessage(Throwable th) {
-
- System.err.println("MockSession.showMessage: stub not yet implemented");
- }
+ System.err.println("MockSession.getSessionInternalFrame: stub not yet implemented");
+ return null;
+ }
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#showWarningMessage(java.lang.String)
- */
- public void showWarningMessage(String msg) {
-
- System.err.println("MockSession.showWarningMessage: stub not yet implemented");
- }
-
- public String formatException(Throwable th) {
-
- System.err.println("MockSession.format: stub not yet implemented");
- return null;
- }
+ /* (non-Javadoc)
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#getSchemaInfo()
+ */
+ public SchemaInfo getSchemaInfo()
+ {
+ return schemaInfo;
+ }
- /**
- * @see net.sourceforge.squirrel_sql.client.session.ISession#getSelectedMainTabIndex()
- */
- public int getSelectedMainTabIndex() {
- System.err.println("MockSession.getSelectedMainTabIndex: stub not yet implemented");
- return 0;
- }
+ public void selectMainTab(int tabIndex) throws IllegalArgumentException
+ {
+ System.err.println("MockSession.selectMainTab: stub not yet implemented");
+ }
- public void setActiveSessionWindow(ISessionWidget activeActiveSessionWindow)
- {
- System.err.println("MockSession.setActiveSessionWindow: stub not yet implemented" );
- }
+ public int addMainTab(IMainPanelTab tab)
+ {
+
+ System.err.println("MockSession.addMainTab: stub not yet implemented");
+ return 0;
+ }
+
+ public void addToStatusBar(JComponent comp)
+ {
+
+ System.err.println("MockSession.addToStatusBar: stub not yet implemented");
+ }
+
+ public void removeFromStatusBar(JComponent comp)
+ {
+
+ System.err.println("MockSession.removeFromStatusBar: stub not yet implemented");
+ }
+
+ public String getTitle()
+ {
+
+ System.err.println("MockSession.getTitle: stub not yet implemented");
+ return null;
+ }
+
+ public String getDatabaseProductName()
+ {
+ String result = null;
+ try
+ {
+ result = con.getSQLMetaData().getDatabaseProductName();
+ }
+ catch (SQLException e)
+ {
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ public void addToToolbar(Action action)
+ {
+
+ System.err.println("MockSession.addToToolbar: stub not yet implemented");
+ }
+
+ public void addSeparatorToToolbar()
+ {
+
+ System.err.println("MockSession.addSeparatorToToolbar: stub not yet implemented");
+ }
+
+ public IParserEventsProcessor getParserEventsProcessor(IIdentifier sqlEntryPanelIdentifier)
+ {
+
+ System.err.println("MockSession.getParserEventsProcessor: stub not yet implemented");
+ return null;
+ }
+
+ public void setActiveSessionWindow(SessionTabWidget activeActiveSessionWindow)
+ {
+
+ System.err.println("MockSession.setActiveSessionWindow: stub not yet implemented");
+ }
+
+ public SessionTabWidget getActiveSessionWindow()
+ {
+
+ System.err.println("MockSession.getActiveSessionWindow: stub not yet implemented");
+ return null;
+ }
+
+ public ISQLPanelAPI getSQLPanelAPIOfActiveSessionWindow()
+ {
+ return panelApi;
+ }
+
+ public IObjectTreeAPI getObjectTreeAPIOfActiveSessionWindow()
+ {
+
+ System.err.println("MockSession.getObjectTreeAPIOfActiveSessionWindow: stub not yet implemented");
+ return null;
+ }
+
+ public boolean isfinishedLoading()
+ {
+
+ System.err.println("MockSession.isfinishedLoading: stub not yet implemented");
+ return true;
+ }
+
+ public void setPluginsfinishedLoading(boolean _finishedLoading)
+ {
+
+ System.err.println("MockSession.setPluginsfinishedLoading: stub not yet implemented");
+ }
+
+ public boolean confirmClose()
+ {
+
+ System.err.println("MockSession.confirmClose: stub not yet implemented");
+ return false;
+ }
+
+ public IIdentifier getIdentifier()
+ {
+ return id;
+ }
+
+ public MockDatabaseMetaData getMockDatabaseMetaData()
+ {
+ return mdata;
+ }
+
+ /**
+ * @param defaultCatalog
+ * the defaultCatalog to set
+ */
+ public void setDefaultCatalog(String defaultCatalog)
+ {
+ this.defaultCatalog = defaultCatalog;
+ }
+
+ /**
+ * @return the defaultCatalog
+ */
+ public String getDefaultCatalog()
+ {
+ return defaultCatalog;
+ }
+
+ /**
+ * @param defaultSchema
+ * the defaultSchema to set
+ */
+ public void setDefaultSchema(String defaultSchema)
+ {
+ this.defaultSchema = defaultSchema;
+ }
+
+ /**
+ * @return the defaultSchema
+ */
+ public String getDefaultSchema()
+ {
+ return defaultSchema;
+ }
+
+ public IQueryTokenizer getQueryTokenizer()
+ {
+ return new QueryTokenizer(";", "--", true);
+ }
+
+ public void setQueryTokenizer(IQueryTokenizer tokenizer)
+ {
+
+ }
+
+ /* (non-Javadoc)
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#getMetaData()
+ */
+ public ISQLDatabaseMetaData getMetaData()
+ {
+ return con.getSQLMetaData();
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#showErrorMessage(java.lang.String)
+ */
+ public void showErrorMessage(String msg)
+ {
+
+ System.err.println("MockSession.showErrorMessage: stub not yet implemented");
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#showErrorMessage(java.lang.Throwable)
+ */
+ public void showErrorMessage(Throwable th)
+ {
+
+ System.err.println("MockSession.showErrorMessage: stub not yet implemented");
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#showMessage(java.lang.String)
+ */
+ public void showMessage(String msg)
+ {
+
+ System.err.println("MockSession.showMessage: stub not yet implemented");
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#showMessage(java.lang.Throwable)
+ */
+ public void showMessage(Throwable th)
+ {
+
+ System.err.println("MockSession.showMessage: stub not yet implemented");
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#showWarningMessage(java.lang.String)
+ */
+ public void showWarningMessage(String msg)
+ {
+
+ System.err.println("MockSession.showWarningMessage: stub not yet implemented");
+ }
+
+ public String formatException(Throwable th)
+ {
+
+ System.err.println("MockSession.format: stub not yet implemented");
+ return null;
+ }
+
+ /**
+ * @see net.sourceforge.squirrel_sql.client.session.ISession#getSelectedMainTabIndex()
+ */
+ public int getSelectedMainTabIndex()
+ {
+ System.err.println("MockSession.getSelectedMainTabIndex: stub not yet implemented");
+ return 0;
+ }
+
+ public void setActiveSessionWindow(ISessionWidget activeActiveSessionWindow)
+ {
+ System.err.println("MockSession.setActiveSessionWindow: stub not yet implemented");
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|