* Tests that the factory can correctly rebuild a DataSource with no
* properties set (i.e. all values should be null and no NPE should be
* thrown).
*/
public void testNoProperties() throws Exception {
JtdsDataSource ds = new JtdsDataSource();
Reference dsRef = ds.getReference();
assertEquals("net.sourceforge.jtds.jdbcx.JtdsObjectFactory",
dsRef.getFactoryClassName());
assertEquals("net.sourceforge.jtds.jdbcx.JtdsDataSource",
dsRef.getClassName());
ds = (JtdsDataSource) new JtdsObjectFactory()
.getObjectInstance(dsRef, null, null, null);
assertNull(ds.getServerName());
assertEquals(0, ds.getServerType());
assertEquals(0, ds.getPortNumber());
assertNull(ds.getDatabaseName());
assertNull(ds.getDatabaseName());
assertEquals(0, ds.getPortNumber());
assertNull(ds.getTds());
assertNull(ds.getCharset());
assertNull(ds.getLanguage());
assertNull(ds.getDomain());
assertNull(ds.getInstance());
assertEquals(false, ds.getLastUpdateCount());
assertEquals(false, ds.getSendStringParametersAsUnicode());
assertEquals(false, ds.getNamedPipe());
assertNull(ds.getMacAddress());
assertEquals(0, ds.getPrepareSql());
assertEquals(0, ds.getPacketSize());
assertEquals(false, ds.getTcpNoDelay());
assertNull(ds.getUser());
assertNull(ds.getPassword());
assertEquals(0, ds.getLoginTimeout());
assertEquals(0, ds.getLobBuffer());
assertEquals(0, ds.getMaxStatements());
assertNull(ds.getAppName());
assertNull(ds.getProgName());
assertEquals(false, ds.getXaEmulation());
assertNull(ds.getLogFile());
assertNull(ds.getSsl());
assertEquals(0, ds.getBatchSize());
assertNull(ds.getDescription());
assertNull(ds.getBindAddress());
assertEquals(false, ds.getUseJCIFS());
}