Author: abayer
Date: Fri Aug 24 17:54:18 2012
New Revision: 1377009
URL: http://svn.apache.org/viewvc?rev=1377009&view=rev
Log:
WHIRR-641. Missing unit test changes
Modified:
whirr/trunk/core/src/test/java/org/apache/whirr/actions/BootstrapClusterActionTest.java
Modified:
whirr/trunk/core/src/test/java/org/apache/whirr/actions/BootstrapClusterActionTest.java
URL:
http://svn.apache.org/viewvc/whirr/trunk/core/src/test/java/org/apache/whirr/actions/BootstrapClusterActionTest.java?rev=1377009&r1=1377008&r2=1377009&view=diff
==============================================================================
---
whirr/trunk/core/src/test/java/org/apache/whirr/actions/BootstrapClusterActionTest.java
(original)
+++
whirr/trunk/core/src/test/java/org/apache/whirr/actions/BootstrapClusterActionTest.java
Fri Aug 24 17:54:18 2012
@@ -119,7 +119,8 @@ public class BootstrapClusterActionTest
ComputeService computeService = mock(ComputeService.class);
TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
Template template = mock(Template.class);
-
+ TemplateOptions templateOptions = mock(TemplateOptions.class);
+
when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
when(serviceContext.getComputeService()).thenReturn(computeService);
when(computeService.getContext()).thenReturn(serviceContext);
@@ -128,6 +129,7 @@ public class BootstrapClusterActionTest
when(templateBuilder.from((TemplateBuilderSpec)
any())).thenReturn(templateBuilder);
when(templateBuilder.options((TemplateOptions)
any())).thenReturn(templateBuilder);
when(templateBuilder.build()).thenReturn(template);
+ when(template.getOptions()).thenReturn(templateOptions);
// here is a scenario when jt+nn fails once, then the retry is successful
// and from the dn+tt one node fails, then the retry is successful
@@ -189,6 +191,7 @@ public class BootstrapClusterActionTest
ComputeService computeService = mock(ComputeService.class);
TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
Template template = mock(Template.class);
+ TemplateOptions templateOptions = mock(TemplateOptions.class);
when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
when(serviceContext.getComputeService()).thenReturn(computeService);
@@ -198,6 +201,7 @@ public class BootstrapClusterActionTest
when(templateBuilder.from((TemplateBuilderSpec)
any())).thenReturn(templateBuilder);
when(templateBuilder.options((TemplateOptions)
any())).thenReturn(templateBuilder);
when(templateBuilder.build()).thenReturn(template);
+ when(template.getOptions()).thenReturn(templateOptions);
// here is a scenario when jt+nn does not fail
// but the dn+tt one node fails 3, then in the retry fails 2
@@ -367,6 +371,7 @@ public class BootstrapClusterActionTest
ComputeService computeService = mock(ComputeService.class);
TemplateBuilder templateBuilder = mock(TemplateBuilder.class);
Template template = mock(Template.class);
+ TemplateOptions templateOptions = mock(TemplateOptions.class);
when(getCompute.apply(clusterSpec)).thenReturn(serviceContext);
when(serviceContext.getComputeService()).thenReturn(computeService);
@@ -376,6 +381,7 @@ public class BootstrapClusterActionTest
when(templateBuilder.from((TemplateBuilderSpec)
any())).thenReturn(templateBuilder);
when(templateBuilder.options((TemplateOptions)
any())).thenReturn(templateBuilder);
when(templateBuilder.build()).thenReturn(template);
+ when(template.getOptions()).thenReturn(templateOptions);
Map<Set<String>, Stack<Integer>> reaction = Maps.newHashMap();
Stack<Integer> nnStack = new Stack<Integer>();