View Javadoc
1   package org.codehaus.plexus.compiler.eclipse;
2   
3   import java.util.Arrays;
4   import java.util.Collection;
5   
6   import org.codehaus.plexus.compiler.AbstractCompilerTest;
7   import org.codehaus.plexus.compiler.CompilerConfiguration;
8   import org.junit.jupiter.api.BeforeEach;
9   
10  public class EclipseCompilerErrorsAsWarningsTest extends AbstractCompilerTest {
11  
12      protected void configureCompilerConfig(CompilerConfiguration compilerConfig) {
13          compilerConfig.addCompilerCustomArgument("-errorsAsWarnings", "true");
14      }
15  
16      @BeforeEach
17      public void setUp() throws Exception {
18          setCompilerDebug(true);
19          setCompilerDeprecationWarnings(true);
20      }
21  
22      @Override
23      protected String getRoleHint() {
24          return "eclipse";
25      }
26  
27      @Override
28      protected int expectedErrors() {
29          return 0;
30      }
31  
32      @Override
33      protected int expectedWarnings() {
34          return 6;
35      }
36  
37      @Override
38      protected Collection<String> expectedOutputFiles() {
39          return Arrays.asList(
40                  "org/codehaus/foo/Deprecation.class",
41                  "org/codehaus/foo/ExternalDeps.class",
42                  "org/codehaus/foo/Person.class",
43                  "org/codehaus/foo/ReservedWord.class"
44                  // "org/codehaus/foo/Bad.class",             // This one has no class file generated as it's one big
45                  // issue
46                  // "org/codehaus/foo/UnknownSymbol.class",
47                  // "org/codehaus/foo/RightClassname.class"
48                  );
49      }
50  }