EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.vcloud.compute.config]

COVERAGE SUMMARY FOR SOURCE FILE [CommonVCloudComputeServiceContextModule.java]

nameclass, %method, %block, %line, %
CommonVCloudComputeServiceContextModule.java0%   (0/1)0%   (0/4)0%   (0/56)0%   (0/7)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CommonVCloudComputeServiceContextModule0%   (0/1)0%   (0/4)0%   (0/56)0%   (0/7)
<static initializer> 0%   (0/1)0%   (0/40)0%   (0/1)
CommonVCloudComputeServiceContextModule (): void 0%   (0/1)0%   (0/3)0%   (0/1)
configure (): void 0%   (0/1)0%   (0/11)0%   (0/4)
provideVAppStatusToNodeState (): Map 0%   (0/1)0%   (0/2)0%   (0/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.vcloud.compute.config;
20 
21import java.util.Map;
22 
23import javax.inject.Singleton;
24 
25import org.jclouds.compute.config.BaseComputeServiceContextModule;
26import org.jclouds.compute.config.BindComputeStrategiesByClass;
27import org.jclouds.compute.config.BindComputeSuppliersByClass;
28import org.jclouds.compute.domain.NodeState;
29import org.jclouds.vcloud.domain.Status;
30 
31import com.google.common.annotations.VisibleForTesting;
32import com.google.common.collect.ImmutableMap;
33import com.google.inject.Provides;
34 
35/**
36 * Configures the {@link VCloudComputeServiceContext}; requires {@link VCloudComputeClientImpl}
37 * bound.
38 * 
39 * @author Adrian Cole
40 */
41public abstract class CommonVCloudComputeServiceContextModule extends BaseComputeServiceContextModule {
42 
43   @VisibleForTesting
44   public static final Map<Status, NodeState> VAPPSTATUS_TO_NODESTATE = ImmutableMap.<Status, NodeState> builder()
45         .put(Status.OFF, NodeState.SUSPENDED).put(Status.ON, NodeState.RUNNING)
46         .put(Status.RESOLVED, NodeState.PENDING).put(Status.ERROR, NodeState.ERROR)
47         .put(Status.UNRECOGNIZED, NodeState.UNRECOGNIZED).put(Status.DEPLOYED, NodeState.PENDING)
48         .put(Status.INCONSISTENT, NodeState.PENDING).put(Status.UNKNOWN, NodeState.UNRECOGNIZED)
49         .put(Status.MIXED, NodeState.PENDING).put(Status.WAITING_FOR_INPUT, NodeState.PENDING)
50         .put(Status.SUSPENDED, NodeState.SUSPENDED).put(Status.UNRESOLVED, NodeState.PENDING).build();
51 
52   @Singleton
53   @Provides
54   protected Map<Status, NodeState> provideVAppStatusToNodeState() {
55      return VAPPSTATUS_TO_NODESTATE;
56   }
57 
58   @Override
59   protected void configure() {
60      super.configure();
61      install(defineComputeStrategyModule());
62      install(defineComputeSupplierModule());
63   }
64 
65   public abstract BindComputeStrategiesByClass defineComputeStrategyModule();
66 
67   public abstract BindComputeSuppliersByClass defineComputeSupplierModule();
68 
69}

[all classes][org.jclouds.vcloud.compute.config]
EMMA 2.0.5312 (C) Vladimir Roubtsov