KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > junit > pkgtestcreation > test > TestClass


1 /*
2  * TestClass.java
3  *
4  * Created on August 23, 2006, 4:32 PM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.netbeans.test.junit.pkgtestcreation.test;
11
12 import java.util.ArrayList JavaDoc;
13
14 /**
15  *
16  * @author ms159439
17  */

18 public class TestClass {
19     
20     /**
21      * Creates a new instance of TestClass
22      */

23     public TestClass() {
24     }
25     
26     /**
27      * public method
28      */

29     public int add(int a, int b) {
30         return a + b;
31     }
32     
33     /**
34      * protected method
35      */

36     protected int arrayListCount(ArrayList JavaDoc a) {
37         return a.size();
38     }
39     
40     /**
41      * private method
42      * should not be included in any test
43      */

44     private int subs(int a, int b) {
45         return a - b;
46     }
47     
48     /**
49      * friendly (pacakge private) method
50      */

51     double sqr(double a) {
52         return Math.pow(a, 2);
53     }
54     
55     /**
56      * static friendly method
57      */

58     static double thirdPow(double a) {
59         return Math.pow(a, 3);
60     }
61 }
62
Popular Tags