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
14bf708e
Kaydet (Commit)
14bf708e
authored
Eki 16, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert "continue" flag to an enum
Change-Id: I160de1152978f301c514d9107c9e9082bab3cf05
üst
a3a89c15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
37 deletions
+40
-37
FlatFileAccess.java
connectivity/qa/complex/connectivity/FlatFileAccess.java
+2
-2
TypeDetection.java
...complex/filter/detection/typeDetection/TypeDetection.java
+17
-17
RecoveryTest.java
framework/qa/complex/framework/recovery/RecoveryTest.java
+5
-5
Assurance.java
qadevOOo/runner/complexlib/Assurance.java
+16
-13
No files found.
connectivity/qa/complex/connectivity/FlatFileAccess.java
Dosyayı görüntüle @
14bf708e
...
...
@@ -228,11 +228,11 @@ public class FlatFileAccess extends ComplexTestCase
{
values
.
add
(
(
T
)
i_getter
.
getValue
(
rowSet
)
);
}
assureEquals
(
i_context
+
": "
+
i_failureDesc
,
i_expectedValues
,
values
.
toArray
(),
true
);
assureEquals
(
i_context
+
": "
+
i_failureDesc
,
i_expectedValues
,
values
.
toArray
(),
ContinueWithTest
.
YES
);
}
catch
(
final
SQLException
e
)
{
failed
(
i_context
+
": caught an exception: "
+
e
.
toString
(),
false
);
failed
(
i_context
+
": caught an exception: "
+
e
.
toString
(),
ContinueWithTest
.
NO
);
}
finally
{
...
...
filter/qa/complex/filter/detection/typeDetection/TypeDetection.java
Dosyayı görüntüle @
14bf708e
...
...
@@ -270,7 +270,7 @@ public class TypeDetection extends ComplexTestCase {
}
}
catch
(
ClassCastException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
...
...
@@ -296,7 +296,7 @@ public class TypeDetection extends ComplexTestCase {
boolean
fileTypeOK
=
helper
.
checkFileType
(
type
,
fileType
);
assure
(
"\nURL-test : "
+
fileAlias
+
":\n\treturned type: '"
+
type
+
"'\n\texpected type: '"
+
fileType
+
"'"
,
fileTypeOK
,
true
);
"'\n\texpected type: '"
+
fileType
+
"'"
,
fileTypeOK
,
ContinueWithTest
.
YES
);
}
/** Filles a MediaDescriptor with a <code>XInputStream</code> of the test
...
...
@@ -317,7 +317,7 @@ public class TypeDetection extends ComplexTestCase {
try
{
xStream
=
helper
.
getFileStream
(
fileURL
);
}
catch
(
NotConnectedException
e
)
{
failed
(
"Could not get XInputStream from file :'"
+
fileURL
+
"'"
,
true
);
failed
(
"Could not get XInputStream from file :'"
+
fileURL
+
"'"
,
ContinueWithTest
.
YES
);
return
;
}
...
...
@@ -332,7 +332,7 @@ public class TypeDetection extends ComplexTestCase {
boolean
fileTypeOK
=
helper
.
checkFileType
(
type
,
fileType
);
assure
(
"\nXInputStream-test: "
+
fileAlias
+
":\n\treturned type: '"
+
type
+
"'\n\texpected type: '"
+
fileType
+
"'"
,
fileTypeOK
,
true
);
"'\n\texpected type: '"
+
fileType
+
"'"
,
fileTypeOK
,
ContinueWithTest
.
YES
);
}
...
...
@@ -375,16 +375,16 @@ public class TypeDetection extends ComplexTestCase {
assure
(
"\n"
+
fileAlias
+
":\n\treturned type: '"
+
type
+
"'\n\texpected type: '"
+
expectedFileType
+
"'"
,
fileTypeOK
,
true
);
fileTypeOK
,
ContinueWithTest
.
YES
);
}
catch
(
FileAliasNotFoundException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
}
catch
(
ClassCastException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
...
...
@@ -429,16 +429,16 @@ public class TypeDetection extends ComplexTestCase {
assure
(
"\n"
+
fileAlias
+
":\n\treturned type: '"
+
type
+
"'\n\texpected type: '"
+
expectedType
+
"'"
,
fileTypeOK
,
true
);
fileTypeOK
,
ContinueWithTest
.
YES
);
}
catch
(
FileAliasNotFoundException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
}
catch
(
ClassCastException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
...
...
@@ -474,16 +474,16 @@ public class TypeDetection extends ComplexTestCase {
assure
(
"\n"
+
fileAlias
+
":\n\treturned type: '"
+
type
+
"'\t\nexpected type: '"
+
fileType
+
"'"
,
fileTypeOK
,
true
);
fileTypeOK
,
ContinueWithTest
.
YES
);
}
catch
(
FileAliasNotFoundException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
}
catch
(
ClassCastException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
...
...
@@ -531,15 +531,15 @@ public class TypeDetection extends ComplexTestCase {
}
if
(
file
.
canWrite
()
&&
bReadOnly
)
assure
(
"\nStreamLoader: file '"
+
fileURL
+
"' is writable but out-Parameter does contain 'ReadOnly' property"
,
false
,
true
);
assure
(
"\nStreamLoader: file '"
+
fileURL
+
"' is writable but out-Parameter does contain 'ReadOnly' property"
,
false
,
ContinueWithTest
.
YES
);
else
if
((!
file
.
canWrite
())
&&
(!
bReadOnly
))
assure
(
"\nStreamLoader: file '"
+
fileURL
+
"'is readonly but out-Parameter does not contain 'ReadOnly' property"
,
false
,
true
);
else
assure
(
"all ok"
,
true
,
true
);
assure
(
"\nStreamLoader: file '"
+
fileURL
+
"'is readonly but out-Parameter does not contain 'ReadOnly' property"
,
false
,
ContinueWithTest
.
YES
);
else
assure
(
"all ok"
,
true
,
ContinueWithTest
.
YES
);
}
}
catch
(
ClassCastException
e
){
failed
(
e
.
toString
(),
true
);
failed
(
e
.
toString
(),
ContinueWithTest
.
YES
);
}
}
...
...
framework/qa/complex/framework/recovery/RecoveryTest.java
Dosyayı görüntüle @
14bf708e
...
...
@@ -323,7 +323,7 @@ public class RecoveryTest extends ComplexTestCase {
XDialog
oDialog
=
null
;
oDialog
=
rt
.
getActiveDialogAfterStartup
(
xMSF
);
assure
(
"could not get Recovery Dialog at start of office"
,
(
oDialog
!=
null
),
C
ONTINUE
);
assure
(
"could not get Recovery Dialog at start of office"
,
(
oDialog
!=
null
),
C
ontinueWithTest
.
YES
);
XWindow
xWindow
=
UnoRuntime
.
queryInterface
(
XWindow
.
class
,
oDialog
);
log
.
println
(
"got the following dialog: '"
+
oDialog
.
getTitle
()
+
"'"
);
...
...
@@ -427,7 +427,7 @@ public class RecoveryTest extends ComplexTestCase {
XWindow
oDialog
=
null
;
oDialog
=
rt
.
getActiveWindow
(
xMSF
);
assure
(
"could not get 'Save Documents' Dialog: "
,
(
oDialog
!=
null
),
C
ONTINUE
);
assure
(
"could not get 'Save Documents' Dialog: "
,
(
oDialog
!=
null
),
C
ontinueWithTest
.
YES
);
UITools
oUITools
=
new
UITools
(
oDialog
);
...
...
@@ -438,7 +438,7 @@ public class RecoveryTest extends ComplexTestCase {
try
{
documents
=
oUITools
.
getListBoxItems
(
listBoxName
);
}
catch
(
java
.
lang
.
Exception
e
){
failed
(
"could not get the document names from the 'Save Documents' dialog"
,
C
ONTINUE
);
failed
(
"could not get the document names from the 'Save Documents' dialog"
,
C
ontinueWithTest
.
YES
);
}
log
.
println
(
"there are "
+
documents
.
length
+
" documents to save"
);
log
.
println
(
"The following documents will be saved:"
);
...
...
@@ -451,12 +451,12 @@ public class RecoveryTest extends ComplexTestCase {
try
{
oUITools
.
setTextEditFiledText
(
"Save to"
,
tempURL
);
}
catch
(
java
.
lang
.
Exception
e
){
failed
(
"could not set target directory for saving documents at 'Save Documents' dialog"
,
C
ONTINUE
);
failed
(
"could not set target directory for saving documents at 'Save Documents' dialog"
,
C
ontinueWithTest
.
YES
);
}
try
{
oUITools
.
clickButton
(
"OK"
);
}
catch
(
java
.
lang
.
Exception
e
){
failed
(
"could not click 'OK' at 'Save Documents' dialog"
,
C
ONTINUE
);
failed
(
"could not click 'OK' at 'Save Documents' dialog"
,
C
ontinueWithTest
.
YES
);
}
}
}
catch
(
com
.
sun
.
star
.
accessibility
.
IllegalAccessibleComponentStateException
e
){
...
...
qadevOOo/runner/complexlib/Assurance.java
Dosyayı görüntüle @
14bf708e
...
...
@@ -24,7 +24,10 @@ package complexlib;
*/
public
class
Assurance
{
public
static
final
boolean
CONTINUE
=
true
;
/** Used to indicate that we should continue with test method, even if check fails */
public
enum
ContinueWithTest
{
YES
,
NO
}
/** State of the current test method **/
protected
boolean
bSuccessful
=
true
;
...
...
@@ -39,7 +42,7 @@ public class Assurance
* @param s The condition that should be true.
*/
protected
void
assure
(
boolean
s
)
{
assure
(
"Assure failed."
,
s
,
false
);
assure
(
"Assure failed."
,
s
,
ContinueWithTest
.
NO
);
}
/**
...
...
@@ -49,7 +52,7 @@ public class Assurance
* @param s The condition that should be true.
*/
protected
void
assure
(
String
msg
,
boolean
s
)
{
assure
(
msg
,
s
,
false
);
assure
(
msg
,
s
,
ContinueWithTest
.
NO
);
}
/**
...
...
@@ -59,7 +62,7 @@ public class Assurance
* @param actual specifies the actual int value
*/
protected
void
assureEquals
(
String
message
,
int
expected
,
int
actual
)
{
assureEquals
(
message
,
Integer
.
valueOf
(
expected
),
Integer
.
valueOf
(
actual
),
false
);
assureEquals
(
message
,
Integer
.
valueOf
(
expected
),
Integer
.
valueOf
(
actual
),
ContinueWithTest
.
NO
);
}
/**
...
...
@@ -69,13 +72,13 @@ public class Assurance
* @param actual specifies the actual string value
*/
protected
void
assureEquals
(
String
message
,
String
expected
,
String
actual
)
{
assureEquals
(
message
,
expected
,
actual
,
false
);
assureEquals
(
message
,
expected
,
actual
,
ContinueWithTest
.
NO
);
}
/**
* assures the two given sequences are of equal length, and have equal content
*/
public
<
T
>
void
assureEquals
(
String
i_message
,
T
[]
i_expected
,
T
[]
i_actual
,
boolean
i_continue
)
public
<
T
>
void
assureEquals
(
String
i_message
,
T
[]
i_expected
,
T
[]
i_actual
,
ContinueWithTest
i_continue
)
{
if
(
i_expected
.
length
!=
i_actual
.
length
)
failed
(
i_message
+
": expected element count: "
+
i_expected
.
length
+
", actual element count: "
+
i_actual
.
length
);
...
...
@@ -91,7 +94,7 @@ public class Assurance
* @param msg The message of the failure.
*/
protected
void
failed
(
String
msg
)
{
assure
(
msg
,
false
,
false
);
assure
(
msg
,
false
,
ContinueWithTest
.
NO
);
}
/**
...
...
@@ -103,19 +106,19 @@ public class Assurance
* The current method will of course marked as failed.
* @param msg The message that is evaluated.
* @param s The condition that should be true.
* @param cont
C
ontinue with test method, even if s is false.
* @param cont
if YES, c
ontinue with test method, even if s is false.
*/
protected
void
assure
(
String
msg
,
boolean
s
,
boolean
cont
)
{
protected
void
assure
(
String
msg
,
boolean
s
,
ContinueWithTest
cont
)
{
bSuccessful
&=
s
;
if
(!
s
)
{
message
+=
msg
+
"\r\n"
;
if
(
!
cont
)
{
if
(
cont
==
ContinueWithTest
.
NO
)
{
throw
new
AssureException
(
msg
);
}
}
}
private
void
assureEquals
(
String
message
,
Object
expected
,
Object
actual
,
boolean
cont
)
{
private
void
assureEquals
(
String
message
,
Object
expected
,
Object
actual
,
ContinueWithTest
cont
)
{
assure
(
message
+
" (expected: "
+
expected
.
toString
()
+
", actual: "
+
actual
.
toString
()
+
")"
,
expected
.
equals
(
actual
),
cont
);
}
...
...
@@ -128,9 +131,9 @@ public class Assurance
* method will continue.<br>
* The current method will of course marked as failed.
* @param msg The message that is evaluated.
* @param cont
C
ontinue with test method, even if s is false.
* @param cont
if YES, c
ontinue with test method, even if s is false.
*/
protected
void
failed
(
String
msg
,
boolean
cont
)
{
protected
void
failed
(
String
msg
,
ContinueWithTest
cont
)
{
assure
(
msg
,
false
,
cont
);
}
...
...
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