Examples of SMInputCursor


Examples of org.codehaus.staxmate.in.SMInputCursor

  // b_iterator is moved and reads A1B1C2 should read A1B2
  public void testOneLevelDeepPartialChildIteration() throws Exception
  {
    assertGotNextElementNamed(a_iterator, "A1");

    SMInputCursor b_iterator = a_iterator.childElementCursor();

    assertGotNextElementNamed(b_iterator, "A1B1");

    SMInputCursor c_iterator = b_iterator.childElementCursor();
    assertGotNextElementNamed(c_iterator, "A1B1C1");

    assertGotNextElementNamed(b_iterator, "A1B2");
    assertNull(b_iterator.getNext());
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  // Works with patch1
  public void testOneLevelDeepChildCursorAcquisition() throws Exception
  {
    assertGotNextElementNamed(a_iterator, "A1");

    SMInputCursor b_iterator = a_iterator.childElementCursor();

    assertGotNextElementNamed(b_iterator,"A1B1");

    // Edge case 1...
    // Get child cursor but leave in State.INITIAL...
    // Skip tree needs to start with initial depth value of 0...
    b_iterator.childElementCursor();
   
    assertGotNextElementNamed(b_iterator,"A1B2");
    assertNull(b_iterator.getNext());

    assertNull(a_iterator.getNext());
  }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  public void testTwoLevelDeepPartialCursorIteration() throws Exception
  {
   
    assertGotNextElementNamed(a_iterator,"A1");
   
    SMInputCursor b_iterator = a_iterator.childElementCursor();
    assertGotNextElementNamed(b_iterator,"A1B1");

    SMInputCursor c_iterator = b_iterator.childElementCursor();
    assertGotNextElementNamed(c_iterator,"A1B1C1");
   
    SMInputCursor d_iterator = c_iterator.childElementCursor();
    assertGotNextElementNamed(d_iterator,"A1B1C1D1");
   
    assertGotNextElementNamed(b_iterator,"A1B2");
    assertNull(b_iterator.getNext());
   
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  // One more try just to be safe, two level up move, without moving the d_iterator
  public void testTwoLevelDeepChildCursorAcquisition() throws Exception
  {
    assertGotNextElementNamed(a_iterator,"A1");
   
    SMInputCursor b_iterator = a_iterator.childElementCursor();
    assertGotNextElementNamed(b_iterator,"A1B1");

    SMInputCursor c_iterator = b_iterator.childElementCursor();
    assertGotNextElementNamed(c_iterator,"A1B1C1");
   
    SMInputCursor d_iterator = c_iterator.childElementCursor();
   
    assertGotNextElementNamed(b_iterator,"A1B2");
    assertNull(b_iterator.getNext());
   
    assertNull(a_iterator.getNext());
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

  /**
   * {@inheritDoc}
   */
  public void stream(SMHierarchicCursor rootCursor) throws XMLStreamException {
    SMInputCursor testSuiteCursor = rootCursor.constructDescendantCursor(new ElementFilter("testsuite"));
    try{
      testSuiteCursor.getNext();
    }
    catch(com.ctc.wstx.exc.WstxEOFException eofExc){
      throw new EmptyReportException();
    }

    do{
      String testSuiteClassName = testSuiteCursor.getAttrValue("name");
      String testFileName = testSuiteCursor.getAttrValue("filename");

      SMInputCursor testCaseCursor = testSuiteCursor.childElementCursor("testcase");
      while (testCaseCursor.getNext() != null) {
        String testClassName = getClassname(testCaseCursor, testSuiteClassName);
        String testSuiteKey = isValidKey(testFileName) ? testFileName : testClassName;
        TestSuite report = testSuites.get(testSuiteKey);
        if (report == null) {
          report = new TestSuite(testSuiteKey);
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

        } catch (com.ctc.wstx.exc.WstxEOFException eofExc) {
          throw new EmptyReportException();
        }

        try {
          SMInputCursor errorCursor = rootCursor.childElementCursor("error"); // error
          while (errorCursor.getNext() != null) {
            String file = errorCursor.getAttrValue("file");
            String line = errorCursor.getAttrValue("line");
            String id = errorCursor.getAttrValue("id");
            String msg = errorCursor.getAttrValue("msg");

            if (isInputValid(file, line, id, msg)) {
              sensor.saveUniqueViolation(project, context, CxxCppCheckRuleRepository.KEY, file, line, id, msg);
            } else {
              CxxUtils.LOG.warn("Skipping invalid violation: '{}'", msg);
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

    // Googletest-reports mark the skipped tests with status="notrun"
    String statusattr = testCaseCursor.getAttrValue("status");
    if ("notrun".equals(statusattr)) {
      status = "skipped";
    } else {
      SMInputCursor childCursor = testCaseCursor.childElementCursor();
      if (childCursor.getNext() != null) {
        String elementName = childCursor.getLocalName();
        if (elementName.equals("skipped")) {
          status = "skipped";
        } else if (elementName.equals("failure")) {
          status = "failure";
          msg = childCursor.getAttrValue("message");
          stack = childCursor.collectDescendantText();
        } else if (elementName.equals("error")) {
          status = "error";
          msg = childCursor.getAttrValue("message");
          stack = childCursor.collectDescendantText();
        }
      }
    }

    return new TestCase(name, time.intValue(), status, stack, msg);
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

       * {@inheritDoc}
       */
      public void stream(SMHierarchicCursor rootCursor) throws XMLStreamException {
        rootCursor.advance();

        SMInputCursor errorCursor = rootCursor.childElementCursor("error");
        while (errorCursor.getNext() != null) {
          String file = errorCursor.getAttrValue("file");
          String line = errorCursor.getAttrValue("line");
          String id = errorCursor.getAttrValue("id");
          String msg = errorCursor.getAttrValue("msg");

          saveUniqueViolation(project, context, CxxExternalRuleRepository.KEY, file, line, id, msg);
        }
      }
    });
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

        }

        try {
          String version = rootCursor.getAttrValue("version");
          if (version.equals("2")) {
            SMInputCursor errorsCursor = rootCursor.childElementCursor("errors");
            if (errorsCursor.getNext() != null) {
              parsed = true;
              SMInputCursor errorCursor = errorsCursor.childElementCursor("error");
              while (errorCursor.getNext() != null) {
                String id = errorCursor.getAttrValue("id");
                String msg = errorCursor.getAttrValue("msg");
                String file = null;
                String line = null;

                SMInputCursor locationCursor = errorCursor.childElementCursor("location");
                if (locationCursor.getNext() != null) {
                  file = locationCursor.getAttrValue("file");
                  line = locationCursor.getAttrValue("line");
                }

                if (isInputValid(file, line, id, msg)) {
                  sensor.saveUniqueViolation(project, context, CxxCppCheckRuleRepository.KEY, file, line, id, msg);
                } else {
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor

        }
        catch(com.ctc.wstx.exc.WstxEOFException eofExc){
          throw new EmptyReportException();
        }

        SMInputCursor errorCursor = rootCursor.childElementCursor("issue");
        try {
        while (errorCursor.getNext() != null){

          String file = errorCursor.getAttrValue("file");
          String line = errorCursor.getAttrValue("line");
          String id = errorCursor.getAttrValue("number");
          String msg = errorCursor.getAttrValue("desc");
            if (isInputValid(file, line, id, msg)) {
              //remap MISRA IDs. Only Unique rules for MISRA 2004 and 2008 has been created in the rule repository
              if(msg.contains("MISRA 2004") || msg.contains("MISRA 2008")) {
                  id = mapMisraRulesToUniqueSonarRules(msg);
              }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.