use of com.oracle.bedrock.runtime.remote.Password in project oracle-bedrock by coherence-community.
the class DockerMachinePlatform method getRemotePlatform.
/**
* Obtain a {@link RemotePlatform} on the Docker machine instance.
*
* @param options the {@link Option}s
*
* @return a {@link RemotePlatform} on the Docker machine instance
*/
public RemotePlatform getRemotePlatform(Option... options) {
String name = getName();
InetAddress address = machine.getAddress(name);
OptionsByType platformOptions = OptionsByType.of(this.getOptions()).add(StrictHostChecking.disabled()).addAll(options);
return new RemotePlatform(name, address, "docker", new Password("tcuser"), platformOptions.asArray());
}
use of com.oracle.bedrock.runtime.remote.Password in project oracle-bedrock by coherence-community.
the class WindowsRemoteTerminalTest method shouldMakeDirectories.
@Test
public void shouldMakeDirectories() throws Exception {
String userName = "Bob";
Authentication authentication = new Password("secret");
String hostName = "foo.com";
int port = 1234;
OptionsByType optionsByType = OptionsByType.empty();
WindowsSession session = mock(WindowsSession.class);
RemotePlatform platform = mock(RemotePlatform.class);
when(platform.getUserName()).thenReturn(userName);
when(platform.getAuthentication()).thenReturn(authentication);
when(platform.getAddress()).thenReturn(InetAddress.getByName(hostName));
when(platform.getPort()).thenReturn(port);
WindowsRemoteTerminal shell = new WindowsRemoteTerminalStub(platform, session);
shell.makeDirectories("dir1\\dir2", optionsByType);
InOrder inOrder = inOrder(session);
inOrder.verify(session).connect();
inOrder.verify(session).execute(eq("mkdir"), eq(Arrays.asList("dir1\\dir2")), any(InputStream.class), any(OutputStream.class), any(OutputStream.class));
}
use of com.oracle.bedrock.runtime.remote.Password in project oracle-bedrock by coherence-community.
the class WindowsRemoteTerminalTest method shouldCreateWindowsSession.
@Test
public void shouldCreateWindowsSession() throws Exception {
String userName = "Bob";
HttpBasedAuthentication authentication = new Password("secret");
String hostName = "foo.com";
int port = 1234;
RemotePlatform platform = mock(RemotePlatform.class);
when(platform.getUserName()).thenReturn(userName);
when(platform.getAuthentication()).thenReturn(authentication);
when(platform.getAddress()).thenReturn(InetAddress.getByName(hostName));
when(platform.getPort()).thenReturn(port);
WindowsRemoteTerminal shell = new WindowsRemoteTerminal(platform);
WindowsSession session = shell.createSession();
assertThat(session, is(notNullValue()));
SoapConnection soapConnection = session.getSoapConnection();
assertThat(soapConnection.getUrl().getHost(), is("foo.com"));
assertThat(soapConnection.getUrl().getPort(), is(1234));
assertThat(soapConnection.getUserName(), is("Bob"));
assertThat(soapConnection.getAuthentication(), is(sameInstance(authentication)));
}
Aggregations