Package net.sf.hajdbc

Examples of net.sf.hajdbc.SequencePropertiesFactory


   * @see net.sf.hajdbc.dialect.StandardDialectTest#getSequences()
   */
  @Override
  public void getSequences() throws SQLException
  {
    SequencePropertiesFactory factory = mock(SequencePropertiesFactory.class);
    SequenceProperties sequence1 = mock(SequenceProperties.class);
    SequenceProperties sequence2 = mock(SequenceProperties.class);
    DatabaseMetaData metaData = mock(DatabaseMetaData.class);
    Connection connection = mock(Connection.class);
    Statement statement = mock(Statement.class);
    ResultSet resultSet = mock(ResultSet.class);
   
    when(metaData.getConnection()).thenReturn(connection);
    when(connection.createStatement()).thenReturn(statement);
    when(statement.executeQuery("SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME, INCREMENT FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES")).thenReturn(resultSet);
    when(resultSet.next()).thenReturn(true).thenReturn(true).thenReturn(false);
    when(resultSet.getString(1)).thenReturn("schema1").thenReturn("schema2");
    when(resultSet.getString(2)).thenReturn("sequence1").thenReturn("sequence2");
    when(resultSet.getInt(3)).thenReturn(1).thenReturn(2);
    when(factory.createSequenceProperties("schema1", "sequence1", 1)).thenReturn(sequence1);
    when(factory.createSequenceProperties("schema2", "sequence2", 2)).thenReturn(sequence2);

    Collection<SequenceProperties> results = this.dialect.getSequenceSupport().getSequences(metaData, factory);
   
    verify(statement).close();
   
View Full Code Here


   * @see net.sf.hajdbc.dialect.StandardDialectTest#getSequences()
   */
  @Override
  public void getSequences() throws SQLException
  {
    SequencePropertiesFactory factory = mock(SequencePropertiesFactory.class);
    SequenceProperties sequence1 = mock(SequenceProperties.class);
    SequenceProperties sequence2 = mock(SequenceProperties.class);
    DatabaseMetaData metaData = mock(DatabaseMetaData.class);
    Connection connection = mock(Connection.class);
    Statement statement = mock(Statement.class);
    ResultSet resultSet = mock(ResultSet.class);
   
    when(metaData.getConnection()).thenReturn(connection);
    when(connection.createStatement()).thenReturn(statement);
    when(statement.executeQuery("SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME, INCREMENT FROM INFORMATION_SCHEMA.SEQUENCES")).thenReturn(resultSet);
    when(resultSet.next()).thenReturn(true).thenReturn(true).thenReturn(false);
    when(resultSet.getString(1)).thenReturn("schema1").thenReturn("schema2");
    when(resultSet.getString(2)).thenReturn("sequence1").thenReturn("sequence2");
    when(resultSet.getInt(3)).thenReturn(1).thenReturn(2);
    when(factory.createSequenceProperties("schema1", "sequence1", 1)).thenReturn(sequence1);
    when(factory.createSequenceProperties("schema2", "sequence2", 2)).thenReturn(sequence2);

    Collection<SequenceProperties> results = this.dialect.getSequenceSupport().getSequences(metaData, factory);
   
    verify(statement).close();
   
View Full Code Here

   * @see net.sf.hajdbc.dialect.StandardDialectTest#getSequences()
   */
  @Override
  public void getSequences() throws SQLException
  {
    SequencePropertiesFactory factory = mock(SequencePropertiesFactory.class);
    SequenceProperties sequence1 = mock(SequenceProperties.class);
    SequenceProperties sequence2 = mock(SequenceProperties.class);
    DatabaseMetaData metaData = mock(DatabaseMetaData.class);
    Connection connection = mock(Connection.class);
    Statement statement = mock(Statement.class);
    ResultSet resultSet = mock(ResultSet.class);
   
    when(metaData.getConnection()).thenReturn(connection);
    when(connection.createStatement()).thenReturn(statement);
    when(statement.executeQuery("SELECT SEQUENCE_NAME, INCREMENT_BY FROM USER_SEQUENCES")).thenReturn(resultSet);
    when(resultSet.next()).thenReturn(true).thenReturn(true).thenReturn(false);
    when(resultSet.getString(1)).thenReturn("sequence1").thenReturn("sequence2");
    when(resultSet.getInt(2)).thenReturn(1).thenReturn(2);
    when(factory.createSequenceProperties(null, "sequence1", 1)).thenReturn(sequence1);
    when(factory.createSequenceProperties(null, "sequence2", 2)).thenReturn(sequence2);

    Collection<SequenceProperties> results = this.dialect.getSequenceSupport().getSequences(metaData, factory);
   
    verify(statement).close();
   
View Full Code Here

TOP

Related Classes of net.sf.hajdbc.SequencePropertiesFactory

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.