Package net.sourceforge.squirrel_sql.client.session

Examples of net.sourceforge.squirrel_sql.client.session.ISession


{

 
  @Test
  public void testIsPluginSession() throws Exception {
    ISession mockSession = mockHelper.createMock(ISession.class);
    ISQLDatabaseMetaData mockSQLDatabaseMetaData = mockHelper.createMock(ISQLDatabaseMetaData.class);
    expect(mockSession.getMetaData()).andStubReturn(mockSQLDatabaseMetaData);
    expect(mockSQLDatabaseMetaData.getDatabaseProductName()).andStubReturn(getDatabaseProductName());
    expect(mockSQLDatabaseMetaData.getDatabaseProductVersion()).andStubReturn(getDatabaseProductVersion());
   
    mockHelper.replayAll();
    if (classUnderTest instanceof DefaultSessionPlugin) {
View Full Code Here


    }

    // Test to ensure that we allow sessions that are ending to be GC'd.
    public void testSessionCleanup() {
        MyBaseMainPanelTab tab = new MyBaseMainPanelTab();
        ISession session1 = createMock(ISession.class);
        tab.setSession(session1);
        ISession session2 = createMock(ISession.class);
        tab.sessionEnding(session2);
        assertEquals(session1, tab.getSession());
        tab.sessionEnding(session1);
        assertEquals(null, tab.getSession());
    }
View Full Code Here

     * and to trigger the enable menu task if the session is relevant to this
     * plugin.
     */
    private class SessionListener extends SessionAdapter {
        public void sessionActivated(SessionEvent evt) {
            final ISession session = evt.getSession();
            EnableMenuTask task = new EnableMenuTask(session);
            session.getApplication().getThreadPool().addTask(task);
        }
View Full Code Here

  public Component getComponent()
  {
    if (_comp == null)
    {
      ISession session = getSession();
      SessionProperties props = session.getProperties();
      String destClassName = props.getMetaDataOutputClassName();
      try
      {
        _comp = new DataSetScrollingPanel(destClassName, null);
      } catch (Exception e)
View Full Code Here

    return _comp;
  }

  protected void refreshComponent() throws DataSetException
  {
    ISession session = getSession();
    if (session == null)
    {
      throw new IllegalStateException("Null ISession");
    }
    PreparedStatement pstmt = null;
View Full Code Here

  /**
   * Refresh the component displaying the database object.
   */
  public synchronized void refreshComponent() throws DataSetException
  {
    ISession session = getSession();
    if (session == null)
    {
      throw new IllegalStateException("Null ISession");
    }
    super._app.getThreadPool().addTask(new Runnable() {
View Full Code Here

   * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.BaseSourceTab#createStatement()
   */
  @Override
  protected PreparedStatement createStatement() throws SQLException
  {
    final ISession session = getSession();

    ISQLConnection conn = session.getSQLConnection();

    String sqlStatement = getSqlStatement();
    String[] bindValues = getBindValues();

    if (s_log.isDebugEnabled())
View Full Code Here

  }

  public static ISession getEasyMockSession(String dbName, boolean replay) throws SQLException
  {
    ISQLDatabaseMetaData md = FwTestUtil.getEasyMockSQLMetaData(dbName, "jdbc:oracle");
    ISession session = AppTestUtil.getEasyMockSession(md, replay);
    return session;
  }
View Full Code Here

    return session;
  }

  public static ISession getEasyMockSession(ISQLDatabaseMetaData md, boolean replay)
  {
    ISession session = null;
    try
    {
      ISQLConnection con = FwTestUtil.getEasyMockSQLConnection();
      session = getEasyMockSession(md, con, false);
      if (replay)
View Full Code Here

    return session;
  }

  public static ISession getEasyMockSession(ISQLDatabaseMetaData md, ISQLConnection con, boolean replay)
  {
    ISession session = createMock(ISession.class);
    IQueryTokenizer tokenizer = FwTestUtil.getEasyMockQueryTokenizer();
    // IMessageHandler messageHandler = getEasyMockMessageHandler();

    expect(session.getMetaData()).andReturn(md).anyTimes();
    expect(session.getApplication()).andReturn(AppTestUtil.getEasyMockApplication()).anyTimes();
    expect(session.getQueryTokenizer()).andReturn(tokenizer).anyTimes();
    session.setQueryTokenizer(isA(QueryTokenizer.class));
    ISQLPanelAPI api = AppTestUtil.getEasyMockSqlPanelApi();
    expect(session.getSQLPanelAPIOfActiveSessionWindow()).andReturn(api).anyTimes();
    // expect(session.getMessageHandler()).andReturn(messageHandler).anyTimes();
    expect(session.getAlias()).andStubReturn(AppTestUtil.getEasyMockSqlAliasExt());
    expect(session.getIdentifier()).andReturn(FwTestUtil.getEasyMockIdentifier()).anyTimes();
    expect(session.getSQLConnection()).andReturn(con).anyTimes();
    session.setExceptionFormatter(isA(ExceptionFormatter.class));
    expectLastCall().anyTimes();
    session.addSeparatorToToolbar();
    expectLastCall().anyTimes();
    SessionPanel panel = AppTestUtil.getEasyMockSessionPanel();
    expect(session.getSessionSheet()).andReturn(panel).anyTimes();
    session.addToToolbar(isA(Action.class));
    expectLastCall().anyTimes();
    SessionInternalFrame frame = AppTestUtil.getEasyMockSessionInternalFrame();
    expect(session.getSessionInternalFrame()).andReturn(frame).anyTimes();

    if (replay)
    {
      replay(session);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.session.ISession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.