Clover coverage report - Maven Clover report
Coverage timestamp: Thu Aug 24 2006 01:18:17 PDT
file stats: LOC: 114   Methods: 13
NCLOC: 74   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ColorGameBean.java 0% 0% 0% 0%
coverage
 1    /*
 2    * Copyright 2004 The Apache Software Foundation
 3    *
 4    * Licensed under the Apache License, Version 2.0 (the "License");
 5    * you may not use this file except in compliance with the License.
 6    * You may obtain a copy of the License at
 7    *
 8    * http://www.apache.org/licenses/LICENSE-2.0
 9    *
 10    * Unless required by applicable law or agreed to in writing, software
 11    * distributed under the License is distributed on an "AS IS" BASIS,
 12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13    * See the License for the specific language governing permissions and
 14    * limitations under the License.
 15    */
 16    package colors;
 17   
 18    import javax.servlet.http.*;
 19   
 20    public class ColorGameBean {
 21   
 22    private String background = "yellow";
 23    private String foreground = "red";
 24    private String color1 = foreground;
 25    private String color2 = background;
 26    private String hint = "no";
 27    private int attempts = 0;
 28    private int intval = 0;
 29    private boolean tookHints = false;
 30   
 31  0 public void processRequest(HttpServletRequest request) {
 32   
 33    // background = "yellow";
 34    // foreground = "red";
 35   
 36  0 if (! color1.equals(foreground)) {
 37  0 if (color1.equalsIgnoreCase("black") ||
 38    color1.equalsIgnoreCase("cyan")) {
 39  0 background = color1;
 40    }
 41    }
 42   
 43  0 if (! color2.equals(background)) {
 44  0 if (color2.equalsIgnoreCase("black") ||
 45    color2.equalsIgnoreCase("cyan")) {
 46  0 foreground = color2;
 47    }
 48    }
 49   
 50  0 attempts++;
 51    }
 52   
 53  0 public void setColor2(String x) {
 54  0 color2 = x;
 55    }
 56   
 57  0 public void setColor1(String x) {
 58  0 color1 = x;
 59    }
 60   
 61  0 public void setAction(String x) {
 62  0 if (!tookHints)
 63  0 tookHints = x.equalsIgnoreCase("Hint");
 64  0 hint = x;
 65    }
 66   
 67  0 public String getColor2() {
 68  0 return background;
 69    }
 70   
 71  0 public String getColor1() {
 72  0 return foreground;
 73    }
 74   
 75  0 public int getAttempts() {
 76  0 return attempts;
 77    }
 78   
 79  0 public boolean getHint() {
 80  0 return hint.equalsIgnoreCase("Hint");
 81    }
 82   
 83  0 public boolean getSuccess() {
 84  0 if (background.equalsIgnoreCase("black") ||
 85    background.equalsIgnoreCase("cyan")) {
 86   
 87  0 if (foreground.equalsIgnoreCase("black") ||
 88    foreground.equalsIgnoreCase("cyan"))
 89  0 return true;
 90    else
 91  0 return false;
 92    }
 93   
 94  0 return false;
 95    }
 96   
 97  0 public boolean getHintTaken() {
 98  0 return tookHints;
 99    }
 100   
 101  0 public void reset() {
 102  0 foreground = "red";
 103  0 background = "yellow";
 104    }
 105   
 106  0 public void setIntval(int value) {
 107  0 intval = value;
 108    }
 109   
 110  0 public int getIntval() {
 111  0 return intval;
 112    }
 113    }
 114