1   ////////////////////////////////////////////////////////////////////////////////
2   // Test case file for checkstyle.
3   // Created: 2003
4   ////////////////////////////////////////////////////////////////////////////////
5   package com.puppycrawl.tools.checkstyle.checks.uncommentedmain;
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[] args)
15      {
16          System.identityHashCode("InputUncommentedMain.main()");
17      }
18  }
19  
20  class Main1
21  {
22      // uncommented main in class Main
23      public static void main(String[] args)
24      {
25          System.identityHashCode("Main.main()");
26      }
27  }
28  
29  class UncommentedMainTest1
30  {
31      // one more uncommented main
32      public static void main(java.lang.String[] args)
33      {
34          System.identityHashCode("test1.main()");
35      }
36  }
37  
38  class UncommentedMainTest2
39  {
40      // wrong arg type
41      public static void main(int args)
42      {
43          System.identityHashCode("test2.main()");
44      }
45  }
46  
47  class UncommentedMainTest3
48  {
49      // no-public main
50      static void main(String[] args)
51      {
52          System.identityHashCode("test3.main()");
53      }
54  }
55  
56  class UncommentedMainTest4
57  {
58      // non-static main
59      public void main(String[] args)
60      {
61          System.identityHashCode("test4.main()");
62      }
63  }
64  
65  class UncommentedMainTest5
66  {
67      // wrong return type
68      public static int main(String[] args)
69      {
70          System.identityHashCode("test5.main()");
71          return 1;
72      }
73  }
74  
75  class UncommentedMainTest6
76  {
77      // too many params
78      public static void main(String[] args, int param)
79      {
80          System.identityHashCode("test6.main()");
81      }
82  }
83  
84  class UncommentedMainTest7
85  {
86      // main w/o params
87      public static void main()
88      {
89          System.identityHashCode("test7.main()");
90      }
91  }
92  
93  class UncommentedMainTest8
94  {
95  
96      public static void main(String... args)
97      {
98          System.identityHashCode("test8.main()");
99      }
100 }
101 
102 class UncommentedMainTest9
103 {
104 
105     public static void main(String args)
106     {
107         System.identityHashCode("test9.main()");
108     }
109 }