From 4c69fc8f2c08b6ee822124c686897a50785b4714 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Tue, 9 Dec 2008 11:54:53 +0000 Subject: CWS-TOOLING: integrate CWS configitems02_svn 2008-12-02 10:22:34 +0100 as r264664 : #i5114# truncate list also in case list size was changed externaly 2008-11-28 10:25:56 +0100 as r264530 : make gcc happy with new line at end of file 2008-11-21 09:44:40 +0100 jsk r264109 : #i96409# 2008-11-21 08:03:30 +0100 jsk r264106 : #i96409# 2008-11-21 07:55:59 +0100 jsk r264105 : #i96409# 2008-11-10 13:42:44 +0100 as r263518 : make code warning free (linux) 2008-10-21 16:38:44 +0200 as r262573 : #i51626# refactor svtools config items (at least some of them) --- .../qa/complex/ConfigItems/CheckConfigItems.java | 186 +++++ .../ConfigItems/helper/AccessibilityOptTest.cxx | 400 ++++++++++ .../ConfigItems/helper/AccessibilityOptTest.hxx | 78 ++ .../complex/ConfigItems/helper/ConfigItemTest.cxx | 253 +++++++ .../complex/ConfigItems/helper/HistoryOptTest.cxx | 806 +++++++++++++++++++++ .../complex/ConfigItems/helper/HistoryOptTest.hxx | 211 ++++++ .../qa/complex/ConfigItems/helper/PrintOptTest.cxx | 743 +++++++++++++++++++ .../qa/complex/ConfigItems/helper/PrintOptTest.hxx | 92 +++ .../qa/complex/ConfigItems/helper/UserOptTest.cxx | 274 +++++++ .../qa/complex/ConfigItems/helper/UserOptTest.hxx | 78 ++ svtools/qa/complex/ConfigItems/helper/exports.map | 10 + svtools/qa/complex/ConfigItems/helper/makefile.mk | 81 +++ svtools/qa/complex/ConfigItems/makefile.mk | 91 +++ 13 files changed, 3303 insertions(+) create mode 100644 svtools/qa/complex/ConfigItems/CheckConfigItems.java create mode 100644 svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx create mode 100644 svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx create mode 100644 svtools/qa/complex/ConfigItems/helper/ConfigItemTest.cxx create mode 100644 svtools/qa/complex/ConfigItems/helper/HistoryOptTest.cxx create mode 100644 svtools/qa/complex/ConfigItems/helper/HistoryOptTest.hxx create mode 100644 svtools/qa/complex/ConfigItems/helper/PrintOptTest.cxx create mode 100644 svtools/qa/complex/ConfigItems/helper/PrintOptTest.hxx create mode 100644 svtools/qa/complex/ConfigItems/helper/UserOptTest.cxx create mode 100644 svtools/qa/complex/ConfigItems/helper/UserOptTest.hxx create mode 100644 svtools/qa/complex/ConfigItems/helper/exports.map create mode 100644 svtools/qa/complex/ConfigItems/helper/makefile.mk create mode 100644 svtools/qa/complex/ConfigItems/makefile.mk (limited to 'svtools/qa') diff --git a/svtools/qa/complex/ConfigItems/CheckConfigItems.java b/svtools/qa/complex/ConfigItems/CheckConfigItems.java new file mode 100644 index 000000000000..97cc21fdec9f --- /dev/null +++ b/svtools/qa/complex/ConfigItems/CheckConfigItems.java @@ -0,0 +1,186 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: CheckConfigItems.java,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:22 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +package complex.ConfigItems; + +import com.sun.star.beans.*; +import com.sun.star.lang.*; +import com.sun.star.uno.*; +import com.sun.star.task.*; + +import complexlib.*; + +import java.lang.*; +import java.util.*; + +//----------------------------------------------- +/** @short todo document me + */ +public class CheckConfigItems extends ComplexTestCase +{ + //------------------------------------------- + // some const + + //------------------------------------------- + // member + + /** points to the global uno service manager. */ + private XMultiServiceFactory m_xSmgr = null; + + /** implements real config item tests in C++. */ + private XJob m_xTest = null; + + //------------------------------------------- + // test environment + + //------------------------------------------- + /** @short A function to tell the framework, + which test functions are available. + + @return All test methods. + @todo Think about selection of tests from outside ... + */ + public String[] getTestMethodNames() + { + return new String[] + { + "checkPicklist", + "checkURLHistory", + "checkHelpBookmarks", + "checkPrintOptions", + "checkAccessibilityOptions", + "checkUserOptions" + }; + } + + //------------------------------------------- + /** @short Create the environment for following tests. + + @descr Use either a component loader from desktop or + from frame + */ + public void before() + throws java.lang.Exception + { + // get uno service manager from global test environment + m_xSmgr = (XMultiServiceFactory)param.getMSF(); + + // TODO register helper service + + // create module manager + m_xTest = (XJob)UnoRuntime.queryInterface( + XJob.class, + m_xSmgr.createInstance("com.sun.star.comp.svtools.ConfigItemTest")); + } + + //------------------------------------------- + /** @short close the environment. + */ + public void after() + throws java.lang.Exception + { + // TODO deregister helper service + + m_xTest = null; + m_xSmgr = null; + } + + //------------------------------------------- + /** @todo document me + */ + public void checkPicklist() + throws java.lang.Exception + { + impl_triggerTest("checkPicklist"); + } + + //------------------------------------------- + /** @todo document me + */ + public void checkURLHistory() + throws java.lang.Exception + { + impl_triggerTest("checkURLHistory"); + } + + //------------------------------------------- + /** @todo document me + */ + public void checkHelpBookmarks() + throws java.lang.Exception + { + impl_triggerTest("checkHelpBookmarks"); + } + + //------------------------------------------- + /** @todo document me + */ + public void checkPrintOptions() + throws java.lang.Exception + { + impl_triggerTest("checkPrintOptions"); + } + + //------------------------------------------- + /** @todo document me + */ + public void checkAccessibilityOptions() + throws java.lang.Exception + { + impl_triggerTest("checkAccessibilityOptions"); + } + + //------------------------------------------- + /** @todo document me + */ + public void checkUserOptions() + throws java.lang.Exception + { + impl_triggerTest("checkUserOptions"); + } + + //------------------------------------------- + /** @todo document me + */ + private void impl_triggerTest(String sTest) + throws java.lang.Exception + { + NamedValue[] lArgs = new NamedValue[1]; + lArgs[0] = new NamedValue(); + lArgs[0].Name = "Test"; + lArgs[0].Value = sTest; + m_xTest.execute(lArgs); + } +} diff --git a/svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx b/svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx new file mode 100644 index 000000000000..d853bf926467 --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.cxx @@ -0,0 +1,400 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibilityOptTest.cxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:23 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "AccessibilityOptTest.hxx" +#include "configitems/accessibilityoptions_const.hxx" + +#include +#include + +#include +#include + +namespace css = ::com::sun::star; + +AccessibilityOptTest::AccessibilityOptTest() +{ + m_xCfg = css::uno::Reference< css::container::XNameAccess >( + ::comphelper::ConfigurationHelper::openConfig( + ::utl::getProcessServiceFactory(), + s_sAccessibility, + ::comphelper::ConfigurationHelper::E_STANDARD), + css::uno::UNO_QUERY); +} + +AccessibilityOptTest::~AccessibilityOptTest() +{ + if (m_xCfg.is()) + m_xCfg.clear(); +} + +//============================================================================= +//test GetAutoDetectSystemHC() +void AccessibilityOptTest::impl_checkGetAutoDetectSystemHC() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bAutoDetectSystemHC; + sal_Bool bAutoDetectSystemHC_; + + bAutoDetectSystemHC = aAccessibilityOpt.GetAutoDetectSystemHC(); + xSet->setPropertyValue( s_sAutoDetectSystemHC, css::uno::makeAny(bAutoDetectSystemHC ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bAutoDetectSystemHC_ = aAccessibilityOpt.GetAutoDetectSystemHC(); + + if ( bAutoDetectSystemHC_ == bAutoDetectSystemHC )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetAutoDetectSystemHC() error!")), 0); +} + +//============================================================================= +//test GetIsForPagePreviews() +void AccessibilityOptTest::impl_checkGetIsForPagePreviews() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsForPagePreviews ; + sal_Bool bIsForPagePreviews_; + + bIsForPagePreviews = aAccessibilityOpt.GetIsForPagePreviews(); + xSet->setPropertyValue( s_sIsForPagePreviews, css::uno::makeAny(bIsForPagePreviews ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsForPagePreviews_ = aAccessibilityOpt.GetIsForPagePreviews(); + + if ( bIsForPagePreviews_ == bIsForPagePreviews )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsForPagePreviews() error!")), 0); +} + +//============================================================================= +//test impl_checkGetIsHelpTipsDisappear() +void AccessibilityOptTest::impl_checkGetIsHelpTipsDisappear() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsHelpTipsDisappear ; + sal_Bool bIsHelpTipsDisappear_; + + bIsHelpTipsDisappear = aAccessibilityOpt.GetIsHelpTipsDisappear(); + xSet->setPropertyValue( s_sIsHelpTipsDisappear, css::uno::makeAny(bIsHelpTipsDisappear ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsHelpTipsDisappear_ = aAccessibilityOpt.GetIsHelpTipsDisappear(); + + if ( bIsHelpTipsDisappear_ == bIsHelpTipsDisappear )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsHelpTipsDisappear() error!")), 0); +} + +//============================================================================= +//test impl_checkGetIsAllowAnimatedGraphics() +void AccessibilityOptTest::impl_checkGetIsAllowAnimatedGraphics() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsAllowAnimatedGraphics ; + sal_Bool bIsAllowAnimatedGraphics_; + + bIsAllowAnimatedGraphics = aAccessibilityOpt.GetIsAllowAnimatedGraphics(); + xSet->setPropertyValue( s_sIsAllowAnimatedGraphics, css::uno::makeAny(bIsAllowAnimatedGraphics ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsAllowAnimatedGraphics_ = aAccessibilityOpt.GetIsAllowAnimatedGraphics(); + + if ( bIsAllowAnimatedGraphics_ == bIsAllowAnimatedGraphics )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAllowAnimatedGraphics() error!")), 0); +} + +//============================================================================= +//test impl_checkGetIsAllowAnimatedText() +void AccessibilityOptTest::impl_checkGetIsAllowAnimatedText() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsAllowAnimatedText ; + sal_Bool bIsAllowAnimatedText_; + + bIsAllowAnimatedText = aAccessibilityOpt.GetIsAllowAnimatedText(); + xSet->setPropertyValue( s_sIsAllowAnimatedText, css::uno::makeAny(bIsAllowAnimatedText ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsAllowAnimatedText_ = aAccessibilityOpt.GetIsAllowAnimatedText(); + + if ( bIsAllowAnimatedText_ == bIsAllowAnimatedText )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAllowAnimatedText() error!")), 0); +} + +//============================================================================= +//test impl_checkGetIsAutomaticFontColor() +void AccessibilityOptTest::impl_checkGetIsAutomaticFontColor() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsAutomaticFontColor ; + sal_Bool bIsAutomaticFontColor_; + + bIsAutomaticFontColor = aAccessibilityOpt.GetIsAutomaticFontColor(); + xSet->setPropertyValue( s_sIsAutomaticFontColor, css::uno::makeAny(bIsAutomaticFontColor ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsAutomaticFontColor_ = aAccessibilityOpt.GetIsAutomaticFontColor(); + + if ( bIsAutomaticFontColor_ == bIsAutomaticFontColor )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsAutomaticFontColor() error!")), 0); +} + +//============================================================================= +//test impl_checkGetIsSystemFont() +void AccessibilityOptTest::impl_checkGetIsSystemFont() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsSystemFont ; + sal_Bool bIsSystemFont_; + + bIsSystemFont = aAccessibilityOpt.GetIsSystemFont(); + xSet->setPropertyValue( s_sIsSystemFont, css::uno::makeAny(bIsSystemFont ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsSystemFont_ = aAccessibilityOpt.GetIsSystemFont(); + + if ( bIsSystemFont_ == bIsSystemFont )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetIsSystemFont() error!")), 0); +} + +//============================================================================= +//test impl_checkGetHelpTipSeconds() +void AccessibilityOptTest::impl_checkGetHelpTipSeconds() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Int16 nHelpTipSeconds ; + sal_Int16 nHelpTipSeconds_; + + nHelpTipSeconds = aAccessibilityOpt.GetHelpTipSeconds(); + xSet->setPropertyValue( s_sHelpTipSeconds, css::uno::makeAny(sal_Int16(nHelpTipSeconds+1)) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + nHelpTipSeconds_ = aAccessibilityOpt.GetHelpTipSeconds(); + + if ( nHelpTipSeconds_ == nHelpTipSeconds )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetHelpTipSeconds() error!")), 0); +} + +//============================================================================= +//test impl_checkIsSelectionInReadonly() +void AccessibilityOptTest::impl_checkIsSelectionInReadonly() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsSelectionInReadonly ; + sal_Bool bIsSelectionInReadonly_; + + bIsSelectionInReadonly = aAccessibilityOpt.IsSelectionInReadonly(); + xSet->setPropertyValue( s_sIsSelectionInReadonly, css::uno::makeAny(bIsSelectionInReadonly ? sal_False:sal_True) ); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + bIsSelectionInReadonly_ = aAccessibilityOpt.IsSelectionInReadonly(); + + if ( bIsSelectionInReadonly_ == bIsSelectionInReadonly )//old config item will not throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsSelectionInReadonly() error!")), 0); +} + +//============================================================================= +//test SetAutoDetectSystemHC() +void AccessibilityOptTest::impl_checkSetAutoDetectSystemHC() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bAutoDetectSystemHC; + sal_Bool bAutoDetectSystemHC_; + + xSet->getPropertyValue(s_sAutoDetectSystemHC) >>= bAutoDetectSystemHC; + aAccessibilityOpt.SetAutoDetectSystemHC( bAutoDetectSystemHC ? sal_False:sal_True ); + xSet->getPropertyValue(s_sAutoDetectSystemHC) >>= bAutoDetectSystemHC_; + + if ( bAutoDetectSystemHC_ == bAutoDetectSystemHC )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetAutoDetectSystemHC() error!")), 0); +} + +//============================================================================= +//test SetIsForPagePreviews() +void AccessibilityOptTest::impl_checkSetIsForPagePreviews() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsForPagePreviews ; + sal_Bool bIsForPagePreviews_; + + xSet->getPropertyValue(s_sIsForPagePreviews) >>= bIsForPagePreviews; + aAccessibilityOpt.SetIsForPagePreviews( bIsForPagePreviews ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsForPagePreviews) >>= bIsForPagePreviews_; + + if ( bIsForPagePreviews_ == bIsForPagePreviews )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsForPagePreviews() error!")), 0); +} + +//============================================================================= +//test impl_checkSetIsHelpTipsDisappear() +void AccessibilityOptTest::impl_checkSetIsHelpTipsDisappear() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsHelpTipsDisappear ; + sal_Bool bIsHelpTipsDisappear_; + + xSet->getPropertyValue(s_sIsHelpTipsDisappear) >>= bIsHelpTipsDisappear; + aAccessibilityOpt.SetIsHelpTipsDisappear( bIsHelpTipsDisappear ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsHelpTipsDisappear) >>= bIsHelpTipsDisappear_; + + if ( bIsHelpTipsDisappear_ == bIsHelpTipsDisappear )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsHelpTipsDisappear() error!")), 0); +} + +//============================================================================= +//test impl_checkSetIsAllowAnimatedGraphics() +void AccessibilityOptTest::impl_checkSetIsAllowAnimatedGraphics() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsAllowAnimatedGraphics ; + sal_Bool bIsAllowAnimatedGraphics_; + + xSet->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bIsAllowAnimatedGraphics; + aAccessibilityOpt.SetIsAllowAnimatedGraphics( bIsAllowAnimatedGraphics ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bIsAllowAnimatedGraphics_; + + if ( bIsAllowAnimatedGraphics_ == bIsAllowAnimatedGraphics )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAllowAnimatedGraphics() error!")), 0); +} + +//============================================================================= +//test impl_checkSetIsAllowAnimatedText() +void AccessibilityOptTest::impl_checkSetIsAllowAnimatedText() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsAllowAnimatedText ; + sal_Bool bIsAllowAnimatedText_; + + xSet->getPropertyValue(s_sIsAllowAnimatedText) >>= bIsAllowAnimatedText; + aAccessibilityOpt.SetIsAllowAnimatedText( bIsAllowAnimatedText ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsAllowAnimatedText) >>= bIsAllowAnimatedText_; + + if ( bIsAllowAnimatedText_ == bIsAllowAnimatedText )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAllowAnimatedText() error!")), 0); +} + +//============================================================================= +//test impl_checkSetIsAutomaticFontColor() +void AccessibilityOptTest::impl_checkSetIsAutomaticFontColor() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsAutomaticFontColor ; + sal_Bool bIsAutomaticFontColor_; + + xSet->getPropertyValue(s_sIsAutomaticFontColor) >>= bIsAutomaticFontColor; + aAccessibilityOpt.SetIsAutomaticFontColor( bIsAutomaticFontColor ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsAutomaticFontColor) >>= bIsAutomaticFontColor_; + + if ( bIsAutomaticFontColor_ == bIsAutomaticFontColor )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsAutomaticFontColor() error!")), 0); +} + +//============================================================================= +//test impl_checkSetIsSystemFont() +void AccessibilityOptTest::impl_checkSetIsSystemFont() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsSystemFont ; + sal_Bool bIsSystemFont_; + + xSet->getPropertyValue(s_sIsSystemFont) >>= bIsSystemFont; + aAccessibilityOpt.SetIsSystemFont( bIsSystemFont ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsSystemFont) >>= bIsSystemFont_; + + if ( bIsSystemFont_ == bIsSystemFont )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetIsSystemFont() error!")), 0); +} + +//============================================================================= +//test impl_checkSetHelpTipSeconds() +void AccessibilityOptTest::impl_checkSetHelpTipSeconds() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Int16 nHelpTipSeconds ; + sal_Int16 nHelpTipSeconds_; + + xSet->getPropertyValue(s_sHelpTipSeconds) >>= nHelpTipSeconds; + aAccessibilityOpt.SetHelpTipSeconds( sal_Int16(nHelpTipSeconds+1) ); + xSet->getPropertyValue(s_sHelpTipSeconds) >>= nHelpTipSeconds_; + + if ( nHelpTipSeconds_ == nHelpTipSeconds )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetHelpTipSeconds() error!")), 0); +} + +//============================================================================= +//test impl_checkSetSelectionInReadonly() +void AccessibilityOptTest::impl_checkSetSelectionInReadonly() +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCfg, css::uno::UNO_QUERY); + sal_Bool bIsSelectionInReadonly ; + sal_Bool bIsSelectionInReadonly_; + + xSet->getPropertyValue(s_sIsSelectionInReadonly) >>= bIsSelectionInReadonly; + aAccessibilityOpt.SetSelectionInReadonly( bIsSelectionInReadonly ? sal_False:sal_True ); + xSet->getPropertyValue(s_sIsSelectionInReadonly) >>= bIsSelectionInReadonly_; + + if ( bIsSelectionInReadonly_ == bIsSelectionInReadonly )//old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSelectionInReadonly() error!")), 0); +} + +//============================================================================= +void AccessibilityOptTest::impl_checkAccessibilityOptions() +{ + impl_checkGetAutoDetectSystemHC(); + impl_checkGetIsForPagePreviews(); + impl_checkGetIsHelpTipsDisappear(); + impl_checkGetIsAllowAnimatedGraphics(); + impl_checkGetIsAllowAnimatedText(); + impl_checkGetIsAutomaticFontColor(); + impl_checkGetIsSystemFont(); + impl_checkGetHelpTipSeconds(); + impl_checkIsSelectionInReadonly(); + + impl_checkSetAutoDetectSystemHC(); + impl_checkSetIsForPagePreviews(); + impl_checkSetIsHelpTipsDisappear(); + impl_checkSetIsAllowAnimatedGraphics(); + impl_checkSetIsAllowAnimatedText(); + impl_checkSetIsAutomaticFontColor(); + impl_checkSetIsSystemFont(); + impl_checkSetHelpTipSeconds(); + impl_checkSetSelectionInReadonly(); +} diff --git a/svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx b/svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx new file mode 100644 index 000000000000..fc2f4681e4fe --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/AccessibilityOptTest.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibilityOptTest.hxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:23 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef SVTOOLS_ACCESSIBILITYOPTTEST_HXX +#define SVTOOLS_ACCESSIBILITYOPTTEST_HXX + +#include +#include + +namespace css = ::com::sun::star; + +class AccessibilityOptTest +{ +public: + AccessibilityOptTest(); + ~AccessibilityOptTest(); + + void impl_checkAccessibilityOptions(); + +private: + void impl_checkGetAutoDetectSystemHC(); + void impl_checkGetIsForPagePreviews(); + void impl_checkGetIsHelpTipsDisappear(); + void impl_checkGetIsAllowAnimatedGraphics(); + void impl_checkGetIsAllowAnimatedText(); + void impl_checkGetIsAutomaticFontColor(); + void impl_checkGetIsSystemFont(); + void impl_checkGetHelpTipSeconds(); + void impl_checkIsSelectionInReadonly(); + + void impl_checkSetAutoDetectSystemHC(); + void impl_checkSetIsForPagePreviews(); + void impl_checkSetIsHelpTipsDisappear(); + void impl_checkSetIsAllowAnimatedGraphics(); + void impl_checkSetIsAllowAnimatedText(); + void impl_checkSetIsAutomaticFontColor(); + void impl_checkSetIsSystemFont(); + void impl_checkSetHelpTipSeconds(); + void impl_checkSetSelectionInReadonly(); + +private: + css::uno::Reference< css::container::XNameAccess > m_xCfg; + SvtAccessibilityOptions aAccessibilityOpt; +}; + +#endif // #ifndef SVTOOLS_ACCESSIBILITYOPTTEST_HXX diff --git a/svtools/qa/complex/ConfigItems/helper/ConfigItemTest.cxx b/svtools/qa/complex/ConfigItems/helper/ConfigItemTest.cxx new file mode 100644 index 000000000000..b21d9d76755e --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/ConfigItemTest.cxx @@ -0,0 +1,253 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ConfigItemTest.cxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:23 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "HistoryOptTest.hxx" +#include "AccessibilityOptTest.hxx" +#include "PrintOptTest.hxx" +#include "UserOptTest.hxx" + +#include +#include +#include +#include + +#include +#include +#include +#include + +//============================================================================= +namespace css = ::com::sun::star; + +namespace svtools{ + +//============================================================================= +static const ::rtl::OUString PROP_TEST = ::rtl::OUString::createFromAscii("Test"); +static const ::rtl::OUString TEST_PICKLIST = ::rtl::OUString::createFromAscii("checkPicklist"); +static const ::rtl::OUString TEST_URLHISTORY = ::rtl::OUString::createFromAscii("checkURLHistory"); +static const ::rtl::OUString TEST_HELPBOOKMARKS = ::rtl::OUString::createFromAscii("checkHelpBookmarks"); +static const ::rtl::OUString TEST_ACCESSIBILITYOPTIONS = ::rtl::OUString::createFromAscii("checkAccessibilityOptions"); +static const ::rtl::OUString TEST_PRINTOPTIONS = ::rtl::OUString::createFromAscii("checkPrintOptions"); +static const ::rtl::OUString TEST_USEROPTIONS = ::rtl::OUString::createFromAscii("checkUserOptions"); + +//============================================================================= +class ConfigItemTest : public ::cppu::WeakImplHelper2< css::task::XJob , + css::lang::XServiceInfo > +{ + //------------------------------------------------------------------------- + // interface + public: + explicit ConfigItemTest(const css::uno::Reference< css::uno::XComponentContext >& xContext); + + // css::task::XJob + virtual css::uno::Any SAL_CALL execute(const css::uno::Sequence< css::beans::NamedValue >& lArguments) + throw (css::uno::RuntimeException , + css::lang::IllegalArgumentException, + css::uno::Exception ); + + // css::lang::XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString& sServiceName) + throw (css::uno::RuntimeException); + + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw (css::uno::RuntimeException); + + //------------------------------------------------------------------------- + // internal + private: + ConfigItemTest(ConfigItemTest &); // not defined + virtual ~ConfigItemTest() {} + void operator=(ConfigItemTest &); // not defined + + //------------------------------------------------------------------------- + // helper for registration ! + public: + static ::rtl::OUString SAL_CALL st_getImplementationName(); + static css::uno::Sequence< ::rtl::OUString > SAL_CALL st_getSupportedServiceNames(); + static css::uno::Reference< css::uno::XInterface > SAL_CALL st_create(const css::uno::Reference< css::uno::XComponentContext >& XContext); + + //------------------------------------------------------------------------- + // member + private: + css::uno::Reference< css::uno::XComponentContext > m_xContext; +}; + +//============================================================================= +ConfigItemTest::ConfigItemTest(const css::uno::Reference< css::uno::XComponentContext >& xContext) + : m_xContext(xContext) +{} + +//============================================================================= +// css::task::XJob +css::uno::Any SAL_CALL ConfigItemTest::execute(const css::uno::Sequence< css::beans::NamedValue >& lArguments) + throw (css::uno::RuntimeException , + css::lang::IllegalArgumentException, + css::uno::Exception ) +{ + ::rtl::OUString sTest; + ::sal_Int32 i = 0; + ::sal_Int32 c = lArguments.getLength(); + for (i=0; i>= sTest; + } + + if (sTest.equals(TEST_PICKLIST)) + { + HistoryOptTest aOptTest; + aOptTest.checkPicklist(); + } + else if (sTest.equals(TEST_URLHISTORY)) + { + HistoryOptTest aOptTest; + aOptTest.checkURLHistory(); + } + else if (sTest.equals(TEST_HELPBOOKMARKS)) + { + HistoryOptTest aOptTest; + aOptTest.checkHelpBookmarks(); + } + else if (sTest.equals(TEST_ACCESSIBILITYOPTIONS)) + { + AccessibilityOptTest aOptTest; + aOptTest.impl_checkAccessibilityOptions(); + } + else if (sTest.equals(TEST_PRINTOPTIONS)) + { + PrintOptTest aOptTest; + aOptTest.impl_checkPrint(); + } + else if (sTest.equals(TEST_USEROPTIONS)) + { + UserOptTest aOptTest; + aOptTest.impl_checkUserData(); + } + + return css::uno::Any(); +} + +//============================================================================= +// com::sun::star::uno::XServiceInfo +::rtl::OUString SAL_CALL ConfigItemTest::getImplementationName() + throw (css::uno::RuntimeException) +{ + return ConfigItemTest::st_getImplementationName(); +} + +//============================================================================= +// com::sun::star::uno::XServiceInfo +::sal_Bool SAL_CALL ConfigItemTest::supportsService(const ::rtl::OUString& sServiceName) + throw (css::uno::RuntimeException) +{ + css::uno::Sequence< ::rtl::OUString > lServiceNames = ConfigItemTest::st_getSupportedServiceNames(); + for (::sal_Int32 i = 0; i < lServiceNames.getLength(); ++i) + { + if (lServiceNames[i].equals(sServiceName)) + return sal_True; + } + return sal_False; +} + +//============================================================================= +// com::sun::star::uno::XServiceInfo +css::uno::Sequence< ::rtl::OUString > SAL_CALL ConfigItemTest::getSupportedServiceNames() + throw (css::uno::RuntimeException) +{ + return ConfigItemTest::st_getSupportedServiceNames(); +} + +//============================================================================= +::rtl::OUString SAL_CALL ConfigItemTest::st_getImplementationName() +{ + return ::rtl::OUString::createFromAscii("com.sun.star.comp.svtools.ConfigItemTest"); +} + +//============================================================================= +css::uno::Sequence< ::rtl::OUString > SAL_CALL ConfigItemTest::st_getSupportedServiceNames() +{ + css::uno::Sequence< ::rtl::OUString > lServices(1); + lServices[0] = ::rtl::OUString::createFromAscii("com.sun.star.test.ConfigItems"); + return lServices; +} + +//============================================================================= +css::uno::Reference< css::uno::XInterface > SAL_CALL ConfigItemTest::st_create(const css::uno::Reference< css::uno::XComponentContext >& xContext) +{ + ConfigItemTest* pObject = new ConfigItemTest(xContext); + css::uno::Reference< css::uno::XInterface > xObject (static_cast< ::cppu::OWeakObject* >(pObject)); + return xObject; +} + +} // namespace svtools + +//============================================================================= +static ::cppu::ImplementationEntry const lRegEntries[] = +{ + { + &::svtools::ConfigItemTest::st_create, + &::svtools::ConfigItemTest::st_getImplementationName, + &::svtools::ConfigItemTest::st_getSupportedServiceNames, + &::cppu::createSingleComponentFactory, 0, 0 + }, + + { 0, 0, 0, 0, 0, 0 } +}; + +//============================================================================= +extern "C" void SAL_CALL component_getImplementationEnvironment(const char** pEnvTypeName, + uno_Environment** ) +{ + *pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +//============================================================================= +extern "C" void * SAL_CALL component_getFactory(const char* sImplName , + void* pServiceManager, + void* pRegistryKey ) +{ + return ::cppu::component_getFactoryHelper(sImplName, pServiceManager, pRegistryKey, lRegEntries); +} + +//============================================================================= +extern "C" sal_Bool SAL_CALL component_writeInfo(void* pServiceManager, + void* pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper(pServiceManager, pRegistryKey, lRegEntries); +} diff --git a/svtools/qa/complex/ConfigItems/helper/HistoryOptTest.cxx b/svtools/qa/complex/ConfigItems/helper/HistoryOptTest.cxx new file mode 100644 index 000000000000..8f191abf61ca --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/HistoryOptTest.cxx @@ -0,0 +1,806 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: HistoryOptTest.cxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:23 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "HistoryOptTest.hxx" +#include "configitems/historyoptions_const.hxx" + +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace css = ::com::sun::star; + +//============================================================================= +static const ::rtl::OUString MESSAGE_CLEAR_FAILED = ::rtl::OUString::createFromAscii("Clearing the list failed."); +static const ::rtl::OUString MESSAGE_SETSIZE_FAILED = ::rtl::OUString::createFromAscii("Setting a new size for a list failed."); +static const ::rtl::OUString MESSAGE_MISS_HISTORY = ::rtl::OUString::createFromAscii("Could not get config access to history list inside config."); +static const ::rtl::OUString MESSAGE_MISS_ITEMLIST = ::rtl::OUString::createFromAscii("Could not get config access to item list inside config."); +static const ::rtl::OUString MESSAGE_MISS_ORDERLIST = ::rtl::OUString::createFromAscii("Could not get config access to order list inside config."); +static const ::rtl::OUString MESSAGE_MISS_ITEM = ::rtl::OUString::createFromAscii("Could not locate item."); +static const ::rtl::OUString MESSAGE_UNEXPECTED_ITEM = ::rtl::OUString::createFromAscii("Found an unexpected item."); +static const ::rtl::OUString MESSAGE_WRONG_ORDER = ::rtl::OUString::createFromAscii("Wrong order in history list."); + +//============================================================================= +HistoryOptTest::HistoryOptTest() + : m_aConfigItem ( ) + , m_eList (ePICKLIST) + , m_xHistoriesXCU( ) + , m_xCommonXCU ( ) +{ +} + +//============================================================================= +HistoryOptTest::~HistoryOptTest() +{ + m_xHistoriesXCU.clear(); + m_xCommonXCU.clear(); +} + +//============================================================================= +void HistoryOptTest::checkPicklist() +{ + impl_testHistory(ePICKLIST, 4); +} + +//============================================================================= +void HistoryOptTest::checkURLHistory() +{ + impl_testHistory(eHISTORY, 10); +} + +//============================================================================= +void HistoryOptTest::checkHelpBookmarks() +{ + impl_testHistory(eHELPBOOKMARKS, 100); +} + +//============================================================================= +void HistoryOptTest::impl_testHistory(EHistoryType eHistory , + ::sal_Int32 nMaxItems) +{ + try + { + m_eList = eHistory; + ::sal_Int32 c = nMaxItems; + ::sal_Int32 i = 0; + + impl_clearList( ); + impl_setSize (c); + + // a) fill list completely and check if all items could be realy created. + // But dont check its order here! Because every new item will change that order. + for (i=0; i xList; + xList = impl_getItemList(); + nCount = xList->getElementNames().getLength(); + + if (nCount != 0) + throw css::uno::Exception(MESSAGE_CLEAR_FAILED, 0); + + xList = impl_getOrderList(); + nCount = xList->getElementNames().getLength(); + + if (nCount != 0) + throw css::uno::Exception(MESSAGE_CLEAR_FAILED, 0); +} + +//============================================================================= +void HistoryOptTest::impl_setSize(::sal_Int32 nSize) +{ + m_aConfigItem.SetSize (m_eList, nSize); + + // a) size info returned by GetSize() means "MaxSize" + // so it must match exactly ! + ::sal_Int32 nCheck = m_aConfigItem.GetSize(m_eList); + if (nCheck != nSize) + throw css::uno::Exception(MESSAGE_SETSIZE_FAILED, 0); + + // b) current size of used XCU lists reflects the current state of + // history list and not max size. So it can be less then size ! + css::uno::Reference< css::container::XNameAccess > xList; + xList = impl_getItemList(); + nCheck = xList->getElementNames().getLength(); + if (nCheck > nSize) + throw css::uno::Exception(MESSAGE_SETSIZE_FAILED, 0); + + xList = impl_getOrderList(); + nCheck = xList->getElementNames().getLength(); + if (nCheck > nSize) + throw css::uno::Exception(MESSAGE_SETSIZE_FAILED, 0); +} + +//============================================================================= +void HistoryOptTest::impl_appendItem(::sal_Int32 nItem) +{ + const ::rtl::OUString sURL = impl_createItemURL (nItem); + const ::rtl::OUString sTitle = impl_createItemTitle (nItem); + const ::rtl::OUString sPassword = impl_createItemPassword(nItem); + + m_aConfigItem.AppendItem(m_eList, sURL, ::rtl::OUString(), sTitle, sPassword); +} + +//============================================================================= +::rtl::OUString HistoryOptTest::impl_createItemURL(::sal_Int32 nItem) +{ + ::rtl::OUStringBuffer sURL(256); + sURL.appendAscii("file:///ooo_api_test/non_existing_test_url_"); + sURL.append ((::sal_Int32)nItem ); + sURL.appendAscii(".odt" ); + + return sURL.makeStringAndClear(); +} + +//============================================================================= +::rtl::OUString HistoryOptTest::impl_createItemTitle(::sal_Int32 nItem) +{ + ::rtl::OUStringBuffer sTitle(256); + sTitle.appendAscii("Non Existing Test Item Nr "); + sTitle.append ((::sal_Int32)nItem ); + + return sTitle.makeStringAndClear(); +} + +//============================================================================= +::rtl::OUString HistoryOptTest::impl_createItemPassword(::sal_Int32 nItem) +{ + ::rtl::OUStringBuffer sPassword(256); + sPassword.appendAscii("Password_" ); + sPassword.append ((::sal_Int32)nItem); + + return sPassword.makeStringAndClear(); +} + +//============================================================================= +::sal_Bool HistoryOptTest::impl_existsItem(::sal_Int32 nItem) +{ + const ::rtl::OUString sURL = impl_createItemURL(nItem); + const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lItems = m_aConfigItem.GetList(m_eList); + const ::sal_Int32 c = lItems.getLength (); + ::sal_Int32 i = 0; + ::sal_Bool bFound = sal_False; + + for (i=0; i xItemList = impl_getItemList(); + css::uno::Reference< css::container::XNameAccess > xItem ; + xItemList->getByName(sURL) >>= xItem; + + bFound = xItem.is(); + } + catch(const css::container::NoSuchElementException&) + {} + + return bFound; +} + +//============================================================================= +::sal_Bool HistoryOptTest::impl_existsItemAtIndex(::sal_Int32 nItem , + ::sal_Int32 nIndex) +{ + const ::rtl::OUString sURL = impl_createItemURL(nItem); + const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lItems = m_aConfigItem.GetList(m_eList); + const ::sal_Int32 c = lItems.getLength (); + ::sal_Bool bFound = sal_False; + + if (nIndex >= c) + return sal_False; + + const ::comphelper::SequenceAsHashMap aItem(lItems[nIndex]); + ::rtl::OUString sCheck = aItem.getUnpackedValueOrDefault(s_sURL, ::rtl::OUString()); + + bFound = sCheck.equals(sURL); + if ( ! bFound) + return sal_False; + bFound = sal_False; + + try + { + css::uno::Reference< css::container::XNameAccess > xItemList = impl_getItemList(); + css::uno::Reference< css::container::XNameAccess > xItem ; + xItemList->getByName(sURL) >>= xItem; + + bFound = xItem.is(); + } + catch(const css::container::NoSuchElementException&) + {} + + if ( ! bFound) + return sal_False; + bFound = sal_False; + + try + { + const ::rtl::OUString sOrder = ::rtl::OUString::valueOf(nIndex); + css::uno::Reference< css::container::XNameAccess > xOrderList = impl_getOrderList(); + css::uno::Reference< css::container::XNameAccess > xOrder ; + xOrderList->getByName(sOrder) >>= xOrder; + + if (xOrder.is()) + { + xOrder->getByName(s_sHistoryItemRef) >>= sCheck; + bFound = sCheck.equals(sURL); + } + } + catch(const css::container::NoSuchElementException&) + {} + + return bFound; +} + +//============================================================================= +css::uno::Reference< css::container::XNameAccess > HistoryOptTest::impl_getItemList() +{ + css::uno::Reference< css::container::XNameAccess > xHistory = impl_getNewHistory(); + css::uno::Reference< css::container::XNameAccess > xList ; + xHistory->getByName (s_sItemList) >>= xList; + + if ( ! xList.is()) + throw css::uno::Exception(MESSAGE_MISS_ITEMLIST, 0); + + return xList; +} + +//============================================================================= +css::uno::Reference< css::container::XNameAccess > HistoryOptTest::impl_getOrderList() +{ + css::uno::Reference< css::container::XNameAccess > xHistory = impl_getNewHistory(); + css::uno::Reference< css::container::XNameAccess > xList ; + xHistory->getByName (s_sOrderList) >>= xList; + + if ( ! xList.is()) + throw css::uno::Exception(MESSAGE_MISS_ORDERLIST, 0); + + return xList; +} + +//============================================================================= +css::uno::Reference< css::container::XNameAccess > HistoryOptTest::impl_getNewHistory() +{ + if ( ! m_xHistoriesXCU.is()) + { + m_xHistoriesXCU = css::uno::Reference< css::container::XNameAccess >( + ::comphelper::ConfigurationHelper::openConfig( + ::utl::getProcessServiceFactory(), + s_sHistories, + ::comphelper::ConfigurationHelper::E_STANDARD), + css::uno::UNO_QUERY_THROW); + } + + css::uno::Reference< css::container::XNameAccess > xHistory; + + switch (m_eList) + { + case ePICKLIST : + m_xHistoriesXCU->getByName(s_sPickList) >>= xHistory; + break; + + case eHISTORY : + m_xHistoriesXCU->getByName(s_sURLHistory) >>= xHistory; + break; + + case eHELPBOOKMARKS : + m_xHistoriesXCU->getByName(s_sHelpBookmarks) >>= xHistory; + break; + } + + if ( ! xHistory.is()) + throw css::uno::Exception(MESSAGE_MISS_HISTORY, 0); + + return xHistory; +} + +//============================================================================= +css::uno::Reference< css::container::XNameAccess > HistoryOptTest::impl_getOldHistory() +{ + if ( ! m_xCommonXCU.is()) + { + m_xCommonXCU = css::uno::Reference< css::container::XNameAccess >( + ::comphelper::ConfigurationHelper::openConfig( + ::utl::getProcessServiceFactory(), + s_sCommonHistory, + ::comphelper::ConfigurationHelper::E_STANDARD), + css::uno::UNO_QUERY_THROW); + } + + css::uno::Reference< css::container::XNameAccess > xHistory; + + switch (m_eList) + { + case ePICKLIST : + m_xCommonXCU->getByName(s_sPickList) >>= xHistory; + break; + + case eHISTORY : + m_xCommonXCU->getByName(s_sURLHistory) >>= xHistory; + break; + + case eHELPBOOKMARKS : + m_xCommonXCU->getByName(s_sHelpBookmarks) >>= xHistory; + break; + } + + if ( ! xHistory.is()) + throw css::uno::Exception(MESSAGE_MISS_HISTORY, 0); + + return xHistory; +} + +/* +//============================================================================= +// clear the list in XML directly when using the new Histories.xcs +void HistoryOptTest::impl_clearList(const ::rtl::OUString& sList) +{ + css::uno::Reference< css::container::XNameAccess > xListAccess; + css::uno::Reference< css::container::XNameContainer > xItemOrder; + css::uno::Reference< css::beans::XPropertySet > xFirstItem; + css::uno::Sequence< ::rtl::OUString > sFileList; + + if (sList.equalsAscii("PickList")) + m_xCfg->getByName(s_sPickList) >>= xListAccess; + + else if (sList.equalsAscii("URLHistory")) + m_xCfg->getByName(s_sURLHistory) >>= xListAccess; + + else if (sList.equalsAscii("HelpBookmarks")) + m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess; + + if (xListAccess.is()) + { + xListAccess->getByName(s_sItemList) >>= xItemOrder ; + sFileList = xItemOrder->getElementNames(); + for(sal_Int32 i=0; iremoveByName(sFileList[i]); + + xListAccess->getByName(s_sOrderList) >>= xItemOrder ; + sFileList = xItemOrder->getElementNames(); + for(sal_Int32 j=0; jremoveByName(sFileList[j]); + + xFirstItem = css::uno::Reference< css::beans::XPropertySet >(xListAccess, css::uno::UNO_QUERY); + xFirstItem->setPropertyValue( s_sFirstItem, css::uno::makeAny((sal_Int32)0) ); + + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } +} + +//============================================================================= +// use configuration API (not ConfigItem!) to verify the results within XML ! +sal_Bool HistoryOptTest::impl_isListEmpty(const ::rtl::OUString& sList) +{ + css::uno::Reference< css::container::XNameAccess > xListAccess; + css::uno::Reference< css::container::XNameAccess > xItemList; + css::uno::Reference< css::container::XNameAccess > xOrderList; + sal_Bool bRet = sal_True; + + if (sList.equalsAscii("PickList")) + m_xCfg->getByName(s_sPickList) >>= xListAccess; + + else if (sList.equalsAscii("URLHistory")) + m_xCfg->getByName(s_sURLHistory) >>= xListAccess; + + else if (sList.equalsAscii("HelpBookmarks")) + m_xCfg->getByName(s_sHelpBookmarks) >>= xListAccess; + + if (xListAccess.is()) + { + xListAccess->getByName(s_sItemList) >>= xItemList; + xListAccess->getByName(s_sOrderList) >>= xOrderList; + + css::uno::Sequence< ::rtl::OUString > sItemList = xItemList->getElementNames(); + css::uno::Sequence< ::rtl::OUString > sOrderList = xOrderList->getElementNames(); + if (sItemList.getLength()!=0 || sOrderList.getLength()!=0) + bRet = sal_False; + } + + return bRet; +} + +//============================================================================= +// append a item: use configuration API (not ConfigItem!) to verify the results within XML ! +void HistoryOptTest::impl_appendItem(const ::rtl::OUString& sList) +{//to do... +} + +//============================================================================= +// test SvtHistoryOptions::GetSize() +void HistoryOptTest::impl_checkGetSize(const ::rtl::OUString& sList) +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCommonXCU, css::uno::UNO_QUERY); + + sal_uInt32 nSize = 0; + sal_uInt32 nSize_ = 0; + + if (sList.equalsAscii("PickList")) + { + nSize = aHistoryOpt.GetSize(ePICKLIST); + + xSet->setPropertyValue(s_sPickListSize, css::uno::makeAny(nSize+1)); + ::comphelper::ConfigurationHelper::flush(m_xCommonXCU); + + nSize_ = aHistoryOpt.GetSize(ePICKLIST); + if (nSize_ == nSize) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetSize(ePICKLIST) error!")), 0); + } + + else if (sList.equalsAscii("URLHistory")) + { + nSize = aHistoryOpt.GetSize(eHISTORY); + + xSet->setPropertyValue(s_sURLHistorySize, css::uno::makeAny(nSize+1)); + ::comphelper::ConfigurationHelper::flush(m_xCommonXCU); + + nSize_ = aHistoryOpt.GetSize(eHISTORY); + + if (nSize_ == nSize) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetSize(eHISTORY) error!")), 0); + } + + else if (sList.equalsAscii("HelpBookmarks")) + { + nSize = aHistoryOpt.GetSize(eHELPBOOKMARKS); + + xSet->setPropertyValue(s_sHelpBookmarksSize, css::uno::makeAny(nSize+1)); + ::comphelper::ConfigurationHelper::flush(m_xCommonXCU); + + nSize_ = aHistoryOpt.GetSize(eHELPBOOKMARKS); + + if (nSize_ == nSize) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetSize(eHELPBOOKMARKS) error!")), 0); + } +} + +//============================================================================= +// test SvtHistoryOptions::SetSize() +void HistoryOptTest::impl_checkSetSize(const ::rtl::OUString& sList) +{ + css::uno::Reference< css::beans::XPropertySet > xSet(m_xCommonXCU, css::uno::UNO_QUERY); + + sal_uInt32 nSize = 0; + sal_uInt32 nSize_ = 0; + + if (sList.equalsAscii("PickList")) + { + xSet->getPropertyValue(s_sPickListSize) >>= nSize; + aHistoryOpt.SetSize(ePICKLIST, (nSize+1)); + xSet->getPropertyValue(s_sPickListSize) >>= nSize_; + + if (nSize_ == nSize) //old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSize(ePICKLIST) error!")), 0); + } + + else if (sList.equalsAscii("URLHistory")) + { + xSet->getPropertyValue(s_sURLHistorySize) >>= nSize; + aHistoryOpt.SetSize(eHISTORY, (nSize+1)); + xSet->getPropertyValue(s_sURLHistorySize) >>= nSize_; + + if (nSize_ == nSize) //old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSize(eHISTORY) error!")), 0); + } + + else if (sList.equalsAscii("HelpBookmarks")) + { + xSet->getPropertyValue(s_sHelpBookmarksSize) >>= nSize; + aHistoryOpt.SetSize(eHELPBOOKMARKS, (nSize+1)); + xSet->getPropertyValue(s_sHelpBookmarksSize) >>= nSize_; + + if (nSize_ == nSize) //old config item will throw error + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SetSize(eHELPBOOKMARKS) error!")), 0); + } +} + +//============================================================================= +// test SvtHistoryOptions::Clear() +void HistoryOptTest::impl_checkClear(const ::rtl::OUString& sList) +{ + if (sList.equalsAscii("PickList")) + { + aHistoryOpt.Clear(ePICKLIST); + if ( !impl_isListEmpty(s_sPickList) ) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Clear(ePICKLIST) error!")), 0); + } + + else if (sList.equalsAscii("URLHistory")) + { + aHistoryOpt.Clear(eHISTORY); + if ( !impl_isListEmpty(s_sURLHistory) ) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Clear(eHISTORY) error!")), 0); + } + + else if (sList.equalsAscii("HelpBookmarks")) + { + aHistoryOpt.Clear(eHELPBOOKMARKS); + if ( !impl_isListEmpty(s_sHelpBookmarks) ) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Clear(eHELPBOOKMARKS) error!")), 0); + } +} + +//============================================================================= +// test SvtHistoryOptions::GetList() +void HistoryOptTest::impl_checkGetList(const ::rtl::OUString& sList) +{ + if (sList.equalsAscii("PickList")) + { + impl_clearList(s_sPickList); + aHistoryOpt.AppendItem( ePICKLIST , + ::rtl::OUString::createFromAscii("file:///c/test1"), + ::rtl::OUString::createFromAscii(""), + ::rtl::OUString::createFromAscii(""), + ::rtl::OUString::createFromAscii("") ); + css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList = aHistoryOpt.GetList( ePICKLIST ); + + if ( aHistoryList.getLength()==0 ) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetList(ePICKLIST) error!")), 0); + } + + else if (sList.equalsAscii("URLHistory")) + { + impl_clearList(s_sURLHistory); + aHistoryOpt.AppendItem( eHISTORY , + ::rtl::OUString::createFromAscii("file:///c/test1"), + ::rtl::OUString::createFromAscii(""), + ::rtl::OUString::createFromAscii(""), + ::rtl::OUString::createFromAscii("") ); + css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList = aHistoryOpt.GetList( eHISTORY ); + + if ( aHistoryList.getLength()==0 ) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetList(eHISTORY) error!")), 0); + } + + else if (sList.equalsAscii("HelpBookmarks")) + { + impl_clearList(s_sHelpBookmarks); + aHistoryOpt.AppendItem( eHELPBOOKMARKS , + ::rtl::OUString::createFromAscii("file:///c/test1"), + ::rtl::OUString::createFromAscii(""), + ::rtl::OUString::createFromAscii(""), + ::rtl::OUString::createFromAscii("") ); + css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aHistoryList = aHistoryOpt.GetList( eHELPBOOKMARKS ); + + if ( aHistoryList.getLength()==0 ) + throw css::uno::RuntimeException( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GetList(eHELPBOOKMARKS) error!")), 0); + } +} + +void HistoryOptTest::impl_checkAppendItem(const ::rtl::OUString& sList) +{ + if (sList.equalsAscii("PickList")) + { + impl_clearList(s_sPickList); + sal_Int32 nListSize = aHistoryOpt.GetSize(ePICKLIST); + + for (sal_Int32 i=0; i +#include + +namespace css = ::com::sun::star; + +class HistoryOptTest +{ + public: + + HistoryOptTest(); + virtual ~HistoryOptTest(); + + //--------------------------------------------------------------------- + /** unit test of picklist */ + void checkPicklist(); + + //--------------------------------------------------------------------- + /** unit test of URL list */ + void checkURLHistory(); + + //--------------------------------------------------------------------- + /** unit test of Help bookmarks */ + void checkHelpBookmarks(); + + private: + + //--------------------------------------------------------------------- + /** test every well known history list in the same way. + * Only the count of created and tested items can be defined from outside + * e.g. usefull for stress tests. + * + * @param eHistory + * specify the history list for testing. + * + * @param nMaxItems + * max count of new created and tested history items. + */ + void impl_testHistory(EHistoryType eHistory , + ::sal_Int32 nMaxItems); + + //--------------------------------------------------------------------- + /** try to clear the whole list and check the results. + * If list could not be cleared successfully an exception is thrown. + */ + void impl_clearList(); + + //--------------------------------------------------------------------- + /** define a new size for the current list and check the results. + * Note: The given size must match against the defined constraints. + * That must be checked before this method is called. + * + * @param nSize + * the new size. + */ + void impl_setSize(::sal_Int32 nSize); + + //--------------------------------------------------------------------- + /** create a new item (means it's properties using a special schema using the + * item id). + * + * Note: This method does not check if creation was successfully. + * Therefore exists more specialized method impl_existsItem() + * and impl_existsItemAtPosition(). + * + * @param nItem + * id of the item + */ + void impl_appendItem(::sal_Int32 nItem); + + //--------------------------------------------------------------------- + /** check if an entry for given item id realy exists (in memory and xcu file). + * + * @param nItem + * id of the item + * + * @return true if item exists - false otherwise. + */ + ::sal_Bool impl_existsItem(::sal_Int32 nItem); + + //--------------------------------------------------------------------- + /** check if an entry for given item id realy exists (in memory and xcu file). + * Further it checks if the requested item is placed at the also specified + * position inside history list. + * + * @param nItem + * id of the item + * + * @param nIndex + * expected position of item inside history list. + * + * @return true if item exists at right position - false otherwise. + */ + ::sal_Bool impl_existsItemAtIndex(::sal_Int32 nItem , + ::sal_Int32 nIndex); + + //--------------------------------------------------------------------- + /** create an URL suitable for the given item id. + * + * @param nItem + * id of the item + * + * @return the new created URL. + */ + ::rtl::OUString impl_createItemURL(::sal_Int32 nItem); + + //--------------------------------------------------------------------- + /** create a title suitable for the given item id. + * + * @param nItem + * id of the item + * + * @return the new created title. + */ + ::rtl::OUString impl_createItemTitle(::sal_Int32 nItem); + + //--------------------------------------------------------------------- + /** create a password suitable for the given item id. + * + * @param nItem + * id of the item + * + * @return the new created password. + */ + ::rtl::OUString impl_createItemPassword(::sal_Int32 nItem); + + //--------------------------------------------------------------------- + /** returns direct access to the item list inside histories.xcu + * suitable for the current defined list type (m_eList). + * + * @return reference to the item list configuration + */ + css::uno::Reference< css::container::XNameAccess > impl_getItemList(); + + //--------------------------------------------------------------------- + /** returns direct access to the order list inside histories.xcu + * suitable for the current defined list type (m_eList). + * + * @return reference to the order list configuration + */ + css::uno::Reference< css::container::XNameAccess > impl_getOrderList(); + + //--------------------------------------------------------------------- + /** returns direct access to the history list inside histories.xcu + * suitable for the current defined list type (m_eList). + * + * @return reference to the history list configuration + */ + css::uno::Reference< css::container::XNameAccess > impl_getNewHistory(); + + //--------------------------------------------------------------------- + /** returns direct access to the history config inside common.xcu + * suitable for the current defined list type (m_eList). + * + * @return reference to the history configuration + */ + css::uno::Reference< css::container::XNameAccess > impl_getOldHistory(); + + private: + + // the config item which should be tested here + SvtHistoryOptions m_aConfigItem; + + // defines the special list for testing (picklist, history or url list) + EHistoryType m_eList; + + // underlying configuration of the tested config items for cross over checks + css::uno::Reference< css::container::XNameAccess > m_xHistoriesXCU; + + // underlying configuration of the tested config items for cross over checks + css::uno::Reference< css::container::XNameAccess > m_xCommonXCU; +}; + +#endif // #ifndef SVTOOLS_HISTORYOPTTEST_HXX diff --git a/svtools/qa/complex/ConfigItems/helper/PrintOptTest.cxx b/svtools/qa/complex/ConfigItems/helper/PrintOptTest.cxx new file mode 100644 index 000000000000..69504e4d5d7e --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/PrintOptTest.cxx @@ -0,0 +1,743 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: PrintOptTest.cxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:24 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "PrintOptTest.hxx" + +#include + +#include +#include + +namespace css = ::com::sun::star; + +// using test only +#define ROOTNODE_PRINTOPTION rtl::OUString::createFromAscii("org.openoffice.Office.Common/Print/Option") +#define PROPERTYNAME_REDUCETRANSPARENCY rtl::OUString::createFromAscii("ReduceTransparency") +#define PROPERTYNAME_REDUCEDTRANSPARENCYMODE rtl::OUString::createFromAscii("ReducedTransparencyMode") +#define PROPERTYNAME_REDUCEGRADIENTS rtl::OUString::createFromAscii("ReduceGradients") +#define PROPERTYNAME_REDUCEDGRADIENTMODE rtl::OUString::createFromAscii("ReducedGradientMode") +#define PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT rtl::OUString::createFromAscii("ReducedGradientStepCount") +#define PROPERTYNAME_REDUCEBITMAPS rtl::OUString::createFromAscii("ReduceBitmaps") +#define PROPERTYNAME_REDUCEDBITMAPMODE rtl::OUString::createFromAscii("ReducedBitmapMode") +#define PROPERTYNAME_REDUCEDBITMAPRESOLUTION rtl::OUString::createFromAscii("ReducedBitmapResolution") +#define PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY rtl::OUString::createFromAscii("ReducedBitmapIncludesTransparency") +#define PROPERTYNAME_CONVERTTOGREYSCALES rtl::OUString::createFromAscii("ConvertToGreyscales") + +PrintOptTest::PrintOptTest() +{ + m_xCfg = css::uno::Reference< css::container::XNameAccess >( + ::comphelper::ConfigurationHelper::openConfig( + ::utl::getProcessServiceFactory(), + rtl::OUString::createFromAscii("org.openoffice.Office.Common/Print/Option"), + ::comphelper::ConfigurationHelper::E_STANDARD), + css::uno::UNO_QUERY); + + if (m_xCfg.is()) + { + //UniString sTmp = UniString("printer"); + //xub_StrLen nTokenCount = sTmp.GetTokenCount('/'); + //sTmp = sTmp.GetToken(nTokenCount - 1, '/'); + m_xCfg->getByName(rtl::OUString::createFromAscii("Printer")) >>= m_xNode; + } +} + +sal_Int16 PrintOptTest::impl_GetReducedTransparencyMode() const +{ + sal_Int16 nRet = 0; + if (m_xNode.is()) + { + css::uno::Reference< css::beans::XPropertySet > xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + xSet->getPropertyValue(PROPERTYNAME_REDUCEDTRANSPARENCYMODE) >>= nRet; + } + return nRet; +} +void PrintOptTest::impl_SetReducedTransparencyMode(sal_Int16 nMode ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Int16 nUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEDTRANSPARENCYMODE) >>= nUpdate; + if (nUpdate != nMode) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEDTRANSPARENCYMODE, css::uno::makeAny(nMode)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Bool PrintOptTest::impl_IsReduceTransparency() const +{ + sal_Bool bRet = sal_False; + if (m_xNode.is()) + { + css::uno::Reference< css::beans::XPropertySet > xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + xSet->getPropertyValue(PROPERTYNAME_REDUCETRANSPARENCY) >>= bRet; + } + return bRet; +} +void PrintOptTest::impl_SetReduceTransparency(sal_Bool bState ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Bool bUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCETRANSPARENCY) >>= bUpdate; + if (bUpdate != bState) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCETRANSPARENCY, css::uno::makeAny(bState)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Bool PrintOptTest::impl_IsReduceGradients() const +{ + sal_Bool bRet = sal_False; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEGRADIENTS) >>= bRet; + } + } + return bRet; +} + +void PrintOptTest::impl_SetReduceGradients(sal_Bool bState ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Bool bUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEGRADIENTS) >>= bUpdate; + if (bUpdate != bState) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEGRADIENTS, css::uno::makeAny(bState)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Int16 PrintOptTest::impl_GetReducedGradientMode() const +{ + sal_Int16 nRet = 0; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTMODE) >>= nRet; + } + } + return nRet; +} + +void PrintOptTest::impl_SetReducedGradientMode(sal_Int16 nMode ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Int16 nUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTMODE) >>= nUpdate; + if (nUpdate != nMode) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEDGRADIENTMODE, css::uno::makeAny(nMode)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Int16 PrintOptTest::impl_GetReducedGradientStepCount() const +{ + sal_Int16 nRet = 64; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT) >>= nRet; + } + } + return nRet; +} +void PrintOptTest::impl_SetReducedGradientStepCount(sal_Int16 nStepCount ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Int16 nUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT) >>= nUpdate; + if (nUpdate != nStepCount) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEDGRADIENTSTEPCOUNT, css::uno::makeAny(nStepCount)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Bool PrintOptTest::impl_IsReduceBitmaps() const +{ + sal_Bool bRet = sal_False; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEBITMAPS) >>= bRet; + } + } + return bRet; +} + +void PrintOptTest::impl_SetReduceBitmaps(sal_Bool bState ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Bool bUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEBITMAPS) >>= bUpdate; + if (bUpdate != bState) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEBITMAPS, css::uno::makeAny(bState)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Int16 PrintOptTest::impl_GetReducedBitmapMode() const +{ + sal_Int16 nRet = 1; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPMODE) >>= nRet; + } + } + return nRet; +} + +void PrintOptTest::impl_SetReducedBitmapMode(sal_Int16 nMode ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Int16 nUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPMODE) >>= nUpdate; + if (nUpdate != nMode) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEDBITMAPMODE, css::uno::makeAny(nMode)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Int16 PrintOptTest::impl_GetReducedBitmapResolution() const +{ + sal_Int16 nRet = 3; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPRESOLUTION) >>= nRet; + } + } + return nRet; +} + +void PrintOptTest::impl_SetReducedBitmapResolution(sal_Int16 nResolution ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Int16 nUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPRESOLUTION) >>= nUpdate; + if (nUpdate != nResolution) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEDBITMAPRESOLUTION, css::uno::makeAny(nResolution)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Bool PrintOptTest::impl_IsReducedBitmapIncludesTransparency() const +{ + sal_Bool bRet = sal_True; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY) >>= bRet; + } + } + return bRet; +} + +void PrintOptTest::impl_SetReducedBitmapIncludesTransparency(sal_Bool bState ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Bool bUpdate; + xSet->getPropertyValue(PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY) >>= bUpdate; + if (bUpdate != bState) + { + xSet->setPropertyValue( PROPERTYNAME_REDUCEDBITMAPINCLUDESTRANSPARENCY, css::uno::makeAny(bState)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + +sal_Bool PrintOptTest::impl_IsConvertToGreyscales() const +{ + sal_Bool bRet = sal_False; + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bRet; + } + } + return bRet; +} + +void PrintOptTest::impl_SetConvertToGreyscales(sal_Bool bState ) +{ + if (m_xNode.is()) + { + css::uno::Reference xSet(m_xNode, css::uno::UNO_QUERY); + if (xSet.is()) + { + sal_Bool bUpdate; + xSet->getPropertyValue(PROPERTYNAME_CONVERTTOGREYSCALES) >>= bUpdate; + if (bUpdate != bState) + { + xSet->setPropertyValue( PROPERTYNAME_CONVERTTOGREYSCALES, css::uno::makeAny(bState)); + ::comphelper::ConfigurationHelper::flush(m_xCfg); + } + } + } +} + + +PrintOptTest::~PrintOptTest() +{ +} + +void PrintOptTest::impl_checkPrint() +{ + //test SetReduceTransparency() + sal_Bool bNewValue = sal_False; + sal_Bool bOldValue = sal_False; + bOldValue = PrintOptTest::impl_IsReduceTransparency(); + bNewValue = !bOldValue; + aPrintOpt.SetReduceTransparency(bNewValue) ; + bNewValue = impl_IsReduceTransparency(); + // if(bNewValue != bOldValue) // test the old source + if ( bNewValue == bOldValue ) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReduceTransparency() error!"), + 0); + } + + //test IsReduceTransparemcy() + bNewValue = bOldValue = sal_False; + bOldValue = impl_IsReduceTransparency(); + bNewValue = !bOldValue; + impl_SetReduceTransparency(bNewValue); + bNewValue = aPrintOpt.IsReduceTransparency(); + //if(bNewValue != bOldValue) // test the old source + if(bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the IsReduceTransparency() error!"), + 0); + } + + // test SetReducedTransparencyMode() + sal_Int16 nOldMode, nNewMode; + nOldMode = nNewMode = 0; + nOldMode = impl_GetReducedTransparencyMode(); + nNewMode = nOldMode + 1; + aPrintOpt.SetReducedTransparencyMode( nNewMode ); + nNewMode = impl_GetReducedTransparencyMode(); + //if(nNewMode != nOldMode) // test the old source + if ( nNewMode == nOldMode ) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReducedTransparencyMode() error!"), + 0); + } + + //test IsReducedTransparencyMode() + nOldMode = nNewMode = 0; + nOldMode = impl_GetReducedTransparencyMode(); + nNewMode = nOldMode + 1; + impl_SetReducedTransparencyMode(nNewMode); + nNewMode = aPrintOpt.GetReducedTransparencyMode(); + //if(nNewMode != nOldMode) // test the old source + if(nNewMode == nOldMode) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the IsReducedTransparencyMode() error!" + "nOldMode's value is :"), + 0); + } + + // test the SetReduceGradients() + bNewValue = bOldValue = sal_False; + bOldValue = impl_IsReduceGradients(); + bNewValue = !bOldValue; + aPrintOpt.SetReduceGradients(bNewValue); + bNewValue = impl_IsReduceGradients(); + //if (bNewValue != bOldValue) //test the old source + if (bNewValue == bOldValue) //test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReduceGradients() error!"), + 0); + + } + + // test the IsReduceGradients() + bNewValue = bOldValue = sal_False; + bOldValue = impl_IsReduceGradients(); + bNewValue = !bOldValue; + this->impl_SetReduceGradients(bNewValue); + bNewValue = aPrintOpt.IsReduceGradients(); + // if (bNewValue != bOldValue) // test the old source + if (bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the IsReduceGradients() error!"), + 0); + + } + + //test SetRedecedGradientMode() + nOldMode = nNewMode = 0; + nOldMode = this->impl_GetReducedGradientMode(); + nNewMode = nOldMode + 1; + aPrintOpt.SetReducedGradientMode(nNewMode); + nNewMode = this->impl_GetReducedGradientMode(); + //if (nNewMode != nOldMode) // test the old source + if (nNewMode == nOldMode)// test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetRedecedGradientMode() error!"), + 0); + } + + // test GetReducedGradientMode() + nOldMode = nNewMode = 0; + nOldMode = this->impl_GetReducedGradientMode(); + nNewMode = nOldMode + 1; + this->impl_SetReducedGradientMode(nNewMode); + nNewMode = aPrintOpt.GetReducedGradientMode(); + //if (nNewMode != nOldMode) // test the old source + if (nNewMode == nOldMode) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the GetReducedGradientMode() error!"), + 0); + + } + + //test the SetReducedGradientStepCount() + sal_Int16 nNewStepCount; + sal_Int16 nOldStepCount; + nNewStepCount = nOldStepCount = 0; + nOldStepCount = this->impl_GetReducedGradientStepCount(); + nNewStepCount = nOldStepCount + 1; + aPrintOpt.SetReducedGradientStepCount(nNewStepCount); + nNewStepCount = this->impl_GetReducedGradientStepCount(); + // if (nNewStepCount != nOldStepCount) // test the old source + if (nNewStepCount == nOldStepCount) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReducedGradientStepCount() error!"), + 0); + + } + + // test the GetReduceGradientStepCount() + nNewStepCount = nOldStepCount = 0; + nOldStepCount = this->impl_GetReducedGradientStepCount(); + nNewStepCount = nOldStepCount + 1; + this->impl_SetReducedGradientStepCount(nNewStepCount); + nNewStepCount = aPrintOpt.GetReducedGradientStepCount(); + // if (nNewStepCount != nOldStepCount) //test the old source + if (nNewStepCount == nOldStepCount) //test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the GetReduceGradientStepCount() error!"), + 0); + } + + // test the SetReduceBitmaps() + bNewValue = bOldValue = sal_False; + bOldValue = this->impl_IsReduceBitmaps(); + bNewValue = !bOldValue; + aPrintOpt.SetReduceBitmaps(bNewValue); + bNewValue = this->impl_IsReduceBitmaps(); + //if (bNewValue != bOldValue) // test the old source + if (bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReduceBitmaps() error!"), + 0); + } + + // test the IsReduceBitmaps() + bNewValue = bOldValue = sal_False; + bOldValue = this->impl_IsReduceBitmaps(); + bNewValue = !bOldValue; + this->impl_SetReduceBitmaps(bNewValue); + bNewValue = aPrintOpt.IsReduceBitmaps(); + //if (bNewValue != bOldValue) // test the old source + if (bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the IsReduceBitmaps() error!"), + 0); + } + + // test the SetReduceBitmap() + nNewMode = nOldMode = 0; + nOldMode = impl_GetReducedBitmapMode(); + nNewMode = nOldMode + 1; + aPrintOpt.SetReducedBitmapMode(nNewMode); + nNewMode = impl_GetReducedBitmapMode(); + //if (nNewMode != nOldMode) // test the old source + if (nNewMode == nOldMode)// test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReduceBitmap() error!"), + 0); + } + + // test the SetReduceBitmapMode() + nNewMode = nOldMode = 0; + nOldMode = this->impl_GetReducedBitmapMode(); + nNewMode = nOldMode + 1; + aPrintOpt.SetReducedBitmapMode(nNewMode); + nNewMode = this->impl_GetReducedBitmapMode(); + //if (nNewMode != nOldMode) // test the old source + if (nNewMode == nOldMode) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReduceBitmapMode() error!"), + 0); + } + + // test the GetReduceBitmapMode() + nNewMode = nOldMode = 0; + nOldMode = this->impl_GetReducedBitmapMode(); + nNewMode = nOldMode + 1; + this->impl_SetReducedBitmapMode(nNewMode); + nNewMode = aPrintOpt.GetReducedBitmapMode(); + //if (nNewMode != nOldMode) // test the old source + if (nNewMode == nOldMode)// test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the GetReduceBitmapMode() error!"), + 0); + + } + + // test the SetReducedBitmapResolution() + sal_Int16 nOldResolution ; + sal_Int16 nNewResolution ; + nNewResolution = nOldResolution = 0; + nOldResolution = impl_GetReducedBitmapResolution(); + nNewResolution = nOldResolution + 1; + aPrintOpt.SetReducedBitmapResolution(nNewResolution); + nNewResolution = impl_GetReducedBitmapResolution(); + //if (nNewResolution != nOldResolution) // test the old source + if (nNewResolution == nOldResolution)// test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReducedBitmapResolution() error!"), + 0); + } + + // test the GetReduceBitmapResolution() + nNewResolution = nOldResolution = 0; + nOldResolution = impl_GetReducedBitmapResolution(); + nNewResolution = nOldResolution + 1; + impl_SetReducedBitmapResolution(nNewResolution); + nNewResolution = impl_GetReducedBitmapResolution(); + //if (nNewResolution != nOldResolution) // test the old source + if (nNewResolution == nOldResolution) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the GetReduceBitmapResolution() error!"), + 0); + } + + // test SetReducedBitmapIncludesTransparency() + bNewValue = bOldValue = sal_False; + bOldValue = impl_IsReducedBitmapIncludesTransparency(); + bNewValue = !bOldValue; + aPrintOpt.SetReducedBitmapIncludesTransparency(bNewValue); + bNewValue = impl_IsReducedBitmapIncludesTransparency(); + //if (bNewValue != bOldValue) // test the new source + if (bNewValue == bOldValue) // test the old source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetReducedBitmapIncludesTransparency() error!"), + 0); + } + + // test the IsReducedBitmapIncludesTransparency() + bNewValue = bOldValue = sal_False; + bOldValue = impl_IsReducedBitmapIncludesTransparency(); + bNewValue = !bOldValue; + impl_SetReducedBitmapIncludesTransparency(bNewValue); + bNewValue = aPrintOpt.IsReducedBitmapIncludesTransparency(); + //if (bNewValue != bOldValue) // test the old source + if (bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the IsReducedBitmapIncludesTransparency() error!"), + 0); + } + + // test the SetConvertToGreyscales() + bNewValue = bOldValue = sal_False; + bOldValue = this->impl_IsConvertToGreyscales(); + bNewValue = !bOldValue; + aPrintOpt.SetConvertToGreyscales(bNewValue); + bNewValue = this->impl_IsConvertToGreyscales(); + //if (bNewValue != bOldValue) // test the old source + if (bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the SetConvertToGreyscales() error!"), + 0); + } + + // test the IsConvertToGreyscales() + bNewValue = bOldValue = sal_False; + bOldValue = this->impl_IsConvertToGreyscales(); + bNewValue = !bOldValue; + impl_SetConvertToGreyscales(bNewValue); + bNewValue = aPrintOpt.IsConvertToGreyscales(); + //if (bNewValue != bOldValue) // test the old source + if (bNewValue == bOldValue) // test the new source + { + throw css::uno::RuntimeException( + rtl::OUString::createFromAscii( + "null com.sun.star.configuration." + "the IsConvertToGreyscales() error!"), + 0); + } +} diff --git a/svtools/qa/complex/ConfigItems/helper/PrintOptTest.hxx b/svtools/qa/complex/ConfigItems/helper/PrintOptTest.hxx new file mode 100644 index 000000000000..14d4267b8878 --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/PrintOptTest.hxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: PrintOptTest.hxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:24 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef SVTOOLS_PRINTOPTTEST_HXX +#define SVTOOLS_PRINTOPTTEST_HXX + +#include +#include + +namespace css = ::com::sun::star; + +class PrintOptTest +{ +public: + + PrintOptTest(); + ~PrintOptTest(); + + void impl_checkPrint(); + +private: //members + + SvtPrinterOptions aPrintOpt; + css::uno::Reference< css::container::XNameAccess > m_xCfg; + css::uno::Reference< css::container::XNameAccess > m_xNode; + +private: // methods + sal_Bool impl_IsReduceTransparency() const ; + void impl_SetReduceTransparency( sal_Bool bState ) ; + + sal_Int16 impl_GetReducedTransparencyMode() const ; + void impl_SetReducedTransparencyMode( sal_Int16 nMode ) ; + + sal_Bool impl_IsReduceGradients() const ; + void impl_SetReduceGradients( sal_Bool bState ) ; + + sal_Int16 impl_GetReducedGradientMode() const ; + void impl_SetReducedGradientMode( sal_Int16 nMode ) ; + + sal_Int16 impl_GetReducedGradientStepCount() const ; + void impl_SetReducedGradientStepCount( sal_Int16 nStepCount ); + + sal_Bool impl_IsReduceBitmaps() const ; + void impl_SetReduceBitmaps( sal_Bool bState ) ; + + sal_Int16 impl_GetReducedBitmapMode() const ; + void impl_SetReducedBitmapMode( sal_Int16 nMode ) ; + + sal_Int16 impl_GetReducedBitmapResolution() const ; + void impl_SetReducedBitmapResolution( sal_Int16 nResolution ) ; + + sal_Bool impl_IsReducedBitmapIncludesTransparency() const ; + void impl_SetReducedBitmapIncludesTransparency( sal_Bool bState ) ; + + sal_Bool impl_IsConvertToGreyscales() const; + void impl_SetConvertToGreyscales( sal_Bool bState ) ; + +}; + +#endif // #ifndef SVTOOLS_PRINTOPTTEST_HXX diff --git a/svtools/qa/complex/ConfigItems/helper/UserOptTest.cxx b/svtools/qa/complex/ConfigItems/helper/UserOptTest.cxx new file mode 100644 index 000000000000..3780eff3f741 --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/UserOptTest.cxx @@ -0,0 +1,274 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: UserOptTest.cxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:24 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "UserOptTest.hxx" + +namespace css = ::com::sun::star; + +//============================================================================= +static const ::rtl::OUString MESSAGE_SETCOMPANY_FAILED = ::rtl::OUString::createFromAscii("set company failed") ; +static const ::rtl::OUString MESSAGE_SETFIRSTNAME_FAILED = ::rtl::OUString::createFromAscii("set firstname failed") ; +static const ::rtl::OUString MESSAGE_SETLASTNAME_FAILED = ::rtl::OUString::createFromAscii("set lastname failed") ; +static const ::rtl::OUString MESSAGE_SETID_FAILED = ::rtl::OUString::createFromAscii("set ID failed") ; +static const ::rtl::OUString MESSAGE_SETSTREET_FAILED = ::rtl::OUString::createFromAscii("set street failed") ; +static const ::rtl::OUString MESSAGE_SETCITY_FAILED = ::rtl::OUString::createFromAscii("set city failed") ; +static const ::rtl::OUString MESSAGE_SETSTATE_FAILED = ::rtl::OUString::createFromAscii("set state failed") ; +static const ::rtl::OUString MESSAGE_SETZIP_FAILED = ::rtl::OUString::createFromAscii("set zip failed") ; +static const ::rtl::OUString MESSAGE_SETCOUNTRY_FAILED = ::rtl::OUString::createFromAscii("set country failed") ; +static const ::rtl::OUString MESSAGE_SETPOSITION_FAILED = ::rtl::OUString::createFromAscii("set position failed") ; +static const ::rtl::OUString MESSAGE_SETTITLE_FAILED = ::rtl::OUString::createFromAscii("set title failed") ; +static const ::rtl::OUString MESSAGE_SETTELEPHONEHOME_FAILED = ::rtl::OUString::createFromAscii("set telephonehome failed") ; +static const ::rtl::OUString MESSAGE_SETTELEPHONEWORK_FAILED = ::rtl::OUString::createFromAscii("set telephonework failed") ; +static const ::rtl::OUString MESSAGE_SETFAX_FAILED = ::rtl::OUString::createFromAscii("set fax failed") ; +static const ::rtl::OUString MESSAGE_SETEMAIL_FAILED = ::rtl::OUString::createFromAscii("set email failed") ; +static const ::rtl::OUString MESSAGE_SETCUSTOMERNUMBER_FAILED = ::rtl::OUString::createFromAscii("set customernumber failed"); +static const ::rtl::OUString MESSAGE_SETFATHERSNAME_FAILED = ::rtl::OUString::createFromAscii("set fathersname failed") ; +static const ::rtl::OUString MESSAGE_SETAPARTMENT_FAILED = ::rtl::OUString::createFromAscii("set apartment failed") ; + +//============================================================================= + + +UserOptTest::UserOptTest() + :m_aConfigItem() + ,m_xCfg() +{ +} + +UserOptTest::~UserOptTest() +{ +} + +void UserOptTest::impl_checkUserData() +{ + impl_checkSetCompany( ::rtl::OUString() ); + impl_checkSetFirstName( ::rtl::OUString() ); + impl_checkSetLastName( ::rtl::OUString() ); + impl_checkSetID( ::rtl::OUString() ); + impl_checkSetStreet( ::rtl::OUString() ); + impl_checkSetCity( ::rtl::OUString() ); + impl_checkSetState( ::rtl::OUString() ); + impl_checkSetZip( ::rtl::OUString() ); + impl_checkSetCountry( ::rtl::OUString() ); + impl_checkSetPosition( ::rtl::OUString() ); + impl_checkSetTitle( ::rtl::OUString() ); + impl_checkSetTelephoneHome( ::rtl::OUString() ); + impl_checkSetTelephoneWork( ::rtl::OUString() ); + impl_checkSetFax( ::rtl::OUString() ); + impl_checkSetEmail( ::rtl::OUString() ); + //impl_checkSetCustomerNumber( ::rtl::OUString() ); + impl_checkSetFathersName( ::rtl::OUString() ); + impl_checkSetApartment( ::rtl::OUString() ); + + impl_checkSetCompany( ::rtl::OUString::createFromAscii("RedFlag2000") ); + impl_checkSetFirstName( ::rtl::OUString::createFromAscii("Yan") ); + impl_checkSetLastName( ::rtl::OUString::createFromAscii("Wu") ); + impl_checkSetID( ::rtl::OUString::createFromAscii("wuy") ); + impl_checkSetStreet( ::rtl::OUString::createFromAscii("SouthFifthRing") ); + impl_checkSetCity( ::rtl::OUString::createFromAscii("Beijing") ); + impl_checkSetState( ::rtl::OUString::createFromAscii("Beijing") ); + impl_checkSetZip( ::rtl::OUString::createFromAscii("100176") ); + impl_checkSetCountry( ::rtl::OUString::createFromAscii("China") ); + impl_checkSetPosition( ::rtl::OUString::createFromAscii("Engineer") ); + impl_checkSetTitle( ::rtl::OUString::createFromAscii("Software Engineer") ); + impl_checkSetTelephoneHome( ::rtl::OUString::createFromAscii("010-51570010") ); + impl_checkSetTelephoneWork( ::rtl::OUString::createFromAscii("010-51570010") ); + impl_checkSetFax( ::rtl::OUString::createFromAscii("010-51570010") ); + impl_checkSetEmail( ::rtl::OUString::createFromAscii("wuy@redflag2000.cn") ); + //impl_checkSetCustomerNumber( ::rtl::OUString::createFromAscii("87654321") ); + impl_checkSetFathersName( ::rtl::OUString::createFromAscii("father") ); + impl_checkSetApartment( ::rtl::OUString::createFromAscii("apartment") ); +} + +void UserOptTest::impl_checkSetCompany( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetCompany( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetCompany(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETCOMPANY_FAILED, 0); +} + +void UserOptTest::impl_checkSetFirstName( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetFirstName( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetFirstName(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETFIRSTNAME_FAILED, 0); +} + +void UserOptTest::impl_checkSetLastName( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetLastName( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetLastName(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETLASTNAME_FAILED, 0); +} + +void UserOptTest::impl_checkSetID( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetID( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetID(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETID_FAILED, 0); +} + +void UserOptTest::impl_checkSetStreet( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetStreet( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetStreet(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETSTREET_FAILED, 0); +} + +void UserOptTest::impl_checkSetCity( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetCity( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetCity(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETCITY_FAILED, 0); +} + +void UserOptTest::impl_checkSetState( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetState( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetState(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETSTATE_FAILED, 0); +} + +void UserOptTest::impl_checkSetZip( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetZip( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetZip(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETZIP_FAILED, 0); +} + +void UserOptTest::impl_checkSetCountry( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetCountry( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetCountry(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETCOUNTRY_FAILED, 0); +} + +void UserOptTest::impl_checkSetPosition( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetPosition( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetPosition(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETPOSITION_FAILED, 0); +} + +void UserOptTest::impl_checkSetTitle( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetTitle( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetTitle(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETTITLE_FAILED, 0); +} + +void UserOptTest::impl_checkSetTelephoneHome( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetTelephoneHome( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetTelephoneHome(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETTELEPHONEHOME_FAILED, 0); +} + +void UserOptTest::impl_checkSetTelephoneWork( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetTelephoneWork( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetTelephoneWork(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETTELEPHONEWORK_FAILED, 0); +} + +void UserOptTest::impl_checkSetFax( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetFax( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetFax(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETFAX_FAILED, 0); +} + +void UserOptTest::impl_checkSetEmail( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetEmail( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetEmail(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETEMAIL_FAILED, 0); +} + +void UserOptTest::impl_checkSetCustomerNumber( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetCustomerNumber( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetCustomerNumber(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETCUSTOMERNUMBER_FAILED, 0); +} + +void UserOptTest::impl_checkSetFathersName( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetFathersName( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetFathersName(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETFATHERSNAME_FAILED, 0); +} + +void UserOptTest::impl_checkSetApartment( const ::rtl::OUString& sUserData ) +{ + m_aConfigItem.SetApartment( sUserData ); + + ::rtl::OUString sCheck = m_aConfigItem.GetApartment(); + if ( sCheck != sUserData ) + throw css::uno::Exception(MESSAGE_SETAPARTMENT_FAILED, 0); +} diff --git a/svtools/qa/complex/ConfigItems/helper/UserOptTest.hxx b/svtools/qa/complex/ConfigItems/helper/UserOptTest.hxx new file mode 100644 index 000000000000..203a4cbc7cbd --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/UserOptTest.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: UserOptTest.hxx,v $ + * + * $Revision: 1.1.4.2 $ + * + * last change: $Author: as $ $Date: 2008/03/19 11:09:25 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef SVTOOLS_USEROPTTEST_HXX +#define SVTOOLS_USEROPTTEST_HXX + +#include +#include + +namespace css = ::com::sun::star; + +class UserOptTest +{ +public: + UserOptTest(); + ~UserOptTest(); + + void impl_checkUserData(); + +private: + void impl_checkSetCompany( const ::rtl::OUString& sUserData ); + void impl_checkSetFirstName( const ::rtl::OUString& sUserData ); + void impl_checkSetLastName( const ::rtl::OUString& sUserData ); + void impl_checkSetID( const ::rtl::OUString& sUserData ); + void impl_checkSetStreet( const ::rtl::OUString& sUserData ); + void impl_checkSetCity( const ::rtl::OUString& sUserData ); + void impl_checkSetState( const ::rtl::OUString& sUserData ); + void impl_checkSetZip( const ::rtl::OUString& sUserData ); + void impl_checkSetCountry( const ::rtl::OUString& sUserData ); + void impl_checkSetPosition( const ::rtl::OUString& sUserData ); + void impl_checkSetTitle( const ::rtl::OUString& sUserData ); + void impl_checkSetTelephoneHome( const ::rtl::OUString& sUserData ); + void impl_checkSetTelephoneWork( const ::rtl::OUString& sUserData ); + void impl_checkSetFax( const ::rtl::OUString& sUserData ); + void impl_checkSetEmail( const ::rtl::OUString& sUserData ); + void impl_checkSetCustomerNumber( const ::rtl::OUString& sUserData ); + void impl_checkSetFathersName( const ::rtl::OUString& sUserData ); + void impl_checkSetApartment( const ::rtl::OUString& sUserData ); + +private: + SvtUserOptions m_aConfigItem; + + css::uno::Reference< css::container::XNameAccess > m_xCfg; +}; + +#endif // #ifndef SVTOOLS_USEROPTTEST_HXX diff --git a/svtools/qa/complex/ConfigItems/helper/exports.map b/svtools/qa/complex/ConfigItems/helper/exports.map new file mode 100644 index 000000000000..85610ad80888 --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/exports.map @@ -0,0 +1,10 @@ +UDK_3_0_0 { + global: + GetVersionInfo; + component_getImplementationEnvironment; + component_getFactory; + component_writeInfo; + + local: + *; +}; diff --git a/svtools/qa/complex/ConfigItems/helper/makefile.mk b/svtools/qa/complex/ConfigItems/helper/makefile.mk new file mode 100644 index 000000000000..6070d25b7bd4 --- /dev/null +++ b/svtools/qa/complex/ConfigItems/helper/makefile.mk @@ -0,0 +1,81 @@ +#************************************************************************* +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.4.2 $ +# +# last change: $Author: as $ $Date: 2008/03/19 11:09:25 $ +# +# The Contents of this file are made available subject to +# the terms of GNU Lesser General Public License Version 2.1. +# +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2005 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +#************************************************************************* +PRJ=..$/..$/..$/.. + +PRJNAME= svtools +TARGET= ConfigItemTest +USE_DEFFILE= TRUE +ENABLE_EXCEPTIONS= TRUE +NO_BSYMBOLIC= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Generate ----------------------------------------------------- + +INCPOST += $(PRJ)$/source$/inc + +# --- light services library ---------------------------------------------------- + +SHL1TARGET= svt_$(TARGET) + +SHL1OBJS= \ + $(SLO)$/UserOptTest.obj \ + $(SLO)$/PrintOptTest.obj \ + $(SLO)$/AccessibilityOptTest.obj \ + $(SLO)$/HistoryOptTest.obj \ + $(SLO)$/ConfigItemTest.obj + +SHL1STDLIBS= \ + $(SVTOOLLIB) \ + $(SVLLIB) \ + $(UNOTOOLSLIB) \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) + +SHL1DEF= $(MISC)$/$(SHL1TARGET).def +#SHL1DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) + +DEF1NAME= $(SHL1TARGET) + +SHL1VERSIONMAP= exports.map + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/svtools/qa/complex/ConfigItems/makefile.mk b/svtools/qa/complex/ConfigItems/makefile.mk new file mode 100644 index 000000000000..f85c5b0a8e65 --- /dev/null +++ b/svtools/qa/complex/ConfigItems/makefile.mk @@ -0,0 +1,91 @@ +#************************************************************************* +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.4.2 $ +# +# last change: $Author: as $ $Date: 2008/03/19 11:09:22 $ +# +# The Contents of this file are made available subject to +# the terms of GNU Lesser General Public License Version 2.1. +# +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2005 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +#************************************************************************* +PRJ = ..$/..$/.. +TARGET = CheckConfigItems +PRJNAME = svtools +PACKAGE = complex$/ConfigItems + +# --- Settings ----------------------------------------------------- +.INCLUDE: settings.mk + + +#----- compile .java files ----------------------------------------- + +JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ + OOoRunner.jar + +JAVAFILES = CheckConfigItems.java + +JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) + +SUBDIRS = helper + +#----- make a jar from compiled files ------------------------------ + +MAXLINELENGTH = 100000 + +JARCLASSDIRS = $(PACKAGE) +JARTARGET = $(TARGET).jar +JARCOMPRESS = TRUE + +# --- Parameters for the test -------------------------------------- + +# start an office if the parameter is set for the makefile +.IF "$(OFFICE)" == "" +CT_APPEXECCOMMAND = +.ELSE +CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +.ENDIF + +# test base is java complex +CT_TESTBASE = -TestBase java_complex + +# test looks something like the.full.package.TestName +CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) + +# start the runner application +CT_APP = org.openoffice.Runner + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +RUN: run + +run: + java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) + + + -- cgit