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

COVERAGE SUMMARY FOR SOURCE FILE [ExecResponse.java]

nameclass, %method, %block, %line, %
ExecResponse.java100% (1/1)29%  (2/7)11%  (15/142)17%  (6/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ExecResponse100% (1/1)29%  (2/7)11%  (15/142)17%  (6/35)
equals (Object): boolean 0%   (0/1)0%   (0/60)0%   (0/20)
getError (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getOutput (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/39)0%   (0/6)
toString (): String 0%   (0/1)0%   (0/22)0%   (0/1)
ExecResponse (String, String, int): void 100% (1/1)100% (12/12)100% (5/5)
getExitCode (): int 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.domain;
20 
21import org.jclouds.compute.config.CustomizationResponse;
22 
23/**
24 * @author Adrian Cole
25 */
26public class ExecResponse implements CustomizationResponse {
27 
28   private final String error;
29   private final String output;
30   private final int exitCode;
31 
32   public ExecResponse(String output, String error, int exitCode) {
33      this.output = output;
34      this.error = error;
35      this.exitCode = exitCode;
36   }
37 
38   public String getError() {
39      return error;
40   }
41 
42   public String getOutput() {
43      return output;
44   }
45 
46   @Override
47   public String toString() {
48      return "[output=" + output + ", error=" + error + ", exitCode=" + exitCode + "]";
49   }
50 
51   @Override
52   public int hashCode() {
53      final int prime = 31;
54      int result = 1;
55      result = prime * result + ((error == null) ? 0 : error.hashCode());
56      result = prime * result + exitCode;
57      result = prime * result + ((output == null) ? 0 : output.hashCode());
58      return result;
59   }
60 
61   @Override
62   public boolean equals(Object obj) {
63      if (this == obj)
64         return true;
65      if (obj == null)
66         return false;
67      if (getClass() != obj.getClass())
68         return false;
69      ExecResponse other = (ExecResponse) obj;
70      if (error == null) {
71         if (other.error != null)
72            return false;
73      } else if (!error.equals(other.error))
74         return false;
75      if (exitCode != other.exitCode)
76         return false;
77      if (output == null) {
78         if (other.output != null)
79            return false;
80      } else if (!output.equals(other.output))
81         return false;
82      return true;
83   }
84 
85   public int getExitCode() {
86      return exitCode;
87   }
88 
89}

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