Package org.sonar.server.issue

Examples of org.sonar.server.issue.RulesAggregation$Rule


            String segment = currTextSegment.toString();
            List<Rule> parentMatches = getMatches().peek();
            int len = parentMatches.size();
            for ( int i = 0; i < len; ++i )
            {
                Rule r = parentMatches.get( i );
                if ( r instanceof TextSegmentHandler )
                {
                    TextSegmentHandler h = (TextSegmentHandler) r;
                    try
                    {
View Full Code Here


    {

        @Override
        protected void configure()
        {
            forPattern( "bar" ).addRule( new Rule()
            {

                @Override
                public void body( String namespace, String name, String text )
                    throws Exception
View Full Code Here

            Log log = getDigester().getLogger();
            boolean debug = log.isDebugEnabled();
            for ( int i = 0; i < rules.size(); i++ )
            {
                int j = ( rules.size() - i ) - 1;
                Rule rule = rules.get( j );
                if ( debug )
                {
                    log.debug( "  Fire end() for " + rule );
                }
                try
                {
                    rule.end( namespaceURI, name );
                }
                catch ( Exception e )
                {
                    throw getDigester().createSAXException( e );
                }
View Full Code Here

  public void app_with_rules() throws Exception {
    MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);

    addComponent();
    when(issueService.findRulesByComponent(COMPONENT_KEY, null, session)).thenReturn(
      new RulesAggregation().add(new RuleDto().setRuleKey("AvoidCycle").setRepositoryKey("squid").setName("Avoid Cycle"))
      );

    WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("key", COMPONENT_KEY);
    request.execute().assertJson(getClass(), "app_with_rules.json");
  }
View Full Code Here

      new SnapshotDto().setPeriodMode(1, "previous_analysis").setPeriodDate(1, periodDate)
      );
    when(periods.label(anyString(), anyString(), any(Date.class))).thenReturn("since previous analysis (May 08 2014)");

    when(issueService.findRulesByComponent(COMPONENT_KEY, periodDate, session)).thenReturn(
      new RulesAggregation().add(new RuleDto().setRuleKey("AvoidCycle").setRepositoryKey("squid").setName("Avoid Cycle"))
      );

    WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("key", COMPONENT_KEY).setParam("period", "1");
    request.execute().assertJson(getClass(), "app_with_rules_when_period_is_set.json");
  }
View Full Code Here

      List<Period> periodList = periods(component.projectUuid(), session);
      Integer periodIndex = request.paramAsInt(PARAM_PERIOD);
      Date periodDate = periodDate(periodIndex, periodList);

      RulesAggregation rulesAggregation = issueService.findRulesByComponent(component.key(), periodDate, session);
      Multiset<String> severitiesAggregation = issueService.findSeveritiesByComponent(component.key(), periodDate, session);
      Map<String, MeasureDto> measuresByMetricKey = measuresByMetricKey(component, session);

      appendComponent(json, component, userSession, session);
      appendPermissions(json, component, userSession);
View Full Code Here

   */
  public String graph() throws Exception {
    StringBuffer text = new StringBuffer();
   
    text.append("digraph M5Tree {\n");
    Rule temp = (Rule)m_ruleSet.elementAt(0);
    temp.topOfTree().graph(text);
    text.append("}\n");
    return text.toString();
  }
View Full Code Here

TOP

Related Classes of org.sonar.server.issue.RulesAggregation$Rule

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.