12#include <com/sun/star/uno/Any.hxx>
13#include <cppunit/TestAssert.h>
24 bool bPropertyGet =
false;
25 bool bPropertySet =
false;
29 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= bPropertyGet);
31 aNewValue <<= !bPropertyGet;
32 xPropertySet->setPropertyValue(
name, aNewValue);
33 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= bPropertySet);
36 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), !bPropertyGet, bPropertySet);
40 const OUString& rName)
46 catch (
const css::beans::UnknownPropertyException& )
57 bool bPropertyGet =
false;
58 bool bPropertySet =
false;
62 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= bPropertyGet);
64 aNewValue <<= !bPropertyGet;
65 xPropertySet->setPropertyValue(
name, aNewValue);
66 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= bPropertySet);
68 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), bPropertyGet, bPropertySet);
72 const OUString& name,
const double& dValue)
77 double dPropertySet = {};
81 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= dPropertyGet);
84 xPropertySet->setPropertyValue(
name, aNewValue);
85 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= dPropertySet);
88 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(msgSet.getStr(), dValue, dPropertySet, 0.5);
92 const OUString& name,
const double& dValue)
96 double dPropertyGet = {};
97 double dPropertySet = {};
101 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= dPropertyGet);
103 aNewValue <<= dValue;
104 xPropertySet->setPropertyValue(
name, aNewValue);
105 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= dPropertySet);
107 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(msgSet.getStr(), dPropertyGet, dPropertySet, 0.5);
110void testLongProperty(uno::Reference<beans::XPropertySet>
const& xPropertySet,
const OUString& name,
111 const sal_Int32& nValue)
115 sal_Int32 nPropertyGet;
116 sal_Int32 nPropertySet;
120 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= nPropertyGet);
123 xPropertySet->setPropertyValue(
name, aNewValue);
124 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= nPropertySet);
127 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(),
nValue, nPropertySet);
131 const OUString& rName,
const sal_Int32& rValue)
137 catch (
const css::beans::UnknownPropertyException& )
144 const OUString& name,
const sal_Int32& nValue)
148 sal_Int32 nPropertyGet;
149 sal_Int32 nPropertySet;
153 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= nPropertyGet);
156 xPropertySet->setPropertyValue(
name, aNewValue);
157 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= nPropertySet);
159 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), nPropertyGet, nPropertySet);
163 const OUString& name,
const sal_Int16& nValue)
167 sal_Int16 nPropertyGet;
168 sal_Int16 nPropertySet;
172 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= nPropertyGet);
175 xPropertySet->setPropertyValue(
name, aNewValue);
176 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= nPropertySet);
179 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(),
nValue, nPropertySet);
183 const OUString& rName,
const sal_Int16& rValue)
189 catch (
const css::beans::UnknownPropertyException& )
196 const OUString& name,
const sal_Int16& nValue)
200 sal_Int16 nPropertyGet;
201 sal_Int16 nPropertySet;
205 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= nPropertyGet);
208 xPropertySet->setPropertyValue(
name, aNewValue);
209 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= nPropertySet);
211 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), nPropertyGet, nPropertySet);
215 const OUString& rName,
const OUString& rValue)
221 catch (
const css::beans::UnknownPropertyException& )
228 const OUString& name,
const OUString& rValue)
232 OUString sPropertyGet;
233 OUString sPropertySet;
237 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= sPropertyGet);
239 aNewValue <<= rValue;
240 xPropertySet->setPropertyValue(
name, aNewValue);
241 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= sPropertySet);
244 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), rValue, sPropertySet);
248 const OUString& name,
const OUString& rValue)
252 OUString sPropertyGet;
253 OUString sPropertySet;
257 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= sPropertyGet);
259 aNewValue <<= rValue;
260 xPropertySet->setPropertyValue(
name, aNewValue);
261 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= sPropertySet);
263 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), sPropertyGet, sPropertySet);
267 const OUString& name,
const util::Color& rValue)
271 util::Color sPropertyGet;
272 util::Color sPropertySet;
276 CPPUNIT_ASSERT_MESSAGE(msgGet.getStr(), xPropertySet->getPropertyValue(
name) >>= sPropertyGet);
278 aNewValue <<= rValue;
279 xPropertySet->setPropertyValue(
name, aNewValue);
280 CPPUNIT_ASSERT(xPropertySet->getPropertyValue(
name) >>= sPropertySet);
283 CPPUNIT_ASSERT_EQUAL_MESSAGE(msgSet.getStr(), rValue, sPropertySet);
void testShortReadonlyProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const sal_Int16 &nValue)
void testStringOptionalProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &rName, const OUString &rValue)
void testLongProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const sal_Int32 &nValue)
void testStringProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const OUString &rValue)
void testShortOptionalProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &rName, const sal_Int16 &rValue)
void testShortProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const sal_Int16 &nValue)
void testBooleanProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name)
void testDoubleProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const double &dValue)
void testBooleanReadonlyProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name)
void testColorProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const util::Color &rValue)
void testBooleanOptionalProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &rName)
void testStringReadonlyProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const OUString &rValue)
void testDoubleReadonlyProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const double &dValue)
void testLongOptionalProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &rName, const sal_Int32 &rValue)
void testLongReadonlyProperty(uno::Reference< beans::XPropertySet > const &xPropertySet, const OUString &name, const sal_Int32 &nValue)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)