2929
3030package org .scijava .maven .plugin .enforcer ;
3131
32- import static org .hamcrest .MatcherAssert .assertThat ;
33- import static org .hamcrest .Matchers .containsString ;
34- import static org .junit .Assert .assertTrue ;
35-
36- import java .io .File ;
37- import java .io .IOException ;
38-
3932import org .apache .maven .enforcer .rule .api .EnforcerLogger ;
4033import org .apache .maven .enforcer .rule .api .EnforcerRuleException ;
4134import org .apache .maven .model .Build ;
4437import org .junit .Before ;
4538import org .junit .Rule ;
4639import org .junit .Test ;
47- import org .junit .rules .ExpectedException ;
4840import org .junit .rules .TemporaryFolder ;
4941
42+ import java .io .File ;
43+ import java .io .IOException ;
44+
45+ import static org .junit .Assert .assertTrue ;
46+
5047/**
5148 * Tests for {@link MainClassExistsRule}.
5249 *
@@ -91,15 +88,23 @@ public void setUp() throws Exception {
9188 }
9289
9390 @ Test
94- public void execute_NoMainClassProperty_Passes () throws Exception {
91+ public void TestNoMainClassProperty () throws Exception {
9592 // No "main-class" property set
9693 MainClassExistsRule rule = new MainClassExistsRuleMock (project );
9794 // Execute the rule and make sure it passes
9895 rule .execute ();
9996 }
10097
98+ @ Test
99+ public void TestEmptyMainClassProperty () throws Exception {
100+ // No "main-class" property set
101+ MainClassExistsRule rule = new MainClassExistsRuleMock (project );
102+ // Execute the rule and make sure it passes
103+ rule .execute ();
104+ }
105+
101106 @ Test
102- public void execute_MainClassExists_Passes () throws Exception {
107+ public void TestMainClassExists () throws Exception {
103108 // Set main-class property
104109 project .getProperties ().setProperty ("main-class" , "com.example.Main" );
105110
@@ -112,7 +117,7 @@ public void execute_MainClassExists_Passes() throws Exception {
112117 }
113118
114119 @ Test
115- public void execute_MainClassDoesNotExist_ThrowsException () throws Exception {
120+ public void TestMainClassDoesNotExist () {
116121 // Set main-class property...
117122 project .getProperties ().setProperty ("main-class" , "com.example.NonExistent" );
118123
0 commit comments