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
a405184a
Kaydet (Commit)
a405184a
authored
Ara 22, 2014
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
java: inline CheckMemoryUsage test properties
Change-Id: Ia5ee0fdc7617b43c4874aa285459f9a1a52cea12
üst
9b8fb077
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
57 deletions
+16
-57
CheckMemoryUsage.java
vcl/qa/complex/memCheck/CheckMemoryUsage.java
+16
-47
CheckMemoryUsage.props
vcl/qa/complex/memCheck/CheckMemoryUsage.props
+0
-10
No files found.
vcl/qa/complex/memCheck/CheckMemoryUsage.java
Dosyayı görüntüle @
a405184a
...
...
@@ -25,8 +25,6 @@ import java.io.File;
import
java.io.FileWriter
;
import
java.io.FilenameFilter
;
import
java.io.PrintWriter
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.StringTokenizer
;
import
lib.TestParameters
;
...
...
@@ -39,6 +37,8 @@ import org.junit.Test;
import
org.openoffice.test.OfficeConnection
;
import
util.DesktopTools
;
import
util.OSName
;
import
util.PropertyName
;
import
com.sun.star.beans.PropertyValue
;
import
com.sun.star.frame.XStorable
;
...
...
@@ -57,13 +57,6 @@ import com.sun.star.util.XCloseable;
* Needed parameters:
* <ul>
* <li>"TestDocumentPath" - the path where test documents are located.</li>
* <li>"AllowMemoryIncrease" (optional) - the allowed memory increase measured in kByte per exported document. The default is 10 kByte.</li>
* <li>"ExportDocCount" (optional) - the amount of exports for each document that is loaded. Is defaulted to 25.
* <li>"FileExportFilter" (optional) - a relation between loaded document type and used export filter. Is defaulted to
* writer, calc and impress. This parameter can be set with a number to give more than one relation. Example:<br>
* "FileExportFilter1=sxw,writer_pdf_Export"<br>
* "FileExportFilter2=sxc,calc_pdf_Export"<br>
* "FileExportFilter3=sxi,impress_pdf_Export"<br></li>
* All parameters are used for iteration over the test document path.
* </ul>
*/
...
...
@@ -92,12 +85,11 @@ class TempDir
public
class
CheckMemoryUsage
{
private
static
final
String
sWriterDoc
=
"sxw,writer_pdf_Export"
;
private
static
final
String
sCalcDoc
=
"sxc,calc_pdf_Export"
;
private
static
final
String
sImpressDoc
=
"sxi,impress_pdf_Export"
;
TempDir
m_aTempDir
;
private
String
[][]
sDocTypeExportFilter
;
private
String
[][]
sDocuments
;
// the allowed memory increase measured in kByte per exported document. The default is 10 kByte.
// the allowed memory increase per exported document: if the memory increase is higher than this number, the test will fail
private
static
final
int
iAllowMemoryIncrease
=
10
;
private
int
iExportDocCount
=
25
;
...
...
@@ -112,10 +104,10 @@ public class CheckMemoryUsage
// some Tests need the qadevOOo TestParameters, it is like a Hashmap for Properties.
TestParameters
param
=
new
TestParameters
();
param
.
put
(
"ServiceFactory"
,
xMsf
);
// some qadevOOo functions need the ServiceFactory
param
.
put
(
PropertyName
.
SERVICE_FACTORY
,
xMsf
);
// some qadevOOo functions need the ServiceFactory
// test does definitely not run on Windows.
if
(
param
.
get
(
"OperatingSystem"
).
equals
(
"wntmsci"
))
if
(
param
.
get
(
PropertyName
.
OPERATING_SYSTEM
).
equals
(
OSName
.
WNTMSCI
))
{
System
.
out
.
println
(
"Test can only reasonably be executed with a tool that "
+
"displays the memory usage of StarOffice."
);
...
...
@@ -127,45 +119,22 @@ public class CheckMemoryUsage
// how many times is every document exported.
int
count
=
param
.
getInt
(
"ExportDocCount"
);
if
(
count
!=
0
)
{
iExportDocCount
=
count
;
}
// the amount of exported documents: each loaded document will be written 'ExportDocCount' times
iExportDocCount
=
25
;
// get the temp dir for creating the command scripts.
m_aTempDir
=
new
TempDir
(
util
.
utils
.
getOfficeTemp
/*Dir*/
(
xMsf
));
// get the file extension, export filter connection
Iterator
<
String
>
keys
=
param
.
keySet
().
iterator
();
ArrayList
<
String
>
v
=
new
ArrayList
<
String
>();
while
(
keys
.
hasNext
())
{
String
key
=
keys
.
next
();
if
(
key
.
startsWith
(
"FileExportFilter"
))
{
v
.
add
((
String
)
param
.
get
(
key
));
}
}
// if no param given, set defaults.
if
(
v
.
isEmpty
())
{
v
.
add
(
sWriterDoc
);
v
.
add
(
sCalcDoc
);
v
.
add
(
sImpressDoc
);
}
// the import and export filters
// store a file extension
sDocTypeExportFilter
=
new
String
[
v
.
size
()][
2
];
for
(
int
i
=
0
;
i
<
v
.
size
();
i
++)
{
// 2do: error routine for wrong given params
final
String
sVContent
=
v
.
get
(
i
);
StringTokenizer
t
=
new
StringTokenizer
(
sVContent
,
","
);
final
String
sExt
=
t
.
nextToken
();
final
String
sName
=
t
.
nextToken
();
sDocTypeExportFilter
[
i
][
0
]
=
sExt
;
sDocTypeExportFilter
[
i
][
1
]
=
sName
;
}
sDocTypeExportFilter
=
new
String
[
3
][
2
];
sDocTypeExportFilter
[
0
][
0
]
=
"sxw"
;
sDocTypeExportFilter
[
0
][
1
]
=
"writer_pdf_Export"
;
sDocTypeExportFilter
[
1
][
0
]
=
"sxc"
;
sDocTypeExportFilter
[
1
][
1
]
=
"calc_pdf_Export"
;
sDocTypeExportFilter
[
2
][
0
]
=
"sxi"
;
sDocTypeExportFilter
[
2
][
1
]
=
"impress_pdf_Export"
;
// get files to load and export
String
sDocumentPath
=
TestDocument
.
getUrl
();
...
...
vcl/qa/complex/memCheck/CheckMemoryUsage.props
Dosyayı görüntüle @
a405184a
...
...
@@ -19,14 +19,4 @@
# the path to the test documents
TestDocumentPath=../../testdocuments
# the allowed memory increase per exported document: if the memory increase is higher than this number, the test will fail
AllowMemoryIncrease=20
# the amount of exported documents: each loaded document will be written 'ExportDocCount' times
ExportDocCount=25
# the import and export filters, separated by comma; further relations can be added with increasing numbers, like
#'FileExportFilter4=sxd,draw_pdf_Export'
FileExportFilter1=sxw,writer_pdf_Export
FileExportFilter2=sxc,calc_pdf_Export
FileExportFilter3=sxi,impress_pdf_Export
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