83 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
92 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
100 CPPUNIT_ASSERT(
m_ds);
101 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
103 CPPUNIT_ASSERT(ds_id.size()!=0);
111 CPPUNIT_ASSERT(
m_ds);
112 std::string id_ds =
"xxx";
121 CPPUNIT_ASSERT(
m_ds);
132 CPPUNIT_ASSERT(
m_ds);
211 CPPUNIT_ASSERT(t.get());
219 std::map<std::string, std::string> connInfo;
221 size_t size_connInfo = connInfo.size();
223 CPPUNIT_ASSERT(size_connInfo > 0);
247 CPPUNIT_ASSERT(newDb.get());
281 std::map<std::string, std::string> connInfo;
283 CPPUNIT_ASSERT(
m_ds);
305 CPPUNIT_ASSERT(
m_ds);
307 CPPUNIT_ASSERT(dialect != 0);
324 CPPUNIT_ASSERT(
m_ds);
327 CPPUNIT_ASSERT(encodings.size() >= 0);
338 CPPUNIT_ASSERT(datasets.size() > 0);
339 std::auto_ptr<te::da::DataSet>
dt;
345 while (i < datasets.size() && i < 10)
368 std::auto_ptr<te::da::DataSet>
dt;
369 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
372 std::string propname = p->
getName();
385 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
388 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
391 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
394 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
409 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
417 std::auto_ptr<te::da::DataSet>
dt;
418 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
421 std::string propname = p->
getName();
429 int pos = datasetType->getPropertyPosition(p->
getName());
434 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
437 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
440 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
443 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
462 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
465 std::string propname = p->
getName();
470 std::auto_ptr<te::da::DataSet> dtRec;
476 std::auto_ptr<te::gm::Envelope> envRec;
478 CPPUNIT_ASSERT_NO_THROW(envRec = (dtRec.get())->getExtent(pos));
481 std::cout << std::endl <<
"DataSetRec Name: " << (*it) <<
"Size: "<< dtRec->size() << std::endl ;
482 std::cout <<
"DataSetRec Envelop : " << envRec->m_llx <<
"," << envRec->m_lly <<
"," << envRec->m_urx <<
"," << envRec->m_ury << std::endl;
483 std::cout <<
"Test Envelop : " << rec->
m_llx <<
"," << rec->
m_lly <<
"," << rec->
m_urx <<
"," << rec->
m_ury << std::endl;
496 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
500 std::string propname = p->
getName();
502 std::auto_ptr<te::da::DataSet> dtRec;
504 std::vector<std::pair<std::string, te::gm::Envelope> >::iterator itpair;
512 std::auto_ptr<te::gm::Envelope> envRec;
514 CPPUNIT_ASSERT_NO_THROW(envRec = dtRec->getExtent(pos));
515 std::cout << std::endl <<
"DataSet Name: " << (*itpair).first <<
" Size: " << dtRec->size() << std::endl ;
516 std::cout <<
"DataSet Envelop returned: " << envRec->m_llx <<
"," << envRec->m_lly <<
"," << envRec->m_urx <<
"," << envRec->m_ury << std::endl;
517 std::cout <<
"Envelop Filter : " << (*itpair).second.m_llx <<
"," << (*itpair).second.m_lly <<
"," << (*itpair).second.m_urx <<
"," << (*itpair).second.m_ury << std::endl;
536 std::auto_ptr<te::da::DataSet> dtRec;
538 std::vector<std::pair<std::string, te::gm::Envelope> >::iterator itpair;
539 std::vector<std::pair<std::string, size_t> >::iterator itsize;
546 std::auto_ptr<te::da::DataSetType> datasetType =
m_ds->
getDataSetType((*itpair).first);
548 std::string propname = p->
getName();
551 size_t ss = dtRec->size();
552 std::cout << std::endl <<
"DataSet Name: " << (*itpair).first <<
" DataSet Size: " << dtRec->size() <<
" Size expected: " << (*itsize).second << std::endl ;
553 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"DataSet size not equal expected", (*itsize).second, ss);
static te::gm::Polygon * sm_pol
std::map< std::string, std::string > m_connInfoDropDs
static std::vector< std::pair< std::string, size_t > > sm_vecNamesSizes
virtual bool isValid() const =0
It checks if the data source is valid (available for using).
static std::unique_ptr< DataSource > create(const std::string &dsType, const std::string &connInfo)
It creates a new repository for a data source.
static te::gm::Envelope sm_box
te::da::SQLDialect * dialect
static te::da::DataSourceCapabilities sm_capabilit
static std::map< std::string, std::string > sm_connInfoNewDs
virtual std::unique_ptr< DataSourceTransactor > getTransactor()=0
It returns the set of parameters used to set up the access channel to the underlying repository...
virtual void open()=0
It opens the data source and makes it ready for using.
static std::map< std::string, std::string > sm_connInfoExist
te::gm::Geometry * m_geom
void tcGetDataSetByEnvRec2()
void tcSetConnectionInfo()
static std::string sm_connStr
static te::da::DataSource * sm_datasource
It represents the SQL query dialect accepted by a given data source.
double m_urx
Upper right corner x-coordinate.
virtual bool isOpened() const =0
It returns true if the data source is opened, otherwise it returns false.
static std::map< std::string, std::string > sm_connInfoDropDs
const DataTypeCapabilities & getDataTypeCapabilities() const
std::vector< std::string > m_vecDtNames
static void drop(const std::string &dsType, const std::string &connInfo)
It removes a data source identified by its connection information and the driver type.
std::vector< std::pair< std::string, size_t > > m_vecNamesSizesRec
std::map< std::string, std::string > m_connInfoExist
A test suit for the DataSource interface.
std::map< std::string, std::string > m_connInfo
It models a property definition.
void tcGetDataSetByGeometry()
void tcGetConnectionInfo()
virtual std::string getType() const =0
It returns the data source type name (in UPPER CASE). Ex: POSTGIS, SQLITE, WFS, WMS, or MYSQL.
virtual void computeMBR(bool cascade) const _NOEXCEPT_OP(true)=0
It computes the minimum bounding rectangle for the geometry.
virtual const DataSourceCapabilities & getCapabilities() const =0
It returns the known capabilities of the data source.
static std::vector< std::pair< std::string, size_t > > sm_vecNamesSizesRec
double m_llx
Lower left corner x-coordinate.
TEDATAACCESSEXPORT std::size_t GetFirstSpatialPropertyPos(const te::da::DataSet *dataset)
It returns the first dataset spatial property or NULL if none is found.
An Envelope defines a 2D rectangular region.
CPPUNIT_TEST_SUITE_REGISTRATION(TsDataSource)
static te::gm::Point sm_pt
static te::dt::TimeDuration dt(20, 30, 50, 11)
static std::vector< std::string > sm_vecDtNames
std::vector< std::pair< std::string, te::gm::Envelope > > m_vecNamesAndRecs
void setId(const std::string &id)
It sets the data source identification.
te::da::DataSource * m_ds
static te::gm::Geometry * sm_geom
virtual std::vector< std::string > getDataSetNames()
It gets the dataset names available in the data source.
void tcGetDataSetByEnvRec()
std::vector< std::pair< std::string, size_t > > m_vecNamesSizes
virtual std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)
It gets information about the given dataset.
A static class for managing the resources used by DataSource test suit.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
static std::map< std::string, std::string > sm_connInfo
double m_lly
Lower left corner y-coordinate.
std::map< std::string, std::string > m_connInfoNewDs
static std::vector< std::pair< std::string, te::gm::Envelope > > sm_vecNamesAndRecs
te::da::DataSourceCapabilities m_capabilit
virtual std::unique_ptr< DataSet > getDataSet(const std::string &name, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It gets the dataset identified by the given name. This method always returns a disconnected dataset...
static std::vector< std::pair< std::string, te::gm::Envelope > > sm_vecDtNamesAndEnvelops
double m_ury
Upper right corner y-coordinate.
const te::core::URI & getConnectionInfo() const
An Uniform Resource Identifier used to describe the datasource connection.
virtual void close()=0
It closes the data source and clears all the resources used by its internal communication channel...
virtual const SQLDialect * getDialect() const =0
It returns the data source SQL dialect, if there is one.
static std::vector< te::gm::Envelope > sm_vecEnvelops
void tcGetDataSetByEnvRec1()
void tcGetDataSetByProperty()
void tcGetDataSetByOids()
This file contains include headers for the TerraLib Common Runtime module.
This file contains include headers for the Vector Geometry model of TerraLib.
static bool exists(const std::string &dsType, const std::string &connInfo)
It checks if the data source exists with the connection information and the driver type...
const std::string & getId() const
An identification value for the data source.
std::vector< std::pair< std::string, te::gm::Envelope > > m_vecDtNamesAndEnvelops
This file contains include headers for the Data Access module of TerraLib.
std::vector< te::gm::Envelope > m_vecEnvelops
A test suit for the DataSource interface.
static std::string sm_dsType
void tcGetDataSetByName()
const std::string & getName() const
It returns the property name.