Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.j256.ormlite.db;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import java.util.List;
	protected void setDatabaseParams() throws SQLException {
		System.setProperty("derby.stream.error.file""target/derby.log");
		 = "jdbc:derby:target/ormlitederby;create=true";
	}
	protected boolean isDriverClassExpected() {
		return false;
	}
	public void testGetDriverClassName() {
		assertEquals("org.apache.derby.jdbc.EmbeddedDriver".getDriverClassName());
	}
	public void testEscapedEntityName() throws Exception {
		String word = "word";
		assertEquals("\"" + word + "\"", TestUtils.appendEscapedEntityName(word));
	}
	public void testGeneratedId() throws Exception {
		List<StringadditionalArgs = new ArrayList<String>();
		List<StringstatementsBefore = new ArrayList<String>();
		.appendColumnArg(sbtableInfo.getFieldTypes()[0], additionalArgsstatementsBeforenullnull);
		assertTrue(sb + "should contain the stuff"sb.toString().contains(" INTEGER GENERATED BY DEFAULT AS IDENTITY"));
		assertEquals(0, statementsBefore.size());
		assertEquals(1, additionalArgs.size());
		assertTrue(additionalArgs.get(0).contains("PRIMARY KEY"));
	}
	public void testBoolean() throws Exception {
		TableInfo<AllTypestableInfo = new TableInfo<AllTypes>(AllTypes.class);
		assertEquals(9, tableInfo.getFieldTypes().length);
		FieldType booleanField = tableInfo.getFieldTypes()[1];
		assertEquals("booleanField"booleanField.getDbColumnName());
		List<StringadditionalArgs = new ArrayList<String>();
		List<StringstatementsBefore = new ArrayList<String>();
		.appendColumnArg(sbbooleanFieldadditionalArgsstatementsBeforenullnull);
		assertTrue(sb.toString().contains("SMALLINT"));
	}
	public void testByte() throws Exception {
		TableInfo<AllTypestableInfo = new TableInfo<AllTypes>(AllTypes.class);
		assertEquals(9, tableInfo.getFieldTypes().length);
		FieldType byteField = tableInfo.getFieldTypes()[3];
		assertEquals("byteField"byteField.getDbColumnName());
		List<StringadditionalArgs = new ArrayList<String>();
		List<StringstatementsBefore = new ArrayList<String>();
		.appendColumnArg(sbbyteFieldadditionalArgsstatementsBeforenullnull);
		assertTrue(sb.toString().contains("SMALLINT"));
	}
	public void testLimitSupport() throws Exception {
	}
New to GrepCode? Check out our FAQ X