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
69309ccb
Kaydet (Commit)
69309ccb
authored
Haz 07, 2010
tarafından
Lars Langhans
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sb123:#i111449# cleanups in sot qa/complex tests
üst
7a058994
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
86 deletions
+111
-86
build.lst
sot/prj/build.lst
+9
-7
OLESimpleStorageUnitTest.java
...qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
+62
-18
Test01.java
sot/qa/complex/olesimplestorage/Test01.java
+10
-10
TestHelper.java
sot/qa/complex/olesimplestorage/TestHelper.java
+8
-7
makefile.mk
sot/qa/complex/olesimplestorage/makefile.mk
+22
-44
No files found.
sot/prj/build.lst
Dosyayı görüntüle @
69309ccb
to sot : tools ucbhelper unotools NULL
to sot : tools ucbhelper unotools NULL
to sot usr1 - all sot_mkout NULL
to sot usr1 - all sot_mkout NULL
to sot\inc nmake - all sot_inc NULL
to sot\inc nmake - all sot_inc NULL
to sot\prj get - all sot_prj NULL
to sot\prj get - all sot_prj NULL
to sot\source\base nmake - all sot_base sot_inc NULL
to sot\source\base nmake - all sot_base sot_inc NULL
to sot\source\sdstor nmake - all sot_sdst sot_inc NULL
to sot\source\sdstor nmake - all sot_sdst sot_inc NULL
to sot\source\unoolestorage nmake - all sot_unoolestor sot_inc NULL
to sot\source\unoolestorage nmake - all sot_unoolestor sot_inc NULL
to sot\util nmake - all sot_ut sot_base sot_sdst sot_unoolestor NULL
to sot\util nmake - all sot_ut sot_base sot_sdst sot_unoolestor NULL
to sot\qa\complex\olesimplestorage nmake - all sot_complex sot_ut NULL
sot/qa/complex/olesimplestorage/OLESimpleStorageUnitTest.java
Dosyayı görüntüle @
69309ccb
...
@@ -26,42 +26,85 @@
...
@@ -26,42 +26,85 @@
************************************************************************/
************************************************************************/
package
complex
.
olesimplestorage
;
package
complex
.
olesimplestorage
;
import
complexlib.ComplexTestCase
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.uno.UnoRuntime
;
import
com.sun.star.uno.UnoRuntime
;
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
.*;
/* Document.
/* Document.
*/
*/
public
class
OLESimpleStorageUnitTest
extends
ComplexTestCase
{
public
class
OLESimpleStorageUnitTest
/* extends ComplexTestCase */
{
private
XMultiServiceFactory
m_xMSF
=
null
;
private
XMultiServiceFactory
m_xMSF
=
null
;
public
String
[]
getTestMethodNames
()
{
//
public String[] getTestMethodNames() {
return
new
String
[]
{
//
return new String[] {
"ExecuteTest01"
};
//
"ExecuteTest01"};
}
//
}
//
public
String
getTestObjectName
()
{
//
public String getTestObjectName() {
return
"OLESimpleStorageUnitTest"
;
//
return "OLESimpleStorageUnitTest";
}
//
}
public
void
before
()
{
@Before
public
void
before
()
{
System
.
out
.
println
(
"before()"
);
try
{
try
{
m_xMSF
=
(
XMultiServiceFactory
)
param
.
getMSF
();
m_xMSF
=
getMSF
();
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
fail
ed
(
"Cannot create service factory!"
);
fail
(
"Cannot create service factory!"
);
}
}
if
(
m_xMSF
==
null
)
{
if
(
m_xMSF
==
null
)
{
fail
ed
(
"Cannot create service factory!"
);
fail
(
"Cannot create service factory!"
);
}
}
}
}
public
void
after
()
{
@After
public
void
after
()
{
System
.
out
.
println
(
"after()"
);
m_xMSF
=
null
;
m_xMSF
=
null
;
}
}
public
void
ExecuteTest01
()
{
@Test
public
void
ExecuteTest01
()
{
OLESimpleStorageTest
aTest
=
new
Test01
(
m_xMSF
,
log
);
System
.
out
.
println
(
"ExecuteTest01()"
);
assure
(
"Test01 failed!"
,
aTest
.
test
()
);
OLESimpleStorageTest
aTest
=
new
Test01
(
m_xMSF
);
assertTrue
(
"Test01 failed!"
,
aTest
.
test
()
);
}
}
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
{
// try
// {
// Thread.sleep(5000);
// }
// catch (java.lang.InterruptedException e)
// {
// }
System
.
out
.
println
(
"tearDownConnection()"
);
connection
.
tearDown
();
}
private
static
final
OfficeConnection
connection
=
new
OfficeConnection
();
}
}
\ No newline at end of file
sot/qa/complex/olesimplestorage/Test01.java
Dosyayı görüntüle @
69309ccb
package
complex
.
olesimplestorage
;
package
complex
.
olesimplestorage
;
import
complexlib.ComplexTestCase
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.lang.XMultiServiceFactory
;
import
com.sun.star.io.XInputStream
;
import
com.sun.star.io.XInputStream
;
...
@@ -10,7 +10,7 @@ import com.sun.star.embed.XOLESimpleStorage;
...
@@ -10,7 +10,7 @@ import com.sun.star.embed.XOLESimpleStorage;
import
com.sun.star.uno.UnoRuntime
;
import
com.sun.star.uno.UnoRuntime
;
import
java.util.Random
;
import
java.util.Random
;
import
share.LogWriter
;
public
class
Test01
implements
OLESimpleStorageTest
public
class
Test01
implements
OLESimpleStorageTest
{
{
...
@@ -19,10 +19,10 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -19,10 +19,10 @@ public class Test01 implements OLESimpleStorageTest
final
int
pStreamCnt
=
5
;
final
int
pStreamCnt
=
5
;
final
int
pBytesCnt
=
10
;
final
int
pBytesCnt
=
10
;
public
Test01
(
XMultiServiceFactory
xMSF
,
LogWriter
aLogWriter
)
public
Test01
(
XMultiServiceFactory
xMSF
)
{
{
m_xMSF
=
xMSF
;
m_xMSF
=
xMSF
;
m_aTestHelper
=
new
TestHelper
(
aLogWriter
,
"Test01: "
);
m_aTestHelper
=
new
TestHelper
(
"Test01: "
);
}
}
public
boolean
test
()
public
boolean
test
()
...
@@ -31,7 +31,7 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -31,7 +31,7 @@ public class Test01 implements OLESimpleStorageTest
{
{
//create a new temporary stream
//create a new temporary stream
Object
oTempFile
=
m_xMSF
.
createInstance
(
"com.sun.star.io.TempFile"
);
Object
oTempFile
=
m_xMSF
.
createInstance
(
"com.sun.star.io.TempFile"
);
XTempFile
xTempFile
=
(
XTempFile
)
UnoRuntime
.
queryInterface
(
XTempFile
.
class
,
oTempFile
);
XTempFile
xTempFile
=
UnoRuntime
.
queryInterface
(
XTempFile
.
class
,
oTempFile
);
m_aTestHelper
.
Message
(
"A new temporary stream created."
);
m_aTestHelper
.
Message
(
"A new temporary stream created."
);
//create OLESimpleStorage based on it
//create OLESimpleStorage based on it
...
@@ -39,7 +39,7 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -39,7 +39,7 @@ public class Test01 implements OLESimpleStorageTest
pArgs
[
0
]
=
(
Object
)
xTempFile
;
pArgs
[
0
]
=
(
Object
)
xTempFile
;
pArgs
[
1
]
=
new
Boolean
(
true
);
pArgs
[
1
]
=
new
Boolean
(
true
);
Object
oOLESimpleStorage
=
m_xMSF
.
createInstanceWithArguments
(
"com.sun.star.embed.OLESimpleStorage"
,
pArgs
);
Object
oOLESimpleStorage
=
m_xMSF
.
createInstanceWithArguments
(
"com.sun.star.embed.OLESimpleStorage"
,
pArgs
);
XOLESimpleStorage
xOLESimpleStorage
=
(
XOLESimpleStorage
)
UnoRuntime
.
queryInterface
(
XOLESimpleStorage
.
class
,
oOLESimpleStorage
);
XOLESimpleStorage
xOLESimpleStorage
=
UnoRuntime
.
queryInterface
(
XOLESimpleStorage
.
class
,
oOLESimpleStorage
);
m_aTestHelper
.
Message
(
"OLESimpleStorage based on XStream created."
);
m_aTestHelper
.
Message
(
"OLESimpleStorage based on XStream created."
);
//fill it with some streams
//fill it with some streams
...
@@ -53,7 +53,7 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -53,7 +53,7 @@ public class Test01 implements OLESimpleStorageTest
{
{
oRandom
.
nextBytes
(
pBytesOut
[
i
]);
oRandom
.
nextBytes
(
pBytesOut
[
i
]);
oStream
[
i
]
=
m_xMSF
.
createInstance
(
"com.sun.star.io.TempFile"
);
oStream
[
i
]
=
m_xMSF
.
createInstance
(
"com.sun.star.io.TempFile"
);
xTempStream
[
i
]
=
(
XTempFile
)
UnoRuntime
.
queryInterface
(
XTempFile
.
class
,
oStream
[
i
]
);
xTempStream
[
i
]
=
UnoRuntime
.
queryInterface
(
XTempFile
.
class
,
oStream
[
i
]
);
xTempStream
[
i
].
getOutputStream
().
writeBytes
(
pBytesOut
[
i
]);
xTempStream
[
i
].
getOutputStream
().
writeBytes
(
pBytesOut
[
i
]);
xTempStream
[
i
].
seek
(
0
);
xTempStream
[
i
].
seek
(
0
);
m_aTestHelper
.
Message
(
"Substream "
+
i
+
" initialized."
);
m_aTestHelper
.
Message
(
"Substream "
+
i
+
" initialized."
);
...
@@ -83,7 +83,7 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -83,7 +83,7 @@ public class Test01 implements OLESimpleStorageTest
//open the same stream with the constructor for inputstream
//open the same stream with the constructor for inputstream
pArgs
[
0
]
=
(
Object
)
xTempFile
.
getInputStream
();
pArgs
[
0
]
=
(
Object
)
xTempFile
.
getInputStream
();
oOLESimpleStorage
=
m_xMSF
.
createInstanceWithArguments
(
"com.sun.star.embed.OLESimpleStorage"
,
pArgs
);
oOLESimpleStorage
=
m_xMSF
.
createInstanceWithArguments
(
"com.sun.star.embed.OLESimpleStorage"
,
pArgs
);
xOLESimpleStorage
=
(
XOLESimpleStorage
)
UnoRuntime
.
queryInterface
(
XOLESimpleStorage
.
class
,
oOLESimpleStorage
);
xOLESimpleStorage
=
UnoRuntime
.
queryInterface
(
XOLESimpleStorage
.
class
,
oOLESimpleStorage
);
m_aTestHelper
.
Message
(
"Storage reopened, based on XInputStream."
);
m_aTestHelper
.
Message
(
"Storage reopened, based on XInputStream."
);
//check that all the streams contain correct information
//check that all the streams contain correct information
...
@@ -92,8 +92,7 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -92,8 +92,7 @@ public class Test01 implements OLESimpleStorageTest
{
{
if
(
xOLESimpleStorage
.
hasByName
(
sSubStreamPrefix
+
i
)
)
if
(
xOLESimpleStorage
.
hasByName
(
sSubStreamPrefix
+
i
)
)
{
{
xTempStream
[
i
]
=
(
XTempFile
)
UnoRuntime
.
queryInterface
(
xTempStream
[
i
]
=
UnoRuntime
.
queryInterface
(
XTempFile
.
class
,
xOLESimpleStorage
.
getByName
(
sSubStreamPrefix
+
i
));
XTempFile
.
class
,
xOLESimpleStorage
.
getByName
(
sSubStreamPrefix
+
i
)
);
xTempStream
[
i
].
seek
(
0
);
xTempStream
[
i
].
seek
(
0
);
xTempStream
[
i
].
getInputStream
().
readBytes
(
pBytesIn
[
i
],
pBytesIn
[
i
][
0
].
length
+
1
);
xTempStream
[
i
].
getInputStream
().
readBytes
(
pBytesIn
[
i
],
pBytesIn
[
i
][
0
].
length
+
1
);
for
(
int
j
=
0
;
j
<
pBytesCnt
;
++
j
)
for
(
int
j
=
0
;
j
<
pBytesCnt
;
++
j
)
...
@@ -120,6 +119,7 @@ public class Test01 implements OLESimpleStorageTest
...
@@ -120,6 +119,7 @@ public class Test01 implements OLESimpleStorageTest
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
m_aTestHelper
.
Error
(
"Exception: "
+
e
);
m_aTestHelper
.
Error
(
"Exception: "
+
e
);
return
false
;
}
}
return
true
;
return
true
;
}
}
...
...
sot/qa/complex/olesimplestorage/TestHelper.java
Dosyayı görüntüle @
69309ccb
package
complex
.
olesimplestorage
;
package
complex
.
olesimplestorage
;
import
share.LogWriter
;
public
class
TestHelper
public
class
TestHelper
{
{
LogWriter
m_aLogWriter
;
String
m_sTestPrefix
;
String
m_sTestPrefix
;
/** Creates a new instance of TestHelper */
/** Creates a new instance of TestHelper
public
TestHelper
(
LogWriter
aLogWriter
,
String
sTestPrefix
)
* @param sTestPrefix
*/
public
TestHelper
(
String
sTestPrefix
)
{
{
m_aLogWriter
=
aLogWriter
;
m_sTestPrefix
=
sTestPrefix
;
m_sTestPrefix
=
sTestPrefix
;
}
}
public
void
Error
(
String
sError
)
public
void
Error
(
String
sError
)
{
{
m_aLogWriter
.
println
(
m_sTestPrefix
+
"Error: "
+
sError
);
System
.
out
.
println
(
m_sTestPrefix
+
"Error: "
+
sError
);
}
}
public
void
Message
(
String
sMessage
)
public
void
Message
(
String
sMessage
)
{
{
m_aLogWriter
.
println
(
m_sTestPrefix
+
sMessage
);
System
.
out
.
println
(
m_sTestPrefix
+
sMessage
);
}
}
}
}
sot/qa/complex/olesimplestorage/makefile.mk
Dosyayı görüntüle @
69309ccb
...
@@ -25,60 +25,38 @@
...
@@ -25,60 +25,38 @@
#
#
#*************************************************************************
#*************************************************************************
PRJ
=
..
$/
..
$/
..
.IF
"$(OOO_SUBSEQUENT_TESTS)"
==
""
TARGET
=
OLESimpleStorageUnitTest
nothing .PHONY
:
PRJNAME
=
sot
.ELSE
PACKAGE
=
complex
$/
olesimplestorage
# --- Settings -----------------------------------------------------
.INCLUDE
:
settings.mk
#----- compile .java files -----------------------------------------
JARFILES
=
ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
JAVAFILES
=
\
OLESimpleStorageUnitTest.java
\
OLESimpleStorageTest.java
\
TestHelper.java
\
Test01.java
JAVACLASSFILES
=
$
(
foreach,i,
$(JAVAFILES)
$(CLASSDIR)$/$(PACKAGE)$/
$
(
i:b
)
.class
)
#----- make a jar from compiled files ------------------------------
MAXLINELENGTH
=
100000
PRJ
=
../../..
PRJNAME
=
sot
TARGET
=
qa_complex_olesimplestorage
JARCLASSDIRS
=
$(PACKAGE)
.IF
"$(OOO_JUNIT_JAR)"
!=
""
JARTARGET
=
$(TARGET)
.jar
PACKAGE
=
complex/olesimplestorage
JARCOMPRESS
=
TRUE
JAVATESTFILES
=
\
OLESimpleStorageUnitTest.java
# --- Parameters for the test --------------------------------------
JAVAFILES
=
$(JAVATESTFILES)
\
OLESimpleStorageTest.java
\
Test01.java
\
TestHelper.java
# start an office if the parameter is set for the makefile
JARFILES
=
OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar
.IF
"$(OFFICE)"
==
""
EXTRAJARFILES
=
$(OOO_JUNIT_JAR)
CT_APPEXECCOMMAND
=
.END
.ELSE
CT_APPEXECCOMMAND
=
-AppExecutionCommand
"
$(OFFICE)$/
soffice -accept=socket,host=localhost,port=8100;urp;"
.ENDIF
# test base is java complex
.INCLUDE
:
settings.mk
CT_TESTBASE
=
-TestBase
java_complex
.INCLUDE
:
target.mk
.INCLUDE
:
installationtest.mk
# test looks something like the.full.package.TestName
ALLTAR
:
javatest
CT_TEST
=
-o
$
(
PACKAGE:s
\$
/
\.\)
.
$
(
JAVAFILES:b
)
# start the runner application
.END
CT_APP
=
org.openoffice.Runner
# --- Targets ------------------------------------------------------
.INCLUDE
:
target.mk
RUN
:
run
run
:
+java
-cp
$(CLASSPATH)
$(CT_APP)
$(CT_TESTBASE)
$(CT_APPEXECCOMMAND)
$(CT_TEST)
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