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
5a31a2f4
Kaydet (Commit)
5a31a2f4
authored
Eyl 08, 2003
tarafından
Rüdiger Timm
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
INTEGRATION: CWS qadev11 (1.4.14); FILE MERGED
2003/09/03 15:34:40 sw 1.4.14.1: #112049#
üst
6a382ba5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
26 deletions
+44
-26
SwXMailMerge.java
qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
+44
-26
No files found.
qadevOOo/tests/java/mod/_sw/SwXMailMerge.java
Dosyayı görüntüle @
5a31a2f4
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: SwXMailMerge.java,v $
* $RCSfile: SwXMailMerge.java,v $
*
*
* $Revision: 1.
4
$
* $Revision: 1.
5
$
*
*
* last change:$Date: 2003-0
5-27 13:46:39
$
* last change:$Date: 2003-0
9-08 12:46:48
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -61,21 +61,24 @@
...
@@ -61,21 +61,24 @@
package
mod
.
_sw
;
package
mod
.
_sw
;
import
com.sun.star.uno.XInterface
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.uno.UnoRuntime
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
lib.StatusException
;
import
lib.StatusException
;
import
lib.TestCase
;
import
lib.TestCase
;
import
lib.TestEnvironment
;
import
lib.TestEnvironment
;
import
lib.TestParameters
;
import
lib.TestParameters
;
import
util.utils
;
import
util.utils
;
import
com.sun.star.beans.NamedValue
;
import
com.sun.star.beans.XPropertySet
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.sdbc.XConnection
;
import
com.sun.star.sdbc.XResultSet
;
import
com.sun.star.sdbc.XResultSet
;
import
com.sun.star.sdbc.XRowSet
;
import
com.sun.star.sdbc.XRowSet
;
import
com.sun.star.sdbc.XConnection
;
import
com.sun.star.sdbcx.XRowLocate
;
import
com.sun.star.beans.XPropertySet
;
import
com.sun.star.beans.NamedValue
;
import
com.sun.star.task.XJob
;
import
com.sun.star.task.XJob
;
import
com.sun.star.uno.UnoRuntime
;
import
com.sun.star.uno.XInterface
;
/**
/**
* Here <code>com.sun.star.text.MailMerge</code> service is tested.<p>
* Here <code>com.sun.star.text.MailMerge</code> service is tested.<p>
...
@@ -85,7 +88,6 @@ import com.sun.star.task.XJob;
...
@@ -85,7 +88,6 @@ import com.sun.star.task.XJob;
*/
*/
public
class
SwXMailMerge
extends
TestCase
{
public
class
SwXMailMerge
extends
TestCase
{
private
XInterface
acceptor
=
null
;
public
void
initialize
(
TestParameters
tParam
,
PrintWriter
log
)
{
public
void
initialize
(
TestParameters
tParam
,
PrintWriter
log
)
{
}
}
...
@@ -111,7 +113,7 @@ public class SwXMailMerge extends TestCase {
...
@@ -111,7 +113,7 @@ public class SwXMailMerge extends TestCase {
XJob
Job
=
null
;
XJob
Job
=
null
;
try
{
try
{
oObj
=
(
XInterface
)
(
(
XMultiServiceFactory
)
Param
.
getMSF
()).
createInstance
oObj
=
(
XInterface
)
(
(
XMultiServiceFactory
)
Param
.
getMSF
()).
createInstance
(
"com.sun.star.text.MailMerge"
);
(
"com.sun.star.text.MailMerge"
);
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
e
)
{
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
e
)
{
throw
new
StatusException
(
"Can't create object environment"
,
e
)
;
throw
new
StatusException
(
"Can't create object environment"
,
e
)
;
...
@@ -120,17 +122,18 @@ public class SwXMailMerge extends TestCase {
...
@@ -120,17 +122,18 @@ public class SwXMailMerge extends TestCase {
// <set some variables>
// <set some variables>
String
cTestDoc
=
utils
.
getFullTestURL
(
"MailMerge.sxw"
);
String
cTestDoc
=
utils
.
getFullTestURL
(
"MailMerge.sxw"
);
//cMailMerge_DocumentURL = cTestDoc
//cMailMerge_DocumentURL = cTestDoc
String
cOutputURL
=
utils
.
getOfficeTemp
(
(
XMultiServiceFactory
)
Param
.
getMSF
());
String
cOutputURL
=
utils
.
getOfficeTemp
(
(
XMultiServiceFactory
)
Param
.
getMSF
());
String
cDataSourceName
=
"Bibliography"
;
String
cDataSourceName
=
"Bibliography"
;
String
cDataCommand
=
"biblio"
;
String
cDataCommand
=
"biblio"
;
Object
[]
sel
=
new
Object
[
2
];
Object
[]
sel
=
new
Object
[
2
];
sel
[
0
]
=
new
int
[
2
];
sel
[
0
]
=
new
int
[
2
];
sel
[
1
]
=
new
int
[
5
];
sel
[
1
]
=
new
int
[
5
];
Object
[]
myBookMarks
=
new
Object
[
2
];
// </set some variables>
// </set some variables>
// <create XResultSet>
// <create XResultSet>
try
{
try
{
oRowSet
=
(
XInterface
)
(
(
XMultiServiceFactory
)
Param
.
getMSF
()).
createInstance
oRowSet
=
(
XInterface
)
(
(
XMultiServiceFactory
)
Param
.
getMSF
()).
createInstance
(
"com.sun.star.sdb.RowSet"
);
(
"com.sun.star.sdb.RowSet"
);
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
e
)
{
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
e
)
{
throw
new
StatusException
(
"Can't create com.sun.star.sdb.RowSet"
,
e
);
throw
new
StatusException
(
"Can't create com.sun.star.sdb.RowSet"
,
e
);
...
@@ -176,16 +179,30 @@ public class SwXMailMerge extends TestCase {
...
@@ -176,16 +179,30 @@ public class SwXMailMerge extends TestCase {
UnoRuntime
.
queryInterface
(
XConnection
.
class
,
oConnection
);
UnoRuntime
.
queryInterface
(
XConnection
.
class
,
oConnection
);
// </create XResultSet>
// </create XResultSet>
// <create Bookmarks>
try
{
XRowLocate
oRowLocate
=
(
XRowLocate
)
UnoRuntime
.
queryInterface
(
XRowLocate
.
class
,
oResultSet
);
oResultSet
.
first
();
myBookMarks
[
0
]
=
oRowLocate
.
getBookmark
();
oResultSet
.
next
();
myBookMarks
[
1
]
=
oRowLocate
.
getBookmark
();
}
catch
(
com
.
sun
.
star
.
sdbc
.
SQLException
e
)
{
throw
new
StatusException
(
"Cant get Bookmarks"
,
e
);
}
// </create Bookmarks>
// <fill object with values>
// <fill object with values>
XPropertySet
oObjProps
=
(
XPropertySet
)
XPropertySet
oObjProps
=
(
XPropertySet
)
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
oObj
);
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
oObj
);
try
{
try
{
oObjProps
.
setPropertyValue
(
"DataSourceName"
,
cDataSourceName
);
oObjProps
.
setPropertyValue
(
"DataSourceName"
,
cDataSourceName
);
oObjProps
.
setPropertyValue
(
"
Data
Command"
,
cDataCommand
);
oObjProps
.
setPropertyValue
(
"Command"
,
cDataCommand
);
oObjProps
.
setPropertyValue
(
"
Data
CommandType"
,
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
oObjProps
.
setPropertyValue
(
"CommandType"
,
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
oObjProps
.
setPropertyValue
(
"OutputType"
,
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
FILE
));
oObjProps
.
setPropertyValue
(
"OutputType"
,
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
FILE
));
oObjProps
.
setPropertyValue
(
"DocumentURL"
,
cTestDoc
);
oObjProps
.
setPropertyValue
(
"DocumentURL"
,
cTestDoc
);
oObjProps
.
setPropertyValue
(
"OutputURL"
,
cOutputURL
);
oObjProps
.
setPropertyValue
(
"OutputURL"
,
cOutputURL
);
System
.
out
.
println
(
"OUTPUT: "
+
cOutputURL
);
oObjProps
.
setPropertyValue
(
"FileNamePrefix"
,
"Author"
);
oObjProps
.
setPropertyValue
(
"FileNamePrefix"
,
"Author"
);
oObjProps
.
setPropertyValue
(
"FileNameFromColumn"
,
new
Boolean
(
false
));
oObjProps
.
setPropertyValue
(
"FileNameFromColumn"
,
new
Boolean
(
false
));
oObjProps
.
setPropertyValue
(
"Selection"
,
new
Object
[
0
]);
oObjProps
.
setPropertyValue
(
"Selection"
,
new
Object
[
0
]);
...
@@ -203,15 +220,15 @@ public class SwXMailMerge extends TestCase {
...
@@ -203,15 +220,15 @@ public class SwXMailMerge extends TestCase {
// <create object relations>
// <create object relations>
Object
[]
vXJobArgs
=
new
Object
[
4
];
Object
[]
vXJobArgs
=
new
Object
[
4
];
NamedValue
[]
vXJobArg0
=
new
NamedValue
[
9
];
NamedValue
[]
vXJobArg0
=
new
NamedValue
[
8
];
NamedValue
[]
vXJobArg1
=
new
NamedValue
[
8
];
NamedValue
[]
vXJobArg1
=
new
NamedValue
[
7
];
NamedValue
[]
vXJobArg2
=
new
NamedValue
[
10
];
NamedValue
[]
vXJobArg2
=
new
NamedValue
[
10
];
NamedValue
[]
vXJobArg3
=
new
NamedValue
[
0
];
NamedValue
[]
vXJobArg3
=
new
NamedValue
[
0
];
// first Arguments
// first Arguments
vXJobArg0
[
0
]
=
new
NamedValue
(
"DataSourceName"
,
cDataSourceName
);
vXJobArg0
[
0
]
=
new
NamedValue
(
"DataSourceName"
,
cDataSourceName
);
vXJobArg0
[
1
]
=
new
NamedValue
(
"
Data
Command"
,
cDataCommand
);
vXJobArg0
[
1
]
=
new
NamedValue
(
"Command"
,
cDataCommand
);
vXJobArg0
[
2
]
=
new
NamedValue
(
"
Data
CommandType"
,
vXJobArg0
[
2
]
=
new
NamedValue
(
"CommandType"
,
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
vXJobArg0
[
3
]
=
new
NamedValue
(
"OutputType"
,
vXJobArg0
[
3
]
=
new
NamedValue
(
"OutputType"
,
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
FILE
));
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
FILE
));
...
@@ -219,25 +236,25 @@ public class SwXMailMerge extends TestCase {
...
@@ -219,25 +236,25 @@ public class SwXMailMerge extends TestCase {
vXJobArg0
[
5
]
=
new
NamedValue
(
"OutputURL"
,
cOutputURL
);
vXJobArg0
[
5
]
=
new
NamedValue
(
"OutputURL"
,
cOutputURL
);
vXJobArg0
[
6
]
=
new
NamedValue
(
"FileNamePrefix"
,
"Identifier"
);
vXJobArg0
[
6
]
=
new
NamedValue
(
"FileNamePrefix"
,
"Identifier"
);
vXJobArg0
[
7
]
=
new
NamedValue
(
"FileNameFromColumn"
,
new
Boolean
(
true
));
vXJobArg0
[
7
]
=
new
NamedValue
(
"FileNameFromColumn"
,
new
Boolean
(
true
));
vXJobArg0
[
8
]
=
new
NamedValue
(
"Selection"
,
sel
);
//
vXJobArg0[8] = new NamedValue("Selection", sel);
//second Arguments
//second Arguments
vXJobArg1
[
0
]
=
new
NamedValue
(
"DataSourceName"
,
cDataSourceName
);
vXJobArg1
[
0
]
=
new
NamedValue
(
"DataSourceName"
,
cDataSourceName
);
vXJobArg1
[
1
]
=
new
NamedValue
(
"
Data
Command"
,
cDataCommand
);
vXJobArg1
[
1
]
=
new
NamedValue
(
"Command"
,
cDataCommand
);
vXJobArg1
[
2
]
=
new
NamedValue
(
"
Data
CommandType"
,
vXJobArg1
[
2
]
=
new
NamedValue
(
"CommandType"
,
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
vXJobArg1
[
3
]
=
new
NamedValue
(
"OutputType"
,
vXJobArg1
[
3
]
=
new
NamedValue
(
"OutputType"
,
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
PRINTER
));
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
PRINTER
));
vXJobArg1
[
4
]
=
new
NamedValue
(
"DocumentURL"
,
cTestDoc
);
vXJobArg1
[
4
]
=
new
NamedValue
(
"DocumentURL"
,
cTestDoc
);
vXJobArg1
[
5
]
=
new
NamedValue
(
"FileNamePrefix"
,
"Author"
);
vXJobArg1
[
5
]
=
new
NamedValue
(
"FileNamePrefix"
,
"Author"
);
vXJobArg1
[
6
]
=
new
NamedValue
(
"FileNameFromColumn"
,
new
Boolean
(
true
));
vXJobArg1
[
6
]
=
new
NamedValue
(
"FileNameFromColumn"
,
new
Boolean
(
true
));
vXJobArg1
[
7
]
=
new
NamedValue
(
"Selection"
,
sel
);
//
vXJobArg1[7] = new NamedValue("Selection", sel);
// third Arguments
// third Arguments
vXJobArg2
[
0
]
=
new
NamedValue
(
"Connection"
,
oXConnection
);
vXJobArg2
[
0
]
=
new
NamedValue
(
"
Active
Connection"
,
oXConnection
);
vXJobArg2
[
1
]
=
new
NamedValue
(
"DataSourceName"
,
cDataSourceName
);
vXJobArg2
[
1
]
=
new
NamedValue
(
"DataSourceName"
,
cDataSourceName
);
vXJobArg2
[
2
]
=
new
NamedValue
(
"
Data
Command"
,
cDataCommand
);
vXJobArg2
[
2
]
=
new
NamedValue
(
"Command"
,
cDataCommand
);
vXJobArg2
[
3
]
=
new
NamedValue
(
"
Data
CommandType"
,
vXJobArg2
[
3
]
=
new
NamedValue
(
"CommandType"
,
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
new
Integer
(
com
.
sun
.
star
.
sdb
.
CommandType
.
TABLE
));
vXJobArg2
[
4
]
=
new
NamedValue
(
"OutputType"
,
vXJobArg2
[
4
]
=
new
NamedValue
(
"OutputType"
,
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
FILE
));
new
Short
(
com
.
sun
.
star
.
text
.
MailMergeType
.
FILE
));
...
@@ -245,7 +262,8 @@ public class SwXMailMerge extends TestCase {
...
@@ -245,7 +262,8 @@ public class SwXMailMerge extends TestCase {
vXJobArg2
[
6
]
=
new
NamedValue
(
"OutputURL"
,
cOutputURL
);
vXJobArg2
[
6
]
=
new
NamedValue
(
"OutputURL"
,
cOutputURL
);
vXJobArg2
[
7
]
=
new
NamedValue
(
"FileNamePrefix"
,
"Identifier"
);
vXJobArg2
[
7
]
=
new
NamedValue
(
"FileNamePrefix"
,
"Identifier"
);
vXJobArg2
[
8
]
=
new
NamedValue
(
"FileNameFromColumn"
,
new
Boolean
(
true
));
vXJobArg2
[
8
]
=
new
NamedValue
(
"FileNameFromColumn"
,
new
Boolean
(
true
));
vXJobArg2
[
9
]
=
new
NamedValue
(
"Selection"
,
sel
);
vXJobArg2
[
9
]
=
new
NamedValue
(
"Selection"
,
myBookMarks
);
// vXJobArg2[9] = new NamedValue("Selection", sel);
vXJobArgs
[
0
]
=
vXJobArg0
;
vXJobArgs
[
0
]
=
vXJobArg0
;
vXJobArgs
[
1
]
=
vXJobArg1
;
vXJobArgs
[
1
]
=
vXJobArg1
;
...
...
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