Package nz.ac.waikato.modeljunit

Examples of nz.ac.waikato.modeljunit.Tester.generate()


        metric.clear();
        tester.reset();
        tester.setRandom(new Random(seed));
        int count = 0;
        while (metric.getPercentage() < 100.0) {
          tester.generate(1);
          if (model.getTime() > lastTime) {
            lastTime = model.getTime();
          } else {
            testSeqTime += lastTime;
            //System.out.println("added " + lastTime + " secs");
View Full Code Here


    //tester.addListener("verbose");
    //GraphListener graphListener = tester.buildGraph();
   
    try {
      for (int count = 0; count < 1000000; count += 1000) {
        tester.generate(1000);
        System.out.println(count);
      }
      //graphListener.printGraphDot("TrafficLight.dot");
    }
    catch (Exception ex) {
View Full Code Here

   
    // uncoment this line if you want to stop when the first error is found.
    // tester.addListener(new StopOnFailureListener());
   
    tester.addCoverageMetric(new TransitionCoverage());
    tester.generate(50);
    tester.printCoverage();
  }
}
View Full Code Here

  public static void main(String[] args)
  {
    Set<String> sut = new HashSet<String>();
    Tester tester = new GreedyTester(new SmartSetAdaptor(sut));
    tester.addListener("verbose");
    tester.generate(100);
  }
}
View Full Code Here

    CoverageMetric actions = tester.addCoverageMetric(new ActionCoverage());
    tester.addListener("verbose");
    // this illustrates how to generate tests upto a given level of coverage.
    int steps = 0;
    while (actions.getPercentage() < 100 /* || steps < 1000*/) {
      tester.generate();
      steps++;
    }
    System.out.println("Generated "+steps+" steps.");
    tester.printCoverage();
  }
View Full Code Here

    Set<String> sut = new StringSet();
    Tester tester = new GreedyTester(new SimpleSetWithAdaptor(sut));
    tester.addCoverageMetric(new TransitionCoverage());
    tester.addListener(new VerboseListener());
    tester.addListener(new StopOnFailureListener());
    tester.generate(60);
    tester.printCoverage(); // print the model coverage information
  }
}
View Full Code Here

    tester.buildGraph(100000);
    CoverageHistory hist = new CoverageHistory(new TransitionCoverage(), 1);
    tester.addCoverageMetric(hist);
    tester.addListener("verbose");
    while (hist.getPercentage() < 99.0)
      tester.generate();
    System.out.println("Transition Coverage ="+hist.toString());
    System.out.println("History = "+hist.toCSV());
  }
}
View Full Code Here

    // ask to print the generated tests
    tester.addListener("verbose");

    // generate a small test suite of 20 steps (covers 4/5 transitions)
    tester.generate(20);

    tester.getModel().printMessage(trCoverage.getName() + " was "
        + trCoverage.toString());
  }
}
View Full Code Here

  public static void main(String[] args)
  {
    Tester tester = new GreedyTester(new AlarmClockOld());
    System.out.println("------------------------");
    tester.setRandom(new Random());
    tester.generate(100);
    GraphListener listener = tester.buildGraph();
    try {
      listener.printGraphDot("OriginalAlarmClock.dot");
    }
    catch (FileNotFoundException e) {
View Full Code Here

  public static void main(String[] args)
  {
    Tester tester = new GreedyTester(new AlarmClock());
    tester.setRandom(new Random());
    tester.generate(100);
    GraphListener listener = tester.buildGraph();
    try {
      listener.printGraphDot("AlarmClock.dot");
    }
    catch (FileNotFoundException e) {
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.