Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::spanner_mocks::MockConnection Class Reference

An inlined versioned namespace to avoid dependency diamonds. More...

#include <google/cloud/spanner/mocks/mock_spanner_connection.h>

Public Member Functions

 MOCK_METHOD (Options, options,(),(override))
 
 MOCK_METHOD (spanner::RowStream, Read,(ReadParams),(override))
 
 MOCK_METHOD (StatusOr< std::vector< spanner::ReadPartition > >, PartitionRead,(PartitionReadParams),(override))
 
 MOCK_METHOD (spanner::RowStream, ExecuteQuery,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::DmlResult >, ExecuteDml,(SqlParams),(override))
 
 MOCK_METHOD (spanner::ProfileQueryResult, ProfileQuery,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::ProfileDmlResult >, ProfileDml,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::ExecutionPlan >, AnalyzeSql,(SqlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::PartitionedDmlResult >, ExecutePartitionedDml,(ExecutePartitionedDmlParams),(override))
 
 MOCK_METHOD (StatusOr< std::vector< spanner::QueryPartition > >, PartitionQuery,(PartitionQueryParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::BatchDmlResult >, ExecuteBatchDml,(ExecuteBatchDmlParams),(override))
 
 MOCK_METHOD (StatusOr< spanner::CommitResult >, Commit,(CommitParams),(override))
 
 MOCK_METHOD (Status, Rollback,(RollbackParams),(override))
 
virtual Options options ()
 Returns the options used by the Connection. More...
 
virtual RowStream Read (ReadParams)
 Defines the interface for Client::Read() More...
 
virtual StatusOr< std::vector< ReadPartition > > PartitionRead (PartitionReadParams)
 Defines the interface for Client::PartitionRead() More...
 
virtual RowStream ExecuteQuery (SqlParams)
 Defines the interface for Client::ExecuteQuery() More...
 
virtual StatusOr< DmlResult > ExecuteDml (SqlParams)
 Defines the interface for Client::ExecuteDml() More...
 
virtual ProfileQueryResult ProfileQuery (SqlParams)
 Defines the interface for Client::ProfileQuery() More...
 
virtual StatusOr< ProfileDmlResult > ProfileDml (SqlParams)
 Defines the interface for Client::ProfileDml() More...
 
virtual StatusOr< ExecutionPlan > AnalyzeSql (SqlParams)
 Defines the interface for Client::AnalyzeSql() More...
 
virtual StatusOr< PartitionedDmlResult > ExecutePartitionedDml (ExecutePartitionedDmlParams)
 Defines the interface for Client::ExecutePartitionedDml() More...
 
virtual StatusOr< std::vector< QueryPartition > > PartitionQuery (PartitionQueryParams)
 Defines the interface for Client::PartitionQuery() More...
 
virtual StatusOr< BatchDmlResult > ExecuteBatchDml (ExecuteBatchDmlParams)
 Defines the interface for Client::ExecuteBatchDml() More...
 
virtual StatusOr< CommitResult > Commit (CommitParams)
 Defines the interface for Client::Commit() More...
 
virtual Status Rollback (RollbackParams)
 Defines the interface for Client::Rollback() More...
 

Detailed Description

An inlined versioned namespace to avoid dependency diamonds.

A class to mock google::cloud::spanner::Connection.

Application developers may want to test their code with simulated responses, including errors from a spanner::Client. To do so, construct a spanner::Client with an instance of this class. Then use the Google Test framework functions to program the behavior of this mock.

See also
Mocking the Cloud Spanner C++ Client with Google Mock for an example using this class.

Member Function Documentation

◆ AnalyzeSql()

virtual StatusOr< ExecutionPlan > google::cloud::spanner::Connection::AnalyzeSql ( SqlParams  )
virtualinherited

Defines the interface for Client::AnalyzeSql()

◆ Commit()

virtual StatusOr< CommitResult > google::cloud::spanner::Connection::Commit ( CommitParams  )
virtualinherited

Defines the interface for Client::Commit()

◆ ExecuteBatchDml()

virtual StatusOr< BatchDmlResult > google::cloud::spanner::Connection::ExecuteBatchDml ( ExecuteBatchDmlParams  )
virtualinherited

Defines the interface for Client::ExecuteBatchDml()

◆ ExecuteDml()

virtual StatusOr< DmlResult > google::cloud::spanner::Connection::ExecuteDml ( SqlParams  )
virtualinherited

Defines the interface for Client::ExecuteDml()

◆ ExecutePartitionedDml()

virtual StatusOr< PartitionedDmlResult > google::cloud::spanner::Connection::ExecutePartitionedDml ( ExecutePartitionedDmlParams  )
virtualinherited

Defines the interface for Client::ExecutePartitionedDml()

◆ ExecuteQuery()

virtual RowStream google::cloud::spanner::Connection::ExecuteQuery ( SqlParams  )
virtualinherited

Defines the interface for Client::ExecuteQuery()

◆ MOCK_METHOD() [1/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( Options  ,
options  ,
()  ,
(override)   
)

◆ MOCK_METHOD() [2/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( spanner::ProfileQueryResult  ,
ProfileQuery  ,
(SqlParams ,
(override)   
)

◆ MOCK_METHOD() [3/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( spanner::RowStream  ,
ExecuteQuery  ,
(SqlParams ,
(override)   
)

◆ MOCK_METHOD() [4/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( spanner::RowStream  ,
Read  ,
(ReadParams ,
(override)   
)

◆ MOCK_METHOD() [5/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( Status  ,
Rollback  ,
(RollbackParams ,
(override)   
)

◆ MOCK_METHOD() [6/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< spanner::BatchDmlResult ,
ExecuteBatchDml  ,
(ExecuteBatchDmlParams ,
(override)   
)

◆ MOCK_METHOD() [7/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< spanner::CommitResult ,
Commit  ,
(CommitParams ,
(override)   
)

◆ MOCK_METHOD() [8/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< spanner::DmlResult ,
ExecuteDml  ,
(SqlParams ,
(override)   
)

◆ MOCK_METHOD() [9/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< spanner::ExecutionPlan ,
AnalyzeSql  ,
(SqlParams ,
(override)   
)

◆ MOCK_METHOD() [10/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< spanner::PartitionedDmlResult ,
ExecutePartitionedDml  ,
(ExecutePartitionedDmlParams ,
(override)   
)

◆ MOCK_METHOD() [11/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< spanner::ProfileDmlResult ,
ProfileDml  ,
(SqlParams ,
(override)   
)

◆ MOCK_METHOD() [12/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< std::vector< spanner::QueryPartition > >  ,
PartitionQuery  ,
(PartitionQueryParams ,
(override)   
)

◆ MOCK_METHOD() [13/13]

google::cloud::spanner_mocks::MockConnection::MOCK_METHOD ( StatusOr< std::vector< spanner::ReadPartition > >  ,
PartitionRead  ,
(PartitionReadParams ,
(override)   
)

◆ options()

virtual Options google::cloud::spanner::Connection::options ( )
inlinevirtualinherited

Returns the options used by the Connection.

◆ PartitionQuery()

virtual StatusOr< std::vector< QueryPartition > > google::cloud::spanner::Connection::PartitionQuery ( PartitionQueryParams  )
virtualinherited

Defines the interface for Client::PartitionQuery()

◆ PartitionRead()

virtual StatusOr< std::vector< ReadPartition > > google::cloud::spanner::Connection::PartitionRead ( PartitionReadParams  )
virtualinherited

Defines the interface for Client::PartitionRead()

◆ ProfileDml()

virtual StatusOr< ProfileDmlResult > google::cloud::spanner::Connection::ProfileDml ( SqlParams  )
virtualinherited

Defines the interface for Client::ProfileDml()

◆ ProfileQuery()

virtual ProfileQueryResult google::cloud::spanner::Connection::ProfileQuery ( SqlParams  )
virtualinherited

Defines the interface for Client::ProfileQuery()

◆ Read()

virtual RowStream google::cloud::spanner::Connection::Read ( ReadParams  )
virtualinherited

Defines the interface for Client::Read()

◆ Rollback()

virtual Status google::cloud::spanner::Connection::Rollback ( RollbackParams  )
virtualinherited

Defines the interface for Client::Rollback()