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
1b85ffca
Kaydet (Commit)
1b85ffca
authored
Kas 09, 2013
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
factorise code; make DBTestBase a UnoApiTest
Change-Id: I29c131f60caa36c464d99b9b86a59e2e16ce94e3
üst
f0389a7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
45 deletions
+28
-45
dbtest_base.cxx
dbaccess/qa/unit/dbtest_base.cxx
+8
-27
embeddeddb_performancetest.cxx
dbaccess/qa/unit/embeddeddb_performancetest.cxx
+20
-18
No files found.
dbaccess/qa/unit/dbtest_base.cxx
Dosyayı görüntüle @
1b85ffca
...
@@ -8,8 +8,7 @@
...
@@ -8,8 +8,7 @@
*/
*/
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <test/bootstrapfixture.hxx>
#include <test/unoapi_test.hxx>
#include <unotest/macros_test.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/Desktop.hpp>
...
@@ -24,30 +23,27 @@ using namespace ::com::sun::star::sdbc;
...
@@ -24,30 +23,27 @@ using namespace ::com::sun::star::sdbc;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
class
DBTestBase
class
DBTestBase
:
public
::
test
::
BootstrapFixture
:
public
UnoApiTest
,
public
::
unotest
::
MacrosTest
{
{
protected
:
protected
:
static
const
OUString
our_sFilePath
;
static
const
OUString
our_sFilePath
;
public
:
public
:
virtual
void
setUp
();
DBTestBase
()
:
UnoApiTest
(
"dbaccess/qa/unit/data"
)
{};
virtual
void
tearDown
();
uno
::
Reference
<
XOfficeDatabaseDocument
>
uno
::
Reference
<
XOfficeDatabaseDocument
>
getDocumentForFileName
(
OUString
sFileName
);
getDocumentForFileName
(
const
OUString
&
sFileName
);
uno
::
Reference
<
XConnection
>
uno
::
Reference
<
XConnection
>
getConnectionForDocument
(
getConnectionForDocument
(
uno
::
Reference
<
XOfficeDatabaseDocument
>&
xDocument
);
uno
::
Reference
<
XOfficeDatabaseDocument
>&
xDocument
);
};
};
const
OUString
DBTestBase
::
our_sFilePath
(
"/dbaccess/qa/unit/data/"
);
uno
::
Reference
<
XOfficeDatabaseDocument
>
uno
::
Reference
<
XOfficeDatabaseDocument
>
DBTestBase
::
getDocumentForFileName
(
OUString
sFileName
)
DBTestBase
::
getDocumentForFileName
(
const
OUString
&
sFileName
)
{
{
uno
::
Reference
<
lang
::
XComponent
>
xComponent
=
OUString
sFilePath
;
loadFromDesktop
(
getSrcRootURL
()
+
our_sFilePath
+
sFileName
);
createFileURL
(
sFileName
,
sFilePath
);
uno
::
Reference
<
lang
::
XComponent
>
xComponent
(
loadFromDesktop
(
sFilePath
));
CPPUNIT_ASSERT
(
xComponent
.
is
());
CPPUNIT_ASSERT
(
xComponent
.
is
());
uno
::
Reference
<
XOfficeDatabaseDocument
>
xDocument
(
xComponent
,
UNO_QUERY
);
uno
::
Reference
<
XOfficeDatabaseDocument
>
xDocument
(
xComponent
,
UNO_QUERY
);
...
@@ -68,19 +64,4 @@ uno::Reference< XConnection > DBTestBase::getConnectionForDocument(
...
@@ -68,19 +64,4 @@ uno::Reference< XConnection > DBTestBase::getConnectionForDocument(
return
xConnection
;
return
xConnection
;
}
}
void
DBTestBase
::
setUp
()
{
::
test
::
BootstrapFixture
::
setUp
();
mxDesktop
=
::
com
::
sun
::
star
::
frame
::
Desktop
::
create
(
::
comphelper
::
getProcessComponentContext
());
CPPUNIT_ASSERT
(
mxDesktop
.
is
());
}
void
DBTestBase
::
tearDown
()
{
test
::
BootstrapFixture
::
tearDown
();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
dbaccess/qa/unit/embeddeddb_performancetest.cxx
Dosyayı görüntüle @
1b85ffca
...
@@ -100,6 +100,8 @@ private:
...
@@ -100,6 +100,8 @@ private:
void
setupTestTable
(
uno
::
Reference
<
XConnection
>&
xConnection
);
void
setupTestTable
(
uno
::
Reference
<
XConnection
>&
xConnection
);
SvFileStream
*
getWordListStream
();
// Individual Tests
// Individual Tests
void
performPreparedStatementInsertTest
(
void
performPreparedStatementInsertTest
(
uno
::
Reference
<
XConnection
>&
xConnection
,
uno
::
Reference
<
XConnection
>&
xConnection
,
...
@@ -123,6 +125,22 @@ public:
...
@@ -123,6 +125,22 @@ public:
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
};
};
SvFileStream
*
EmbeddedDBPerformanceTest
::
getWordListStream
()
{
OUString
wlPath
;
createFileURL
(
"wordlist"
,
wlPath
);
SvFileStream
*
pFile
(
new
SvFileStream
(
wlPath
,
STREAM_READ
));
if
(
!
pFile
)
{
fprintf
(
stderr
,
"Please ensure the wordlist is present
\n
"
);
CPPUNIT_ASSERT
(
false
);
}
return
pFile
;
}
void
EmbeddedDBPerformanceTest
::
printTimes
(
void
EmbeddedDBPerformanceTest
::
printTimes
(
const
TimeValue
*
pTime1
,
const
TimeValue
*
pTime1
,
const
TimeValue
*
pTime2
,
const
TimeValue
*
pTime2
,
...
@@ -252,15 +270,7 @@ void EmbeddedDBPerformanceTest::performPreparedStatementInsertTest(
...
@@ -252,15 +270,7 @@ void EmbeddedDBPerformanceTest::performPreparedStatementInsertTest(
uno
::
Reference
<
XParameters
>
xParameters
(
xPreparedStatement
,
UNO_QUERY_THROW
);
uno
::
Reference
<
XParameters
>
xParameters
(
xPreparedStatement
,
UNO_QUERY_THROW
);
::
boost
::
scoped_ptr
<
SvFileStream
>
pFile
(
new
SvFileStream
(
::
boost
::
scoped_ptr
<
SvFileStream
>
pFile
(
getWordListStream
());
getSrcRootURL
()
+
our_sFilePath
+
"wordlist"
,
STREAM_READ
));
if
(
!
pFile
)
{
fprintf
(
stderr
,
"Please ensure the wordlist is present
\n
"
);
CPPUNIT_ASSERT
(
false
);
}
OUString
aWord
;
OUString
aWord
;
sal_Int32
aID
=
0
;
sal_Int32
aID
=
0
;
...
@@ -296,15 +306,7 @@ void EmbeddedDBPerformanceTest::performStatementInsertTest(
...
@@ -296,15 +306,7 @@ void EmbeddedDBPerformanceTest::performStatementInsertTest(
uno
::
Reference
<
XStatement
>
xStatement
=
uno
::
Reference
<
XStatement
>
xStatement
=
xConnection
->
createStatement
();
xConnection
->
createStatement
();
::
boost
::
scoped_ptr
<
SvFileStream
>
pFile
(
new
SvFileStream
(
::
boost
::
scoped_ptr
<
SvFileStream
>
pFile
(
getWordListStream
());
getSrcRootURL
()
+
our_sFilePath
+
"wordlist"
,
STREAM_READ
));
if
(
!
pFile
)
{
fprintf
(
stderr
,
"Please ensure the wordlist is present
\n
"
);
CPPUNIT_ASSERT
(
false
);
}
OUString
aWord
;
OUString
aWord
;
sal_Int32
aID
=
0
;
sal_Int32
aID
=
0
;
...
...
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