Examples of ResultBuilder


Examples of com.googlecode.jslint4java.JSLintResult.ResultBuilder

     * Run the formatter over the current set of issues. The File as input is
     * just a convenient way of passing a name & path together.
     */
    private void runFormatter(File file) {
        rf.begin();
        ResultBuilder builder = new JSLintResult.ResultBuilder(file.getName());
        for (Issue issue : issues) {
            builder.addIssue(issue);
        }
        rf.output(builder.build());
        rf.end();
    }
View Full Code Here

Examples of com.googlecode.jslint4java.JSLintResult.ResultBuilder

    @Test
    public void reportContentsSanity() throws Exception {
        ReportWriterImpl rw = createReportWriter(REPORT_XML);
        rw.open();
        // Create a result with no problems.
        rw.report(new ResultBuilder("foo.js").build());
        rw.close();
        String report = readFile(rw.getReportFile());
        assertThat(report, containsString("<jslint>"));
        assertThat(report, containsString("<file name='foo.js'>"));
        assertThat(report, containsString("</jslint>"));
View Full Code Here

Examples of com.googlecode.jslint4java.JSLintResult.ResultBuilder

     */
    @NeedsContext
    private JSLintResult buildResults(final String systemId, final long startNanos, final long endNanos) {
        return (JSLintResult) contextFactory.call(new ContextAction() {
            public Object run(Context cx) {
                ResultBuilder b = new JSLintResult.ResultBuilder(systemId);
                b.duration(TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos));
                for (Issue issue : readErrors(systemId)) {
                    b.addIssue(issue);
                }

                // Collect a report on what we've just linted.
                b.report(callReport(false));

                // Extract JSLINT.data() output and set it on the result.
                Object o = lintFunc.get("data", lintFunc);
                // Real JSLINT will always have this, but some of my test stubs don't.
                if (o != UniqueTag.NOT_FOUND) {
                    Function reportFunc = (Function) o;
                    Scriptable data = (Scriptable) reportFunc.call(cx, lintFunc, null,
                            Context.emptyArgs);
                    for (String global : Util.listValueOfType("global", String.class, data)) {
                        b.addGlobal(global);
                    }
                    b.json(Util.booleanValue("json", data));
                    for (JSFunction f : Util.listValue("functions", data, new JSFunctionConverter())) {
                        b.addFunction(f);
                    }
                }

                // Extract the list of properties. Note that we don't expose the counts, as it
                // doesn't seem that useful.
                Object properties = lintFunc.get("property", lintFunc);
                if (properties != UniqueTag.NOT_FOUND) {
                    for (Object id: ScriptableObject.getPropertyIds((Scriptable) properties)) {
                        b.addProperty(id.toString());
                    }
                }

                return b.build();
            }
        });
    }
View Full Code Here

Examples of gov.nist.scap.xccdf.document.ResultBuilder

  }

  protected abstract ResultBuilder newResultBuilder();

  public ResultContent generateResults() throws IOException {
        ResultBuilder resultBuilder = newResultBuilder();
    resultBuilder.setStartTime(startTime);

    if (options.getTailoringInstance() != null) {
      resultBuilder.appendTailoring(options.getTailoringInstance());
    }

    if (options.getProfileId() != null) {
      resultBuilder.setProfileId(options.getProfileId());
    }

    resultBuilder.setTitle(getTitle(document.getId(), options.getProfileId(),
        startTime), "en-US");

    resultBuilder.setTestSystem(applicationProperties.getApplicationName()
        + " " + applicationProperties.getBuildVersion());

    // TODO: P5: find a way to populate the privileged and authenticated values correctly
    resultBuilder.appendIdentity(System.getProperty("user.name"), false, true);

    appendTargetAndFacts(resultBuilder);

    // TODO: P2: investigate if included values should be limited to evaluated rules or all rules
    // Currently using evaluated rules
    for (RuleResult ruleResult : ruleResultMap.values()) {
      resultBuilder.appendRuleResult(ruleResult, xccdfResult);
      for (Map.Entry<Value, LiteralValue> entry : ruleResult.getValuesUsed().entrySet()) {
        // TODO: P3: eliminate duplicate values
        resultBuilder.appendSetValue(entry.getKey(), entry.getValue());
      }
    }

    for (Score score : scores) {
      resultBuilder.appendScore(score);
    }

    resultBuilder.setEndTime(endTime);
    return resultBuilder.getResultContent();
  }
View Full Code Here

Examples of gov.nist.scap.xccdf.document.ResultBuilder

  }

  @Override
  public ResultBuilder newResultBuilder() {
    XCCDFDocumentImpl document = getDocument();
    ResultBuilder result;
    if (getXCCDFOptions().isStandaloneResults()) {
      // TODO: pass URL
      BenchmarkDocument.Benchmark benchmark = document.getData();
      result = new ResultBuilderImpl(benchmark.getId(), benchmark.getVersion().getStringValue(), document.getSourceContext().getUri().normalize());
    } else {
View Full Code Here

Examples of gov.nist.scap.xccdf.document.ResultBuilder

  }

  @Override
  public ResultBuilder newResultBuilder() {
    XCCDFDocumentImpl document = getDocument();
    ResultBuilder result;
    if (getXCCDFOptions().isStandaloneResults()) {
      // TODO: pass URL
      BenchmarkDocument.Benchmark benchmark = document.getData();
      result = new ResultBuilderImpl(benchmark.getId(), benchmark.getVersion().getStringValue(), document.getSourceContext().getUri().normalize());
    } else {
View Full Code Here

Examples of net.geco.control.ResultBuilder

  public void mergePools() {
    new PoolMerger(gecoControl).merge(poolStages);
  }
 
  public void exportMergedResults() {
    ResultBuilder resultBuilder = new ResultBuilder(gecoControl);
    Html html = new Html();
    for (String cat : gecoControl.registry().getCategoryNames()) {
      exportMergedResult(cat, resultBuilder, html);
    }
    try {
View Full Code Here

Examples of net.geco.control.ResultBuilder

    return pool.registry().findRunnerData(data.getRunner().getEcard());
  }
 
 
  public void buildHeats() {
    new ResultBuilder(gecoControl); // used by HeatBuilder
    HeatBuilder heatBuilder = new HeatBuilder(gecoControl);
    try {
      String filepath = StageBuilder.filepath(gecoControl.stage().getBaseDir(), "heat_startlists.csv"); //$NON-NLS-1$
      heatBuilder.generateCsvHeats(filepath, gecoControl.registry().getHeatSets().toArray(new HeatSet[0]));
    } catch (IOException e) {
View Full Code Here

Examples of net.geco.control.ResultBuilder

  @Override
  public void buildControls(GecoControl gecoControl) {
    new StageControl(gecoControl);
    new RunnerControl(gecoControl);
    new ResultBuilder(gecoControl);
    new ResultExporter(gecoControl);
    new SplitExporter(gecoControl);
    new SingleSplitPrinter(gecoControl);
    new HeatBuilder(gecoControl);
    new RegistryStats(gecoControl);
View Full Code Here

Examples of net.geco.control.ResultBuilder

  @Override
  public void buildControls(GecoControl gecoControl) {
    new StageControl(gecoControl);
    new RunnerControl(gecoControl);
    new ResultBuilder(gecoControl);
    new ResultExporter(gecoControl);
    new SplitExporter(gecoControl);
    new SingleSplitPrinter(gecoControl);
    new RegistryStats(gecoControl);
    new AutoMergeHandler(gecoControl);
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.