Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
af5cef5b
Kaydet (Commit)
af5cef5b
authored
May 14, 2010
tarafından
sb
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sb123: #i111601# various additional test helper functionality
üst
88d1e25d
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
239 additions
and
25 deletions
+239
-25
makefile.mk
smoketestoo_native/makefile.mk
+2
-1
smoketest.cxx
smoketestoo_native/smoketest.cxx
+3
-3
gettestargument.hxx
test/inc/test/gettestargument.hxx
+46
-0
d.lst
test/prj/d.lst
+1
-1
getargument.cxx
test/source/cpp/getargument.cxx
+6
-1
getargument.hxx
test/source/cpp/getargument.hxx
+7
-7
gettestargument.cxx
test/source/cpp/gettestargument.cxx
+43
-0
makefile.mk
test/source/cpp/makefile.mk
+1
-0
officeconnection.cxx
test/source/cpp/officeconnection.cxx
+5
-4
Argument.java
test/source/java/Argument.java
+36
-0
OfficeConnection.java
test/source/java/OfficeConnection.java
+3
-7
OfficeFileUrl.java
test/source/java/OfficeFileUrl.java
+42
-0
TestArgument.java
test/source/java/TestArgument.java
+39
-0
makefile.mk
test/source/java/makefile.mk
+5
-1
No files found.
smoketestoo_native/makefile.mk
Dosyayı görüntüle @
af5cef5b
...
...
@@ -49,7 +49,8 @@ ALLTAR : cpptest
cpptest
:
$(SHL1TARGETN) $(BIN)/smoketestdoc.sxw
OOO_CPPTEST_ARGS
=
$(SHL1TARGETN)
-env
:arg-doc
=
$(BIN)
/smoketestdoc.sxw
TEST_ARGUMENTS
=
smoketest.doc
=
$(BIN)
/smoketestdoc.sxw
CPPTEST_LIBRARY
=
$(SHL1TARGETN)
$(BIN)/smoketestdoc.sxw
:
data/smoketestdoc.sxw
$(COPY)
$<
$@
...
...
smoketestoo_native/smoketest.cxx
Dosyayı görüntüle @
af5cef5b
...
...
@@ -53,7 +53,7 @@
#include "osl/diagnose.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "test/getargument.hxx"
#include "test/get
test
argument.hxx"
#include "test/officeconnection.hxx"
#include "test/oustringostreaminserter.hxx"
#include "test/toabsolutefileurl.hxx"
...
...
@@ -121,8 +121,8 @@ void Test::tearDown() {
void
Test
::
test
()
{
rtl
::
OUString
doc
;
CPPUNIT_ASSERT
(
test
::
getArgument
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"doc"
)),
&
doc
));
test
::
get
Test
Argument
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"
smoketest.
doc"
)),
&
doc
));
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
args
(
1
);
args
[
0
].
Name
=
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"MacroExecutionMode"
));
...
...
test/inc/test/gettestargument.hxx
0 → 100644
Dosyayı görüntüle @
af5cef5b
/*************************************************************************
*
* 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
test/prj/d.lst
Dosyayı görüntüle @
af5cef5b
...
...
@@ -5,7 +5,7 @@ mkdir: %_DEST%\inc%_EXT%\test\detail
..\%__SRC%\lib\libtest.dylib %_DEST%\lib%_EXT%\libtest.dylib
..\%__SRC%\lib\libtest.so %_DEST%\lib%_EXT%\libtest.so
..\inc\test\detail\testdllapi.hxx %_DEST%\inc%_EXT%\test\detail\testdllapi.hxx
..\inc\test\get
argument.hxx %_DEST%\inc%_EXT%\test\ge
targument.hxx
..\inc\test\get
testargument.hxx %_DEST%\inc%_EXT%\test\gettes
targument.hxx
..\inc\test\officeconnection.hxx %_DEST%\inc%_EXT%\test\officeconnection.hxx
..\inc\test\oustringostreaminserter.hxx %_DEST%\inc%_EXT%\test\oustringostreaminserter.hxx
..\inc\test\toabsolutefileurl.hxx %_DEST%\inc%_EXT%\test\toabsolutefileurl.hxx
...
...
test/source/cpp/getargument.cxx
Dosyayı görüntüle @
af5cef5b
...
...
@@ -29,10 +29,13 @@
#include "rtl/bootstrap.hxx"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "test/getargument.hxx"
#include "getargument.hxx"
namespace
test
{
namespace
detail
{
bool
getArgument
(
rtl
::
OUString
const
&
name
,
rtl
::
OUString
*
value
)
{
OSL_ASSERT
(
value
!=
0
);
return
rtl
::
Bootstrap
::
get
(
...
...
@@ -40,3 +43,5 @@ bool getArgument(rtl::OUString const & name, rtl::OUString * value) {
}
}
}
test/
inc/test
/getargument.hxx
→
test/
source/cpp
/getargument.hxx
Dosyayı görüntüle @
af5cef5b
...
...
@@ -23,22 +23,22 @@
* for a copy of the LGPLv3 License.
************************************************************************/
#ifndef INCLUDED_TEST_GETARGUMENT_HXX
#define INCLUDED_TEST_GETARGUMENT_HXX
#ifndef INCLUDED_TEST_
SOURCE_CPP_
GETARGUMENT_HXX
#define INCLUDED_TEST_
SOURCE_CPP_
GETARGUMENT_HXX
#include "sal/config.h"
#include "test/detail/testdllapi.hxx"
namespace
rtl
{
class
OUString
;
}
namespace
test
{
namespace
detail
{
// Obtain the value of an argument tunneled in via an "arg-<name>" bootstrap
// variable:
OOO_DLLPUBLIC_TEST
bool
getArgument
(
bool
getArgument
(
rtl
::
OUString
const
&
name
,
rtl
::
OUString
*
value
);
}
}
#endif
test/source/cpp/gettestargument.cxx
0 → 100644
Dosyayı görüntüle @
af5cef5b
/*************************************************************************
*
* 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
);
}
}
test/source/cpp/makefile.mk
Dosyayı görüntüle @
af5cef5b
...
...
@@ -37,6 +37,7 @@ CFLAGSCXX += $(CPPUNIT_CFLAGS)
SLOFILES
=
\
$(SLO)
/getargument.obj
\
$(SLO)
/gettestargument.obj
\
$(SLO)
/officeconnection.obj
\
$(SLO)
/toabsolutefileurl.obj
...
...
test/source/cpp/officeconnection.cxx
Dosyayı görüntüle @
af5cef5b
...
...
@@ -37,10 +37,11 @@
#include "osl/process.h"
#include "osl/time.h"
#include "sal/types.h"
#include "test/getargument.hxx"
#include "test/officeconnection.hxx"
#include "test/toabsolutefileurl.hxx"
#include "getargument.hxx"
namespace
{
namespace
css
=
com
::
sun
::
star
;
...
...
@@ -57,7 +58,7 @@ void OfficeConnection::setUp() {
rtl
::
OUString
desc
;
rtl
::
OUString
argSoffice
;
CPPUNIT_ASSERT
(
getArgument
(
detail
::
getArgument
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"soffice"
)),
&
argSoffice
));
if
(
argSoffice
.
matchAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"path:"
)))
{
...
...
@@ -78,7 +79,7 @@ void OfficeConnection::setUp() {
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
";urp"
)));
rtl
::
OUString
argUser
;
CPPUNIT_ASSERT
(
getArgument
(
detail
::
getArgument
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"user"
)),
&
argUser
));
rtl
::
OUString
userArg
(
rtl
::
OUString
(
...
...
@@ -94,7 +95,7 @@ void OfficeConnection::setUp() {
acceptArg
.
pData
,
userArg
.
pData
,
jreArg
.
pData
,
classpathArg
.
pData
};
rtl_uString
**
envs
=
0
;
rtl
::
OUString
argEnv
;
if
(
getArgument
(
if
(
detail
::
getArgument
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"env"
)),
&
argEnv
))
{
envs
=
&
argEnv
.
pData
;
...
...
test/source/java/Argument.java
0 → 100644
Dosyayı görüntüle @
af5cef5b
/*************************************************************************
*
* 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
;
final
class
Argument
{
public
static
String
get
(
String
name
)
{
return
System
.
getProperty
(
"org.openoffice.test.arg."
+
name
);
}
private
Argument
()
{}
}
test/source/java/OfficeConnection.java
Dosyayı görüntüle @
af5cef5b
...
...
@@ -49,17 +49,17 @@ public final class OfficeConnection {
/** Start up an OOo instance.
*/
public
void
setUp
()
throws
Exception
{
String
sofficeArg
=
getArgumen
t
(
"soffice"
);
String
sofficeArg
=
Argument
.
ge
t
(
"soffice"
);
if
(
sofficeArg
.
startsWith
(
"path:"
))
{
description
=
"pipe,name=oootest"
+
UUID
.
randomUUID
();
ProcessBuilder
pb
=
new
ProcessBuilder
(
sofficeArg
.
substring
(
"path:"
.
length
()),
"-quickstart=no"
,
"-nofirststartwizard"
,
"-norestore"
,
"-accept="
+
description
+
";urp"
,
"-env:UserInstallation="
+
getArgumen
t
(
"user"
),
"-env:UserInstallation="
+
Argument
.
ge
t
(
"user"
),
"-env:UNO_JAVA_JFW_ENV_JREHOME=true"
,
"-env:UNO_JAVA_JFW_ENV_CLASSPATH=true"
);
String
envArg
=
getArgumen
t
(
"env"
);
String
envArg
=
Argument
.
ge
t
(
"env"
);
if
(
envArg
!=
null
)
{
Map
<
String
,
String
>
env
=
pb
.
environment
();
int
i
=
envArg
.
indexOf
(
"="
);
...
...
@@ -142,10 +142,6 @@ public final class OfficeConnection {
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
)
throws
InterruptedException
{
...
...
test/source/java/OfficeFileUrl.java
0 → 100644
Dosyayı görüntüle @
af5cef5b
/*************************************************************************
*
* 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
()
{}
}
test/source/java/TestArgument.java
0 → 100644
Dosyayı görüntüle @
af5cef5b
/*************************************************************************
*
* 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
()
{}
}
test/source/java/makefile.mk
Dosyayı görüntüle @
af5cef5b
...
...
@@ -30,7 +30,11 @@ TARGET = java
.IF
"$(OOO_JUNIT_JAR)"
!=
""
PACKAGE
=
org/openoffice/test
JAVAFILES
=
OfficeConnection.java
JAVAFILES
=
\
Argument.java
\
OfficeConnection.java
\
OfficeFileUrl.java
\
TestArgument.java
JARFILES
=
juh.jar ridl.jar unoil.jar
EXTRAJARFILES
=
$(OOO_JUNIT_JAR)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment