mirror of https://github.com/apache/jclouds.git
formatting
This commit is contained in:
parent
557445db57
commit
90037fb656
|
@ -44,39 +44,39 @@ public class NodePredicatesTest {
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
node = createMock(NodeMetadata.class);
|
node = createMock(NodeMetadata.class);
|
||||||
computeService = createMock(ComputeService.class);
|
computeService = createMock(ComputeService.class);
|
||||||
|
|
||||||
expect(node.getId()).andReturn("myid").anyTimes();
|
expect(node.getId()).andReturn("myid").anyTimes();
|
||||||
expect(computeService.getNodeMetadata("myid")).andReturn(node).anyTimes();
|
expect(computeService.getNodeMetadata("myid")).andReturn(node).anyTimes();
|
||||||
expect(node.getLocation()).andReturn(null).anyTimes();
|
expect(node.getLocation()).andReturn(null).anyTimes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNodeRunningReturnsTrueWhenRunning() {
|
public void testNodeRunningReturnsTrueWhenRunning() {
|
||||||
expect(node.getState()).andReturn(NodeState.RUNNING).atLeastOnce();
|
expect(node.getState()).andReturn(NodeState.RUNNING).atLeastOnce();
|
||||||
replay(node);
|
replay(node);
|
||||||
replay(computeService);
|
replay(computeService);
|
||||||
|
|
||||||
NodeRunning nodeRunning = new NodeRunning(computeService);
|
NodeRunning nodeRunning = new NodeRunning(computeService);
|
||||||
Assert.assertTrue(nodeRunning.apply(node));
|
Assert.assertTrue(nodeRunning.apply(node));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions=IllegalStateException.class)
|
@Test(expectedExceptions = IllegalStateException.class)
|
||||||
public void testNodeRunningFailsOnTerminated() {
|
public void testNodeRunningFailsOnTerminated() {
|
||||||
expect(node.getState()).andReturn(NodeState.TERMINATED).atLeastOnce();
|
expect(node.getState()).andReturn(NodeState.TERMINATED).atLeastOnce();
|
||||||
replay(node);
|
replay(node);
|
||||||
replay(computeService);
|
replay(computeService);
|
||||||
|
|
||||||
NodeRunning nodeRunning = new NodeRunning(computeService);
|
|
||||||
nodeRunning.apply(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expectedExceptions=IllegalStateException.class)
|
|
||||||
public void testNodeRunningFailsOnError() {
|
|
||||||
expect(node.getState()).andReturn(NodeState.ERROR).atLeastOnce();
|
|
||||||
replay(node);
|
|
||||||
replay(computeService);
|
|
||||||
|
|
||||||
NodeRunning nodeRunning = new NodeRunning(computeService);
|
NodeRunning nodeRunning = new NodeRunning(computeService);
|
||||||
nodeRunning.apply(node);
|
nodeRunning.apply(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(expectedExceptions = IllegalStateException.class)
|
||||||
|
public void testNodeRunningFailsOnError() {
|
||||||
|
expect(node.getState()).andReturn(NodeState.ERROR).atLeastOnce();
|
||||||
|
replay(node);
|
||||||
|
replay(computeService);
|
||||||
|
|
||||||
|
NodeRunning nodeRunning = new NodeRunning(computeService);
|
||||||
|
nodeRunning.apply(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue