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

COVERAGE SUMMARY FOR SOURCE FILE [ComputeServiceContextImpl.java]

nameclass, %method, %block, %line, %
ComputeServiceContextImpl.java100% (1/1)18%  (2/11)40%  (21/53)41%  (7/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ComputeServiceContextImpl100% (1/1)18%  (2/11)40%  (21/53)41%  (7/17)
close (): void 0%   (0/1)0%   (0/4)0%   (0/2)
credentialStore (): Map 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
getCredentialStore (): Map 0%   (0/1)0%   (0/3)0%   (0/1)
getProviderSpecificContext (): RestContext 0%   (0/1)0%   (0/3)0%   (0/1)
getUtils (): Utils 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)
utils (): Utils 0%   (0/1)0%   (0/3)0%   (0/1)
ComputeServiceContextImpl (ComputeService, Map, Utils, RestContext): void 100% (1/1)100% (18/18)100% (6/6)
getComputeService (): ComputeService 100% (1/1)100% (3/3)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.compute.internal;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Map;
24 
25import javax.inject.Inject;
26import javax.inject.Singleton;
27 
28import org.jclouds.compute.ComputeService;
29import org.jclouds.compute.ComputeServiceContext;
30import org.jclouds.compute.Utils;
31import org.jclouds.domain.Credentials;
32import org.jclouds.rest.RestContext;
33 
34/**
35 * @author Adrian Cole
36 */
37@Singleton
38public class ComputeServiceContextImpl<S, A> implements ComputeServiceContext {
39   private final ComputeService computeService;
40   private final RestContext<S, A> providerSpecificContext;
41   private final Utils utils;
42   private final Map<String, Credentials> credentialStore;
43 
44   @SuppressWarnings( { "unchecked" })
45   @Inject
46   public ComputeServiceContextImpl(ComputeService computeService, Map<String, Credentials> credentialStore,
47            Utils utils, @SuppressWarnings("rawtypes") RestContext providerSpecificContext) {
48      this.credentialStore = credentialStore;
49      this.utils = utils;
50      this.providerSpecificContext = providerSpecificContext;
51      this.computeService = checkNotNull(computeService, "computeService");
52   }
53 
54   public ComputeService getComputeService() {
55      return computeService;
56   }
57 
58   @SuppressWarnings( { "unchecked", "hiding" })
59   @Override
60   public <S, A> RestContext<S, A> getProviderSpecificContext() {
61      return (RestContext<S, A>) providerSpecificContext;
62   }
63 
64   @Override
65   public void close() {
66      providerSpecificContext.close();
67   }
68 
69   @Override
70   public Utils getUtils() {
71      return utils();
72   }
73 
74   @Override
75   public Utils utils() {
76      return utils;
77   }
78 
79   public int hashCode() {
80      return providerSpecificContext.hashCode();
81   }
82 
83   @Override
84   public String toString() {
85      return providerSpecificContext.toString();
86   }
87 
88   @Override
89   public boolean equals(Object obj) {
90      return providerSpecificContext.equals(obj);
91   }
92 
93   @Override
94   public Map<String, Credentials> getCredentialStore() {
95      return credentialStore;
96   }
97 
98   @Override
99   public Map<String, Credentials> credentialStore() {
100      return credentialStore;
101   }
102}

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