KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > InputUncommentedMain


1 ////////////////////////////////////////////////////////////////////////////////
2
// Test case file for checkstyle.
3
// Created: 2003
4
////////////////////////////////////////////////////////////////////////////////
5
package com.puppycrawl.tools.checkstyle;
6
7 /**
8  * Test case for UncommentedMainCheck
9  * @author o_sukhodolsky
10  */

11 public class InputUncommentedMain
12 {
13     // uncommented main
14
public static void main(String JavaDoc[] args)
15     {
16         System.out.println("InputUncommentedMain.main()");
17     }
18 }
19
20 class Main
21 {
22     // uncommented main in class Main
23
public static void main(String JavaDoc[] args)
24     {
25         System.out.println("Main.main()");
26     }
27 }
28
29 class UncommentedMainTest1
30 {
31     // one more uncommented main
32
public static void main(java.lang.String JavaDoc[] args)
33     {
34         System.out.println("test1.main()");
35     }
36 }
37
38 class UncommentedMainTest2
39 {
40     // wrong arg type
41
public static void main(int args)
42     {
43         System.out.println("test2.main()");
44     }
45 }
46
47 class UncommentedMainTest3
48 {
49     // no-public main
50
static void main(String JavaDoc[] args)
51     {
52         System.out.println("test3.main()");
53     }
54 }
55
56 class UncommentedMainTest4
57 {
58     // non-static main
59
public void main(String JavaDoc[] args)
60     {
61         System.out.println("test4.main()");
62     }
63 }
64
65 class UncommentedMainTest5
66 {
67     // wrong return type
68
public static int main(String JavaDoc[] args)
69     {
70         System.out.println("test5.main()");
71         return 1;
72     }
73 }
74
75 class UncommentedMainTest6
76 {
77     // too many params
78
public static void main(String JavaDoc[] args, int param)
79     {
80         System.out.println("test6.main()");
81     }
82 }
83
84 class UncommentedMainTest7
85 {
86     // main w/o params
87
public static void main()
88     {
89         System.out.println("test7.main()");
90     }
91 }
92
Popular Tags