Examples of link()


Examples of com.google.test.metric.ClassCost.link()

  private ClassCost classCost(String name, int cost) {
    List<MethodCost> methods = new ArrayList<MethodCost>();
    methods.add(new MethodCost("method_" + cost, 1, cost));
    ClassCost classCost = new ClassCost(name, methods);
    classCost.link(new CostModel(1, 1));
    return classCost;
  }

  public void testPrintSummary() throws Exception {
    report.addClassCost(classCost("c.g.t.A", 1));
View Full Code Here

Examples of com.google.test.metric.MethodCost.link()

    MethodCost methodCost = new MethodCost("", "methodName", 123, false, false, false);
    methodCost.addCostSource(new GlobalCost(new SourceLocation(null, 123), null, Cost.global(1)));
    methodCost.addCostSource(new CyclomaticCost(new SourceLocation(null, 234), Cost.cyclomatic(1)));
    methodCost.addCostSource(new CyclomaticCost(new SourceLocation(null, 345), Cost.cyclomatic(1)));
    methodCost.addCostSource(new GlobalCost(new SourceLocation(null, 456), null, Cost.global(1)));
    methodCost.link();
    report.writeCost(methodCost);
    assertXMLEquals("<method cyclomatic=\"2\" global=\"2\" line=\"123\" "
        + "lod=\"0\" name=\"methodName\" overall=\"22\">L123,L234,L345,L456,</method>");
  }
View Full Code Here

Examples of com.google.test.metric.MethodCost.link()

    m1.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    m1.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    MethodCost m2 = new MethodCost("", "M2", -1, false, false, false);
    m2.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    m1.link();
    m2.link();
    ClassCost classCost = new ClassCost("className", asList(m1, m2));
    report.writeCost(classCost);
    assertXMLEquals("<class class=\"className\" cost=\"1\">M1()M2()</class>");
  }
View Full Code Here

Examples of com.google.test.metric.MethodCost.link()

    };
    report.printHeader();
    MethodCost m1 = new MethodCost("", "M1", -1, false, false, false);
    m1.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    m1.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    m1.link();
    ClassCost c1 = new ClassCost("C1", asList(m1));
    ClassCost c2 = new ClassCost("C2", asList(m1));
    report.addClassCost(c1);
    report.addClassCost(c2);
    report.printFooter();
View Full Code Here

Examples of com.google.test.metric.MethodCost.link()

  private static final String CLASS_NAME = "com.google.foo.Bar";
  public void testReport() throws Exception {

    MethodCost methodCost = new MethodCost("", "doThing", 3, false, false, false);
    methodCost.addCostSource(new CyclomaticCost(new SourceLocation(null, 0), Cost.cyclomatic(1)));
    methodCost.link();
    final ClassCost classCost = new ClassCost(CLASS_NAME, Arrays.asList(methodCost));
    report.addClassCost(classCost);
    report.printFooter();

    String output = out.toString();
View Full Code Here

Examples of com.google.test.metric.MethodCost.link()

    List<MethodCost> methods = new ArrayList<MethodCost>();
    MethodCost methodCost = new MethodCost("", "method_" + cost, 1, false, false, false);
    for (int i = 0; i < cost; i++) {
      methodCost.addCostSource(new CyclomaticCost(new SourceLocation(null, i), Cost.cyclomatic(1)));
    }
    methodCost.link();
    methods.add(methodCost);
    ClassCost classCost = new ClassCost(name, methods);
    return classCost;
  }
View Full Code Here

Examples of com.google.test.metric.MethodCost.link()

    DrillDownReportGenerator printer =
      new DrillDownReportGenerator(new PrintStream(out), costModel, null, MAX_VALUE, 0);
    MethodCost costOnlyMethod1 = new MethodCost("", "c.g.t.A.method1()V", 0, false, false, false);
    costOnlyMethod1.addCostSource(new CyclomaticCost(new SourceLocation(null, 1), Cost.cyclomatic(1)));
    costOnlyMethod1.addCostSource(new GlobalCost(new SourceLocation(null, 0), null, Cost.global(1)));
    costOnlyMethod1.link();
    printer.print("", costOnlyMethod1, Integer.MAX_VALUE);
    assertStringEquals("c.g.t.A.method1()V [CC: 1, GC: 1 / CC: 1, GC: 1]\n", out.toString());
  }

  public void test2DeepPrintAll() throws Exception {
View Full Code Here

Examples of com.jogamp.opengl.util.glsl.ShaderProgram.link()

        final ShaderProgram program = new ShaderProgram();
        boolean status;
        status = program.add(gl, vs, stream);
        status &= program.add(gl, fs, stream);
        status &= program.link(gl, stream);

        if (!status) {
            throw new RuntimeException(baos.toString());
        }
View Full Code Here

Examples of com.sun.star.sheet.XSheetLinkable.link()

            UnoRuntime.queryInterface(XSheetLinkable.class, oSheet);

        // creating link. Doesn't matter that it refers to unexistant object.
        // this is for proper work of X*Access tests.
        String aSourceArea = util.utils.getFullTestURL("calcshapes.sxc");
        SL.link(aSourceArea, "Sheet1", "", "",
            com.sun.star.sheet.SheetLinkMode.VALUE);

        // Getting links.
        XPropertySet docProps = (XPropertySet)
            UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
View Full Code Here

Examples of com.sun.star.sheet.XSheetLinkable.link()

            UnoRuntime.queryInterface(XSheetLinkable.class, oSheet);

        // creating link. Doesn't matter that it refers to unexistant object.
        // this is for proper work of XAccess tests.
        String sURL = utils.getFullTestDocName("ScSheetLinksObj.sdc");
        SL.link(sURL, "Sheet1", "", "", com.sun.star.sheet.SheetLinkMode.VALUE);

        // Getting links.
        XPropertySet docProps = (XPropertySet)
            UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc);
        Object oLinks = null;
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.