Examples of SourceLocation


Examples of com.google.test.metric.SourceLocation

  }

  public void testSupressAllWhenMinCostIs4() throws Exception {
    DrillDownReportGenerator printer =
      new DrillDownReportGenerator(new PrintStream(out), costModel, null, MAX_VALUE, 4);
    methodCost2.addCostSource(new MethodInvocationCost(new SourceLocation(null, 81), methodCost1,
        NON_OVERRIDABLE_METHOD_CALL, Cost.cyclomatic(1)));
    methodCost2.link();
    printer.print("", methodCost2, MAX_VALUE);
    assertStringEquals("", out.toString());
  }
View Full Code Here

Examples of com.google.test.metric.SourceLocation

  }

  public void testSupressPartialWhenMinCostIs2() throws Exception {
    DrillDownReportGenerator printer =
      new DrillDownReportGenerator(new PrintStream(out), costModel, null, MAX_VALUE, 2);
    methodCost2.addCostSource(new MethodInvocationCost(new SourceLocation(null, 81), methodCost1,
        NON_OVERRIDABLE_METHOD_CALL, Cost.cyclomatic(1)));
    methodCost2.link();
    printer.print("", methodCost2, Integer.MAX_VALUE);
    assertStringEquals("c.g.t.A.method2()V [CC: 3 / CC: 2]\n", out.toString());
  }
View Full Code Here

Examples of com.google.test.metric.SourceLocation

  }

  public void testSecondLevelRecursive() throws Exception {
    DrillDownReportGenerator printer =
      new DrillDownReportGenerator(new PrintStream(out), costModel, null, MAX_VALUE, 0);
    methodCost3.addCostSource(new MethodInvocationCost(new SourceLocation(null, 1), methodCost2,
        NON_OVERRIDABLE_METHOD_CALL, Cost.cyclomatic(2)));
    methodCost2.addCostSource(new MethodInvocationCost(new SourceLocation(null, 2), methodCost2,
        NON_OVERRIDABLE_METHOD_CALL, new Cost()));
    methodCost3.link();
    printer.print("", methodCost3, 10);
    assertStringEquals("c.g.t.A.method3()V [CC: 5 / CC: 3]\n" +
      "  line 1: c.g.t.A.method2()V [CC: 2 / CC: 2] " + NON_OVERRIDABLE_METHOD_CALL + "\n",
View Full Code Here

Examples of com.google.test.metric.SourceLocation

public class MethodCostTest extends TestCase {

  public void testComputeOverallCost() throws Exception {
    MethodCost cost = new MethodCost("", "a", 0, false, false, false);
    cost.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    cost.addCostSource(new GlobalCost(new SourceLocation(null, 0), null, Cost.global(1)));
    MethodCost cost3 = new MethodCost("", "b", 0, false, false, false);
    cost3.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    cost3.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    cost3.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    cost.addCostSource(new MethodInvocationCost(new SourceLocation(null, 0), cost3,
        IMPLICIT_STATIC_INIT, Cost.cyclomatic(3)));
    CostModel costModel = new CostModel(2, 10, 1);
    cost.link();

    assertEquals((long) 2 * (3 + 1) + 10 * 1, costModel.computeOverall(cost.getTotalCost()));
View Full Code Here

Examples of com.volantis.mcs.model.validation.SourceLocation

                }
                buffer.append(level);

                // Add the position in the file
                buffer.append(" ");
                SourceLocation location = diagnostic.getLocation();
                buffer.append(location.getSourceDocumentName());
                buffer.append(":(");
                buffer.append(location.getSourceLineNumber());
                buffer.append(",");
                buffer.append(location.getSourceColumnNumber());
                buffer.append(")");

                // Only add the path if debug is enabled since it is internal
                // but it can be pretty useful.
                if (logger.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.flex.compiler.common.SourceLocation

    {
        String currentFileName = cfg.findSourcePath(b, instructionIndex);
        int currentLine = cfg.findLineNumber(b, instructionIndex);

        if ( currentFileName != null && currentLine != -1 )
            return new SourceLocation(currentFileName, ISourceLocation.UNKNOWN, ISourceLocation.UNKNOWN, currentLine, ISourceLocation.UNKNOWN);
        else
            return new SourceLocation();
    }
View Full Code Here

Examples of org.apache.ode.bpel.compiler.SourceLocation

    cmsg.severity = severity;
    cmsg.code = "parseXsl";
    cmsg.phase = 0;
    cmsg.messageText = exception.getMessageAndLocation();
    CompilationException ce = new CompilationException(cmsg, exception);
    SourceLocation loc = exception.getLocator() != null ? new SourceLocatorWrapper(exception.getLocator()) : null;
      if (_cc != null)
        _cc.recoveredFromError(loc,ce);
      else
      __log.error("XSL stylesheet parsing error! ", exception);
  }
View Full Code Here

Examples of org.apache.ode.bpel.compiler.api.SourceLocation

            wf = new DefaultResourceFinder(_bpelFile.getAbsoluteFile().getParentFile(), suDir.getAbsoluteFile());
        }

        CompileListener clistener = new CompileListener() {
            public void onCompilationMessage(CompilationMessage compilationMessage) {
                SourceLocation location = compilationMessage.source;
                if (location == null) {
                    compilationMessage.source = process;
                }
                logCompilationMessage(compilationMessage);
            }
View Full Code Here

Examples of org.apache.pig.parser.SourceLocation

            }
           
        } catch(CloneNotSupportedException e) {
             e.printStackTrace();
        }
        copy.setLocation( new SourceLocation( location ) );
        return copy;
    }
View Full Code Here

Examples of org.apache.vxquery.util.SourceLocation

        } catch (ParseException pe) {
            List<SystemException> exceptions = parser.getExceptions();
            if (!exceptions.isEmpty()) {
                throw exceptions.get(0);
            }
            throw new SystemException(ErrorCode.XPST0003, new SourceLocation(sourceName, pe.currentToken.beginLine,
                    pe.currentToken.beginColumn));
        }
    }
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.