Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.j256.ormlite.jdbc;
 
 import static org.easymock.EasyMock.createMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
 import static org.junit.Assert.assertEquals;
 
public class JdbcCompiledStatementTest extends BaseCoreTest {
	public void testGetColumnName() throws SQLException {
		PreparedStatement preparedStatement = createMock(PreparedStatement.class);
		expect(metadata.getColumnName(1)).andReturn("TEST_COLUMN1");
		expect(preparedStatement.getMetaData()).andReturn(metadata);
		replay(metadatapreparedStatement);
		assertEquals("TEST_COLUMN1"stmt.getColumnName(0));
		verify(preparedStatementmetadata);
	}
	public void testGetMoreResults() throws SQLException {
		PreparedStatement preparedStatement = createMock(PreparedStatement.class);
		expect(preparedStatement.getMoreResults()).andReturn(.);
		replay(preparedStatement);
		verify(preparedStatement);
	}
	public void testSetNull() throws SQLException {
		PreparedStatement preparedStatement = createMock(PreparedStatement.class);
		preparedStatement.setNull(1, TypeValMapper.getTypeValForSqlType(.));
		EasyMock.expectLastCall();
		replay(preparedStatement);
		verify(preparedStatement);
	}
	@Test(expected = IllegalArgumentException.class)
	public void testExecuteUpdateWithSelectType() throws SQLException {
		PreparedStatement preparedStatement = createMock(PreparedStatement.class);
		stmt.runUpdate();
	}
	@Test(expected = IllegalArgumentException.class)
		PreparedStatement preparedStatement = createMock(PreparedStatement.class);
		stmt.runQuery();
	}
New to GrepCode? Check out our FAQ X