[Libreoffice-commits] .: Branch 'feature/tubes2' - tubes/CppunitTest_tubes_test.mk tubes/qa tubes/test-config.ini

Will Thompson wjt at kemper.freedesktop.org
Thu Mar 22 03:44:15 PDT 2012


 tubes/CppunitTest_tubes_test.mk |    2 ++
 tubes/qa/test_manager.cxx       |   22 +++++++++++++++-------
 tubes/test-config.ini           |    3 +++
 3 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 16e48ea17024c7b97b3048bf4463ae443f930455
Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Thu Mar 22 10:43:57 2012 +0000

    tubes: move hardcoded test accounts to an .ini file

diff --git a/tubes/CppunitTest_tubes_test.mk b/tubes/CppunitTest_tubes_test.mk
index 7b558d7..57a53a5 100644
--- a/tubes/CppunitTest_tubes_test.mk
+++ b/tubes/CppunitTest_tubes_test.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,tubes_test, \
 $(eval $(call gb_CppunitTest_add_linked_libs,tubes_test, \
     tubes \
     sal \
+    unotest \
     $(gb_STDLIBS) \
 ))
 
@@ -42,6 +43,7 @@ $(eval $(call gb_CppunitTest_add_libs,tubes_test, \
 
 $(eval $(call gb_CppunitTest_set_include,tubes_test,\
     -I$(realpath $(SRCDIR)/tubes/inc) \
+    -I$(realpath $(OUTDIR)/inc/udkapi) \
     $$(TELEPATHY_CFLAGS) \
     $$(INCLUDE) \
 ))
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx
index 69266d0..63077dc 100644
--- a/tubes/qa/test_manager.cxx
+++ b/tubes/qa/test_manager.cxx
@@ -37,10 +37,12 @@
 #include <cppunit/plugin/TestPlugIn.h>
 #include <rtl/string.hxx>
 #include <rtl/ustring.hxx>
+#include <rtl/bootstrap.hxx>
+#include <unotest/bootstrapfixturebase.hxx>
 
 namespace {
 
-class TestTeleTubes: public CppUnit::TestFixture
+class TestTeleTubes: public test::BootstrapFixtureBase
 {
 public:
 
@@ -83,22 +85,28 @@ public:
     CPPUNIT_TEST( testFailAlways );     // need failure to display SAL_LOG, comment out for real builds
     CPPUNIT_TEST_SUITE_END();
 
+private:
+// XXX The Jabber accounts specified in test-config.ini need to be setup in
+// Empathy, enabled, connected, and on each other's rosters.
+    rtl::Bootstrap            maTestConfig;
+
+    rtl::OUString             maAcc1;
+    rtl::OUString             maAcc2;
 };
 
 // static, not members, so they actually survive cppunit test iteration
 static TeleManager* mpManager1 = NULL;
 static TeleManager* mpManager2 = NULL;
 
-// XXX The accounts need to be setup in Empathy and a jabber daemon needs
-// to be running on localhost.localdomain and both accounts need to be
-// enabled and connected.
-static rtl::OUString sAcc1( RTL_CONSTASCII_USTRINGPARAM( "libo1 at localhost.localdomain"));
-static rtl::OUString sAcc2( RTL_CONSTASCII_USTRINGPARAM( "libo2 at localhost.localdomain"));
 static sal_uInt32 nSentPackets = 0;
 
 TestTeleTubes::TestTeleTubes()
+    : maTestConfig(getURLFromSrc("/tubes/test-config.ini"))
 {
     TeleManager::addSuffixToNames( "TeleTest");
+
+    CPPUNIT_ASSERT( maTestConfig.getFrom("offerer", maAcc1));
+    CPPUNIT_ASSERT( maTestConfig.getFrom("accepter", maAcc2));
 }
 
 TestTeleTubes::~TestTeleTubes()
@@ -182,7 +190,7 @@ void TestTeleTubes::testPrepareAccountManager2()
 
 void TestTeleTubes::testStartBuddySession1()
 {
-    bool bStarted = mpManager1->startBuddySession( sAcc1, sAcc2);
+    bool bStarted = mpManager1->startBuddySession( maAcc1, maAcc2);
     CPPUNIT_ASSERT( bStarted == true);
 }
 
diff --git a/tubes/test-config.ini b/tubes/test-config.ini
new file mode 100644
index 0000000..dba2be1
--- /dev/null
+++ b/tubes/test-config.ini
@@ -0,0 +1,3 @@
+# Locally-configured Jabber accounts used by Tubes test suite.
+offerer=libo1 at localhost.localdomain
+accepter=libo2 at localhost.localdomain


More information about the Libreoffice-commits mailing list