public void OdbcConnectionWithoutPooling(TestCaseResult result) { string host = TestSettings.GetString("HOST"); string connectionString = "HOST=" + host + ";UID=dba;PWD=dba;Pooling=False;"; VirtuosoConnection conn = new VirtuosoConnection(connectionString); try { conn.Open(); conn.Close(); } finally { conn.Dispose(); } }
protected virtual void Dispose(bool isDisposing) { if (_isDisposed) { return; } if (isDisposing) { if (Connection != null) { Connection.Close(); Connection.Dispose(); } } _isDisposed = true; }
public void State(TestCaseResult result) { string host = TestSettings.GetString("HOST"); string connectionString = "HOST=" + host + ";UID=dba;PWD=dba;"; VirtuosoConnection conn = new VirtuosoConnection(connectionString); try { result.FailIfNotEqual(ConnectionState.Closed, conn.State); conn.Open(); result.FailIfNotEqual(ConnectionState.Open, conn.State); conn.Close(); result.FailIfNotEqual(ConnectionState.Closed, conn.State); } finally { conn.Dispose(); } }
public void PersistSecurityInfo(TestCaseResult result) { string host = TestSettings.GetString("HOST"); string connectionString = "HOST=" + host + ";UID=dba;PWD=dba;Persist Security Info=true;"; VirtuosoConnection conn = new VirtuosoConnection(connectionString); try { result.FailIfNotEqual(connectionString, conn.ConnectionString); conn.Open(); result.FailIfNotEqual(connectionString, conn.ConnectionString); conn.Close(); result.FailIfNotEqual(connectionString, conn.ConnectionString); } finally { conn.Dispose(); } }
public void DisposeInvalid(TestCaseResult result) { VirtuosoConnection conn = null; try { string connectionString = "InvalidConnectionString"; conn = new VirtuosoConnection(connectionString); } catch (ArgumentException) { // suppress ArgumentException } finally { if (conn != null) { conn.Dispose(); } } }
public void DisposeNew(TestCaseResult result) { VirtuosoConnection conn = new VirtuosoConnection(); conn.Dispose(); }
public void Dispose() { Connection.Close(); Connection.Dispose(); }