Package nz.ac.waikato.modeljunit

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


      tester.addCoverageMetric(new TransitionCoverage());
      tester.addCoverageMetric(new TransitionPairCoverage());
     
      tester.addListener(new StopOnFailureListener());
     
      tester.generate(10000);
     
      tester.printCoverage();
    }
   
    public void testAddDelRowModel()
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

   
    // 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

    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

  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

        GreedyTester tester = new GreedyTester(loadModelClass(project));
        CoverageMetric metric = new TransitionCoverage();
        tester.addCoverageMetric(metric);
        int i = 1;
        while (metric.getMaximum() == -1) {
            tester.generate(i);
            i++;
        }
        mMaximum = metric.getMaximum();
    }
View Full Code Here

  /** An example of generating tests from this model. */
  public static void main(String[] args)
  {
    Tester tester = new GreedyTester(new SimpleSet());
    tester.addListener(new VerboseListener());
    tester.generate(100);
  }
}
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.