summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data.qrc3
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0content.7zbin0 -> 98 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0installerbase.7zbin0 -> 114 bytes
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/Updates.xml13
-rw-r--r--tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp33
5 files changed, 49 insertions, 0 deletions
diff --git a/tests/auto/installer/extractarchiveoperationtest/data.qrc b/tests/auto/installer/extractarchiveoperationtest/data.qrc
index a8cc1a892..87f648568 100644
--- a/tests/auto/installer/extractarchiveoperationtest/data.qrc
+++ b/tests/auto/installer/extractarchiveoperationtest/data.qrc
@@ -11,5 +11,8 @@
<file>data/xmloperationrepository/A/1.0.0content4.zip</file>
<file>data/xmloperationrepository/A/1.0.0anothercontent.7z</file>
<file>data/xmloperationrepository/A/1.0.0default.7z</file>
+ <file>data/installerbaserepository/Updates.xml</file>
+ <file>data/installerbaserepository/A/1.0.0content.7z</file>
+ <file>data/installerbaserepository/A/1.0.0installerbase.7z</file>
</qresource>
</RCC>
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0content.7z b/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0content.7z
new file mode 100644
index 000000000..585f58296
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0installerbase.7z b/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0installerbase.7z
new file mode 100644
index 000000000..c3b6aec9c
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/A/1.0.0installerbase.7z
Binary files differ
diff --git a/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/Updates.xml b/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/Updates.xml
new file mode 100644
index 000000000..887300c97
--- /dev/null
+++ b/tests/auto/installer/extractarchiveoperationtest/data/installerbaserepository/Updates.xml
@@ -0,0 +1,13 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>InstallerBase</DisplayName>
+ <Description>Example component InstallerBase</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <Default>true</Default>
+ <DownloadableArchives>installerbase.7z,content.7z</DownloadableArchives>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp b/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp
index 89492bd94..a8a65e983 100644
--- a/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp
+++ b/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp
@@ -177,6 +177,39 @@ private slots:
QVERIFY(dir.removeRecursively());
}
+ void testInstallerBaseBinaryExtraction()
+ {
+ m_testDirectory = QInstaller::generateTemporaryFileName();
+ QVERIFY(QDir().mkpath(m_testDirectory));
+ QVERIFY(QDir(m_testDirectory).exists());
+
+ QScopedPointer<PackageManagerCore> core(PackageManager::getPackageManagerWithInit
+ (m_testDirectory, ":///data/installerbaserepository"));
+ core->setInstallerBaseBinary(m_testDirectory + QDir::separator() + "testInstallerBase.txt");
+ core->installDefaultComponentsSilently();
+
+ QFile contentResourceFile(m_testDirectory + QDir::separator() + "installerResources" + QDir::separator() + "A" + QDir::separator() + "1.0.0content.txt");
+ QVERIFY2(contentResourceFile.open(QIODevice::ReadOnly | QIODevice::Text), "Could not open content resource file for reading.");
+ QTextStream fileStream(&contentResourceFile);
+ QString line = fileStream.readLine();
+ QVERIFY2(!line.isEmpty(), "Content not written to resource file.");
+ contentResourceFile.close();
+
+ QFile installerBaseResourceFile(m_testDirectory + QDir::separator() + "installerResources" + QDir::separator() + "A" + QDir::separator() + "1.0.0installerbase.txt");
+ QVERIFY2(installerBaseResourceFile.open(QIODevice::ReadOnly | QIODevice::Text), "Could not open installerbase resource file for reading.");
+ QTextStream fileStream2(&installerBaseResourceFile);
+ line = installerBaseResourceFile.readLine();
+ QVERIFY2(line.isEmpty(), "Installerbase falsly written to resource file.");
+ installerBaseResourceFile.close();
+
+ core->setPackageManager();
+ core->commitSessionOperations();
+
+ QCOMPARE(PackageManagerCore::Success, core->uninstallComponentsSilently(QStringList() << "A"));
+ QDir dir(m_testDirectory);
+ QVERIFY(dir.removeRecursively());
+ }
+
private:
QString m_testDirectory;
};