Kaydet (Commit) b8d65266 authored tarafından sb's avatar sb

sb131: merged in DEV300_m90

...@@ -2,4 +2,6 @@ qa qadevOOo : javaunohelper jurt ridljar unoil NULL ...@@ -2,4 +2,6 @@ qa qadevOOo : javaunohelper jurt ridljar unoil NULL
qa qadevOOo usr1 - all qa_mkout NULL qa qadevOOo usr1 - all qa_mkout NULL
qa qadevOOo nmake - all qa_runner_ant_build NULL qa qadevOOo nmake - all qa_runner_ant_build NULL
qa qadevOOo\runner nmake - all qa_make_package qa_runner_ant_build NULL qa qadevOOo\runner nmake - all qa_make_package qa_runner_ant_build NULL
qa qadevOOo\qa\unoapi nmake - all qa_qa_unoapi NULL
qa qadevOOo\qa\unoapi nmake - all qa_qa_unoapi qa_make_package NULL
qa qadevOOo\qa\complex\junitskeleton nmake - all qa_complex_junitskel qa_make_package NULL
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
package complex.junitskeleton;
import com.sun.star.io.IOException;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.util.XCloseable;
import java.io.File;
import java.io.RandomAccessFile;
import lib.TestParameters;
import util.SOfficeFactory;
// ---------- junit imports -----------------
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openoffice.test.OfficeConnection;
import static org.junit.Assert.*;
// ------------------------------------------
public class Skeleton
{
/**
* The test parameters
*/
private static TestParameters param = null;
@Test public void check() {
assertTrue("Couldn't open document", open());
System.out.println("check");
assertTrue("Couldn't close document", close());
String tempDirURL = util.utils.getOfficeTemp/*Dir*/(getMSF());
System.out.println("temp dir URL is: " + tempDirURL);
String tempDir = graphical.FileHelper.getSystemPathFromFileURL(tempDirURL);
assertTrue("Temp directory doesn't exist.", new File(tempDir).exists());
}
private boolean open()
{
System.out.println("open()");
// get multiservicefactory -----------------------------------------
final XMultiServiceFactory xMsf = getMSF();
SOfficeFactory SOF = SOfficeFactory.getFactory(xMsf);
// some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
param = new TestParameters();
param.put("ServiceFactory", xMsf); // some qadevOOo functions need the ServiceFactory
return true;
}
private boolean close()
{
System.out.println("close()");
return true;
}
// marked as test
@Test public void checkDocument()
{
System.out.println("checkDocument()");
final String sREADME = TestDocument.getUrl("README.txt");
System.out.println("README is in:" + sREADME);
File aFile = new File(sREADME);
if (! aFile.exists())
{
// It is a little bit stupid that office urls not compatible to java file urls
System.out.println("java.io.File can't access Office file urls.");
String sREADMESystemPath = graphical.FileHelper.getSystemPathFromFileURL(sREADME);
aFile = new File(sREADMESystemPath);
assertTrue("File '" + sREADMESystemPath + "' doesn't exists.", aFile.exists());
}
try
{
RandomAccessFile aAccess = new RandomAccessFile(aFile, "r");
long nLength = aAccess.length();
System.out.println("File length: " + nLength);
assertTrue("File length wrong", nLength > 0);
String sLine = aAccess.readLine();
assertTrue("Line must not be empty", sLine.length() > 0);
System.out.println(" Line: '" + sLine + "'");
System.out.println(" length: " + sLine.length());
assertTrue("File length not near equal to string length", sLine.length() + 2 >= nLength);
aAccess.close();
}
catch (java.io.FileNotFoundException e)
{
fail("Can't find file: " + sREADME + " - " + e.getMessage());
}
catch (java.io.IOException e)
{
fail("IO Exception: " + e.getMessage());
}
}
@Test public void checkOpenDocumentWithOffice()
{
// SOfficeFactory aFactory = new SOfficeFactory(getMSF());
SOfficeFactory SOF = SOfficeFactory.getFactory(getMSF());
final String sREADME = TestDocument.getUrl("README.txt");
try
{
XComponent aDocument = SOF.loadDocument(sREADME);
complex.junitskeleton.justatest.shortWait();
XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, aDocument);
xClose.close(true);
}
catch (com.sun.star.lang.IllegalArgumentException ex)
{
fail("Illegal argument exception caught: " + ex.getMessage());
}
catch (com.sun.star.io.IOException ex)
{
fail("IOException caught: " + ex.getMessage());
}
catch (com.sun.star.uno.Exception ex)
{
fail("Exception caught: " + ex.getMessage());
}
}
// marked as prepare for test, will call before every test
@Before public void before()
{
System.out.println("before()");
System.setProperty("THIS IS A TEST", "Hallo");
}
// marked as post for test, will call after every test
@After public void after()
{
System.out.println("after()");
String sValue = System.getProperty("THIS IS A TEST");
assertEquals(sValue, "Hallo");
}
private XMultiServiceFactory getMSF()
{
final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
return xMSF1;
}
// setup and close connections
@BeforeClass public static void setUpConnection() throws Exception {
System.out.println("setUpConnection()");
connection.setUp();
}
@AfterClass public static void tearDownConnection()
throws InterruptedException, com.sun.star.uno.Exception
{
System.out.println("tearDownConnection()");
connection.tearDown();
}
private static final OfficeConnection connection = new OfficeConnection();
}
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
package complex.junitskeleton;
import java.io.File;
import org.openoffice.test.OfficeFileUrl;
final class TestDocument
{
public static String getUrl(String name)
{
return OfficeFileUrl.getAbsolute(new File("test_documents", name));
}
private TestDocument() {}
}
/**
* @author: ll93751
* @copyright: Sun Microsystems Inc. 2010
*/
package complex.junitskeleton;
public class justatest /* extends *//* implements */ {
//public static void main( String[] argv ) {
//
// }
public void justatest()
{
System.out.println("justatest CTor.");
}
public void testfkt()
{
System.out.println("Test called.");
}
/**
* Sleeps for 0.5 sec. to allow StarOffice to react on <code>
* reset</code> call.
*/
public static void shortWait()
{
try
{
Thread.sleep(500) ;
}
catch (InterruptedException e)
{
System.out.println("While waiting :" + e) ;
}
}
}
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org 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 version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
nothing .PHONY:
@echo "OOO_SUBSEQUENT_TESTS not set, do nothing."
.ELSE
PRJ = ../../..
PRJNAME = sc
TARGET = qa_complex_junitskeleton
.IF "$(OOO_JUNIT_JAR)" != ""
PACKAGE = complex/junitskeleton
# here store only Files which contain a @Test
JAVATESTFILES = \
Skeleton.java
# put here all other files
JAVAFILES = $(JAVATESTFILES) \
justatest.java \
TestDocument.java
JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
EXTRAJARFILES = $(OOO_JUNIT_JAR)
# Sample how to debug
# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
.END
.INCLUDE: settings.mk
.INCLUDE: target.mk
.INCLUDE: installationtest.mk
ALLTAR : javatest
.END
...@@ -56,7 +56,8 @@ ALLTAR : cpptest ...@@ -56,7 +56,8 @@ ALLTAR : cpptest
cpptest : $(SHL1TARGETN) cpptest : $(SHL1TARGETN)
OOO_CPPTEST_ARGS = $(SHL1TARGETN) -env:arg-doc=$(BIN)/smoketestdoc.sxw TEST_ARGUMENTS = smoketest.doc=$(BIN)/smoketestdoc.sxw
CPPTEST_LIBRARY = $(SHL1TARGETN)
.IF "$(OS)" != "WNT" .IF "$(OS)" != "WNT"
$(installationtest_instpath).flag : $(shell ls \ $(installationtest_instpath).flag : $(shell ls \
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "sal/config.h" #include "sal/config.h"
#include "boost/noncopyable.hpp" #include "boost/noncopyable.hpp"
#include "com/sun/star/awt/AsyncCallback.hpp"
#include "com/sun/star/awt/XCallback.hpp" #include "com/sun/star/awt/XCallback.hpp"
#include "com/sun/star/awt/XRequestCallback.hpp"
#include "com/sun/star/beans/PropertyState.hpp" #include "com/sun/star/beans/PropertyState.hpp"
#include "com/sun/star/beans/PropertyValue.hpp" #include "com/sun/star/beans/PropertyValue.hpp"
#include "com/sun/star/document/MacroExecMode.hpp" #include "com/sun/star/document/MacroExecMode.hpp"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include "osl/diagnose.h" #include "osl/diagnose.h"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "test/getargument.hxx" #include "test/gettestargument.hxx"
#include "test/officeconnection.hxx" #include "test/officeconnection.hxx"
#include "test/oustringostreaminserter.hxx" #include "test/oustringostreaminserter.hxx"
#include "test/toabsolutefileurl.hxx" #include "test/toabsolutefileurl.hxx"
...@@ -149,8 +149,8 @@ void Test::tearDown() { ...@@ -149,8 +149,8 @@ void Test::tearDown() {
void Test::test() { void Test::test() {
rtl::OUString doc; rtl::OUString doc;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
test::getArgument( test::getTestArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("doc")), &doc)); rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("smoketest.doc")), &doc));
css::uno::Sequence< css::beans::PropertyValue > args(1); css::uno::Sequence< css::beans::PropertyValue > args(1);
args[0].Name = rtl::OUString( args[0].Name = rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode")); RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode"));
...@@ -168,10 +168,12 @@ void Test::test() { ...@@ -168,10 +168,12 @@ void Test::test() {
css::uno::Reference< css::frame::XController >( css::uno::Reference< css::frame::XController >(
css::uno::Reference< css::frame::XModel >( css::uno::Reference< css::frame::XModel >(
css::uno::Reference< css::frame::XComponentLoader >( css::uno::Reference< css::frame::XComponentLoader >(
connection_.getFactory()->createInstance( (connection_.getComponentContext()->
rtl::OUString( getServiceManager()->createInstanceWithContext(
RTL_CONSTASCII_USTRINGPARAM( rtl::OUString(
"com.sun.star.frame.Desktop"))), RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.frame.Desktop")),
connection_.getComponentContext())),
css::uno::UNO_QUERY_THROW)->loadComponentFromURL( css::uno::UNO_QUERY_THROW)->loadComponentFromURL(
test::toAbsoluteFileUrl(doc), test::toAbsoluteFileUrl(doc),
rtl::OUString( rtl::OUString(
...@@ -184,11 +186,8 @@ void Test::test() { ...@@ -184,11 +186,8 @@ void Test::test() {
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
Result result; Result result;
// Shifted to main thread to work around potential deadlocks (i112867): // Shifted to main thread to work around potential deadlocks (i112867):
css::uno::Reference< css::awt::XRequestCallback >( com::sun::star::awt::AsyncCallback::create(
connection_.getFactory()->createInstance( //TODO: AsyncCallback ctor connection_.getComponentContext())->addCallback(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.AsyncCallback"))),
css::uno::UNO_QUERY_THROW)->addCallback(
new Callback( new Callback(
disp, url, css::uno::Sequence< css::beans::PropertyValue >(), disp, url, css::uno::Sequence< css::beans::PropertyValue >(),
new Listener(&result)), new Listener(&result)),
......
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef INCLUDED_TEST_GETTESTARGUMENT_HXX
#define INCLUDED_TEST_GETTESTARGUMENT_HXX
#include "sal/config.h"
#include "test/detail/testdllapi.hxx"
namespace rtl { class OUString; }
namespace test {
// Obtain the value of a test argument (tunneled in via an "arg-testarg.<name>"
// bootstrap variable):
OOO_DLLPUBLIC_TEST bool getTestArgument(
rtl::OUString const & name, rtl::OUString * value);
}
#endif
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#include "osl/process.h" #include "osl/process.h"
#include "test/detail/testdllapi.hxx" #include "test/detail/testdllapi.hxx"
namespace com { namespace sun { namespace star { namespace lang { namespace com { namespace sun { namespace star { namespace uno {
class XMultiServiceFactory; class XComponentContext;
} } } } } } } }
namespace test { namespace test {
...@@ -51,13 +51,13 @@ public: ...@@ -51,13 +51,13 @@ public:
void tearDown(); void tearDown();
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
getFactory() const; getComponentContext() const;
private: private:
oslProcess process_; oslProcess process_;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
factory_; context_;
}; };
} }
......
te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridljar sal solenv unoil NULL te test : BOOST:boost cppu cppuhelper CPPUNIT:cppunit javaunohelper offuh ridljar sal solenv unoil NULL
te test\inc nmake - all inc NULL te test\inc nmake - all inc NULL
te test\source\cpp nmake - all source_cpp inc NULL te test\source\cpp nmake - all source_cpp inc NULL
te test\source\java nmake - all source_java NULL te test\source\java\org\openoffice\test nmake - all source_java NULL
...@@ -5,7 +5,7 @@ mkdir: %_DEST%\inc%_EXT%\test\detail ...@@ -5,7 +5,7 @@ mkdir: %_DEST%\inc%_EXT%\test\detail
..\%__SRC%\lib\libtest.dylib %_DEST%\lib%_EXT%\libtest.dylib ..\%__SRC%\lib\libtest.dylib %_DEST%\lib%_EXT%\libtest.dylib
..\%__SRC%\lib\libtest.so %_DEST%\lib%_EXT%\libtest.so ..\%__SRC%\lib\libtest.so %_DEST%\lib%_EXT%\libtest.so
..\inc\test\detail\testdllapi.hxx %_DEST%\inc%_EXT%\test\detail\testdllapi.hxx ..\inc\test\detail\testdllapi.hxx %_DEST%\inc%_EXT%\test\detail\testdllapi.hxx
..\inc\test\getargument.hxx %_DEST%\inc%_EXT%\test\getargument.hxx ..\inc\test\gettestargument.hxx %_DEST%\inc%_EXT%\test\gettestargument.hxx
..\inc\test\officeconnection.hxx %_DEST%\inc%_EXT%\test\officeconnection.hxx ..\inc\test\officeconnection.hxx %_DEST%\inc%_EXT%\test\officeconnection.hxx
..\inc\test\oustringostreaminserter.hxx %_DEST%\inc%_EXT%\test\oustringostreaminserter.hxx ..\inc\test\oustringostreaminserter.hxx %_DEST%\inc%_EXT%\test\oustringostreaminserter.hxx
..\inc\test\toabsolutefileurl.hxx %_DEST%\inc%_EXT%\test\toabsolutefileurl.hxx ..\inc\test\toabsolutefileurl.hxx %_DEST%\inc%_EXT%\test\toabsolutefileurl.hxx
......
...@@ -29,10 +29,13 @@ ...@@ -29,10 +29,13 @@
#include "rtl/bootstrap.hxx" #include "rtl/bootstrap.hxx"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "test/getargument.hxx"
#include "getargument.hxx"
namespace test { namespace test {
namespace detail {
bool getArgument(rtl::OUString const & name, rtl::OUString * value) { bool getArgument(rtl::OUString const & name, rtl::OUString * value) {
OSL_ASSERT(value != 0); OSL_ASSERT(value != 0);
return rtl::Bootstrap::get( return rtl::Bootstrap::get(
...@@ -40,3 +43,5 @@ bool getArgument(rtl::OUString const & name, rtl::OUString * value) { ...@@ -40,3 +43,5 @@ bool getArgument(rtl::OUString const & name, rtl::OUString * value) {
} }
} }
}
...@@ -23,22 +23,22 @@ ...@@ -23,22 +23,22 @@
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
************************************************************************/ ************************************************************************/
#ifndef INCLUDED_TEST_GETARGUMENT_HXX #ifndef INCLUDED_TEST_SOURCE_CPP_GETARGUMENT_HXX
#define INCLUDED_TEST_GETARGUMENT_HXX #define INCLUDED_TEST_SOURCE_CPP_GETARGUMENT_HXX
#include "sal/config.h" #include "sal/config.h"
#include "test/detail/testdllapi.hxx"
namespace rtl { class OUString; }
namespace test { namespace test {
namespace detail {
// Obtain the value of an argument tunneled in via an "arg-<name>" bootstrap // Obtain the value of an argument tunneled in via an "arg-<name>" bootstrap
// variable: // variable:
OOO_DLLPUBLIC_TEST bool getArgument( bool getArgument(
rtl::OUString const & name, rtl::OUString * value); rtl::OUString const & name, rtl::OUString * value);
} }
}
#endif #endif
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include "sal/config.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "test/gettestargument.hxx"
#include "getargument.hxx"
namespace test {
bool getTestArgument(rtl::OUString const & name, rtl::OUString * value) {
return detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("testarg.")) + name, value);
}
}
...@@ -44,6 +44,7 @@ CFLAGSCXX+=-DADAPT_EXT_STL ...@@ -44,6 +44,7 @@ CFLAGSCXX+=-DADAPT_EXT_STL
SLOFILES = \ SLOFILES = \
$(SLO)/getargument.obj \ $(SLO)/getargument.obj \
$(SLO)/gettestargument.obj \
$(SLO)/officeconnection.obj \ $(SLO)/officeconnection.obj \
$(SLO)/toabsolutefileurl.obj \ $(SLO)/toabsolutefileurl.obj \
$(SLO)/uniquepipename.obj $(SLO)/uniquepipename.obj
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "com/sun/star/connection/NoConnectException.hpp" #include "com/sun/star/connection/NoConnectException.hpp"
#include "com/sun/star/frame/XDesktop.hpp" #include "com/sun/star/frame/XDesktop.hpp"
#include "com/sun/star/lang/DisposedException.hpp" #include "com/sun/star/lang/DisposedException.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "cppuhelper/bootstrap.hxx" #include "cppuhelper/bootstrap.hxx"
#include <preextstl.h> #include <preextstl.h>
#include "cppunit/TestAssert.h" #include "cppunit/TestAssert.h"
...@@ -39,11 +39,12 @@ ...@@ -39,11 +39,12 @@
#include "osl/process.h" #include "osl/process.h"
#include "osl/time.h" #include "osl/time.h"
#include "sal/types.h" #include "sal/types.h"
#include "test/getargument.hxx"
#include "test/officeconnection.hxx" #include "test/officeconnection.hxx"
#include "test/toabsolutefileurl.hxx" #include "test/toabsolutefileurl.hxx"
#include "test/uniquepipename.hxx" #include "test/uniquepipename.hxx"
#include "getargument.hxx"
namespace { namespace {
namespace css = com::sun::star; namespace css = com::sun::star;
...@@ -60,7 +61,7 @@ void OfficeConnection::setUp() { ...@@ -60,7 +61,7 @@ void OfficeConnection::setUp() {
rtl::OUString desc; rtl::OUString desc;
rtl::OUString argSoffice; rtl::OUString argSoffice;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getArgument( detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice")),
&argSoffice)); &argSoffice));
if (argSoffice.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("path:"))) { if (argSoffice.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("path:"))) {
...@@ -77,7 +78,7 @@ void OfficeConnection::setUp() { ...@@ -77,7 +78,7 @@ void OfficeConnection::setUp() {
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";urp"))); rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";urp")));
rtl::OUString argUser; rtl::OUString argUser;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getArgument( detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")), &argUser)); rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")), &argUser));
rtl::OUString userArg( rtl::OUString userArg(
rtl::OUString( rtl::OUString(
...@@ -85,15 +86,12 @@ void OfficeConnection::setUp() { ...@@ -85,15 +86,12 @@ void OfficeConnection::setUp() {
toAbsoluteFileUrl(argUser)); toAbsoluteFileUrl(argUser));
rtl::OUString jreArg( rtl::OUString jreArg(
RTL_CONSTASCII_USTRINGPARAM("-env:UNO_JAVA_JFW_ENV_JREHOME=true")); RTL_CONSTASCII_USTRINGPARAM("-env:UNO_JAVA_JFW_ENV_JREHOME=true"));
rtl::OUString classpathArg(
RTL_CONSTASCII_USTRINGPARAM(
"-env:UNO_JAVA_JFW_ENV_CLASSPATH=true"));
rtl_uString * args[] = { rtl_uString * args[] = {
noquickArg.pData, nofirstArg.pData, norestoreArg.pData, noquickArg.pData, nofirstArg.pData, norestoreArg.pData,
acceptArg.pData, userArg.pData, jreArg.pData, classpathArg.pData }; acceptArg.pData, userArg.pData, jreArg.pData };
rtl_uString ** envs = 0; rtl_uString ** envs = 0;
rtl::OUString argEnv; rtl::OUString argEnv;
if (getArgument( if (detail::getArgument(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env")), &argEnv)) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("env")), &argEnv))
{ {
envs = &argEnv.pData; envs = &argEnv.pData;
...@@ -117,14 +115,14 @@ void OfficeConnection::setUp() { ...@@ -117,14 +115,14 @@ void OfficeConnection::setUp() {
cppu::defaultBootstrap_InitialComponentContext())); cppu::defaultBootstrap_InitialComponentContext()));
for (;;) { for (;;) {
try { try {
factory_ = context_ =
css::uno::Reference< css::lang::XMultiServiceFactory >( css::uno::Reference< css::uno::XComponentContext >(
resolver->resolve( resolver->resolve(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:")) + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:")) +
desc + desc +
rtl::OUString( rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( RTL_CONSTASCII_USTRINGPARAM(
";urp;StarOffice.ServiceManager"))), ";urp;StarOffice.ComponentContext"))),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
break; break;
} catch (css::connection::NoConnectException &) {} } catch (css::connection::NoConnectException &) {}
...@@ -138,21 +136,23 @@ void OfficeConnection::setUp() { ...@@ -138,21 +136,23 @@ void OfficeConnection::setUp() {
} }
void OfficeConnection::tearDown() { void OfficeConnection::tearDown() {
if (factory_.is()) {
css::uno::Reference< css::frame::XDesktop > desktop(
factory_->createInstance(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
css::uno::UNO_QUERY_THROW);
factory_.clear();
try {
CPPUNIT_ASSERT(desktop->terminate());
desktop.clear();
} catch (css::lang::DisposedException &) {}
// it appears that DisposedExceptions can already happen while
// receiving the response of the terminate call
}
if (process_ != 0) { if (process_ != 0) {
if (context_.is()) {
css::uno::Reference< css::frame::XDesktop > desktop(
context_->getServiceManager()->createInstanceWithContext(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.frame.Desktop")),
context_),
css::uno::UNO_QUERY_THROW);
context_.clear();
try {
CPPUNIT_ASSERT(desktop->terminate());
desktop.clear();
} catch (css::lang::DisposedException &) {}
// it appears that DisposedExceptions can already happen while
// receiving the response of the terminate call
}
CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, osl_joinProcess(process_)); CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, osl_joinProcess(process_));
oslProcessInfo info; oslProcessInfo info;
info.Size = sizeof info; info.Size = sizeof info;
...@@ -164,9 +164,9 @@ void OfficeConnection::tearDown() { ...@@ -164,9 +164,9 @@ void OfficeConnection::tearDown() {
} }
} }
css::uno::Reference< css::lang::XMultiServiceFactory > css::uno::Reference< css::uno::XComponentContext >
OfficeConnection::getFactory() const { OfficeConnection::getComponentContext() const {
return factory_; return context_;
} }
} }
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
package org.openoffice.test;
public final class Argument {
public static String get(String name) {
return System.getProperty("org.openoffice.test.arg." + name);
}
private Argument() {}
}
/*
* ************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
* ************************************************************************
*/
package org.openoffice.test;
/**
* Helper Functions for File handling
*/
public class FileHelper
{
public FileHelper()
{
}
/**
* Concat a _sRelativePathToAdd to a _sPath and append a '/' to the _sPath only if need.
*
* @param _sPath
* @param _sRelativePathToAdd
* @return a right concated path
*/
public static String appendPath(String _sPath, String _sRelativePathToAdd)
{
String sNewPath = _sPath;
String fs = System.getProperty("file.separator");
if (_sPath.startsWith("file:"))
{
fs = "/"; // we use a file URL so only '/' is allowed.
}
if (! (sNewPath.endsWith("/") || sNewPath.endsWith("\\") ) )
{
sNewPath += fs;
}
sNewPath += _sRelativePathToAdd;
return sNewPath;
}
}
...@@ -31,8 +31,9 @@ import com.sun.star.comp.helper.Bootstrap; ...@@ -31,8 +31,9 @@ import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.connection.NoConnectException; import com.sun.star.connection.NoConnectException;
import com.sun.star.frame.XDesktop; import com.sun.star.frame.XDesktop;
import com.sun.star.lang.DisposedException; import com.sun.star.lang.DisposedException;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.PrintStream; import java.io.PrintStream;
...@@ -49,17 +50,16 @@ public final class OfficeConnection { ...@@ -49,17 +50,16 @@ public final class OfficeConnection {
/** Start up an OOo instance. /** Start up an OOo instance.
*/ */
public void setUp() throws Exception { public void setUp() throws Exception {
String sofficeArg = getArgument("soffice"); String sofficeArg = Argument.get("soffice");
if (sofficeArg.startsWith("path:")) { if (sofficeArg.startsWith("path:")) {
description = "pipe,name=oootest" + UUID.randomUUID(); description = "pipe,name=oootest" + UUID.randomUUID();
ProcessBuilder pb = new ProcessBuilder( ProcessBuilder pb = new ProcessBuilder(
sofficeArg.substring("path:".length()), "-quickstart=no", sofficeArg.substring("path:".length()), "-quickstart=no",
"-nofirststartwizard", "-norestore", "-nofirststartwizard", "-norestore",
"-accept=" + description + ";urp", "-accept=" + description + ";urp",
"-env:UserInstallation=" + getArgument("user"), "-env:UserInstallation=" + Argument.get("user"),
"-env:UNO_JAVA_JFW_ENV_JREHOME=true", "-env:UNO_JAVA_JFW_ENV_JREHOME=true");
"-env:UNO_JAVA_JFW_ENV_CLASSPATH=true"); String envArg = Argument.get("env");
String envArg = getArgument("env");
if (envArg != null) { if (envArg != null) {
Map<String, String> env = pb.environment(); Map<String, String> env = pb.environment();
int i = envArg.indexOf("="); int i = envArg.indexOf("=");
...@@ -85,11 +85,11 @@ public final class OfficeConnection { ...@@ -85,11 +85,11 @@ public final class OfficeConnection {
Bootstrap.createInitialComponentContext(null)); Bootstrap.createInitialComponentContext(null));
for (;;) { for (;;) {
try { try {
factory = UnoRuntime.queryInterface( context = UnoRuntime.queryInterface(
XMultiServiceFactory.class, XComponentContext.class,
resolver.resolve( resolver.resolve(
"uno:" + description + "uno:" + description +
";urp;StarOffice.ServiceManager")); ";urp;StarOffice.ComponentContext"));
break; break;
} catch (NoConnectException e) {} } catch (NoConnectException e) {}
if (process != null) { if (process != null) {
...@@ -104,19 +104,24 @@ public final class OfficeConnection { ...@@ -104,19 +104,24 @@ public final class OfficeConnection {
throws InterruptedException, com.sun.star.uno.Exception throws InterruptedException, com.sun.star.uno.Exception
{ {
boolean desktopTerminated = true; boolean desktopTerminated = true;
if (factory != null) { if (process != null) {
XDesktop desktop = UnoRuntime.queryInterface( if (context != null) {
XDesktop.class, XMultiComponentFactory factory = context.getServiceManager();
factory.createInstance("com.sun.star.frame.Desktop")); assertNotNull(factory);
factory = null; XDesktop desktop = UnoRuntime.queryInterface(
try { XDesktop.class,
desktopTerminated = desktop.terminate(); factory.createInstanceWithContext(
} catch (DisposedException e) {} "com.sun.star.frame.Desktop", context));
// it appears that DisposedExceptions can already happen while context = null;
// receiving the response of the terminate call try {
desktop = null; desktopTerminated = desktop.terminate();
} else if (process != null) { } catch (DisposedException e) {}
process.destroy(); // it appears that DisposedExceptions can already happen
// while receiving the response of the terminate call
desktop = null;
} else {
process.destroy();
}
} }
int code = 0; int code = 0;
if (process != null) { if (process != null) {
...@@ -130,10 +135,10 @@ public final class OfficeConnection { ...@@ -130,10 +135,10 @@ public final class OfficeConnection {
assertTrue(errTerminated); assertTrue(errTerminated);
} }
/** Obtain the service factory of the running OOo instance. /** Obtain the component context of the running OOo instance.
*/ */
public XMultiServiceFactory getFactory() { public XComponentContext getComponentContext() {
return factory; return context;
} }
//TODO: get rid of this hack for legacy qa/unoapi tests //TODO: get rid of this hack for legacy qa/unoapi tests
...@@ -141,10 +146,6 @@ public final class OfficeConnection { ...@@ -141,10 +146,6 @@ public final class OfficeConnection {
return description; return description;
} }
private static String getArgument(String name) {
return System.getProperty("org.openoffice.test.arg." + name);
}
private static Integer waitForProcess(Process process, final long millis) private static Integer waitForProcess(Process process, final long millis)
throws InterruptedException throws InterruptedException
{ {
...@@ -217,5 +218,5 @@ public final class OfficeConnection { ...@@ -217,5 +218,5 @@ public final class OfficeConnection {
private Process process = null; private Process process = null;
private Forward outForward = null; private Forward outForward = null;
private Forward errForward = null; private Forward errForward = null;
private XMultiServiceFactory factory = null; private XComponentContext context = null;
} }
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
package org.openoffice.test;
import java.io.File;
/** Obtain the office-internal absolute file URL of a given file.
*/
public final class OfficeFileUrl {
public static String getAbsolute(File file) {
return file.getAbsoluteFile().toURI().toString().replaceFirst(
"\\A[Ff][Ii][Ll][Ee]:/(?=[^/]|\\z)", "file:///");
// file:/path -> file:///path
}
private OfficeFileUrl() {}
}
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
package org.openoffice.test;
/** Obtain the value of a test argument (tunneled in via an
"org.openoffice.test.arg.testarg.<name>" system property).
*/
public final class TestArgument {
public static String get(String name) {
return Argument.get("testarg." + name);
}
private TestArgument() {}
}
...@@ -23,14 +23,19 @@ ...@@ -23,14 +23,19 @@
# for a copy of the LGPLv3 License. # for a copy of the LGPLv3 License.
#***********************************************************************/ #***********************************************************************/
PRJ = ../.. PRJ = ../../../../..
PRJNAME = test PRJNAME = test
TARGET = java TARGET = java
.IF "$(OOO_JUNIT_JAR)" != "" .IF "$(OOO_JUNIT_JAR)" != ""
PACKAGE = org/openoffice/test PACKAGE = org/openoffice/test
JAVAFILES = OfficeConnection.java JAVAFILES = \
Argument.java \
FileHelper.java \
OfficeConnection.java \
OfficeFileUrl.java \
TestArgument.java
JARFILES = juh.jar ridl.jar unoil.jar JARFILES = juh.jar ridl.jar unoil.jar
EXTRAJARFILES = $(OOO_JUNIT_JAR) EXTRAJARFILES = $(OOO_JUNIT_JAR)
......
...@@ -78,6 +78,7 @@ testcase tUpdtScripts ...@@ -78,6 +78,7 @@ testcase tUpdtScripts
dim iCurrentDialog as integer dim iCurrentDialog as integer
dim iDiffCount as integer dim iDiffCount as integer
dim max_diffcount as integer
hInitSingleDoc() hInitSingleDoc()
...@@ -109,25 +110,33 @@ testcase tUpdtScripts ...@@ -109,25 +110,33 @@ testcase tUpdtScripts
case DLG_JAVASCRIPT: ToolsMacrosOrganizeMacrosJavaScript case DLG_JAVASCRIPT: ToolsMacrosOrganizeMacrosJavaScript
kontext "ScriptOrganizer" kontext "ScriptOrganizer"
hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) hGetAllNodeNames( ScriptTreeList, cScriptNamesList() )
max_diffcount = 0
case DLG_BEANSHELL: ToolsMacrosOrganizeMacrosBeanShell case DLG_BEANSHELL: ToolsMacrosOrganizeMacrosBeanShell
kontext "ScriptOrganizer" kontext "ScriptOrganizer"
hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) hGetAllNodeNames( ScriptTreeList, cScriptNamesList() )
max_diffcount = 0
case DLG_PYTHON: ToolsMacrosOrganizeMacrosPython case DLG_PYTHON: ToolsMacrosOrganizeMacrosPython
kontext "ScriptOrganizer" kontext "ScriptOrganizer"
hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) hGetAllNodeNames( ScriptTreeList, cScriptNamesList() )
max_diffcount = 0
case DLG_BASIC_ORG: ToolsMacro_uno case DLG_BASIC_ORG: ToolsMacro_uno
Kontext "Makro" Kontext "Makro"
hGetScriptNames( MakroAus, MakroListe, cScriptNamesList() ) hGetScriptNames( MakroAus, MakroListe, cScriptNamesList() )
max_diffcount = 6
case DLG_RUN_MACRO: ToolsMacrosRunMacro case DLG_RUN_MACRO: ToolsMacrosRunMacro
kontext "ScriptSelector" kontext "ScriptSelector"
hGetScriptNames( LibraryTreeList, ScriptList, cScriptNamesList() ) hGetScriptNames( LibraryTreeList, ScriptList, cScriptNamesList() )
max_diffcount = 6
end select end select
printlog( "Compare to reference list, create new one if differences were found" ) printlog( "Compare to reference list, create new one if differences were found" )
iDiffCount = hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) iDiffCount = abs( hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) )
if ( iDiffCount <> 0 ) then warnlog( "The number of scripts has changed, please review." )
' Usually we should have 0 differences in the list. However, as we do not have
' a unique way of installing the office (Root-Installation, archives and
' others) we need a little tolerance here. If a number of bundled extensions
' are installed, we have more scripts.
if ( iDiffCount > max_diffcount ) then warnlog( "The number of scripts has changed, please review." )
printlog( "Close <" & sDialog & ">" ) printlog( "Close <" & sDialog & ">" )
select case ( sDialog ) select case ( sDialog )
......
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description : Impress Only Required Test (Part 1)
'*
'\*****************************************************************
public glLocale (15*20) as string
global ExtensionString as String
sub main
Printlog " -------------------- Impress-Only-Required-Test -----------------------------"
Call hStatusIn ( "Graphics","i_only_updt_1.bas")
use "graphics\tools\id_tools.inc"
use "graphics\tools\id_tools_2.inc"
use "graphics\required\includes\global\id_002.inc" 'Edit
use "graphics\required\includes\global\id_003.inc" 'View
use "graphics\required\includes\global\id_004.inc" 'Insert
use "graphics\required\includes\global\id_005.inc" 'Format
use "graphics\required\includes\global\id_006.inc" 'Tools
use "graphics\required\includes\impress\im_003_.inc" 'Ansicht
use "graphics\required\includes\impress\im_004_.inc" 'Einfuegen
if hSetLocaleStrings ( gTesttoolPath + "graphics\tools\locale_1.txt" , glLocale () ) = FALSE then
qaErrorLog "Locales doesn't exist in file : "+gTesttoolPath + "graphics\tools\locale_1.txt" ' this is needed for spellchecking.
endif
call id_002
call im_003_
call id_003
call im_004_
call id_004
call id_005
call id_Tools
Call hStatusOut
end sub
'----------------------------------------------
sub LoadIncludeFiles
use "global\system\includes\master.inc"
use "global\system\includes\gvariabl.inc"
use "global\required\includes\g_option.inc"
use "global\required\includes\g_customize.inc"
use "global\required\includes\g_001.inc"
use "global\required\includes\g_009.inc"
gApplication = "IMPRESS"
Call GetUseFiles()
end sub
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description : Impress Only Required (Test Part 2)
'*
'\*****************************************************************
public glLocale (15*20) as string
global ExtensionString as String
sub main
Printlog " -------------------- Impress-Only-Required-Test -----------------------------"
Call hStatusIn ( "Graphics","i_only_updt_2.bas")
use "graphics\tools\id_tools.inc"
use "graphics\tools\id_tools_2.inc"
use "graphics\required\includes\global\id_001.inc" 'File
use "graphics\required\includes\global\id_007.inc" 'Kontext
use "graphics\required\includes\global\id_008.inc" 'Window
use "graphics\required\includes\global\id_009.inc" 'Help
use "graphics\required\includes\global\id_011.inc" 'Toolbars
use "graphics\required\includes\impress\im_007_.inc" 'Praesentation
if hSetLocaleStrings ( gTesttoolPath + "graphics\tools\locale_1.txt" , glLocale () ) = FALSE then
qaErrorLog "Locales doesn't exist in file : "+gTesttoolPath + "graphics\tools\locale_1.txt" ' this is needed for spellchecking.
endif
call id_011
Call tFileExportAsPDF
Call tExportAsPDFButton
Call im_007_
call id_008
call id_009
call id_007
Call hStatusOut
end sub
'----------------------------------------------
sub LoadIncludeFiles
use "global\system\includes\master.inc"
use "global\system\includes\gvariabl.inc"
use "global\required\includes\g_option.inc"
use "global\required\includes\g_customize.inc"
use "global\required\includes\g_001.inc"
use "global\required\includes\g_009.inc"
gApplication = "IMPRESS"
Call GetUseFiles()
end sub
...@@ -42,14 +42,7 @@ sub main ...@@ -42,14 +42,7 @@ sub main
PrintLog "------------ Graphics User-scenario-test: PowerUser creates a Presentation ------------" PrintLog "------------ Graphics User-scenario-test: PowerUser creates a Presentation ------------"
Call i_us_presentation1 ' User-Scenario: Pro. Call i_us_presentation ' User-Scenario: Pro.
Call i_us_presentation2
Call i_us_presentation3
Call i_us_presentation4
Call i_us_presentation5
Call i_us_presentation6
Call i_us_presentation7
Call i_us2_pres1 ' User-Scenario: Beginner. Call i_us2_pres1 ' User-Scenario: Beginner.
Call i_us2_pres2 Call i_us2_pres2
......
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\*****************************************************************
testcase tdEditCrossFading
printlog " open application "
Call hNewDocument
printlog " create 2 rectangles "
gMouseClick 50,50
Call hRechteckErstellen ( 10, 10, 20, 40 )
Call hRechteckErstellen ( 30, 30, 50, 60 )
printlog " Edit-YSelect All "
EditSelectAll
try
printlog " Edit->Cross-fading "
EditCrossFading
catch
warnlog "EditCrossFading not accessible :-("
endcatch
Kontext "Ueberblenden"
Call DialogTest ( Ueberblenden )
printlog " Change : 'Increments'; 1 more, 1 less "
Schritte.More
Schritte.Less
printlog " Change: Cross-fading attributes; uncheck, check "
Attributierung.uncheck
Attributierung.check
printlog " Change: same orientation; uncheck, check "
GleicheOrientierung.Uncheck
GleicheOrientierung.Check
printlog " cancel dialog 'Cross-fading'; uncheck, check "
Ueberblenden.Cancel
printlog " close application "
Call hCloseDocument
endcase 'tdEditCrossFading
'------------------------------------------------------------------------------
testcase tdEditLayer
printlog " open application "
Call hNewDocument
printlog " View->Layer "
ViewLayer
printlog " Edit->Layer->Insert "
InsertLayer
Kontext "EbeneEinfuegenDlg"
Call DialogTest ( EbeneEinfuegenDlg )
printlog " Change: Set another name for the layer "
EbenenName.SetText "SomeThing"
printlog " Change: Visible; uncheck, check "
Sichtbar.UnCheck
Sichtbar.Check
printlog " Change: Printable; uncheck, check "
Druckbar.UnCheck
Druckbar.Check
printlog " Change: Locked; check, uncheck "
Gesperrt.Check
Gesperrt.UnCheck
EbeneEinfuegenDlg.OK
printlog " (Edit->Layer->Modify is tested in format-menu-test) "
printlog " Edit->Layer->Rename "
EditLayerRename
kontext "DocumentDrawImpress"
LayerTabBar.TypeKeys "Apply!!<Return>" , true
printlog " Edit->Layer->Delete "
EditDeleteLayer
printlog " Messagebox: really delete? YES "
Kontext "Messagebox"
Messagebox.Yes
sleep (2)
printlog " View->Layer "
ViewLayer
printlog " close application "
Call hCloseDocument
endcase 'tdEditLayer
'------------------------------------------------------------------------------
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\*****************************************************************
testcase tdViewPagePane
printlog " open application "
Call hNewDocument
sleep 1
kontext "pagepane"
if (NOT pagepane.exists) then
qaerrorlog "Pages Panel not visible on opening application. Opening now."
ViewPagePane
endif
kontext "pagepane"
sleep (2)
try
printlog " View->Page Pane "
ViewPagePane
sleep (2)
if (pagepane.exists) then
warnlog "View->Page Pane failed."
ViewPagePane
endif
catch
warnlog "View->Page Pane couldn't get executed"
endcatch
sleep 1
if (NOT pagepane.exists) then
ViewPagePane
sleep (1)
endif
printlog " close application "
Call hCloseDocument
endcase 'tdViewPagePane
'-------------------------------------------------------------------------------
testcase tdViewSlide
printlog " open application "
hNewDocument
kontext "DocumentDrawImpress" ' special case :-)
printlog " click the button on the bottom: 'Master View' (because it is not accessible via the menu :-() "
ViewMasterPage
sleep 1
printlog " View->Slide "
ViewPagePane
Sleep 1
printlog " close application "
Call hCloseDocument
endcase 'tdViewSlide
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\*****************************************************************
testcase tiFormatLayer
printlog " open application "
Call hNewDocument
printlog " View->Layer "
ViewLayer
printlog " Format->Layer "
FormatLayer
Kontext "EbeneAendernDlg"
DialogTest ( EbeneAendernDlg )
printlog " cancel dialog 'Modify Layer' "
EbeneAendernDlg.Cancel
printlog " View->Layer "
ViewLayer
printlog " close application "
Call hCloseDocument
endcase 'tiFormatLayer
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\*****************************************************************
testcase tdModifyRotate
printlog " open application "
Call hNewDocument
printlog " create a rectangle "
Call hRechteckErstellen 20,20,40,40
sleep 1
printlog " Modify->Rotate "
ModifyRotate
sleep 1
printlog " close application "
Call hCloseDocument
endcase 'tdModifyRotate
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\**********************************************************************************
testcase tiViewNavigator
Call hNewDocument
Kontext "NavigatorDraw"
if Not NavigatorDraw.Exists Then
ViewNavigator
end if
Kontext "NavigatorDraw"
Call DialogTest ( NavigatorDraw )
try
Kontext "Navigator"
Navigator.Close
catch
Errorlog " Navigator wasn't closed, second try with Menu"
ViewNavigator
endcatch
Call hCloseDocument
endcase
'-------------------------------------------------------------------------
testcase tiViewZoom
Call hNewDocument
UseBindings
ViewZoom
Kontext "Massstab"
DialogTest ( Massstab )
Massstab.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------
testcase tiViewToolbar
Call hNewDocument
ViewToolbarsThreeDSettings
WaitSlot (1000)
ViewToolbarsThreeDSettings
WaitSlot (1000)
ViewToolbarsAlign
WaitSlot (1000)
ViewToolbarsAlign
WaitSlot (1000)
ViewToolbarsTools
WaitSlot (1000)
ViewToolbarsTools
WaitSlot (1000)
ViewToolbarsBezier
WaitSlot (1000)
ViewToolbarsBezier
WaitSlot (1000)
ViewToolbarsFontwork
WaitSlot (1000)
ViewToolbarsFontwork
WaitSlot (1000)
' if gApplication = "IMPRESS" then
' ViewToolbarsPresentation ' only in impress, not draw
' ViewToolbarsPresentation
' endif
ViewToolbarsFormControls
WaitSlot (1000)
ViewToolbarsFormControls
WaitSlot (1000)
'-----------------
ViewToolbarsFormDesign
WaitSlot (1000)
ViewToolbarsFormDesign
WaitSlot (1000)
ViewToolbarsFormNavigation
WaitSlot (1000)
ViewToolbarsFormNavigation
WaitSlot (1000)
ViewToolbarsGluepoints
WaitSlot (1000)
ViewToolbarsGluepoints
WaitSlot (1000)
ViewToolbarsInsert
WaitSlot (1000)
ViewToolbarsInsert
WaitSlot (1000)
ViewToolbarsGraphic
WaitSlot (1000)
ViewToolbarsGraphic
WaitSlot (1000)
ViewToolbarsMediaPlayback
WaitSlot (1000)
ViewToolbarsMediaPlayback
WaitSlot (1000)
ViewToolbarsOptionbar
WaitSlot (1000)
ViewToolbarsOptionbar
WaitSlot (1000)
ViewToolbarsPicture
WaitSlot (1000)
ViewToolbarsPicture
WaitSlot (1000)
ViewToolbarsStandard
WaitSlot (1000)
ViewToolbarsStandard
WaitSlot (1000)
ViewToolbarsStandardView
WaitSlot (1000)
ViewToolbarsStandardView
WaitSlot (1000)
ViewToolbarsHyperlinkbar
WaitSlot (1000)
ViewToolbarsHyperlinkbar
WaitSlot (1000)
ViewToolbarsColorBar
WaitSlot (1000)
ViewToolbarsColorBar
WaitSlot (1000)
ViewToolbarsCustomize
WaitSlot (1000)
Kontext
try
Messagebox.SetPage TabCustomizeMenu ' 1 ------------------
catch
warnlog "couldn't switch to tabpage 'Menus'"
endcatch
Kontext "TabCustomizeMenu"
if TabCustomizeMenu.exists(5) then
Call DialogTest ( TabCustomizeMenu )
Menu.typeKeys("<down>")
Entries.typeKeys("<down>")
sleep 2
BtnNew.Click
sleep 1
Kontext "MenuOrganiser"
Call DialogTest ( MenuOrganiser )
MenuOrganiser.cancel
sleep 1
Kontext "TabCustomizeMenu"
TabCustomizeMenu.Close
end if
sleep (1)
Call hCloseDocument
endcase
'-------------------------------------------------------------------------
testcase tiViewDisplayQuality
Call hNewDocument
Call hRechteckErstellen 20,20,40,40
try
ViewQualityBlackWhite
Printlog "- Quality set to black and white"
catch
Warnlog "- Slot could not be accessed"
endcatch
WaitSlot (1000)
try
ViewQualityGreyscale
Printlog "- View quality set to greyscale"
catch
Warnlog "- View quality greyscale could not be accessed"
endcatch
WaitSlot (1000)
try
ViewQualityColour
Printlog "- View quality set to colour"
catch
Warnlog "- View quality colour could not be accessed"
endcatch
Call hClosedocument
endcase
'-------------------------------------------------------------------------
testcase tiViewLayer
Call hNewDocument
ViewLayer
WaitSlot (1000)
ViewLayer
Call hCloseDocument
endcase
'-------------------------------------------------------------------------
testcase tViewGrid
Call hNewDocument
ViewGridVisible
ViewGridUse
ViewGridFront
ViewGridVisible
ViewGridUse
ViewGridFront
WaitSlot (1000)
Call hCloseDocument
endcase
'-------------------------------------------------------------------------
testcase tViewSnapLines
Call hNewDocument
ViewSnapLinesVisible
ViewSnapLinesUse
ViewSnapLinesFront
ViewSnapLinesVisible
ViewSnapLinesUse
ViewSnapLinesFront
WaitSlot (1000)
Call hCloseDocument
endcase
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\**********************************************************************************
testcase tiInsertSlide
Call hNewDocument
InsertSlide
WaitSlot (2000)
hTypekeys "<Pagedown>"
WaitSlot (2000) 'sleep 2
Call hCloseDocument
endcase
testcase tiInsertDuplicateSlide
Call hNewDocument
Call hRechteckErstellen ( 30, 40, 40, 50 )
InsertDuplicateSlide
WaitSlot (2000)
Call hCloseDocument
endcase
testcase tiInsertField
Call hNewDocument
InsertFieldsTimeFix
WaitSlot (1000)
printlog "OK Time Fix"
EditSelectAll
hTypekeys "<Delete>"
sleep 1
InsertFieldsDateFix
WaitSlot (1000)
printlog "OK Date Fix"
EditSelectAll
hTypekeys "<Delete>"
sleep 1
InsertFieldsTimeVariable
WaitSlot (1000)
printlog "OK Time Variabel"
EditSelectAll
hTypekeys "<Delete>"
sleep 1
InsertFieldsDateVariable
WaitSlot (1000)
printlog "OK Date Variabel"
EditSelectAll
hTypekeys "<Delete>"
sleep 1
InsertFieldsAuthorDraw
WaitSlot (1000)
printlog "OK Author"
EditSelectAll
hTypekeys "<Delete>"
sleep 1
InsertFieldsPageNumberDraw
WaitSlot (1000)
printlog "OK Page number"
EditSelectAll
hTypekeys "<Delete>"
sleep 1
InsertFieldsFileName
WaitSlot (1000) 'sleep 1
printlog "OK File name"
EditSelectAll
hTypekeys "<Delete>"
sleep 2
Call hCloseDocument
endcase
testcase tiInsertSpecialCharacter
Call hNewDocument
hTextrahmenErstellen ("This is a testtext",30,40,60,50)
sleep 2
InsertSpecialCharacterDraw
Kontext "Sonderzeichen"
if ( Sonderzeichen.exists( 2 ) ) then
Call DialogTest (Sonderzeichen)
hCloseDialog( Sonderzeichen, "Cancel" )
else
warnlog( "<Special Characters> dialog not open" )
endif
Call hCloseDocument
endcase
testcase tiInsertHyperlink
Call hNewDocument
InsertHyperlink
kontext "HyperlinkDialog"
if ( HyperlinkDialog.exists( 2 ) ) then
Kontext "TabHyperlinkInternet"
Auswahl.MouseDown 50, 5
Auswahl.MouseUp 50, 5
Auswahl.typekeys "<PAGEDOWN><PAGEUP>"
Auswahl.typekeys "<TAB>"
'Workaround to get rid of a Focusing-problem...
NameText.Typekeys "alal <RETURN>"
NameText.Typekeys "<MOD1 A><DELETE>"
TabHyperlinkInternet.Typekeys "<TAB>", 6
TabHyperlinkInternet.Typekeys "<LEFT>", 3
'End of workaround...
Internet.Check
ZielUrl.SetText( "http://www.nowhere.com" )
Uebernehmen.Click()
kontext "HyperlinkDialog"
HyperlinkDialog.Close()
else
warnlog "Failed to open <HyperlinkDialog>"
end if
Call hCloseDocument
endcase
testcase tiInsertGraphic
Call hNewDocument
InsertGraphicsFromFile
WaitSlot (2000) '
try
Kontext "GrafikEinfuegenDlg"
if Link.exists then
Link.Check
else
Warnlog "Linking grafik doesn't work :-("
end if
if Preview.exists then
Preview.Check
else
Warnlog "Preview of graphic doesn't work :-("
end if
DialogTest (GrafikEinfuegenDlg)
Dateiname.settext Convertpath (gTesttoolPath + "global\input\graf_inp\stabler.tif")
Oeffnen.click
catch
Warnlog "Insert graphic doesn't work :-("
endcatch
Call hCloseDocument
endcase
testcase tiInsertObjectSound
goto endsub ' disabled for final, because always wrong (TZ 01/2002)
'TODO: TBO: enhance!
Call hNewDocument
try
InsertObjectSound
WaitSlot (1000)
Kontext "OeffnenDlg"
' Call Dialogtest (OeffnenDlg) ' just be sure to check one pth and one open dialog : TZ 28.11.201
OeffnenDlg.Cancel
catch
printlog "'Insert -> Object -> Sound' not available. TestDevelopmentInProgress (TDIP) ;-)"
endcatch
Call hCloseDocument
endcase
testcase tiInsertObjectVideo
goto endsub
'TODO: TBO: enhance!
Call hNewDocument
try
InsertObjectVideo
Kontext "OeffnenDlg"
' Call Dialogtest (OeffnenDlg)
WaitSlot (1000)
OeffnenDlg.Cancel
catch
printlog "'Insert -> Object -> Video' not available. (TDIP) ;-)"
endcatch
Call hCloseDocument
endcase
testcase tiInsertChart
Call hNewDocument
InsertChart
Kontext "Messagebox"
if ( Messagebox.Exists( 2 ) ) then
Warnlog Messagebox.GetText
hCloseDialog( Messagebox, "OK" )
end if
gMouseClick 1,1
sleep 2
Call hCloseDocument
endcase
testcase tiInsertObjectOLEObjects
hNewDocument
InsertObjectOLEObject
Kontext "OLEObjektEinfuegen"
' Call Dialogtest ( OLEObjektEinfuegen )
' NeuErstellen.Check ' is default value
Call DialogTest (OLEObjektEinfuegen, 1)
AusDateiErstellen.Check
Call DialogTest (OLEObjektEinfuegen, 2)
Durchsuchen.click
Kontext "OeffnenDlG"
OeffnenDLG.Cancel
Kontext "OLEObjektEinfuegen"
OLEObjektEinfuegen.Cancel
sleep 1
Call hCloseDocument
endcase
testcase tiInsertSpreadsheet
if gtSYSName = "Linux" then
printlog "Linux = wont test tiInsertSpreadsheet"
goto endsub
endif
Call hNewDocument
WaitSlot (2000)
InsertSpreadsheetDraw
WaitSlot (2000)
Kontext "Messagebox"
if Messagebox.Exists (5) then
Warnlog Messagebox.GetText
hCloseDialog( Messagebox, "ok" )
end if
gMouseClick 1,1
sleep 1
hTypekeys "<Tab><Delete>"
sleep 2
Call hCloseDocument
endcase
testcase tiInsertFormula
Call hNewDocument
InsertObjectFormulaDraw
Kontext "Messagebox"
if ( Messagebox.Exists( 2 ) ) then
Warnlog Messagebox.GetText
hCloseDialog( Messagebox, "ok" )
end if
gMouseClick 1,1
sleep 1
hTypekeys "<Tab><Delete>"
Call hCloseDocument
endcase
testcase tiInsertFloatingFrame
Call hNewDocument
InsertFloatingFrame
WaitSlot (2000)
Kontext "TabEigenschaften"
Dialogtest (TabEigenschaften)
Oeffnen.Click
Kontext "OeffnenDlg"
hCloseDialog( OeffnenDlg, "Cancel" )
Kontext "TabEigenschaften"
TabEigenschaften.Cancel
Call hCloseDocument
endcase
testcase tiInsertFile
Call hNewDocument
WaitSlot (1000)
InsertFileDraw
WaitSlot (1000)
Kontext "OeffnenDLG"
' Call Dialogtest ( OeffnenDLG )
OeffnenDLG.Cancel
Call hCloseDocument
endcase
testcase tiInsertPlugin
call hNewDocument
InsertObjectPlugIn
Kontext "PluginEinfuegen"
if PluginEinfuegen.exists (5) then
call Dialogtest (PluginEinfuegen)
Durchsuchen.Click
sleep 1
Kontext "Messagebox"
if Messagebox.Exists (5) Then
Warnlog Messagebox.GetText
Messagebox.OK
else
printlog "No Messagebox :-)"
end if
Kontext "OeffnenDlG"
if OeffnenDlG.exists (5) then
OeffnenDLG.Cancel
end if
Kontext "PluginEinfuegen"
if PluginEinfuegen.exists (5) then PluginEinfuegen.Cancel
else
warnlog "Insert Plugin does not work :-("
end if
Call hCloseDocument
endcase
testcase tiInsertScan
goto endsub
Call hNewDocument
InsertScanRequest ' as long as there is no scanner available, nothing happens
WaitSlot (1000)
InsertScanSelectSource
WaitSlot (1000)
printlog "Not testable, not translatable, just callable, because of systemdialog :-("
Call hCloseDocument
endcase
testcase tiInsertSnappointLine
Call hNewDocument
InsertSnapPointLine
Kontext "NeuesFangobjekt"
DialogTest ( NeuesFangobjekt )
NeuesFangobjekt.Cancel
sleep 2
Call hCloseDocument
endcase
testcase tdInsertLayer
Call hNewDocument
WaitSlot (1000)
ViewLayer
InsertLayer
Kontext "EbeneEinfuegenDlg"
DialogTest ( EbeneEinfuegenDlg )
EbeneEinfuegenDlg.Cancel
Call hCloseDocument
endcase
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org 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 version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org. If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'******************************************************************
' #1 tiWindowNewWindow
' #1 tidWindow123 'wrn:2
'\*****************************************************************
testcase tiWindowNewWindow
Call hNewDocument
Call hRechteckErstellen ( 10, 10, 20, 40 )
WindowNewWindow
WaitSlot (2000)
Call hCloseDocument
endcase
testcase tidWindow123
goto endsub '' testing TBO: 29.03.2002
dim iMenues as integer
Call hNewDocument
Call hRechteckErstellen ( 10, 10, 20, 40 )
Kontext "DocumentImpress"
DocumentImpress.UseMenu
iMenues = MenuGetItemCount
warnlog "---- Number of Main menus: " & iMenues
MenuSelect(Menugetitemid(8))
sleep 1
iMenues = MenuGetItemCount
printlog "---- Number of Main menus: " & iMenues
' MenuSelect(Menugetitemid(14))
sleep 1
i=1
printlog "count: " + i + "; of submenu: " + MenuGetItemCount + "; SID: " + MenuGetItemId (i) + "; Text: " + MenuGetItemText (Menugetitemid(i)) + "; Command: " + MenuGetItemCommand(Menugetitemid(i)) + "; Seperator?: " + MenuIsSeperator(i) + "; Enabled: " + MenuIsItemEnabled(Menugetitemid(i)) + "; Checked: " + MenuIsItemChecked(Menugetitemid(i)) + ";"
i=2
printlog "count: " + i + "; of submenu: " + MenuGetItemCount + "; SID: " + MenuGetItemId (i) + "; Text: " + MenuGetItemText (Menugetitemid(i)) + "; Command: " + MenuGetItemCommand(Menugetitemid(i)) + "; Seperator?: " + MenuIsSeperator(i) + "; Enabled: " + MenuIsItemEnabled(Menugetitemid(i)) + "; Checked: " + MenuIsItemChecked(Menugetitemid(i)) + ";"
warnlog "Dynamic entries not accessible ? :-((((("
' i=3
' printlog "count: " + i + "; of submenue: " + MenuGetItemCount + "; SID: " + MenuGetItemId (i) + "; Text: " + MenuGetItemText (Menugetitemid(i)) + "; Command: " + MenuGetItemCommand(Menugetitemid(i)) + "; Seperator?: " + MenuIsSeperator(i) + "; Enabled: " + MenuIsItemEnabled(Menugetitemid(i)) + "; Checked: " + MenuIsItemChecked(Menugetitemid(i)) + ";"
Call hCloseDocument
endcase
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
' '
'/************************************************************************ '/************************************************************************
'* '*
'* owner : oliver.creamer@Sun.COM '* owner : oliver.craemer@Sun.COM
'* '*
'* short description : Lookup for correct attributes of datapilot pagefields '* short description : Lookup for correct attributes of datapilot pagefields
'* '*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment