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

COVERAGE SUMMARY FOR SOURCE FILE [VCloudComputeServiceContextModule.java]

nameclass, %method, %block, %line, %
VCloudComputeServiceContextModule.java100% (12/12)94%  (15/16)97%  (169/175)95%  (19/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VCloudComputeServiceContextModule100% (1/1)80%  (4/5)94%  (103/109)93%  (14/15)
provideTemplate (Injector, TemplateBuilder): TemplateBuilder 0%   (0/1)0%   (0/6)0%   (0/1)
VCloudComputeServiceContextModule (): void 100% (1/1)100% (3/3)100% (1/1)
configure (): void 100% (1/1)100% (92/92)100% (11/11)
defineComputeStrategyModule (): BindComputeStrategiesByClass 100% (1/1)100% (4/4)100% (1/1)
defineComputeSupplierModule (): BindComputeSuppliersByClass 100% (1/1)100% (4/4)100% (1/1)
     
class VCloudComputeServiceContextModule$1100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$1 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$10100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$10 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$11100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$11 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$2100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$2 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$3100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$3 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$4100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$4 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$5100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$5 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$6100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$6 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$7100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$7 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$8100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$8 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/1)
     
class VCloudComputeServiceContextModule$9100% (1/1)100% (1/1)100% (6/6)100% (1/1)
VCloudComputeServiceContextModule$9 (VCloudComputeServiceContextModule): void 100% (1/1)100% (6/6)100% (1/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 
21 
22import static org.jclouds.compute.domain.OsFamily.UBUNTU;
23 
24import org.jclouds.compute.ComputeServiceContext;
25import org.jclouds.compute.config.BindComputeStrategiesByClass;
26import org.jclouds.compute.config.BindComputeSuppliersByClass;
27import org.jclouds.compute.domain.Hardware;
28import org.jclouds.compute.domain.Image;
29import org.jclouds.compute.domain.NodeMetadata;
30import org.jclouds.compute.domain.TemplateBuilder;
31import org.jclouds.compute.internal.ComputeServiceContextImpl;
32import org.jclouds.compute.options.TemplateOptions;
33import org.jclouds.compute.strategy.PopulateDefaultLoginCredentialsForImageStrategy;
34import org.jclouds.rest.RestContext;
35import org.jclouds.rest.internal.RestContextImpl;
36import org.jclouds.vcloud.VCloudClient;
37import org.jclouds.vcloud.compute.functions.HardwareForVApp;
38import org.jclouds.vcloud.compute.functions.HardwareInOrg;
39import org.jclouds.vcloud.compute.functions.ImagesInOrg;
40import org.jclouds.vcloud.compute.functions.VAppToNodeMetadata;
41import org.jclouds.vcloud.compute.internal.VCloudTemplateBuilderImpl;
42import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
43import org.jclouds.vcloud.compute.strategy.GetLoginCredentialsFromGuestConfiguration;
44import org.jclouds.vcloud.domain.Org;
45import org.jclouds.vcloud.domain.VApp;
46 
47import com.google.common.base.Function;
48import com.google.inject.Injector;
49import com.google.inject.Scopes;
50import com.google.inject.TypeLiteral;
51 
52/**
53 * Configures the {@link VCloudComputeServiceContext}; requires {@link VCloudComputeClientImpl}
54 * bound.
55 * 
56 * @author Adrian Cole
57 */
58public class VCloudComputeServiceContextModule extends CommonVCloudComputeServiceContextModule {
59 
60   @Override
61   protected void configure() {
62      super.configure();
63      bind(new TypeLiteral<Function<VApp, NodeMetadata>>() {
64      }).to(VAppToNodeMetadata.class);
65      bind(TemplateOptions.class).to(VCloudTemplateOptions.class);
66      bind(TemplateBuilder.class).to(VCloudTemplateBuilderImpl.class);
67      bind(new TypeLiteral<Function<VApp, Hardware>>() {
68      }).to(new TypeLiteral<HardwareForVApp>() {
69      });
70      bind(new TypeLiteral<ComputeServiceContext>() {
71      }).to(new TypeLiteral<ComputeServiceContextImpl<VCloudClient, VCloudClient>>() {
72      }).in(Scopes.SINGLETON);
73      bind(new TypeLiteral<RestContext<VCloudClient, VCloudClient>>() {
74      }).to(new TypeLiteral<RestContextImpl<VCloudClient, VCloudClient>>() {
75      }).in(Scopes.SINGLETON);
76      bind(new TypeLiteral<Function<Org, Iterable<? extends Image>>>() {
77      }).to(new TypeLiteral<ImagesInOrg>() {
78      });
79      bind(new TypeLiteral<Function<Org, Iterable<? extends Hardware>>>() {
80      }).to(new TypeLiteral<HardwareInOrg>() {
81      });
82      bind(PopulateDefaultLoginCredentialsForImageStrategy.class).to(GetLoginCredentialsFromGuestConfiguration.class);
83   }
84   
85   //CIM ostype does not include version info
86   @Override
87   protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
88      return template.osFamily(UBUNTU).os64Bit(true);
89   }
90   
91   @Override
92   public BindComputeStrategiesByClass defineComputeStrategyModule() {
93      return new VCloudBindComputeStrategiesByClass();
94   }
95 
96   @Override
97   public BindComputeSuppliersByClass defineComputeSupplierModule() {
98      return new VCloudBindComputeSuppliersByClass();
99   }
100}

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