Implemented copy, cut and paste frame
[dashstudio.git] / tests / xdbms / object / test_object.cpp
blobd95360fedf81222cef0211a29efe84374ebde947
2 #include <QtTest/QtTest>
3 #include <QXmlStreamWriter>
5 #include <dashserver/xdbms/manager.h>
6 #include <dashserver/xdbms/table.h>
7 #include <dashserver/xdbms/object.h>
10 /**
11 * @brief Prueba unitaria de la clase XDBMS::Manager.
13 class TestObject : public QObject
15 Q_OBJECT
16 private slots:
17 void initTestCase();
18 void cleanupTestCase();
20 void addObject();
23 /**
24 * Se comprueba que el motor de base de datos se inicie de manera apropiada.
26 void TestObject::initTestCase()
30 void TestObject::cleanupTestCase()
34 void TestObject::addObject()
36 XDBMS::Object obj1("obj1");
37 XDBMS::Object obj2("obj2");
38 obj2.add("prop1", "val1");
40 obj1.add(&obj2);
42 QString xml;
44 QXmlStreamWriter writer(&xml);
45 obj1.save(&writer);
48 XDBMS::Object obj3;
49 obj3.load(xml);
51 QString xml2;
53 QXmlStreamWriter writer(&xml2);
54 obj3.save(&writer);
57 QCOMPARE(xml, xml2);
61 QTEST_MAIN(TestObject);
62 #include "test_object.moc"