diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2012-05-18 10:49:35 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2012-05-22 10:51:53 +0200 |
commit | 53a1087d1321758ab1dc0a6ad737c135249bd5e6 (patch) | |
tree | ab0f9596da64a1907690b324bd05416c585eaf8c /tests/manual/ssh/remoteprocess | |
parent | b9d9bb7ba85e3b3ea0e06f0876272c0e3bebd144 (diff) | |
download | qt-creator-53a1087d1321758ab1dc0a6ad737c135249bd5e6.tar.gz |
Move SSH support into a dedicated library.
It does not belong into libUtils, which is a collection of small
unrelated utility classes.
Task-number: QTCREATORBUG-7218
Change-Id: Id92b9f28678afec93e6f07166adfde6550f38072
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'tests/manual/ssh/remoteprocess')
5 files changed, 22 insertions, 23 deletions
diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.cpp b/tests/manual/ssh/remoteprocess/argumentscollector.cpp index 64cc0ef883..b5acea9968 100644 --- a/tests/manual/ssh/remoteprocess/argumentscollector.cpp +++ b/tests/manual/ssh/remoteprocess/argumentscollector.cpp @@ -36,15 +36,16 @@ #include <iostream> +using namespace QSsh; + using namespace std; -using namespace Utils; ArgumentsCollector::ArgumentsCollector(const QStringList &args) : m_arguments(args) { } -Utils::SshConnectionParameters ArgumentsCollector::collect(bool &success) const +QSsh::SshConnectionParameters ArgumentsCollector::collect(bool &success) const { SshConnectionParameters parameters; try { diff --git a/tests/manual/ssh/remoteprocess/argumentscollector.h b/tests/manual/ssh/remoteprocess/argumentscollector.h index e2dc69e0b3..d7189597f1 100644 --- a/tests/manual/ssh/remoteprocess/argumentscollector.h +++ b/tests/manual/ssh/remoteprocess/argumentscollector.h @@ -33,7 +33,7 @@ #ifndef ARGUMENTSCOLLECTOR_H #define ARGUMENTSCOLLECTOR_H -#include <utils/ssh/sshconnection.h> +#include <ssh/sshconnection.h> #include <QStringList> @@ -41,7 +41,7 @@ class ArgumentsCollector { public: ArgumentsCollector(const QStringList &args); - Utils::SshConnectionParameters collect(bool &success) const; + QSsh::SshConnectionParameters collect(bool &success) const; private: struct ArgumentErrorException { @@ -54,7 +54,7 @@ private: bool checkAndSetIntArg(int &pos, int &val, bool &alreadyGiven, const char *opt) const; bool checkForNoProxy(int &pos, - Utils::SshConnectionParameters::ProxyType &type, + QSsh::SshConnectionParameters::ProxyType &type, bool &alreadyGiven) const; const QStringList m_arguments; diff --git a/tests/manual/ssh/remoteprocess/main.cpp b/tests/manual/ssh/remoteprocess/main.cpp index 01203bd2d0..0fac815a29 100644 --- a/tests/manual/ssh/remoteprocess/main.cpp +++ b/tests/manual/ssh/remoteprocess/main.cpp @@ -33,7 +33,7 @@ #include "argumentscollector.h" #include "remoteprocesstest.h" -#include <utils/ssh/sshconnection.h> +#include <ssh/sshconnection.h> #include <QCoreApplication> #include <QObject> @@ -42,13 +42,11 @@ #include <cstdlib> #include <iostream> -using namespace Utils; - int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); bool parseSuccess; - const Utils::SshConnectionParameters ¶meters + const QSsh::SshConnectionParameters ¶meters = ArgumentsCollector(app.arguments()).collect(parseSuccess); if (!parseSuccess) return EXIT_FAILURE; diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp b/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp index 47eaaee77b..2f0557491a 100644 --- a/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp +++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp @@ -32,7 +32,7 @@ #include "remoteprocesstest.h" -#include <utils/ssh/sshpseudoterminal.h> +#include <ssh/sshpseudoterminal.h> #include <QCoreApplication> #include <QTextStream> @@ -40,7 +40,7 @@ #include <iostream> -using namespace Utils; +using namespace QSsh; const QByteArray StderrOutput("ChannelTest"); @@ -93,8 +93,8 @@ void RemoteProcessTest::handleProcessStarted() } else { m_started = true; if (m_state == TestingCrash) { - Utils::SshRemoteProcessRunner * const killer - = new Utils::SshRemoteProcessRunner(this); + QSsh::SshRemoteProcessRunner * const killer + = new QSsh::SshRemoteProcessRunner(this); killer->run("pkill -9 sleep", m_sshParams); } else if (m_state == TestingIoDevice) { connect(m_catProcess.data(), SIGNAL(readyRead()), SLOT(handleReadyRead())); @@ -214,9 +214,9 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus) } std::cout << "Ok.\nTesting I/O device functionality... " << std::flush; m_state = TestingIoDevice; - m_sshConnection = Utils::SshConnection::create(m_sshParams); + m_sshConnection = QSsh::SshConnection::create(m_sshParams); connect(m_sshConnection.data(), SIGNAL(connected()), SLOT(handleConnected())); - connect(m_sshConnection.data(), SIGNAL(error(Utils::SshError)), + connect(m_sshConnection.data(), SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError())); m_sshConnection->connectToHost(); m_timeoutTimer->start(); @@ -308,7 +308,7 @@ void RemoteProcessTest::handleReadyRead() << qPrintable(testString()) << "', got '" << qPrintable(data) << "'." << std::endl; qApp->exit(1); } - Utils::SshRemoteProcessRunner * const killer = new Utils::SshRemoteProcessRunner(this); + QSsh::SshRemoteProcessRunner * const killer = new QSsh::SshRemoteProcessRunner(this); killer->run("pkill -9 cat", m_sshParams); break; } diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.h b/tests/manual/ssh/remoteprocess/remoteprocesstest.h index e203eaea63..0eb59ab0f6 100644 --- a/tests/manual/ssh/remoteprocess/remoteprocesstest.h +++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.h @@ -33,7 +33,7 @@ #ifndef REMOTEPROCESSTEST_H #define REMOTEPROCESSTEST_H -#include <utils/ssh/sshremoteprocessrunner.h> +#include <ssh/sshremoteprocessrunner.h> #include <QObject> @@ -44,7 +44,7 @@ class RemoteProcessTest : public QObject { Q_OBJECT public: - RemoteProcessTest(const Utils::SshConnectionParameters ¶ms); + RemoteProcessTest(const QSsh::SshConnectionParameters ¶ms); ~RemoteProcessTest(); void run(); @@ -70,13 +70,13 @@ private: void handleSuccessfulCrashTest(); void handleSuccessfulIoTest(); - const Utils::SshConnectionParameters m_sshParams; + const QSsh::SshConnectionParameters m_sshParams; QTimer * const m_timeoutTimer; QTextStream *m_textStream; - Utils::SshRemoteProcessRunner * const m_remoteRunner; - Utils::SshRemoteProcess::Ptr m_catProcess; - Utils::SshRemoteProcess::Ptr m_echoProcess; - Utils::SshConnection::Ptr m_sshConnection; + QSsh::SshRemoteProcessRunner * const m_remoteRunner; + QSsh::SshRemoteProcess::Ptr m_catProcess; + QSsh::SshRemoteProcess::Ptr m_echoProcess; + QSsh::SshConnection::Ptr m_sshConnection; QByteArray m_remoteStdout; QByteArray m_remoteStderr; QByteArray m_remoteData; |