OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / tests / manual / ssh / remoteprocess / remoteprocesstest.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef SFTPTEST_H
34 #define SFTPTEST_H
35
36 #include <utils/ssh/sshremoteprocessrunner.h>
37
38 QT_FORWARD_DECLARE_CLASS(QTimer);
39 #include <QtCore/QObject>
40
41 class RemoteProcessTest : public QObject
42 {
43     Q_OBJECT
44 public:
45     RemoteProcessTest(const Utils::SshConnectionParameters &params);
46     ~RemoteProcessTest();
47     void run();
48
49 private slots:
50     void handleConnectionError();
51     void handleProcessStarted();
52     void handleProcessStdout(const QByteArray &output);
53     void handleProcessStderr(const QByteArray &output);
54     void handleProcessClosed(int exitStatus);
55     void handleTimeout();
56
57 private:
58     enum State { Inactive, TestingSuccess, TestingFailure, TestingCrash };
59
60     QTimer * const m_timeoutTimer;
61     const Utils::SshRemoteProcessRunner::Ptr m_remoteRunner;
62     QByteArray m_remoteStdout;
63     QByteArray m_remoteStderr;
64     State m_state;
65     bool m_started;
66 };
67
68
69 #endif // SFTPTEST_H