diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/protocols/oscar/liboscar/tests/ssigrouptest.cpp | |
download | tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/oscar/liboscar/tests/ssigrouptest.cpp')
-rw-r--r-- | kopete/protocols/oscar/liboscar/tests/ssigrouptest.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/kopete/protocols/oscar/liboscar/tests/ssigrouptest.cpp b/kopete/protocols/oscar/liboscar/tests/ssigrouptest.cpp new file mode 100644 index 00000000..a1a9e754 --- /dev/null +++ b/kopete/protocols/oscar/liboscar/tests/ssigrouptest.cpp @@ -0,0 +1,73 @@ +//Licensed under the GNU General Public License + +#include "ssigrouptest.h" + +LoginTest::LoginTest(int argc, char ** argv) : QApplication( argc, argv ) +{ + // set up client stream + myConnector = new KNetworkConnector( 0 ); + myConnector->setOptHostPort( "login.oscar.aol.com", 5190 ); + myTestObject = new ClientStream( myConnector, myConnector); + + // notify when the transport layer is connected + //connect( myTestObject, SIGNAL( connected() ), SLOT( slotConnected() ) ); + myClient = new Client(); + + myConnection = new Connection( myConnector, myTestObject, "AUTHORIZER" ); + myConnection->setClient( myClient ); + // do test once the event loop is running + QTimer::singleShot( 0, this, SLOT( slotDoTest() ) ); + connected = false; +} + +LoginTest::~LoginTest() +{ + delete myTestObject; + delete myConnector; + delete myClient; +} + +void LoginTest::slotDoTest() +{ + QString server = QString::fromLatin1("login.oscar.aol.com"); + // connect to server + qDebug( "connecting to server "); + + myClient->setIsIcq( true ); + myClient->start( server, 5190, "userid", "password" ); + myClient->connectToServer( myConnection, server, true ); + QTimer::singleShot( 10000, this, SLOT(runAddGroupTest() ) ); + connected = true; +} + +void LoginTest::slotConnected() +{ + qDebug( "connection is up"); + connected = true; +} + +int main(int argc, char ** argv) +{ + LoginTest a( argc, argv ); + a.exec(); + if ( !a.isConnected() ) + return 0; +} + +void LoginTest::runAddGroupTest() +{ + qDebug( "running ssi group add test" ); + QString group = QString::fromLatin1( "dummygroup" ); + myClient->addGroup( group ); + QTimer::singleShot( 5000, this, SLOT( runDelGroupTest() ) ); +} + +void LoginTest::runDelGroupTest() +{ + qDebug( "running ssi group del test" ); + QString group = QString::fromLatin1( "dummygroup" ); + myClient->removeGroup( group ); +} + + +#include "ssigrouptest.moc" |