Search in sources :

Example 1 with MockSSHCommandExecutor

use of org.apache.hive.ptest.execution.MockSSHCommandExecutor in project hive by apache.

the class TestCloudExecutionContextProvider method setup.

@Before
public void setup() throws Exception {
    dataDir = baseDir.newFolder().getAbsolutePath();
    workingDir = baseDir.newFolder().getAbsolutePath();
    cloudComputeService = mock(CloudComputeService.class);
    sshCommandExecutor = new MockSSHCommandExecutor(LOG);
    node1 = mock(NodeMetadata.class);
    node2 = mock(NodeMetadata.class);
    node3 = mock(NodeMetadata.class);
    template = mock(Template.class);
    when(template.getLocation()).thenReturn(mock(Location.class));
    when(template.getImage()).thenReturn(mock(Image.class));
    when(template.getHardware()).thenReturn(mock(Hardware.class));
    when(node1.getHostname()).thenReturn("node1");
    when(node1.getPublicAddresses()).thenReturn(Collections.singleton("1.1.1.1"));
    when(node2.getHostname()).thenReturn("node2");
    when(node2.getPublicAddresses()).thenReturn(Collections.singleton("1.1.1.2"));
    when(node3.getHostname()).thenReturn("node3");
    when(node3.getPublicAddresses()).thenReturn(Collections.singleton("1.1.1.3"));
    runNodesException = new RunNodesException("", 2, template, Collections.singleton(node1), Collections.<String, Exception>emptyMap(), Collections.singletonMap(node2, new Exception("For testing")));
}
Also used : NodeMetadata(org.jclouds.compute.domain.NodeMetadata) MockSSHCommandExecutor(org.apache.hive.ptest.execution.MockSSHCommandExecutor) RunNodesException(org.jclouds.compute.RunNodesException) Hardware(org.jclouds.compute.domain.Hardware) Image(org.jclouds.compute.domain.Image) RunNodesException(org.jclouds.compute.RunNodesException) Template(org.jclouds.compute.domain.Template) Location(org.jclouds.domain.Location) Before(org.junit.Before)

Aggregations

MockSSHCommandExecutor (org.apache.hive.ptest.execution.MockSSHCommandExecutor)1 RunNodesException (org.jclouds.compute.RunNodesException)1 Hardware (org.jclouds.compute.domain.Hardware)1 Image (org.jclouds.compute.domain.Image)1 NodeMetadata (org.jclouds.compute.domain.NodeMetadata)1 Template (org.jclouds.compute.domain.Template)1 Location (org.jclouds.domain.Location)1 Before (org.junit.Before)1