mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-11 10:27:10 +02:00
Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
This commit is contained in:
153
vendor/POCO/Data/testsuite/src/Binder.cpp
vendored
Normal file
153
vendor/POCO/Data/testsuite/src/Binder.cpp
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// Binder.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "Binder.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
Binder::Binder()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Binder::~Binder()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int8 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt8 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int16 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt16 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int32 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt32 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int64 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt64 &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
void Binder::bind(std::size_t pos, const long& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const unsigned long& val, Direction dir)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const bool &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const float &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const double &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const char &val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const char* const &pVal, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UTF16String& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const BLOB& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const CLOB& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Date& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Time& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const DateTime& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const NullData& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
113
vendor/POCO/Data/testsuite/src/Binder.h
vendored
Normal file
113
vendor/POCO/Data/testsuite/src/Binder.h
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// Binder.h
|
||||
//
|
||||
// Definition of the Binder class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_Binder_INCLUDED
|
||||
#define Data_Test_Binder_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class Binder: public Poco::Data::AbstractBinder
|
||||
/// A no-op implementation of AbstractBinder for testing.
|
||||
{
|
||||
public:
|
||||
Binder();
|
||||
/// Creates the Binder.
|
||||
|
||||
~Binder();
|
||||
/// Destroys the Binder.
|
||||
|
||||
void bind(std::size_t pos, const Poco::Int8 &val, Direction dir);
|
||||
/// Binds an Int8.
|
||||
|
||||
void bind(std::size_t pos, const Poco::UInt8 &val, Direction dir);
|
||||
/// Binds an UInt8.
|
||||
|
||||
void bind(std::size_t pos, const Poco::Int16 &val, Direction dir);
|
||||
/// Binds an Int16.
|
||||
|
||||
void bind(std::size_t pos, const Poco::UInt16 &val, Direction dir);
|
||||
/// Binds an UInt16.
|
||||
|
||||
void bind(std::size_t pos, const Poco::Int32 &val, Direction dir);
|
||||
/// Binds an Int32.
|
||||
|
||||
void bind(std::size_t pos, const Poco::UInt32 &val, Direction dir);
|
||||
/// Binds an UInt32.
|
||||
|
||||
void bind(std::size_t pos, const Poco::Int64 &val, Direction dir);
|
||||
/// Binds an Int64.
|
||||
|
||||
void bind(std::size_t pos, const Poco::UInt64 &val, Direction dir);
|
||||
/// Binds an UInt64.
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
void bind(std::size_t pos, const long& val, Direction dir);
|
||||
/// Binds a long.
|
||||
|
||||
void bind(std::size_t pos, const unsigned long& val, Direction dir);
|
||||
/// Binds an unsigned long.
|
||||
#endif
|
||||
|
||||
void bind(std::size_t pos, const bool &val, Direction dir);
|
||||
/// Binds a boolean.
|
||||
|
||||
void bind(std::size_t pos, const float &val, Direction dir);
|
||||
/// Binds a float.
|
||||
|
||||
void bind(std::size_t pos, const double &val, Direction dir);
|
||||
/// Binds a double.
|
||||
|
||||
void bind(std::size_t pos, const char &val, Direction dir);
|
||||
/// Binds a single character.
|
||||
|
||||
void bind(std::size_t pos, const char* const &pVal, Direction dir);
|
||||
/// Binds a const char ptr.
|
||||
|
||||
void bind(std::size_t pos, const std::string& val, Direction dir);
|
||||
/// Binds a string.
|
||||
|
||||
void bind(std::size_t pos, const Poco::UTF16String& val, Direction dir);
|
||||
/// Binds a UTF16String.
|
||||
|
||||
void bind(std::size_t pos, const BLOB& val, Direction dir);
|
||||
/// Binds a BLOB.
|
||||
|
||||
void bind(std::size_t pos, const CLOB& val, Direction dir);
|
||||
/// Binds a CLOB.
|
||||
|
||||
void bind(std::size_t pos, const Date& val, Direction dir);
|
||||
/// Binds a Date.
|
||||
|
||||
void bind(std::size_t pos, const Time& val, Direction dir);
|
||||
/// Binds a Time.
|
||||
|
||||
void bind(std::size_t pos, const DateTime& val, Direction dir);
|
||||
/// Binds a DateTime.
|
||||
|
||||
void bind(std::size_t pos, const NullData& val, Direction dir);
|
||||
/// Binds a DateTime.
|
||||
|
||||
void reset();
|
||||
};
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_Binder_INCLUDED
|
53
vendor/POCO/Data/testsuite/src/Connector.cpp
vendored
Normal file
53
vendor/POCO/Data/testsuite/src/Connector.cpp
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Connector.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "Connector.h"
|
||||
#include "SessionImpl.h"
|
||||
#include "Poco/Data/SessionFactory.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
const std::string Connector::KEY("test");
|
||||
|
||||
|
||||
Connector::Connector()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Connector::~Connector()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Poco::AutoPtr<Poco::Data::SessionImpl> Connector::createSession(const std::string& connectionString,
|
||||
std::size_t timeout)
|
||||
{
|
||||
return Poco::AutoPtr<Poco::Data::SessionImpl>(new SessionImpl(connectionString, timeout));
|
||||
}
|
||||
|
||||
|
||||
void Connector::addToFactory()
|
||||
{
|
||||
Poco::Data::SessionFactory::instance().add(new Connector());
|
||||
}
|
||||
|
||||
|
||||
void Connector::removeFromFactory()
|
||||
{
|
||||
Poco::Data::SessionFactory::instance().remove(KEY);
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
65
vendor/POCO/Data/testsuite/src/Connector.h
vendored
Normal file
65
vendor/POCO/Data/testsuite/src/Connector.h
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// Connector.h
|
||||
//
|
||||
// Definition of the Connector class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_Connector_INCLUDED
|
||||
#define Data_Test_Connector_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Connector.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class Connector: public Poco::Data::Connector
|
||||
/// Connector instantiates SessionImpl objects for testing.
|
||||
{
|
||||
public:
|
||||
static const std::string KEY;
|
||||
/// Keyword for creating test sessions.
|
||||
|
||||
Connector();
|
||||
/// Creates the Connector.
|
||||
|
||||
~Connector();
|
||||
/// Destroys the Connector.
|
||||
|
||||
const std::string& name() const;
|
||||
/// Returns the name associated with this connector.
|
||||
|
||||
Poco::AutoPtr<Poco::Data::SessionImpl> createSession(const std::string& connectionString,
|
||||
std::size_t timeout = SessionImpl::LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates a test SessionImpl object and initializes it with the given connectionString.
|
||||
|
||||
static void addToFactory();
|
||||
/// Registers the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory.
|
||||
|
||||
static void removeFromFactory();
|
||||
/// Unregisters the Connector under the Keyword Connector::KEY at the Poco::Data::SessionFactory.
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
/// inlines
|
||||
///
|
||||
inline const std::string& Connector::name() const
|
||||
{
|
||||
return KEY;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_Connector_INCLUDED
|
1393
vendor/POCO/Data/testsuite/src/DataTest.cpp
vendored
Normal file
1393
vendor/POCO/Data/testsuite/src/DataTest.cpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
67
vendor/POCO/Data/testsuite/src/DataTest.h
vendored
Normal file
67
vendor/POCO/Data/testsuite/src/DataTest.h
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// DataTest.h
|
||||
//
|
||||
// Definition of the DataTest class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef DataTest_INCLUDED
|
||||
#define DataTest_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/BinaryReader.h"
|
||||
#include "Poco/BinaryWriter.h"
|
||||
#include "Poco/Data/Row.h"
|
||||
#include "CppUnit/TestCase.h"
|
||||
|
||||
|
||||
class DataTest: public CppUnit::TestCase
|
||||
{
|
||||
public:
|
||||
DataTest(const std::string& name);
|
||||
~DataTest();
|
||||
|
||||
void testSession();
|
||||
void testStatementFormatting();
|
||||
void testFeatures();
|
||||
void testProperties();
|
||||
void testLOB();
|
||||
void testCLOB();
|
||||
void testCLOBStreams();
|
||||
void testColumnVector();
|
||||
void testColumnVectorBool();
|
||||
void testColumnDeque();
|
||||
void testColumnList();
|
||||
void testRow();
|
||||
void testRowSort();
|
||||
void testRowFormat();
|
||||
void testDateAndTime();
|
||||
void testExternalBindingAndExtraction();
|
||||
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
static CppUnit::Test* suite();
|
||||
|
||||
private:
|
||||
void testRowStrictWeak(const Poco::Data::Row& row1,
|
||||
const Poco::Data::Row& row2,
|
||||
const Poco::Data::Row& row3);
|
||||
/// Strict weak ordering requirement for sorted containers
|
||||
/// as described in Josuttis "The Standard C++ Library"
|
||||
/// chapter 6.5. pg. 176.
|
||||
/// For this to pass, the following condition must be satisifed:
|
||||
/// row1 < row2 < row3
|
||||
|
||||
void writeToCLOB(Poco::BinaryWriter& writer);
|
||||
void readFromCLOB(Poco::BinaryReader& reader);
|
||||
};
|
||||
|
||||
|
||||
#endif // DataTest_INCLUDED
|
24
vendor/POCO/Data/testsuite/src/DataTestSuite.cpp
vendored
Normal file
24
vendor/POCO/Data/testsuite/src/DataTestSuite.cpp
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// DataTestSuite.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "DataTestSuite.h"
|
||||
#include "DataTest.h"
|
||||
#include "SessionPoolTest.h"
|
||||
|
||||
|
||||
CppUnit::Test* DataTestSuite::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DataTestSuite");
|
||||
|
||||
pSuite->addTest(DataTest::suite());
|
||||
pSuite->addTest(SessionPoolTest::suite());
|
||||
|
||||
return pSuite;
|
||||
}
|
27
vendor/POCO/Data/testsuite/src/DataTestSuite.h
vendored
Normal file
27
vendor/POCO/Data/testsuite/src/DataTestSuite.h
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// DataTestSuite.h
|
||||
//
|
||||
// Definition of the DataTestSuite class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef DataTestSuite_INCLUDED
|
||||
#define DataTestSuite_INCLUDED
|
||||
|
||||
|
||||
#include "CppUnit/TestSuite.h"
|
||||
|
||||
|
||||
class DataTestSuite
|
||||
{
|
||||
public:
|
||||
static CppUnit::Test* suite();
|
||||
};
|
||||
|
||||
|
||||
#endif // DataTestSuite_INCLUDED
|
17
vendor/POCO/Data/testsuite/src/Driver.cpp
vendored
Normal file
17
vendor/POCO/Data/testsuite/src/Driver.cpp
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Driver.cpp
|
||||
//
|
||||
// Console-based test driver for Poco Data.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "CppUnit/TestRunner.h"
|
||||
#include "DataTestSuite.h"
|
||||
|
||||
|
||||
CppUnitMain(DataTestSuite)
|
188
vendor/POCO/Data/testsuite/src/Extractor.cpp
vendored
Normal file
188
vendor/POCO/Data/testsuite/src/Extractor.cpp
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
//
|
||||
// Extractor.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "Extractor.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
Extractor::Extractor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Extractor::~Extractor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int8& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt8& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int16& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt16& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int32& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt32& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int64& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
bool Extractor::extract(std::size_t pos, long& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, unsigned long& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, bool& val)
|
||||
{
|
||||
val = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, float& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, double& val)
|
||||
{
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, char& val)
|
||||
{
|
||||
val = '\0';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::string& val)
|
||||
{
|
||||
val = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UTF16String& val)
|
||||
{
|
||||
std::string str("");
|
||||
Poco::UnicodeConverter::convert(str, val);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::Date& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::Time& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::DateTime& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Any& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Dynamic::Var& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
127
vendor/POCO/Data/testsuite/src/Extractor.h
vendored
Normal file
127
vendor/POCO/Data/testsuite/src/Extractor.h
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// Extractor.h
|
||||
//
|
||||
// Definition of the Extractor class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_Extractor_INCLUDED
|
||||
#define Data_Test_Extractor_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractExtractor.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class Extractor: public Poco::Data::AbstractExtractor
|
||||
/// A no-op implementation of AbstractExtractor for testing.
|
||||
{
|
||||
public:
|
||||
Extractor();
|
||||
/// Creates the Extractor.
|
||||
|
||||
~Extractor();
|
||||
/// Destroys the Extractor.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Int8& val);
|
||||
/// Extracts an Int8.
|
||||
|
||||
bool extract(std::size_t pos, Poco::UInt8& val);
|
||||
/// Extracts an UInt8.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Int16& val);
|
||||
/// Extracts an Int16.
|
||||
|
||||
bool extract(std::size_t pos, Poco::UInt16& val);
|
||||
/// Extracts an UInt16.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Int32& val);
|
||||
/// Extracts an Int32.
|
||||
|
||||
bool extract(std::size_t pos, Poco::UInt32& val);
|
||||
/// Extracts an UInt32.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Int64& val);
|
||||
/// Extracts an Int64.
|
||||
|
||||
bool extract(std::size_t pos, Poco::UInt64& val);
|
||||
/// Extracts an UInt64.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Any& val);
|
||||
/// Extracts an Any.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Dynamic::Var& val);
|
||||
/// Extracts a Var.
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
bool extract(std::size_t pos, long& val);
|
||||
/// Extracts a long.
|
||||
|
||||
bool extract(std::size_t pos, unsigned long& val);
|
||||
/// Extracts an unsigned long.
|
||||
#endif
|
||||
|
||||
bool extract(std::size_t pos, bool& val);
|
||||
/// Extracts a boolean.
|
||||
|
||||
bool extract(std::size_t pos, float& val);
|
||||
/// Extracts a float.
|
||||
|
||||
bool extract(std::size_t pos, double& val);
|
||||
/// Extracts a double.
|
||||
|
||||
bool extract(std::size_t pos, char& val);
|
||||
/// Extracts a single character.
|
||||
|
||||
bool extract(std::size_t pos, std::string& val);
|
||||
/// Extracts a string.
|
||||
|
||||
bool extract(std::size_t pos, Poco::UTF16String& val);
|
||||
/// Extracts a UTF16String.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::BLOB& val);
|
||||
/// Extracts a BLOB.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::CLOB& val);
|
||||
/// Extracts a CLOB.
|
||||
|
||||
bool extract(std::size_t pos, Date& val);
|
||||
/// Extracts a Date.
|
||||
|
||||
bool extract(std::size_t pos, Time& val);
|
||||
/// Extracts a Time.
|
||||
|
||||
bool extract(std::size_t pos, Poco::DateTime& val);
|
||||
/// Extracts a DateTime.
|
||||
|
||||
bool isNull(std::size_t col, std::size_t row = -1);
|
||||
/// Returns true if the current row value at pos column is null.
|
||||
|
||||
void reset();
|
||||
};
|
||||
|
||||
|
||||
inline void Extractor::reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::isNull(std::size_t col, std::size_t row)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_Extractor_INCLUDED
|
148
vendor/POCO/Data/testsuite/src/Preparator.cpp
vendored
Normal file
148
vendor/POCO/Data/testsuite/src/Preparator.cpp
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
//
|
||||
// Preparator.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "Preparator.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
Preparator::Preparator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Preparator::~Preparator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Int8&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::UInt8&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Int16&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::UInt16&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Int32&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::UInt32&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Int64&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::UInt64&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
void Preparator::prepare(std::size_t pos, const long&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const unsigned long&)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const bool&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const float&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const double&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const char&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const std::string&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::UTF16String&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::BLOB&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::CLOB&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::Date&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::Time&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::DateTime&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Any&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Dynamic::Var&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
112
vendor/POCO/Data/testsuite/src/Preparator.h
vendored
Normal file
112
vendor/POCO/Data/testsuite/src/Preparator.h
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
//
|
||||
// Preparator.h
|
||||
//
|
||||
// Definition of the Preparator class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_Preparator_INCLUDED
|
||||
#define Data_Test_Preparator_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractPreparator.h"
|
||||
#include "Poco/Any.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class Preparator: public Poco::Data::AbstractPreparator
|
||||
/// A no-op implementation of AbstractPreparator for testing.
|
||||
{
|
||||
public:
|
||||
Preparator();
|
||||
/// Creates the Preparator.
|
||||
|
||||
~Preparator();
|
||||
/// Destroys the Preparator.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Int8&);
|
||||
/// Prepares an Int8.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::UInt8&);
|
||||
/// Prepares an UInt8.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Int16&);
|
||||
/// Prepares an Int16.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::UInt16&);
|
||||
/// Prepares an UInt16.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Int32&);
|
||||
/// Prepares an Int32.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::UInt32&);
|
||||
/// Prepares an UInt32.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Int64&);
|
||||
/// Prepares an Int64.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::UInt64&);
|
||||
/// Prepares an UInt64.
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
void prepare(std::size_t pos, const long&);
|
||||
/// Prepares a long.
|
||||
|
||||
void prepare(std::size_t pos, const unsigned long&);
|
||||
/// Prepares an unsigned long.
|
||||
#endif
|
||||
|
||||
void prepare(std::size_t pos, const bool&);
|
||||
/// Prepares a boolean.
|
||||
|
||||
void prepare(std::size_t pos, const float&);
|
||||
/// Prepares a float.
|
||||
|
||||
void prepare(std::size_t pos, const double&);
|
||||
/// Prepares a double.
|
||||
|
||||
void prepare(std::size_t pos, const char&);
|
||||
/// Prepares a single character.
|
||||
|
||||
void prepare(std::size_t pos, const std::string&);
|
||||
/// Prepares a string.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::UTF16String&);
|
||||
/// Prepares a UTF16String.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::BLOB&);
|
||||
/// Prepares a BLOB.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::CLOB&);
|
||||
/// Prepares a CLOB.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::Date&);
|
||||
/// Prepares a Date.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::Time&);
|
||||
/// Prepares a Time.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::DateTime&);
|
||||
/// Prepares a DateTime.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Any&);
|
||||
/// Prepares an Any.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Dynamic::Var&);
|
||||
/// Prepares a Var.
|
||||
};
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_Preparator_INCLUDED
|
172
vendor/POCO/Data/testsuite/src/SessionImpl.cpp
vendored
Normal file
172
vendor/POCO/Data/testsuite/src/SessionImpl.cpp
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
//
|
||||
// SessionImpl.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "SessionImpl.h"
|
||||
#include "TestStatementImpl.h"
|
||||
#include "Connector.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
SessionImpl::SessionImpl(const std::string& init, std::size_t timeout):
|
||||
Poco::Data::AbstractSessionImpl<SessionImpl>(init, timeout),
|
||||
_f(false),
|
||||
_connected(true)
|
||||
{
|
||||
addFeature("f1", &SessionImpl::setF, &SessionImpl::getF);
|
||||
addFeature("f2", 0, &SessionImpl::getF);
|
||||
addFeature("f3", &SessionImpl::setF, 0);
|
||||
addFeature("connected", &SessionImpl::setConnected, &SessionImpl::getConnected);
|
||||
addProperty("p1", &SessionImpl::setP, &SessionImpl::getP);
|
||||
addProperty("p2", 0, &SessionImpl::getP);
|
||||
addProperty("p3", &SessionImpl::setP, &SessionImpl::getP);
|
||||
}
|
||||
|
||||
|
||||
SessionImpl::~SessionImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::open(const std::string& connectionString)
|
||||
{
|
||||
_connected = true;
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::close()
|
||||
{
|
||||
_connected = false;
|
||||
}
|
||||
|
||||
void SessionImpl::reset()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::isConnected() const
|
||||
{
|
||||
return _connected;
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::setConnectionTimeout(std::size_t timeout)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
std::size_t SessionImpl::getConnectionTimeout() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
StatementImpl::Ptr SessionImpl::createStatementImpl()
|
||||
{
|
||||
return new TestStatementImpl(*this);
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::begin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::commit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::rollback()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::canTransact() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::isTransaction() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::setTransactionIsolation(Poco::UInt32)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 SessionImpl::getTransactionIsolation() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::hasTransactionIsolation(Poco::UInt32) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::isTransactionIsolation(Poco::UInt32) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const std::string& SessionImpl::connectorName() const
|
||||
{
|
||||
return Connector::KEY;
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::getConnected(const std::string& name) const
|
||||
{
|
||||
return _connected;
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::setConnected(const std::string& name, bool value)
|
||||
{
|
||||
_connected = value;
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::setF(const std::string& name, bool value)
|
||||
{
|
||||
_f = value;
|
||||
}
|
||||
|
||||
|
||||
bool SessionImpl::getF(const std::string& name) const
|
||||
{
|
||||
return _f;
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::setP(const std::string& name, const Poco::Any& value)
|
||||
{
|
||||
_p = value;
|
||||
}
|
||||
|
||||
|
||||
Poco::Any SessionImpl::getP(const std::string& name) const
|
||||
{
|
||||
return _p;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
115
vendor/POCO/Data/testsuite/src/SessionImpl.h
vendored
Normal file
115
vendor/POCO/Data/testsuite/src/SessionImpl.h
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
//
|
||||
// SessionImpl.h
|
||||
//
|
||||
// Definition of the SessionImpl class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_SessionImpl_INCLUDED
|
||||
#define Data_Test_SessionImpl_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractSessionImpl.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Binder.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class SessionImpl: public Poco::Data::AbstractSessionImpl<SessionImpl>
|
||||
/// A no-op implementation of SessionImpl for testing.
|
||||
{
|
||||
public:
|
||||
SessionImpl(const std::string& init,
|
||||
std::size_t timeout = LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates the SessionImpl. Opens a connection to the database.
|
||||
|
||||
~SessionImpl();
|
||||
/// Destroys the SessionImpl.
|
||||
|
||||
StatementImpl::Ptr createStatementImpl();
|
||||
/// Returns an test StatementImpl.
|
||||
|
||||
void open(const std::string& connectionString = "");
|
||||
/// Opens the session.
|
||||
|
||||
void close();
|
||||
/// Closes the session.
|
||||
|
||||
void reset();
|
||||
/// Reset connection with dababase and clears session state, but without disconnecting
|
||||
|
||||
bool isConnected() const;
|
||||
/// Returns true if session is connected to the database,
|
||||
/// false otherwise.
|
||||
|
||||
void setConnectionTimeout(std::size_t timeout);
|
||||
/// Sets the session connection timeout value.
|
||||
|
||||
std::size_t getConnectionTimeout() const;
|
||||
/// Returns the session connection timeout value.
|
||||
|
||||
void begin();
|
||||
/// Starts a transaction.
|
||||
|
||||
void commit();
|
||||
/// Commits and ends a transaction.
|
||||
|
||||
void rollback();
|
||||
/// Aborts a transaction.
|
||||
|
||||
bool canTransact() const;
|
||||
/// Returns true if session has transaction capabilities.
|
||||
|
||||
bool isTransaction() const;
|
||||
/// Returns true iff a transaction is a transaction is in progress, false otherwise.
|
||||
|
||||
void setTransactionIsolation(Poco::UInt32);
|
||||
/// Sets the transaction isolation level.
|
||||
|
||||
Poco::UInt32 getTransactionIsolation() const;
|
||||
/// Returns the transaction isolation level.
|
||||
|
||||
bool hasTransactionIsolation(Poco::UInt32) const;
|
||||
/// Returns true iff the transaction isolation level corresponding
|
||||
/// to the supplied bitmask is supported.
|
||||
|
||||
bool isTransactionIsolation(Poco::UInt32) const;
|
||||
/// Returns true iff the transaction isolation level corresponds
|
||||
/// to the supplied bitmask.
|
||||
|
||||
const std::string& connectorName() const;
|
||||
/// Returns the name of the connector.
|
||||
|
||||
void setConnected(const std::string& name, bool value);
|
||||
bool getConnected(const std::string& name) const;
|
||||
/// Sets/gets the connected property.
|
||||
/// This is normally done by implementation
|
||||
/// when a database connection loss is detected.
|
||||
|
||||
void setF(const std::string& name, bool value);
|
||||
bool getF(const std::string& name) const;
|
||||
void setP(const std::string& name, const Poco::Any& value);
|
||||
Poco::Any getP(const std::string& name) const;
|
||||
|
||||
private:
|
||||
bool _f;
|
||||
Poco::Any _p;
|
||||
bool _connected;
|
||||
std::string _connectionString;
|
||||
};
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_SessionImpl_INCLUDED
|
272
vendor/POCO/Data/testsuite/src/SessionPoolTest.cpp
vendored
Normal file
272
vendor/POCO/Data/testsuite/src/SessionPoolTest.cpp
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
//
|
||||
// SessionPoolTest.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "SessionPoolTest.h"
|
||||
#include "CppUnit/TestCaller.h"
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/Data/SessionPool.h"
|
||||
#include "Poco/Data/SessionPoolContainer.h"
|
||||
#include "Poco/Thread.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Connector.h"
|
||||
|
||||
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Thread;
|
||||
using Poco::AutoPtr;
|
||||
using Poco::NotFoundException;
|
||||
using Poco::InvalidAccessException;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::SessionPool;
|
||||
using Poco::Data::SessionPoolContainer;
|
||||
using Poco::Data::SessionPoolExhaustedException;
|
||||
using Poco::Data::SessionPoolExistsException;
|
||||
using Poco::Data::SessionUnavailableException;
|
||||
|
||||
|
||||
SessionPoolTest::SessionPoolTest(const std::string& name): CppUnit::TestCase(name)
|
||||
{
|
||||
Poco::Data::Test::Connector::addToFactory();
|
||||
}
|
||||
|
||||
|
||||
SessionPoolTest::~SessionPoolTest()
|
||||
{
|
||||
Poco::Data::Test::Connector::removeFromFactory();
|
||||
}
|
||||
|
||||
|
||||
void SessionPoolTest::testSessionPool()
|
||||
{
|
||||
SessionPool pool("test", "cs", 1, 4, 2);
|
||||
|
||||
pool.setFeature("f1", true);
|
||||
assertTrue (pool.getFeature("f1"));
|
||||
try { pool.getFeature("g1"); fail ("must fail"); }
|
||||
catch ( Poco::NotFoundException& ) { }
|
||||
|
||||
pool.setProperty("p1", 1);
|
||||
assertTrue (1 == Poco::AnyCast<int>(pool.getProperty("p1")));
|
||||
try { pool.getProperty("r1"); fail ("must fail"); }
|
||||
catch ( Poco::NotFoundException& ) { }
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 0);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 4);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
Session s1(pool.get());
|
||||
|
||||
assertTrue (s1.getFeature("f1"));
|
||||
assertTrue (1 == Poco::AnyCast<int>(s1.getProperty("p1")));
|
||||
|
||||
try { pool.setFeature("f1", true); fail ("must fail"); }
|
||||
catch ( Poco::InvalidAccessException& ) { }
|
||||
|
||||
try { pool.setProperty("p1", 1); fail ("must fail"); }
|
||||
catch ( Poco::InvalidAccessException& ) { }
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 1);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 3);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
Session s2(pool.get("f1", false));
|
||||
assertTrue (!s2.getFeature("f1"));
|
||||
assertTrue (1 == Poco::AnyCast<int>(s2.getProperty("p1")));
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 2);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 2);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
{
|
||||
Session s3(pool.get("p1", 2));
|
||||
assertTrue (s3.getFeature("f1"));
|
||||
assertTrue (2 == Poco::AnyCast<int>(s3.getProperty("p1")));
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 3);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 1);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
}
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 3);
|
||||
assertTrue (pool.idle() == 1);
|
||||
assertTrue (pool.available() == 2);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
Session s4(pool.get());
|
||||
assertTrue (s4.getFeature("f1"));
|
||||
assertTrue (1 == Poco::AnyCast<int>(s4.getProperty("p1")));
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 3);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 1);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
Session s5(pool.get());
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 4);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 0);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
try
|
||||
{
|
||||
Session s6(pool.get());
|
||||
fail("pool exhausted - must throw");
|
||||
}
|
||||
catch (SessionPoolExhaustedException&) { }
|
||||
|
||||
s5.close();
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 4);
|
||||
assertTrue (pool.idle() == 1);
|
||||
assertTrue (pool.available() == 1);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
try
|
||||
{
|
||||
s5 << "DROP TABLE IF EXISTS Test", now;
|
||||
fail("session unusable - must throw");
|
||||
}
|
||||
catch (SessionUnavailableException&) { }
|
||||
|
||||
s4.close();
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 4);
|
||||
assertTrue (pool.idle() == 2);
|
||||
assertTrue (pool.available() == 2);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
Thread::sleep(5000); // time to clean up idle sessions
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 2);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 2);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
Session s6(pool.get());
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 3);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 1);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
s6.setFeature("connected", false);
|
||||
assertTrue (pool.dead() == 1);
|
||||
|
||||
s6.close();
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 2);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 2);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
|
||||
assertTrue (pool.isActive());
|
||||
pool.shutdown();
|
||||
assertTrue (!pool.isActive());
|
||||
try
|
||||
{
|
||||
Session s7(pool.get());
|
||||
fail("pool shut down - must throw");
|
||||
}
|
||||
catch (InvalidAccessException&) { }
|
||||
|
||||
assertTrue (pool.capacity() == 4);
|
||||
assertTrue (pool.allocated() == 0);
|
||||
assertTrue (pool.idle() == 0);
|
||||
assertTrue (pool.available() == 0);
|
||||
assertTrue (pool.dead() == 0);
|
||||
assertTrue (pool.allocated() == pool.used() + pool.idle());
|
||||
}
|
||||
|
||||
|
||||
void SessionPoolTest::testSessionPoolContainer()
|
||||
{
|
||||
SessionPoolContainer spc;
|
||||
AutoPtr<SessionPool> pPool = new SessionPool("TeSt", "Cs");
|
||||
spc.add(pPool);
|
||||
assertTrue (pPool->isActive());
|
||||
assertTrue (spc.isActive("test", "cs"));
|
||||
assertTrue (spc.isActive("test:///cs"));
|
||||
assertTrue (spc.has("test:///cs"));
|
||||
assertTrue (1 == spc.count());
|
||||
|
||||
Poco::Data::Session sess = spc.get("test:///cs");
|
||||
assertTrue ("test" == sess.impl()->connectorName());
|
||||
assertTrue ("Cs" == sess.impl()->connectionString());
|
||||
assertTrue ("test:///Cs" == sess.uri());
|
||||
|
||||
try { spc.add(pPool); fail ("must fail"); }
|
||||
catch (SessionPoolExistsException&) { }
|
||||
pPool->shutdown();
|
||||
assertTrue (!pPool->isActive());
|
||||
assertTrue (!spc.isActive("test", "cs"));
|
||||
assertTrue (!spc.isActive("test:///cs"));
|
||||
spc.remove(pPool->name());
|
||||
assertTrue (!spc.has("test:///cs"));
|
||||
assertTrue (!spc.isActive("test", "cs"));
|
||||
assertTrue (!spc.isActive("test:///cs"));
|
||||
assertTrue (0 == spc.count());
|
||||
try { spc.get("test"); fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
|
||||
spc.add("tEsT", "cs");
|
||||
spc.add("TeSt", "cs");//duplicate request, must be silently ignored
|
||||
assertTrue (1 == spc.count());
|
||||
spc.remove("TesT:///cs");
|
||||
assertTrue (0 == spc.count());
|
||||
try { spc.get("test"); fail ("must fail"); }
|
||||
catch (NotFoundException&) { }
|
||||
}
|
||||
|
||||
|
||||
void SessionPoolTest::setUp()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SessionPoolTest::tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CppUnit::Test* SessionPoolTest::suite()
|
||||
{
|
||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SessionPoolTest");
|
||||
|
||||
CppUnit_addTest(pSuite, SessionPoolTest, testSessionPool);
|
||||
CppUnit_addTest(pSuite, SessionPoolTest, testSessionPoolContainer);
|
||||
|
||||
return pSuite;
|
||||
}
|
39
vendor/POCO/Data/testsuite/src/SessionPoolTest.h
vendored
Normal file
39
vendor/POCO/Data/testsuite/src/SessionPoolTest.h
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// SessionPoolTest.h
|
||||
//
|
||||
// Definition of the SessionPoolTest class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef SessionPoolTest_INCLUDED
|
||||
#define SessionPoolTest_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "CppUnit/TestCase.h"
|
||||
|
||||
|
||||
class SessionPoolTest: public CppUnit::TestCase
|
||||
{
|
||||
public:
|
||||
SessionPoolTest(const std::string& name);
|
||||
~SessionPoolTest();
|
||||
|
||||
void testSessionPool();
|
||||
void testSessionPoolContainer();
|
||||
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
static CppUnit::Test* suite();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
#endif // SessionPoolTest_INCLUDED
|
82
vendor/POCO/Data/testsuite/src/StatementImpl.cpp
vendored
Normal file
82
vendor/POCO/Data/testsuite/src/StatementImpl.cpp
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// StatementImpl.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "StatementImpl.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
StatementImpl::StatementImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
StatementImpl::~StatementImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void StatementImpl::compileImpl()
|
||||
{
|
||||
// prepare binding
|
||||
_ptrBinder = new Binder;
|
||||
_ptrExtractor = new Extractor;
|
||||
_ptrPrepare = new Preparation();
|
||||
}
|
||||
|
||||
|
||||
bool StatementImpl::canBind() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void StatementImpl::bindImpl()
|
||||
{
|
||||
// bind
|
||||
typedef Poco::Data::AbstractBindingVec Bindings;
|
||||
Bindings& binds = bindings();
|
||||
if (binds.empty())
|
||||
return;
|
||||
|
||||
Bindings::iterator it = binds.begin();
|
||||
Bindings::iterator itEnd = binds.end();
|
||||
std::size_t pos = 0;
|
||||
for (; it != itEnd && (*it)->canBind(); ++it)
|
||||
{
|
||||
(*it)->bind(pos);
|
||||
pos += (*it)->numOfColumnsHandled();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool StatementImpl::hasNext()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void StatementImpl::next()
|
||||
{
|
||||
Poco::Data::AbstractExtractionVec::iterator it = extractions().begin();
|
||||
Poco::Data::AbstractExtractionVec::iterator itEnd = extractions().end();
|
||||
std::size_t pos = 0;
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
(*it)->extract(pos);
|
||||
pos += (*it)->numOfColumnsHandled();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
91
vendor/POCO/Data/testsuite/src/StatementImpl.h
vendored
Normal file
91
vendor/POCO/Data/testsuite/src/StatementImpl.h
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// StatementImpl.h
|
||||
//
|
||||
// Definition of the StatementImpl class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_StatementImpl_INCLUDED
|
||||
#define Data_Test_StatementImpl_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Binder.h"
|
||||
#include "Extractor.h"
|
||||
#include "Preparator.h"
|
||||
|
||||
|
||||
struct sqlite3;
|
||||
struct sqlite3_stmt;
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class StatementImpl: public Poco::Data::StatementImpl
|
||||
/// A no-op implementation of StatementImpl for testing.
|
||||
{
|
||||
public:
|
||||
StatementImpl();
|
||||
/// Creates the StatementImpl.
|
||||
|
||||
~StatementImpl();
|
||||
/// Destroys the StatementImpl.
|
||||
|
||||
protected:
|
||||
bool hasNext();
|
||||
/// Returns true if a call to next() will return data.
|
||||
|
||||
void next();
|
||||
/// Retrieves the next row from the resultset.
|
||||
/// Will throw, if the resultset is empty.
|
||||
|
||||
bool canBind() const;
|
||||
/// Returns true if a valid statement is set and we can bind.
|
||||
|
||||
void compileImpl();
|
||||
/// Compiles the statement, doesn't bind yet
|
||||
|
||||
void bindImpl();
|
||||
/// Binds parameters
|
||||
|
||||
AbstractExtractor& extractor();
|
||||
/// Returns the concrete extractor used by the statement.
|
||||
|
||||
AbstractBinder& binder();
|
||||
/// Returns the concrete binder used by the statement.
|
||||
|
||||
private:
|
||||
Poco::SharedPtr<Binder> _ptrBinder;
|
||||
Poco::SharedPtr<Extractor> _ptrExtractor;
|
||||
Poco::SharedPtr<Preparation> _ptrPrepare;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline AbstractExtractor& StatementImpl::extractor()
|
||||
{
|
||||
return *_ptrExtractor;
|
||||
}
|
||||
|
||||
|
||||
inline AbstractBinder& StatementImpl::binder()
|
||||
{
|
||||
return *_ptrBinder;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_StatementImpl_INCLUDED
|
101
vendor/POCO/Data/testsuite/src/TestStatementImpl.cpp
vendored
Normal file
101
vendor/POCO/Data/testsuite/src/TestStatementImpl.cpp
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
//
|
||||
// TestStatementImpl.cpp
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "TestStatementImpl.h"
|
||||
#include "SessionImpl.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
TestStatementImpl::TestStatementImpl(SessionImpl& rSession):
|
||||
Poco::Data::StatementImpl(rSession),
|
||||
_compiled(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
TestStatementImpl::~TestStatementImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void TestStatementImpl::compileImpl()
|
||||
{
|
||||
// prepare binding
|
||||
_ptrBinder = new Binder;
|
||||
_ptrExtractor = new Extractor;
|
||||
_ptrPreparation = new Preparator;
|
||||
_compiled = true;
|
||||
}
|
||||
|
||||
|
||||
bool TestStatementImpl::canBind() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void TestStatementImpl::bindImpl()
|
||||
{
|
||||
// bind
|
||||
using Bindings = Poco::Data::AbstractBindingVec;
|
||||
Bindings& binds = bindings();
|
||||
if (binds.empty())
|
||||
return;
|
||||
|
||||
Bindings::iterator it = binds.begin();
|
||||
Bindings::iterator itEnd = binds.end();
|
||||
std::size_t pos = 0;
|
||||
for (; it != itEnd && (*it)->canBind(); ++it)
|
||||
{
|
||||
(*it)->bind(pos);
|
||||
pos += (*it)->numOfColumnsHandled();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::size_t TestStatementImpl::columnsReturned() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const MetaColumn& TestStatementImpl::metaColumn(std::size_t pos) const
|
||||
{
|
||||
static MetaColumn c(pos, "", MetaColumn::FDT_BOOL, 0);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
bool TestStatementImpl::hasNext()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::size_t TestStatementImpl::next()
|
||||
{
|
||||
Poco::Data::AbstractExtractionVec::iterator it = extractions().begin();
|
||||
Poco::Data::AbstractExtractionVec::iterator itEnd = extractions().end();
|
||||
std::size_t pos = 0;
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
(*it)->extract(pos);
|
||||
pos += (*it)->numOfColumnsHandled();
|
||||
}
|
||||
|
||||
return 1u;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
117
vendor/POCO/Data/testsuite/src/TestStatementImpl.h
vendored
Normal file
117
vendor/POCO/Data/testsuite/src/TestStatementImpl.h
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
//
|
||||
// TestStatementImpl.h
|
||||
//
|
||||
// Definition of the TestStatementImpl class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_TestStatementImpl_INCLUDED
|
||||
#define Data_Test_TestStatementImpl_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/MetaColumn.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Binder.h"
|
||||
#include "Extractor.h"
|
||||
#include "Preparator.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class SessionImpl;
|
||||
|
||||
|
||||
class TestStatementImpl: public Poco::Data::StatementImpl
|
||||
/// A no-op implementation of TestStatementImpl for testing.
|
||||
{
|
||||
public:
|
||||
TestStatementImpl(SessionImpl& rSession);
|
||||
/// Creates the TestStatementImpl.
|
||||
|
||||
~TestStatementImpl();
|
||||
/// Destroys the TestStatementImpl.
|
||||
|
||||
protected:
|
||||
std::size_t columnsReturned() const;
|
||||
/// Returns number of columns returned by query.
|
||||
|
||||
int affectedRowCount() const;
|
||||
/// Returns the number of affected rows.
|
||||
/// Used to find out the number of rows affected by insert or update.
|
||||
|
||||
const MetaColumn& metaColumn(std::size_t pos) const;
|
||||
/// Returns column meta data.
|
||||
|
||||
bool hasNext();
|
||||
/// Returns true if a call to next() will return data.
|
||||
|
||||
std::size_t next();
|
||||
/// Retrieves the next row or set of rows from the resultset.
|
||||
/// Will throw, if the resultset is empty.
|
||||
|
||||
bool canBind() const;
|
||||
/// Returns true if a valid statement is set and we can bind.
|
||||
|
||||
bool canCompile() const;
|
||||
/// Returns true if statement was not compiled.
|
||||
|
||||
void compileImpl();
|
||||
/// Compiles the statement, doesn't bind yet
|
||||
|
||||
void bindImpl();
|
||||
/// Binds parameters
|
||||
|
||||
AbstractExtraction::ExtractorPtr extractor();
|
||||
/// Returns the concrete extractor used by the statement.
|
||||
|
||||
AbstractBinding::BinderPtr binder();
|
||||
/// Returns the concrete binder used by the statement.
|
||||
|
||||
private:
|
||||
Poco::SharedPtr<Binder> _ptrBinder;
|
||||
Poco::SharedPtr<Extractor> _ptrExtractor;
|
||||
Poco::SharedPtr<Preparator> _ptrPreparation;
|
||||
bool _compiled;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline AbstractExtraction::ExtractorPtr TestStatementImpl::extractor()
|
||||
{
|
||||
return _ptrExtractor;
|
||||
}
|
||||
|
||||
|
||||
inline AbstractBinding::BinderPtr TestStatementImpl::binder()
|
||||
{
|
||||
return _ptrBinder;
|
||||
}
|
||||
|
||||
|
||||
inline int TestStatementImpl::affectedRowCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool TestStatementImpl::canCompile() const
|
||||
{
|
||||
return !_compiled;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_TestStatementImpl_INCLUDED
|
30
vendor/POCO/Data/testsuite/src/WinCEDriver.cpp
vendored
Normal file
30
vendor/POCO/Data/testsuite/src/WinCEDriver.cpp
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// WinCEDriver.cpp
|
||||
//
|
||||
// Console-based test driver for Windows CE.
|
||||
//
|
||||
// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "CppUnit/TestRunner.h"
|
||||
#include "DataTestSuite.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
int wmain(int argc, wchar_t* argv[])
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
char buffer[1024];
|
||||
std::wcstombs(buffer, argv[i], sizeof(buffer));
|
||||
args.push_back(std::string(buffer));
|
||||
}
|
||||
CppUnit::TestRunner runner;
|
||||
runner.addTest("DataTestSuite", DataTestSuite::suite());
|
||||
return runner.run(args) ? 0 : 1;
|
||||
}
|
28
vendor/POCO/Data/testsuite/src/WinDriver.cpp
vendored
Normal file
28
vendor/POCO/Data/testsuite/src/WinDriver.cpp
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// WinDriver.cpp
|
||||
//
|
||||
// Windows test driver for Poco Data.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#include "WinTestRunner/WinTestRunner.h"
|
||||
#include "DataTestSuite.h"
|
||||
|
||||
|
||||
class TestDriver: public CppUnit::WinTestRunnerApp
|
||||
{
|
||||
void TestMain()
|
||||
{
|
||||
CppUnit::WinTestRunner runner;
|
||||
runner.addTest(DataTestSuite::suite());
|
||||
runner.run();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
TestDriver theDriver;
|
Reference in New Issue
Block a user