~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to nepomuk/services/backupsync/lib/test/testbase.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *
3
 
 * $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
4
 
 *
5
 
 * This file is part of the Nepomuk KDE project.
6
 
 * Copyright (C) 2006-2007 Sebastian Trueg <trueg@kde.org>
7
 
 *
8
 
 * This library is free software; you can redistribute it and/or modify
9
 
 * it under the terms of the GNU Lesser General Public License as published by
10
 
 * the Free Software Foundation; either version 2 of the License, or
11
 
 * (at your option) any later version.
12
 
 * See the file "COPYING.LIB" for the exact licensing terms.
13
 
 */
14
 
 
15
 
#include "testbase.h"
16
 
 
17
 
#include <Nepomuk/Resource>
18
 
#include <Nepomuk/ResourceManager>
19
 
 
20
 
#include <Soprano/Soprano>
21
 
 
22
 
#include <ktempdir.h>
23
 
 
24
 
void TestBase::initTestCase()
25
 
{
26
 
    m_tmpDir = new KTempDir();
27
 
    const Soprano::Backend* backend = Soprano::PluginManager::instance()->discoverBackendByName("virtuoso");
28
 
    m_model = backend->createModel( Soprano::BackendSettings() << Soprano::BackendSetting(Soprano::BackendOptionStorageDir, m_tmpDir->name() ));
29
 
    Nepomuk::ResourceManager::instance()->setOverrideMainModel( m_model );
30
 
}
31
 
 
32
 
 
33
 
void TestBase::cleanupTestCase()
34
 
{
35
 
    Nepomuk::ResourceManager::instance()->setOverrideMainModel( 0 );
36
 
    delete m_model;
37
 
    delete m_tmpDir;
38
 
}
39
 
 
40
 
 
41
 
void TestBase::init()
42
 
{
43
 
    m_model->removeAllStatements();
44
 
}
45
 
 
46
 
 
47
 
void TestBase::cleanup()
48
 
{
49
 
}
50
 
 
51
 
#include "testbase.moc"