105 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
119 CPPUNIT_ASSERT(
m_ds != 0);
122 CPPUNIT_ASSERT(t.get() != 0);
124 std::vector< std::string > dsNames = t->getDataSetNames();
125 CPPUNIT_ASSERT(dsNames.size() > 0);
127 const std::string oldDsName = dsNames[ 0 ];
128 const std::string newDsName =
"newDsName";
130 t->renameDataSet( oldDsName, newDsName );
132 t->renameDataSet( newDsName, oldDsName );
141 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
144 std::vector<std::string> datasets = t->getDataSetNames();
146 CPPUNIT_ASSERT(datasets.size() > 0);
148 std::auto_ptr<te::da::DataSet>
dt;
154 while (i < datasets.size() && i < 10)
156 dt = t->getDataSet(datasets[i]);
157 CPPUNIT_ASSERT_NO_THROW(t->getDataSet(datasets[i]));
180 CPPUNIT_ASSERT(t.get());
182 std::auto_ptr<te::da::DataSet>
dt;
183 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
184 std::auto_ptr<te::da::DataSetType> datasetType = t->getDataSetType(*it);
186 std::string propname = p->
getName();
199 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
202 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
205 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
208 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
223 CPPUNIT_ASSERT_NO_THROW(
m_ds->
open());
225 CPPUNIT_ASSERT(t.get());
230 std::vector<std::string> datasets = t->getDataSetNames();
232 std::auto_ptr<te::da::DataSet>
dt;
234 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
235 std::auto_ptr<te::da::DataSetType> datasetType = t->getDataSetType(*it);
237 std::string propname = p->
getName();
245 int pos = datasetType->getPropertyPosition(p->
getName());
250 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
253 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
256 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
259 std::cout << std::endl <<
"DataSet Name: " << (*it) <<
" DataSet Size: " << dt->size() << std::endl ;
275 CPPUNIT_ASSERT(t.get());
281 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
282 std::auto_ptr<te::da::DataSetType> datasetType = t->getDataSetType(*it);
284 std::string propname = p->
getName();
289 std::auto_ptr<te::da::DataSet> dtRec;
295 std::auto_ptr<te::gm::Envelope> envRec;
297 CPPUNIT_ASSERT_NO_THROW(envRec = (dtRec.get())->getExtent(pos));
300 std::cout << std::endl <<
"DataSetRec Name: " << (*it) <<
"Size: "<< dtRec->size() << std::endl ;
301 std::cout <<
"DataSetRec Envelop : " << envRec->m_llx <<
"," << envRec->m_lly <<
"," << envRec->m_urx <<
"," << envRec->m_ury << std::endl;
302 std::cout <<
"Test Envelop : " << rec->
m_llx <<
"," << rec->
m_lly <<
"," << rec->
m_urx <<
"," << rec->
m_ury << std::endl;
313 CPPUNIT_ASSERT(t.get());
319 std::vector<std::string>::iterator it =
m_vecDtNames.begin();
320 std::auto_ptr<te::da::DataSetType> datasetType = t->getDataSetType(*it);
323 std::string propname = p->
getName();
325 std::auto_ptr<te::da::DataSet> dtRec;
327 std::vector<std::pair<std::string, te::gm::Envelope> >::iterator itpair;
332 CPPUNIT_ASSERT_NO_THROW(dtRec = t->getDataSet( (*itpair).first,propname, &(*itpair).second,
te::gm::INTERSECTS ));
335 std::auto_ptr<te::gm::Envelope> envRec;
337 CPPUNIT_ASSERT_NO_THROW(envRec = dtRec->getExtent(pos));
338 std::cout << std::endl <<
"DataSet Name: " << (*itpair).first <<
" Size: " << dtRec->size() << std::endl ;
339 std::cout <<
"DataSet Envelop returned: " << envRec->m_llx <<
"," << envRec->m_lly <<
"," << envRec->m_urx <<
"," << envRec->m_ury << std::endl;
340 std::cout <<
"Envelop Filter : " << (*itpair).second.m_llx <<
"," << (*itpair).second.m_lly <<
"," << (*itpair).second.m_urx <<
"," << (*itpair).second.m_ury << std::endl;
357 CPPUNIT_ASSERT(t.get());
363 std::auto_ptr<te::da::DataSet> dtRec;
365 std::vector<std::pair<std::string, te::gm::Envelope> >::iterator itpair;
366 std::vector<std::pair<std::string, size_t> >::iterator itsize;
373 std::auto_ptr<te::da::DataSetType> datasetType = t->getDataSetType((*itpair).first);
375 std::string propname = p->
getName();
377 CPPUNIT_ASSERT_NO_THROW(dtRec = t->getDataSet( (*itpair).first, propname,&(*itpair).second,
te::gm::INTERSECTS));
378 size_t ss = dtRec->size();
379 std::cout << std::endl <<
"DataSet Name: " << (*itpair).first <<
" DataSet Size: " << dtRec->size() <<
" Size expected: " << (*itsize).second << std::endl ;
380 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"DataSet size not equal expected", (*itsize).second, ss);
405 std::vector<std::pair<std::string, size_t> >::iterator it =
m_vecNamesSizes.begin();
406 std::string sql =
"Select * FROM " + (*it).first;
408 CPPUNIT_ASSERT(dstrans.get());
410 std::auto_ptr<te::da::DataSet>
dt;
411 CPPUNIT_ASSERT_NO_THROW(dt = dstrans->query(sql));
412 size_t dtsize = dt->size();
413 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Size not equal expected: ", (*it).second, dtsize);
static te::gm::Polygon * sm_pol
static std::vector< std::pair< std::string, size_t > > sm_vecNamesSizes
std::vector< std::pair< std::string, te::gm::Envelope > > m_vecDtNamesAndEnvelops
static te::gm::Envelope sm_box
CPPUNIT_TEST_SUITE_REGISTRATION(TsDataSourceTransactor)
virtual std::unique_ptr< DataSourceTransactor > getTransactor()=0
It returns the set of parameters used to set up the access channel to the underlying repository...
void tcGetDataSetByEnvRec()
Test Case: get only the objects that intercepts a given rectangle.
virtual void open()=0
It opens the data source and makes it ready for using.
static te::da::DataSource * sm_datasource
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.
void tcGetDataSet()
Test Case: get the dataSet using the i-th position in the DataSourceCatalog.
const DataTypeCapabilities & getDataTypeCapabilities() const
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
const QueryCapabilities & getQueryCapabilities() const
bool supportsSelectInto() const
It models a property definition.
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.
void tcGetDataSetByOids()
Test Case: It gets a dataset identified by the given name using the set of objects identification...
An Envelope defines a 2D rectangular region.
static size_t sm_nroDataSets
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::string > m_vecDtNames
static te::gm::Geometry * sm_geom
std::vector< std::pair< std::string, size_t > > m_vecNamesSizesRec
void tcGetDataSetByEnvRec1()
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
void tcBegin()
Test Case: Testing DataSourceTransactor of an given datasource.
double m_lly
Lower left corner y-coordinate.
std::vector< std::pair< std::string, size_t > > m_vecNamesSizes
static std::vector< std::pair< std::string, te::gm::Envelope > > sm_vecNamesAndRecs
void tcGetDataSetByEnvRec2()
Test Case: get only the objects that intercepts a given rectangle.
te::da::DataSource * m_ds
static std::vector< std::pair< std::string, te::gm::Envelope > > sm_vecDtNamesAndEnvelops
void tcGetBatchExecutor()
te::da::DataSourceCapabilities m_capabilit
double m_ury
Upper right corner y-coordinate.
const te::core::URI & getConnectionInfo() const
An Uniform Resource Identifier used to describe the datasource connection.
static std::vector< te::gm::Envelope > sm_vecEnvelops
void tcGetDataSetByProperty()
Test Case: It gets the DataSet identified by the given name using a spatial filter over the given geo...
std::map< std::string, std::string > m_connInfo
A test suit for the DataSourceTransactor interface.
This file contains include headers for the TerraLib Common Runtime module.
std::vector< te::gm::Envelope > m_vecEnvelops
This file contains include headers for the Vector Geometry model of TerraLib.
A test suit for the DataSourceTransactor interface.
This file contains include headers for the Data Access module of TerraLib.
void tcGetDataSetByGeometry()
Test Case: get only the objects that intercepts a given geometry (point, box, pol, geom).
static std::string sm_dsType
std::vector< std::pair< std::string, te::gm::Envelope > > m_vecNamesAndRecs
te::gm::Geometry * m_geom
const std::string & getName() const
It returns the property name.