12#include <com/sun/star/lang/EventObject.hpp>
13#include <com/sun/star/util/XRefreshListener.hpp>
14#include <com/sun/star/util/XRefreshable.hpp>
16#include <com/sun/star/uno/Reference.hxx>
21#include <cppunit/TestAssert.h>
30class MockedRefreshListener :
public ::cppu::WeakImplHelper<util::XRefreshListener>
33 MockedRefreshListener()
39 virtual void SAL_CALL refreshed(
const lang::EventObject& )
override
43 virtual void SAL_CALL disposing(
const lang::EventObject& )
override {}
49 uno::Reference<util::XRefreshable> xRefreshable(
init(), uno::UNO_QUERY_THROW);
52 xRefreshable->addRefreshListener(uno::Reference<util::XRefreshListener>(xListener));
54 xRefreshable->refresh();
55 CPPUNIT_ASSERT(xListener->m_bListenerCalled);
57 xListener->m_bListenerCalled =
false;
58 xRefreshable->removeRefreshListener(uno::Reference<util::XRefreshListener>(xListener));
59 xRefreshable->refresh();
60 CPPUNIT_ASSERT(!xListener->m_bListenerCalled);
virtual css::uno::Reference< css::uno::XInterface > init()=0
void testRefreshListener()