File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed
main/java/com/googlesource/gerrit/plugins/qtcodereview
test/java/com/googlesource/gerrit/plugins/qtcodereview Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // Copyright (C) 2018 The Qt Company
3
+ //
4
+
5
+ package com .googlesource .gerrit .plugins .qtcodereview ;
6
+
7
+ import com .google .gerrit .sshd .SshCommand ;
8
+ import com .google .gerrit .sshd .CommandMetaData ;
9
+
10
+ @ CommandMetaData (name ="ping" , description ="Ping the SSH Command interface" )
11
+ class QtCommandPing extends SshCommand {
12
+ @ Override
13
+ protected void run () {
14
+ stdout .print (String .format ("Pong\n username=%s\n name=%s\n email=%s\n " ,
15
+ user .asIdentifiedUser ().getUserName (),
16
+ user .asIdentifiedUser ().getName (),
17
+ user .asIdentifiedUser ().getNameEmail ()));
18
+ }
19
+ }
20
+
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ class QtSshModule extends PluginCommandModule {
10
10
11
11
@ Override
12
12
protected void configureCommands () {
13
-
13
+ command ( QtCommandPing . class );
14
14
}
15
15
}
Original file line number Diff line number Diff line change 8
8
import com .google .gerrit .acceptance .PushOneCommit ;
9
9
import com .google .gerrit .acceptance .RestResponse ;
10
10
import com .google .gerrit .acceptance .TestPlugin ;
11
-
11
+ import com . google . gerrit . acceptance . UseSsh ;
12
12
import com .google .gerrit .reviewdb .client .Change ;
13
13
14
14
import org .eclipse .jgit .revwalk .RevCommit ;
22
22
sshModule = "com.googlesource.gerrit.plugins.qtcodereview.QtSshModule"
23
23
)
24
24
25
+ @ UseSsh
25
26
public class QtCodeReviewIT extends LightweightPluginDaemonTest {
26
27
27
28
protected static final String R_HEADS = "refs/heads/" ;
28
29
protected static final String R_STAGING = "refs/staging/" ;
29
30
protected static final String R_PUSH = "refs/for/" ;
30
31
31
32
@ Test
32
- public void dummyTest () {
33
-
33
+ public void pingSSHTest () throws Exception {
34
+ assertThat (adminSshSession .exec ("gerrit-plugin-qt-workflow ping" )).contains ("Pong" );
35
+ assertThat (adminSshSession .getError ()).isNull ();
34
36
}
35
37
36
38
You can’t perform that action at this time.
0 commit comments