View Javadoc
1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.cli;
5   
6   import static org.junit.Assert.assertTrue;
7   
8   import java.io.File;
9   
10  import net.sourceforge.pmd.util.FileUtil;
11  
12  import org.junit.Test;
13  
14  /**
15   * @author Romain Pelisse <belaran@gmail.com>
16   * 
17   */
18  public class CLITest extends BaseCLITest {
19      @Test
20      public void useEcmaScript() {
21          String[] args = { "-d", SOURCE_FOLDER, "-f", "xml", "-R", "ecmascript-basic", "-version", "3", "-l",
22                  "ecmascript", "-debug" };
23          String resultFilename = runTest(args, "useEcmaScript");
24          assertTrue("Invalid JavaScript version",
25                  FileUtil.findPatternInFile(new File(resultFilename), "Using Ecmascript version: Ecmascript 3"));
26      }
27  }