EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.compute]

COVERAGE SUMMARY FOR SOURCE FILE [StandaloneComputeServiceContextBuilder.java]

nameclass, %method, %block, %line, %
StandaloneComputeServiceContextBuilder.java100% (1/1)100% (2/2)72%  (51/71)79%  (11/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StandaloneComputeServiceContextBuilder100% (1/1)100% (2/2)72%  (51/71)79%  (11/14)
StandaloneComputeServiceContextBuilder (Class, Properties): void 100% (1/1)68%  (42/62)75%  (9/12)
addClientModule (List): void 100% (1/1)100% (9/9)100% (2/2)

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.compute;
20 
21import static org.jclouds.Constants.PROPERTY_API_VERSION;
22import static org.jclouds.Constants.PROPERTY_ENDPOINT;
23import static org.jclouds.Constants.PROPERTY_IDENTITY;
24 
25import java.util.List;
26import java.util.Properties;
27 
28import org.jclouds.PropertiesBuilder;
29import org.jclouds.compute.config.StandaloneComputeServiceClientModule;
30 
31import com.google.inject.Module;
32 
33/**
34 * 
35 * @author Adrian Cole
36 */
37public class StandaloneComputeServiceContextBuilder<D> extends ComputeServiceContextBuilder<D, D> {
38 
39   public StandaloneComputeServiceContextBuilder(Class<D> driverClass, Properties props) {
40      super(driverClass, driverClass, props);
41      if (properties.size() == 0)
42         properties.putAll(new PropertiesBuilder().build());
43      if (!properties.containsKey("jclouds.provider"))
44         properties.setProperty("jclouds.provider", "standalone");
45      if (!properties.containsKey(PROPERTY_ENDPOINT))
46         properties.setProperty(PROPERTY_ENDPOINT, "standalone");
47      if (!properties.containsKey(PROPERTY_API_VERSION))
48         properties.setProperty(PROPERTY_API_VERSION, "1");
49      if (!properties.containsKey(PROPERTY_IDENTITY))
50         properties.setProperty(PROPERTY_IDENTITY, System.getProperty("user.name"));
51   }
52 
53   @Override
54   protected void addClientModule(List<Module> modules) {
55      modules.add(new StandaloneComputeServiceClientModule<D>(syncClientType));
56   }
57 
58}

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