Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

omgmodellerwebservicesplugintest.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tim Sutton   *
00003  *   tim@linfiniti.com   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #include <QtTest/QtTest>
00021 #include <QDomDocument>
00022 #include <QFile>
00023 #include <omgmodellerwebservicesplugin.h>
00024 #include <soapH.h>
00025 
00026 class OmgModellerWebServicesPluginTest: public QObject
00027 {
00028   Q_OBJECT;
00029   private slots:
00030     void getAlgorithms();
00031     void getLayers();
00032     void getName();
00033     void initTestCase();// will be called before the first testfunction is executed.
00034     void cleanupTestCase();// will be called after the last testfunction was executed.
00035     //void init();// will be called before each testfunction is executed.
00036     //void cleanup();// will be called after every testfunction.
00037   public slots:
00038     void showMessage(QString,QString);
00039     void showMessage(QString);
00040   private:
00041     OmgModellerWebServicesPlugin * mpPlugin;
00042     const OmgPluginMessenger * mpMessenger;
00043 };
00044 
00045 void OmgModellerWebServicesPluginTest::initTestCase()
00046 {
00047   mpPlugin = new OmgModellerWebServicesPlugin(); 
00048   mpMessenger = mpPlugin->getMessenger();
00049   connect(mpMessenger, SIGNAL(modelMessage(QString,QString )),
00050       this, SLOT(showMessage(QString,QString)));
00051   connect(mpMessenger, SIGNAL(modelError(QString,QString )),
00052       this, SLOT(showMessage(QString,QString)));
00053   connect(mpMessenger, SIGNAL(error(QString )),
00054       this, SLOT(showMessage(QString)));
00055   QCoreApplication::setOrganizationName("openModeller");
00056   QCoreApplication::setOrganizationDomain("openmodeller.sf.net");
00057   QCoreApplication::setApplicationName("OpenModellerGui");
00058 }
00059 
00060 void OmgModellerWebServicesPluginTest::cleanupTestCase()
00061 {
00062   delete mpPlugin;
00063 }
00064 
00065 void OmgModellerWebServicesPluginTest::showMessage(QString theModelId,QString theMessage)
00066 {
00067   qDebug(theMessage);
00068 }
00069 
00070 void OmgModellerWebServicesPluginTest::showMessage(QString theMessage)
00071 {
00072   qDebug(theMessage);
00073 }
00074 
00075 void OmgModellerWebServicesPluginTest::getLayers()
00076 {
00077   const QString myLayers = mpPlugin->getLayers("");
00078   //@TODO parse and really verify the xml properly
00079   QVERIFY(!myLayers.isEmpty());
00080 }
00081 void OmgModellerWebServicesPluginTest::getName()
00082 {
00083   const  QString myName = mpPlugin->getName();
00084   QVERIFY(myName == "Web Services Modeller Plugin");
00085 }
00086 
00087 void OmgModellerWebServicesPluginTest::getAlgorithms()
00088 {
00089   QStringList myList = mpPlugin->getAlgorithmList();
00090   //qDebug(myList.join(",").toLocal8Bit());
00091   QVERIFY(myList.size()>0);
00092 }
00093 
00094 QTEST_MAIN(OmgModellerWebServicesPluginTest) 
00095 #include "moc_omgmodellerwebservicesplugintest.cxx"

Generated on Mon Apr 28 15:09:49 2008 for openModellerDesktop by  doxygen 1.4.1-20050210