コード例 #1
0
  @Test
  public void test() {
    TraceUseCheck check = new TraceUseCheck();

    SourceFile file =
        FlexAstScanner.scanSingleFile(new File("src/test/resources/checks/TraceUse.as"), check);
    CheckMessagesVerifier.verify(file.getCheckMessages())
        .next()
        .atLine(1)
        .withMessage("Remove this use of the \"trace\" function.")
        .noMore();
  }
コード例 #2
0
 @Test
 public void test() {
   SourceFile file =
       FlexAstScanner.scanSingleFile(new File("src/test/resources/checks/StarTypeUse.as"), check);
   CheckMessagesVerifier.verify(file.getCheckMessages())
       .next()
       .atLine(5)
       .withMessage("Remove usage of this \"star\" type")
       .next()
       .atLine(6)
       .noMore();
 }
コード例 #3
0
 @Test
 public void test() {
   SourceFile file =
       FlexAstScanner.scanSingleFile(
           new File("src/test/resources/checks/ManagedEventTagWithEvent.as"), check);
   CheckMessagesVerifier.verify(file.getCheckMessages())
       .next()
       .atLine(2)
       .withMessage(
           "The managed event \"mes\" is either misspelled or is missing a companion Event metadata tag")
       .next()
       .atLine(7)
       .withMessage(
           "The managed event \"click\" is either misspelled or is missing a companion Event metadata tag")
       .noMore();
 }
コード例 #4
0
  @Test
  public void test() {
    ActionScript2Check check = new ActionScript2Check();

    SourceFile file =
        FlexAstScanner.scanSingleFile(
            new File("src/test/resources/checks/ActionScript2.as"), check);
    CheckMessagesVerifier.verify(file.getCheckMessages())
        .next()
        .atLine(1)
        .withMessage("'intrinsic' not available in ActionScript 3.0")
        .next()
        .atLine(2)
        .withMessage("Operator '<>' not available in ActionScript 3.0")
        .next()
        .atLine(4)
        .withMessage("Operator 'not' not available in ActionScript 3.0")
        .next()
        .atLine(6)
        .withMessage("'set variable statement' not available in ActionScript 3.0")
        .noMore();
  }