KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jester > acceptancetests > Untested


1 package jester.acceptancetests;
2
3 public class Untested {
4     public Untested() {
5         super();
6     }
7     public int canDecrementOrWhatever(int aNum) {
8         return --aNum;
9     }
10     public int canIncrementOrWhatever(int aNum) {
11         return ++aNum;
12     }
13     public boolean canReturnAnyBooleanFalse() {
14         return false;
15     }
16     public boolean canReturnAnyBooleanTrue() {
17         return true;
18     }
19     public int canReturnAnyInt() {
20         return 1;
21     }
22     public int canTakeAnyBranchFor(boolean condition) {
23         if (condition) {
24             return 1;
25         } else {
26             return 0;
27         }
28     }
29     public boolean couldBeEqual() {
30         return "hi" != "hello";
31     }
32     public boolean couldBeNotEqual() {
33         String JavaDoc a = "hi";
34         return a == a;
35     }
36     public int switchStatementThatWouldCauseCompilationProblem(int k) {
37         switch(k){
38           case '1' :
39             return 3;
40           case '2' :
41             return 4;
42         }
43         return 1;
44     }
45     public void methodWithIntCommentedOut(){
46         //should ignore this 1 if default comment ignoring working
47
}
48     int Log2(float n) { return Log(2,n); }
49     
50     int Log(int i,float n) { return 2; }
51     
52     public void dontWantWhileTrueToBeMutated(){
53         while(true){//should ignore this if default ignoring working
54
break;
55         }
56     }
57 }
Popular Tags