Package com.adobe.ac.pmd

Examples of com.adobe.ac.pmd.IFlexViolation


                                                                            null );

      assertEquals( 1,
                    violatons.size() );

      final IFlexViolation firstViolation = violatons.get( 0 );

      assertEquals( 0,
                    firstViolation.getBeginLine() );
      assertEquals( 0,
                    firstViolation.getEndLine() );
      assertEquals( "emptyMessage. description",
                    firstViolation.getRuleMessage() );
   }
View Full Code Here


                                                                              null );

      assertEquals( 1,
                    violatons.size() );

      final IFlexViolation firstViolation = violatons.get( 0 );

      assertEquals( 0,
                    firstViolation.getBeginLine() );
      assertEquals( 0,
                    firstViolation.getEndLine() );
      assertEquals( "warning message",
                    firstViolation.getRuleMessage() );
   }
View Full Code Here

   @Override
   protected final void findViolations( final IPackage packageNode )
   {
      if ( containsUpperCharacter( packageNode.getName() ) )
      {
         final IFlexViolation violation = addViolation( packageNode,
                                                        packageNode.getName() );

         violation.setEndColumn( packageNode.getName().length()
               + violation.getBeginColumn() );
      }
   }
View Full Code Here

   {
      if ( isAlreadyViolationAdded( beginningNode ) )
      {
         return null;
      }
      final IFlexViolation violation = addViolation( ViolationPosition.create( beginningNode.getLine(),
                                                                               endNode.getLine(),
                                                                               beginningNode.getColumn(),
                                                                               endNode.getColumn() ) );

      for ( int i = 0; i < messageToReplace.length; i++ )
      {
         violation.replacePlaceholderInMessage( messageToReplace[ i ],
                                                i );
      }

      return violation;
   }
View Full Code Here

      List< AssertPosition > failures;
      failures = new ArrayList< AssertPosition >();

      for ( int i = 0; i < expectedPositions.length; i++ )
      {
         final IFlexViolation violation = violations.get( i );
         final ViolationPosition expectedPosition = expectedPositions[ i ];

         if ( expectedPosition.getBeginLine() != violation.getBeginLine() )
         {
            failures.add( AssertPosition.create( BEGIN_LINE_NOT_CORRECT
                                                       + " at " + i + "th violation on " + resourcePath,
                                                 expectedPosition.getBeginLine(),
                                                 violation.getBeginLine() ) );
         }
         if ( expectedPosition.getEndLine() != violation.getEndLine() )
         {
            failures.add( AssertPosition.create( END_LINE_NOT_CORRECT
                                                       + " at " + i + "th violation on " + resourcePath,
                                                 expectedPosition.getEndLine(),
                                                 violation.getEndLine() ) );
         }
      }
      return failures;
   }
View Full Code Here

    * @return
    */
   protected final IFlexViolation addViolation( final List< IFlexViolation > violations,
                                                final ViolationPosition position )
   {
      final IFlexViolation violation = new Violation( position, this, getCurrentFile() );
      final int beginLine = position.getBeginLine();

      prettyPrintMessage( violation );

      if ( beginLine == -1
View Full Code Here

   protected final IFlexViolation addViolation( final List< IFlexViolation > violations,
                                                final ViolationPosition position,
                                                final String... messageToReplace )
   {
      final IFlexViolation violation = addViolation( violations,
                                                     position );

      for ( int i = 0; i < messageToReplace.length; i++ )
      {
         violation.replacePlaceholderInMessage( messageToReplace[ i ],
                                                i );
      }

      return violation;
   }
View Full Code Here

TOP

Related Classes of com.adobe.ac.pmd.IFlexViolation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.