diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-01-03 10:37:08 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-01-03 10:37:08 +0000 |
commit | d3ba0b010d93dfe691a12b7a5f253bb1c6bcbc6d (patch) | |
tree | d8fd6508fcf16fddeebb37b043f05f742234b1a1 /cppuhelper/qa/propertysetmixin | |
parent | 392ac36d42bb2092dacded0d9014e5630e058296 (diff) |
INTEGRATION: CWS sb67 (1.3.26); FILE MERGED
2006/12/13 10:14:41 sb 1.3.26.1: #i72311# Throw UnknownPropertyException from add|removeProperty|VetoableChangeListener.
Diffstat (limited to 'cppuhelper/qa/propertysetmixin')
-rw-r--r-- | cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx | 80 |
1 files changed, 78 insertions, 2 deletions
diff --git a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx index 4970d920a5da..e43469047df2 100644 --- a/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx +++ b/cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx @@ -4,9 +4,9 @@ * * $RCSfile: test_propertysetmixin.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obo $ $Date: 2006-09-16 12:38:52 $ + * last change: $Author: hr $ $Date: 2007-01-03 11:37:08 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -585,6 +585,82 @@ void Test::testFull( static_cast< sal_Int32 >(100), full->getSecond().Value.Value.Value); CPPUNIT_ASSERT(!full->getSecond().Value.IsDefaulted); CPPUNIT_ASSERT(full->getSecond().IsAmbiguous); + css::uno::Reference< css::beans::XPropertyChangeListener > boundListener( + new BoundListener); + fullp->addPropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("First")), boundListener); + fullp->removePropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("First")), boundListener); + fullp->addPropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second")), boundListener); + fullp->removePropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second")), boundListener); + try { + fullp->addPropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third")), + boundListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + try { + fullp->removePropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third")), + boundListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + fullp->addPropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fourth")), boundListener); + fullp->removePropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fourth")), boundListener); + try { + fullp->addPropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fifth")), + boundListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + try { + fullp->removePropertyChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fifth")), + boundListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + css::uno::Reference< css::beans::XVetoableChangeListener > vetoListener( + new VetoListener); + fullp->addVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("First")), vetoListener); + fullp->removeVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("First")), vetoListener); + fullp->addVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second")), vetoListener); + fullp->removeVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Second")), vetoListener); + try { + fullp->addVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third")), + vetoListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + try { + fullp->removeVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Third")), + vetoListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + fullp->addVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fourth")), vetoListener); + fullp->removeVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fourth")), vetoListener); + try { + fullp->addVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fifth")), + vetoListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} + try { + fullp->removeVetoableChangeListener( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Fifth")), + vetoListener); + CPPUNIT_FAIL("exception expected"); + } catch (css::beans::UnknownPropertyException &) {} } css::uno::Reference< css::uno::XComponentContext > Test::m_context; |