void MigrationTest::testBinaryImport()
{ // the migration requires the file to be writable
createTempCopy(u"hsqldb_migration_test.odb");
uno::Reference<XOfficeDatabaseDocument> const xDocument
= getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument); // at this point migration is already done
// the migration requires the file to be writable
createTempCopy(u"tdf126268.odb");
uno::Reference<XOfficeDatabaseDocument> const xDocument
= getDocumentForUrl(maTempFile.GetURL());
// select basically everything from the .odb
uno::Reference<XStatement> statement = xConnection->createStatement();
uno::Reference<XResultSet> xRes
= statement->executeQuery(u"SELECT ID, Column1, Column2 FROM tableTest ORDER BY ID"_ustr);
uno::Reference<XRow> xRow(xRes, UNO_QUERY_THROW);
// check result for (auto& e : expect)
{
CPPUNIT_ASSERT(xRes->next());
CPPUNIT_ASSERT_EQUAL(e.id, xRow->getShort(1));
CPPUNIT_ASSERT_EQUAL(e.number, xRow->getString(2)); //decimal
CPPUNIT_ASSERT_EQUAL(e.number, xRow->getString(3)); //numeric
}
CPPUNIT_ASSERT(!xRes->next());
}
/* The values here assume that our results are in UTC. However, tdf#119675"Firebird:Migration:Userdialogtosettreatmentof datetimeandtimevaluesduringmigration"isgoingtochangethe finalresultofmigration.Ifthatchangeisimplementedbelow thelevelwearetesting,thistestwillhavetoallowfororset thedestinationtimezone.
*/ const expect_t expect[]
= { { 0, 15, 10, 10 }, { 1, 23, 30, 30 }, { 2, 5, 0, 0 }, { 3, 4, 30, 0 },
{ 4, 3, 15, 10 }, { 5, 5, 0, 0 }, { 6, 3, 22, 22 } };
// the migration requires the file to be writable
createTempCopy(u"tdf119625.odb");
uno::Reference<XOfficeDatabaseDocument> const xDocument
= getDocumentForUrl(maTempFile.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument); // at this point migration is already done /* In the presence of tdf#119625, terminal already has messages
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.