EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.byon]

COVERAGE SUMMARY FOR SOURCE FILE [BYONComputeServiceContextBuilder.java]

nameclass, %method, %block, %line, %
BYONComputeServiceContextBuilder.java100% (2/2)100% (6/6)100% (44/44)100% (11/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BYONComputeServiceContextBuilder100% (1/1)100% (4/4)100% (33/33)100% (10/10)
BYONComputeServiceContextBuilder (Properties): void 100% (1/1)100% (5/5)100% (2/2)
addContextModule (List): void 100% (1/1)100% (10/10)100% (3/3)
addNodeStoreModule (List): void 100% (1/1)100% (7/7)100% (2/2)
addNodeStoreModuleIfNotPresent (List): void 100% (1/1)100% (11/11)100% (3/3)
     
class BYONComputeServiceContextBuilder$1100% (1/1)100% (2/2)100% (11/11)100% (2/2)
BYONComputeServiceContextBuilder$1 (BYONComputeServiceContextBuilder): void 100% (1/1)100% (6/6)100% (1/1)
apply (Module): boolean 100% (1/1)100% (5/5)100% (1/1)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  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,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.byon;
20 
21import java.util.List;
22import java.util.Properties;
23 
24import org.jclouds.byon.config.BYONComputeServiceContextModule;
25import org.jclouds.byon.config.ConfiguresNodeStore;
26import org.jclouds.byon.config.YamlNodeStoreModule;
27import org.jclouds.compute.StandaloneComputeServiceContextBuilder;
28 
29import com.google.common.base.Predicate;
30import com.google.common.base.Supplier;
31import com.google.common.collect.Iterables;
32import com.google.inject.Module;
33 
34/**
35 * 
36 * @author Adrian Cole
37 */
38@SuppressWarnings("rawtypes")
39public class BYONComputeServiceContextBuilder extends StandaloneComputeServiceContextBuilder<Supplier> {
40 
41   public BYONComputeServiceContextBuilder(Properties props) {
42      super(Supplier.class, props);
43   }
44 
45   @Override
46   protected void addContextModule(List<Module> modules) {
47      modules.add(new BYONComputeServiceContextModule());
48      addNodeStoreModuleIfNotPresent(modules);
49   }
50 
51   protected void addNodeStoreModuleIfNotPresent(List<Module> modules) {
52      if (!Iterables.any(modules, new Predicate<Module>() {
53         public boolean apply(Module input) {
54            return input.getClass().isAnnotationPresent(ConfiguresNodeStore.class);
55         }
56 
57      })) {
58         addNodeStoreModule(modules);
59      }
60   }
61 
62   protected void addNodeStoreModule(List<Module> modules) {
63      modules.add(new YamlNodeStoreModule());
64   }
65}

[all classes][org.jclouds.byon]
EMMA 2.0.5312 (C) Vladimir Roubtsov