@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(); }
@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(); }
@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(); }
@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(); }