summaryrefslogtreecommitdiff
path: root/extensions/qa
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-01-04 19:25:57 +0100
committerJan Holesovsky <kendy@suse.cz>2012-01-04 20:26:42 +0100
commit20caa9a3f41d04ccc921b0435e887fc8ec519585 (patch)
tree78f3771e281fd8f8d58b608ad8dc9f489cf8149a /extensions/qa
parentbc4699ba6e05af115ffed17e2938e3176f3f930a (diff)
Online update: Introduce inst:gitid to check exactly if we are the same.
This allows to feed updates via a static .xml in a controlled environment.
Diffstat (limited to 'extensions/qa')
-rw-r--r--extensions/qa/update/simple.xml6
-rw-r--r--extensions/qa/update/test_update.cxx27
2 files changed, 27 insertions, 6 deletions
diff --git a/extensions/qa/update/simple.xml b/extensions/qa/update/simple.xml
index 6a6af1280b87..79003972317b 100644
--- a/extensions/qa/update/simple.xml
+++ b/extensions/qa/update/simple.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<inst:description xmlns:inst="http://update.libreoffice.org/description">
- <inst:id>LibreOffice_3.4</inst:id>
- <inst:version>3.4.2</inst:version>
- <inst:buildid>102</inst:buildid>
+ <inst:id>LibreOffice 3.5.0 Beta2</inst:id>
+ <inst:version>3.5.0 Beta2</inst:version>
+ <inst:gitid>123456-abcdef-1a2b3c-4d5e6f</inst:gitid>
<inst:os>Linux</inst:os>
<inst:arch>x86</inst:arch>
diff --git a/extensions/qa/update/test_update.cxx b/extensions/qa/update/test_update.cxx
index bed67d374350..af93e66c7ec2 100644
--- a/extensions/qa/update/test_update.cxx
+++ b/extensions/qa/update/test_update.cxx
@@ -121,8 +121,8 @@ protected:
CPPUNIT_FAIL( "Wrong type of the entry." );
}
- // test the checkForUpdates() method
- void testCheckForUpdates()
+ // test the checkForUpdates() method - update is available
+ void testCheckUpdateAvailable()
{
UpdateInfo aInfo;
rtl::Reference< UpdateCheck > aController( UpdateCheck::get() );
@@ -131,6 +131,7 @@ protected:
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Linux" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "x86" ) ),
m_aRepositoryList,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "111111-222222-333333-444444" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InstallSetID" ) ) ) )
{
CPPUNIT_ASSERT( aInfo.Sources.size() == 1 );
@@ -140,9 +141,29 @@ protected:
CPPUNIT_FAIL( "Calling checkForUpdates() failed." );
}
+ // test the checkForUpdates() method - we are up-to-date
+ void testCheckUpToDate()
+ {
+ UpdateInfo aInfo;
+ rtl::Reference< UpdateCheck > aController( UpdateCheck::get() );
+
+ if ( checkForUpdates( aInfo, m_xContext, aController->getInteractionHandler(), m_xProvider,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Linux" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "x86" ) ),
+ m_aRepositoryList,
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "123456-abcdef-1a2b3c-4d5e6f" ) ),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InstallSetID" ) ) ) )
+ {
+ CPPUNIT_ASSERT( aInfo.Sources.size() == 0 );
+ }
+ else
+ CPPUNIT_FAIL( "Calling checkForUpdates() failed." );
+ }
+
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testGetUpdateInformationEnumeration);
- CPPUNIT_TEST(testCheckForUpdates);
+ CPPUNIT_TEST(testCheckUpdateAvailable);
+ CPPUNIT_TEST(testCheckUpToDate);
CPPUNIT_TEST_SUITE_END();
private: