toshsan / caliper

Automatically exported from code.google.com/p/caliper
Apache License 2.0
0 stars 0 forks source link

Running CaliperMain throws NPE #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

public class TestBenchmark extends SimpleBenchmark {
    public void timeRandom(int reps) {
        Random random = new Random();
        int count = 0;
        for (int i = 0; i < reps; i++) {
            count += random.nextInt(10);
        }
        System.out.println(count);
    }

    public static void main(String... args) {
        CaliperMain.main(TestBenchmark.class, new String[] {});
    }
}

What is the expected output? What do you see instead?

Scenario selection: 
  Benchmark methods: [Random]
  User parameters:   {}
  Virtual machines:  [Home]
  Selection type:    Full cartesian product

This selection yields 1 scenarios.
9
Measuring 1 trials each of 1 scenarios. Estimated runtime: 15s.
1 of 1 measurements complete: 100.0%.
Execution complete: 15.10s.
java.lang.NullPointerException
    at com.google.caliper.runner.ConsoleResultProcessor.processRun(ConsoleResultProcessor.java:110)
    at com.google.caliper.runner.CaliperRun.run(CaliperRun.java:143)
    at com.google.caliper.runner.CaliperMain.exitlessMain(CaliperMain.java:90)
    at com.google.caliper.runner.CaliperMain.main(CaliperMain.java:60)
    at com.google.caliper.runner.CaliperMain.main(CaliperMain.java:49)
    at org.example.TestBenchmark.main(TestBenchmark.java:24)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

An unexpected exception has been thrown by the caliper runner.
Please see https://sites.google.com/site/caliperusers/issues

What version of the product are you using? On what operating system?

1.0-SNAPSHOT, Mac OS X, Java(TM) SE Runtime Environment (build 1.7.0_04-b21)

Please provide any additional information below.

Original issue reported on code.google.com by jamiemcc...@gmail.com on 15 Jun 2012 at 10:42

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 1 Nov 2012 at 8:32

GoogleCodeExporter commented 9 years ago

Original comment by gak@google.com on 1 Nov 2012 at 9:19