test_class.declarator: readerUnderTest = null
test_class.original_string: ResultSetColumnReader readerUnderTest = null;
test_class.type: ResultSetColumnReader
test_class.var_name: readerUnderTest
test_class.declarator: mockResultSet = null
test_class.original_string: ResultSet mockResultSet = null;
test_class.type: ResultSet
test_class.var_name: mockResultSet
test_class.declarator: mockResultSetMetaData = null
test_class.original_string: ResultSetMetaData mockResultSetMetaData = null;
test_class.type: ResultSetMetaData
test_class.var_name: mockResultSetMetaData
test_class.file: sql12/fw/src/test/java/net/sourceforge/squirrel_sql/fw/sql/ResultSetColumnReaderTest.java
test_class.identifier: ResultSetColumnReaderTest
test_class.superclass: extends BaseSQuirreLJUnit4TestCase
test_case.body: @Test
      public final void testGetLong() throws SQLException {
          int index = 1;
          
          /* local expectations */
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.SMALLINT);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.TINYINT);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.INTEGER);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.BIGINT);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.REAL);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.VARCHAR);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.BIT);
          expect(mockResultSetMetaData.getColumnType(index++)).andReturn(Types.BIT);
          
          index = 1;
          expect(mockResultSet.getMetaData()).andReturn(mockResultSetMetaData).anyTimes();        
          expect(mockResultSet.getObject(index++)).andReturn(Long.valueOf(123)).anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn(Integer.valueOf(345)).anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn("123").anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn(Short.valueOf((short)127)).anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn("567").anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn("789").anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn("true").anyTimes();
          expect(mockResultSet.getObject(index++)).andReturn("false").anyTimes();
          
          
          /* execute test */
          index = 1;
          replayAll();
          readerUnderTest = new ResultSetColumnReader(mockResultSet);
          Long value = readerUnderTest.getLong(index++);
          assertEquals(new Long(123), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(345), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(123), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(127), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(567), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(789), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(1), value);
          value = readerUnderTest.getLong(index++);
          assertEquals(new Long(0), value);
          
          verifyAll();
      }
test_case.class_method_signature: ResultSetColumnReaderTest.testGetLong()
test_case.full_signature: @Test public final void testGetLong()
test_case.identifier: testGetLong
test_case.invocations: andReturn expect getColumnType andReturn expect getColumnType andReturn expect getColumnType andReturn expect getColumnType andReturn expect getColumnType andReturn expect getColumnType andReturn expect getColumnType andReturn expect getColumnType anyTimes andReturn expect getMetaData anyTimes andReturn expect getObject valueOf anyTimes andReturn expect getObject valueOf anyTimes andReturn expect getObject anyTimes andReturn expect getObject valueOf anyTimes andReturn expect getObject anyTimes andReturn expect getObject anyTimes andReturn expect getObject anyTimes andReturn expect getObject replayAll getLong assertEquals getLong assertEquals getLong assertEquals getLong assertEquals getLong assertEquals getLong assertEquals getLong assertEquals getLong assertEquals verifyAll
test_case.modifiers: @Test public final
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetLong()
focal_class.declarator: LONG_ZERO = Long.valueOf(0)
focal_class.modifier: private final static
focal_class.original_string: private final static Long LONG_ZERO = Long.valueOf(0);
focal_class.type: Long
focal_class.var_name: LONG_ZERO
focal_class.declarator: DOUBLE_ZERO = Double.valueOf(0)
focal_class.modifier: private final static
focal_class.original_string: private final static Double DOUBLE_ZERO = Double.valueOf(0);
focal_class.type: Double
focal_class.var_name: DOUBLE_ZERO
focal_class.declarator: _rs
focal_class.modifier: private final
focal_class.original_string: private final ResultSet _rs;
focal_class.type: ResultSet
focal_class.var_name: _rs
focal_class.declarator: _wasNull
focal_class.modifier: private
focal_class.original_string: private boolean _wasNull;
focal_class.type: boolean
focal_class.var_name: _wasNull
focal_class.declarator: _rsmd
focal_class.modifier: private
focal_class.original_string: private ResultSetMetaData _rsmd;
focal_class.type: ResultSetMetaData
focal_class.var_name: _rsmd
focal_class.file: sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/sql/ResultSetColumnReader.java
focal_class.identifier: ResultSetColumnReader
focal_class.class_method_signature: ResultSetColumnReader.ResultSetColumnReader(ResultSet rs)
focal_class.full_signature: public  ResultSetColumnReader(ResultSet rs)
focal_class.identifier: ResultSetColumnReader
focal_class.modifiers: public
focal_class.parameters: (ResultSet rs)
focal_class.signature:  ResultSetColumnReader(ResultSet rs)
focal_class.class_method_signature: ResultSetColumnReader.next()
focal_class.full_signature: public boolean next()
focal_class.identifier: next
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean next()
focal_class.class_method_signature: ResultSetColumnReader.getBoolean(int columnIdx)
focal_class.full_signature: public Boolean getBoolean(int columnIdx)
focal_class.identifier: getBoolean
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Boolean
focal_class.signature: Boolean getBoolean(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getDate(int columnIdx)
focal_class.full_signature: public Date getDate(int columnIdx)
focal_class.identifier: getDate
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Date
focal_class.signature: Date getDate(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getDouble(int columnIdx)
focal_class.full_signature: public Double getDouble(int columnIdx)
focal_class.identifier: getDouble
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Double
focal_class.signature: Double getDouble(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getLong(int columnIdx)
focal_class.full_signature: public Long getLong(int columnIdx)
focal_class.identifier: getLong
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Long
focal_class.signature: Long getLong(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getObject(int columnIdx)
focal_class.full_signature: public Object getObject(int columnIdx)
focal_class.identifier: getObject
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Object
focal_class.signature: Object getObject(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getString(int columnIdx)
focal_class.full_signature: public String getString(int columnIdx)
focal_class.identifier: getString
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: String
focal_class.signature: String getString(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getTime(int columnIdx)
focal_class.full_signature: public Time getTime(int columnIdx)
focal_class.identifier: getTime
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Time
focal_class.signature: Time getTime(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.getTimeStamp(int columnIdx)
focal_class.full_signature: public Timestamp getTimeStamp(int columnIdx)
focal_class.identifier: getTimeStamp
focal_class.modifiers: public
focal_class.parameters: (int columnIdx)
focal_class.return: Timestamp
focal_class.signature: Timestamp getTimeStamp(int columnIdx)
focal_class.class_method_signature: ResultSetColumnReader.wasNull()
focal_class.full_signature: public boolean wasNull()
focal_class.identifier: wasNull
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean wasNull()
focal_method.body: public Long getLong(int columnIdx) throws SQLException
  	{
  		Object obj = _rs.getObject(columnIdx);
  		Long results = LONG_ZERO;
  		_wasNull = true;
  
  		if (obj != null)
  		{
  			final int columnType = _rsmd.getColumnType(columnIdx);
  			if (columnType != Types.NULL)
  			{
  				_wasNull = false;
  				switch (columnType)
  				{
  					case Types.SMALLINT:
  					case Types.TINYINT:
  					case Types.INTEGER:
  					case Types.BIGINT :
  					    if (obj instanceof Number)
  						{
  							results = ((Number)obj).longValue();
  						}
  						else
  						{
  							results = new Long(obj.toString());
  						}
  						break;
                      case Types.BIT:
                          if ("true".equalsIgnoreCase(obj.toString())) {
                              results = Long.valueOf(1);
                          } else {
                              results = Long.valueOf(0);
                          }
                          break;
  					default:
  						results = new Long(obj.toString());
  						break;
  				}
  			}
  		}
  
  		return results;
  	}
focal_method.class_method_signature: ResultSetColumnReader.getLong(int columnIdx)
focal_method.full_signature: public Long getLong(int columnIdx)
focal_method.identifier: getLong
focal_method.invocations: getObject getColumnType longValue toString equalsIgnoreCase toString valueOf valueOf toString
focal_method.modifiers: public
focal_method.parameters: (int columnIdx)
focal_method.return: Long
focal_method.signature: Long getLong(int columnIdx)