mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
ODBC tests for UUID, updated ActiveRecord projects
This commit is contained in:
parent
7569ccf82b
commit
1c9ca37923
@ -547,7 +547,6 @@
|
||||
<ClInclude Include="include\Poco\ActiveRecord\IDTraits.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\Query.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\StatementPlaceholderProvider.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\TypeHandler.h"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ActiveRecord.cpp">
|
||||
|
@ -2,13 +2,13 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="ActiveRecord">
|
||||
<UniqueIdentifier>{eb0280a1-a66f-43a9-b087-283f3d9139d1}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{a2961e06-9534-4945-9e33-934994da5c47}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ActiveRecord\Header Files">
|
||||
<UniqueIdentifier>{2f82c075-05e0-4477-9388-91cf1e241f3e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{a04c32cc-eb8e-4257-a1fc-abdceac6ef39}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ActiveRecord\Source Files">
|
||||
<UniqueIdentifier>{31a3a452-f2fc-4069-b735-edde3b7f789c}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{2c6e1f7c-78bd-4a1a-8c85-581b5684a1ee}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -30,9 +30,6 @@
|
||||
<ClInclude Include="include\Poco\ActiveRecord\StatementPlaceholderProvider.h">
|
||||
<Filter>ActiveRecord\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\TypeHandler.h">
|
||||
<Filter>ActiveRecord\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ActiveRecord.cpp">
|
||||
|
@ -547,7 +547,6 @@
|
||||
<ClInclude Include="include\Poco\ActiveRecord\IDTraits.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\Query.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\StatementPlaceholderProvider.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\TypeHandler.h"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ActiveRecord.cpp">
|
||||
|
@ -2,13 +2,13 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="ActiveRecord">
|
||||
<UniqueIdentifier>{ceead541-8bf8-4ce1-9bc2-20efb73de1e6}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{a4ef5b7c-1517-45e6-8856-e9a6c0a9193c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ActiveRecord\Header Files">
|
||||
<UniqueIdentifier>{f0cd499d-26dc-4a15-950b-713fefc2140e}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{28638692-307b-4c80-9fed-23bcf87f7cc1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ActiveRecord\Source Files">
|
||||
<UniqueIdentifier>{07561f15-f350-4d4d-bd7c-8108cc3f72ed}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{0b612e41-e6c4-48fa-9e02-ba01ee09fb19}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -30,9 +30,6 @@
|
||||
<ClInclude Include="include\Poco\ActiveRecord\StatementPlaceholderProvider.h">
|
||||
<Filter>ActiveRecord\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\TypeHandler.h">
|
||||
<Filter>ActiveRecord\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ActiveRecord.cpp">
|
||||
|
@ -547,7 +547,6 @@
|
||||
<ClInclude Include="include\Poco\ActiveRecord\IDTraits.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\Query.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\StatementPlaceholderProvider.h"/>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\TypeHandler.h"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ActiveRecord.cpp">
|
||||
|
@ -2,13 +2,13 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="ActiveRecord">
|
||||
<UniqueIdentifier>{2d793a01-367a-4494-8825-e83fc6bf6a9b}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{0c7ca2fc-405c-41cb-8a85-0c0be704bb61}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ActiveRecord\Header Files">
|
||||
<UniqueIdentifier>{724c795a-0793-4a4e-a7b2-50ef1a3535e6}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{dc022939-cad7-4896-a860-11904f78b5e8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="ActiveRecord\Source Files">
|
||||
<UniqueIdentifier>{b72bbac1-7fd7-4167-a4fa-4c700c2636bf}</UniqueIdentifier>
|
||||
<UniqueIdentifier>{ff728db9-1520-40b8-89fd-93aa9669be62}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -30,9 +30,6 @@
|
||||
<ClInclude Include="include\Poco\ActiveRecord\StatementPlaceholderProvider.h">
|
||||
<Filter>ActiveRecord\Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\Poco\ActiveRecord\TypeHandler.h">
|
||||
<Filter>ActiveRecord\Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ActiveRecord.cpp">
|
||||
|
@ -524,10 +524,6 @@
|
||||
RelativePath=".\include\Poco\ActiveRecord\StatementPlaceholderProvider.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\ActiveRecord\TypeHandler.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
|
@ -612,6 +612,15 @@ void ODBCSQLServerTest::recreateFloatsTable()
|
||||
}
|
||||
|
||||
|
||||
void ODBCSQLServerTest::recreateUUIDsTable()
|
||||
{
|
||||
dropObject("TABLE", "Strings");
|
||||
try { session() << "CREATE TABLE Strings (str UNIQUEIDENTIFIER)", now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateUUIDsTable()"); }
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateUUIDsTable()"); }
|
||||
}
|
||||
|
||||
|
||||
void ODBCSQLServerTest::recreateTuplesTable()
|
||||
{
|
||||
dropObject("TABLE", "Tuples");
|
||||
@ -787,6 +796,7 @@ CppUnit::Test* ODBCSQLServerTest::suite()
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testDateTime);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testFloat);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testDouble);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testUUID);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testTuple);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testTupleVector);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testStoredProcedure);
|
||||
|
@ -64,6 +64,7 @@ private:
|
||||
void recreateStringsTable();
|
||||
void recreateIntsTable();
|
||||
void recreateFloatsTable();
|
||||
void recreateUUIDsTable();
|
||||
void recreateTuplesTable();
|
||||
void recreateVectorTable();
|
||||
void recreateVectorsTable();
|
||||
|
@ -917,6 +917,21 @@ void ODBCTest::testDouble()
|
||||
}
|
||||
|
||||
|
||||
void ODBCTest::testUUID()
|
||||
{
|
||||
if (!_pSession) fail ("Test not available.");
|
||||
|
||||
for (int i = 0; i < 8;)
|
||||
{
|
||||
recreateUUIDsTable();
|
||||
_pSession->setFeature("autoBind", bindValue(i));
|
||||
_pSession->setFeature("autoExtract", bindValue(i+1));
|
||||
_pExecutor->uuids();
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ODBCTest::testTuple()
|
||||
{
|
||||
if (!_pSession) fail ("Test not available.");
|
||||
|
@ -113,6 +113,8 @@ public:
|
||||
virtual void testFloat();
|
||||
virtual void testDouble();
|
||||
|
||||
virtual void testUUID();
|
||||
|
||||
virtual void testTuple();
|
||||
virtual void testTupleVector();
|
||||
|
||||
@ -166,6 +168,7 @@ protected:
|
||||
virtual void recreateStringsTable();
|
||||
virtual void recreateIntsTable();
|
||||
virtual void recreateFloatsTable();
|
||||
virtual void recreateUUIDsTable();
|
||||
virtual void recreateTuplesTable();
|
||||
virtual void recreateVectorsTable();
|
||||
virtual void recreateAnysTable();
|
||||
@ -317,6 +320,12 @@ inline void ODBCTest::recreateFloatsTable()
|
||||
}
|
||||
|
||||
|
||||
inline void ODBCTest::recreateUUIDsTable()
|
||||
{
|
||||
throw Poco::NotImplementedException("ODBCTest::recreateUUIDsTable()");
|
||||
}
|
||||
|
||||
|
||||
inline void ODBCTest::recreateTuplesTable()
|
||||
{
|
||||
throw Poco::NotImplementedException("ODBCTest::recreateTuplesTable()");
|
||||
|
@ -1540,6 +1540,29 @@ void SQLExecutor::doubles()
|
||||
}
|
||||
|
||||
|
||||
void SQLExecutor::uuids()
|
||||
{
|
||||
std::string funct = "uuids()";
|
||||
Poco::UUID data("49cf6461-9b62-4163-9659-5472ef73153d");
|
||||
Poco::UUID ret;
|
||||
|
||||
try { session() << "INSERT INTO Strings VALUES (?)", use(data), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
|
||||
|
||||
int count = 0;
|
||||
try { session() << "SELECT COUNT(*) FROM Strings", into(count), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
|
||||
assertTrue (count == 1);
|
||||
|
||||
try { session() << "SELECT str FROM Strings", into(ret), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
|
||||
assertTrue (ret == data);
|
||||
}
|
||||
|
||||
|
||||
void SQLExecutor::insertSingleBulkVec()
|
||||
{
|
||||
std::string funct = "insertSingleBulkVec()";
|
||||
|
@ -469,6 +469,7 @@ public:
|
||||
void time();
|
||||
void floats();
|
||||
void doubles();
|
||||
void uuids();
|
||||
void tuples();
|
||||
void tupleVector();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user