mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 14:12:11 +00:00
bug4811: renamed SshShellCommandChannel
This commit is contained in:
1 parent
d3024b1cb0
commit
7188c98f88
6 files changed
+12
-17
No files matched your search
-5
@@ -16,7 +16,6 @@ import com.sap.sailing.selenium.api.event.SecurityApi.User;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
|
||||
public class SecurityApiTest extends AbstractSeleniumTest {
|
||||
|
||||
private static final String USERNAME = "max";
|
||||
private static final String USERNAME_FULL = "Max Mustermann";
|
||||
|
||||
@@ -30,12 +29,9 @@ public class SecurityApiTest extends AbstractSeleniumTest {
|
||||
@Test
|
||||
public void testCreateAndGetUser() {
|
||||
final ApiContext adminCtx = createAdminApiContext(getContextRoot(), SECURITY_CONTEXT);
|
||||
|
||||
final AccessToken createUserResponse = securityApi.createUser(adminCtx, "max", USERNAME_FULL, null, "start123");
|
||||
|
||||
assertEquals("Responded username of createUser is different!", USERNAME, createUserResponse.getUsername());
|
||||
assertNotNull("Token is missing in reponse!", createUserResponse.getAccessToken());
|
||||
|
||||
User getUserResponse = securityApi.getUser(adminCtx, USERNAME);
|
||||
assertEquals("Responded username of getUser is different!", USERNAME, getUserResponse.getUsername());
|
||||
}
|
||||
@@ -43,7 +39,6 @@ public class SecurityApiTest extends AbstractSeleniumTest {
|
||||
@Test
|
||||
public void testSayHello() {
|
||||
final ApiContext adminCtx = createAdminApiContext(getContextRoot(), SECURITY_CONTEXT);
|
||||
|
||||
final Hello hello = securityApi.sayHello(adminCtx);
|
||||
assertEquals("Responded principal of hello is different!", "admin", hello.getPrincipal());
|
||||
assertEquals("Responded authenticated of hello is different!", true, hello.isAuthenticated());
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ public class ConnectivityTest {
|
||||
InetAddress address = host.getPublicAddress(Duration.ONE_SECOND.times(20));
|
||||
assertNotNull(address);
|
||||
logger.info("Obtained public IP address "+address);
|
||||
SshShellCommandChannel shellChannel = null;
|
||||
SshCommandChannel shellChannel = null;
|
||||
int sshConnectAttempts = 20;
|
||||
while (shellChannel == null && sshConnectAttempts-- > 0) {
|
||||
try {
|
||||
|
||||
@@ -20,14 +20,14 @@ public interface AwsInstance extends Host {
|
||||
* commands to sent to the server, and a {@link PipedInputStream} wrapped around a {@link PipedOutputStream} which
|
||||
* you set to the channel.
|
||||
*/
|
||||
SshShellCommandChannel createSshChannel(String sshUserName) throws JSchException, IOException, InterruptedException;
|
||||
SshCommandChannel createSshChannel(String sshUserName) throws JSchException, IOException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Connects to an SSH session for the "root" user with a "shell" channel
|
||||
*
|
||||
* @see #createSshChannel(String)
|
||||
*/
|
||||
SshShellCommandChannel createRootSshChannel() throws JSchException, IOException, InterruptedException;
|
||||
SshCommandChannel createRootSshChannel() throws JSchException, IOException, InterruptedException;
|
||||
|
||||
ChannelSftp createSftpChannel(String sshUserName) throws JSchException, IOException;
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import com.jcraft.jsch.JSchException;
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public interface SshShellCommandChannel {
|
||||
public interface SshCommandChannel {
|
||||
/**
|
||||
* @param commandLine
|
||||
* the command without any trailing line separator
|
||||
+4
-4
@@ -24,7 +24,7 @@ import com.sap.sse.landscape.SecurityGroup;
|
||||
import com.sap.sse.landscape.aws.AwsAvailabilityZone;
|
||||
import com.sap.sse.landscape.aws.AwsInstance;
|
||||
import com.sap.sse.landscape.aws.AwsLandscape;
|
||||
import com.sap.sse.landscape.aws.SshShellCommandChannel;
|
||||
import com.sap.sse.landscape.aws.SshCommandChannel;
|
||||
import com.sap.sse.landscape.ssh.JCraftLogAdapter;
|
||||
import com.sap.sse.landscape.ssh.SSHKeyPair;
|
||||
import com.sap.sse.landscape.ssh.YesUserInfo;
|
||||
@@ -104,7 +104,7 @@ public class AwsInstanceImpl implements AwsInstance {
|
||||
* @see #createSshChannel(String)
|
||||
*/
|
||||
@Override
|
||||
public SshShellCommandChannel createRootSshChannel() throws JSchException, IOException, InterruptedException {
|
||||
public SshCommandChannel createRootSshChannel() throws JSchException, IOException, InterruptedException {
|
||||
return createSshChannel(ROOT_USER_NAME);
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ public class AwsInstanceImpl implements AwsInstance {
|
||||
* {@link PipedInputStream} wrapped around a {@link PipedOutputStream} which you set to the channel.
|
||||
*/
|
||||
@Override
|
||||
public SshShellCommandChannel createSshChannel(String sshUserName) throws JSchException, IOException, InterruptedException {
|
||||
return new SshShellCommandChannelImpl((ChannelExec) createSshChannelInternal(sshUserName, "exec"));
|
||||
public SshCommandChannel createSshChannel(String sshUserName) throws JSchException, IOException, InterruptedException {
|
||||
return new SshCommandChannelImpl((ChannelExec) createSshChannelInternal(sshUserName, "exec"));
|
||||
}
|
||||
|
||||
private Channel createSshChannelInternal(String sshUserName, String channelType) throws JSchException, IOException {
|
||||
|
||||
+4
-4
@@ -10,11 +10,11 @@ import com.jcraft.jsch.Channel;
|
||||
import com.jcraft.jsch.ChannelExec;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.Session;
|
||||
import com.sap.sse.landscape.aws.SshShellCommandChannel;
|
||||
import com.sap.sse.landscape.aws.SshCommandChannel;
|
||||
|
||||
|
||||
public class SshShellCommandChannelImpl implements SshShellCommandChannel {
|
||||
private static final Logger logger = Logger.getLogger(SshShellCommandChannelImpl.class.getName());
|
||||
public class SshCommandChannelImpl implements SshCommandChannel {
|
||||
private static final Logger logger = Logger.getLogger(SshCommandChannelImpl.class.getName());
|
||||
private final ChannelExec channel;
|
||||
private InputStream stdout;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class SshShellCommandChannelImpl implements SshShellCommandChannel {
|
||||
* the result of a {@link Session#openChannel(String)} call; the channel is assumed to not yet be
|
||||
* {@link Channel#connect() connected}
|
||||
*/
|
||||
public SshShellCommandChannelImpl(ChannelExec channel) throws IOException, JSchException, InterruptedException {
|
||||
public SshCommandChannelImpl(ChannelExec channel) throws IOException, JSchException, InterruptedException {
|
||||
this.channel = channel;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user