Package nz.ac.waikato.modeljunit.examples

Examples of nz.ac.waikato.modeljunit.examples.SimpleSet


  public static void testGetRandomNumber()
  {
    TestFailureException exception = new TestFailureException();
    exception.setSequence(new ArrayList<Transition>());
    ShortenFailure sut = new ShortenFailure(new RandomTester(new SimpleSet()),
        exception);

    assertTrue(sut.getRandomNumber(0) == 0); //modified

    for (int i = 0; i < 10; i++) //check number is within the range
View Full Code Here


  public static void testGetRefinedSequence()
  {
    TestFailureException exception = new TestFailureException();
    exception.setSequence(new ArrayList<Transition>());
    ShortenFailure sut = new ShortenFailure(new RandomTester(new SimpleSet()),
        exception);
    List<Transition> list = new ArrayList<Transition>();
    list.add(new Transition("1", "a1", "2")); //0
    list.add(new Transition("2", "a2", "3")); //1
    list.add(new Transition("3", "a1", "3")); //2
View Full Code Here

  public static void testAddToHashTable()
  {
    TestFailureException exception = new TestFailureException();
    exception.setSequence(new ArrayList<Transition>());
    ShortenFailure sut = new ShortenFailure(new RandomTester(new SimpleSet()),
        exception);
    HashMap<String, ArrayList<Integer>> table = new HashMap<String, ArrayList<Integer>>();
    sut.addToHashTable(table, "1", 0);
    sut.addToHashTable(table, "3", 2);
    sut.addToHashTable(table, "3", 3);
View Full Code Here

  public static void testFindAllSequenceCycles()
  {
    TestFailureException exception = new TestFailureException();
    exception.setSequence(new ArrayList<Transition>());
    ShortenFailure sut = new ShortenFailure(new RandomTester(new SimpleSet()),
        exception);
    List<Transition> list = new ArrayList<Transition>();
    list.add(new Transition("1", "a1", "2")); //0
    list.add(new Transition("2", "a2", "3")); //1
    list.add(new Transition("3", "a1", "3")); //2
View Full Code Here

  public void testGetShortest()
  {
    TestFailureException exception = new TestFailureException();
    exception.setSequence(new ArrayList<Transition>());
    ShortenFailure sut = new ShortenFailure(new RandomTester(new SimpleSet()),
        exception);
    List<Transition> list = new ArrayList<Transition>();
    list.add(new Transition("1", "a1", "2")); //0
    list.add(new Transition("2", "a2", "3")); //1
    list.add(new Transition("3", "a1", "3")); //2
View Full Code Here

  public void testAreListsEqual()
  {
    TestFailureException exception = new TestFailureException();
    exception.setSequence(new ArrayList<Transition>());
    ShortenFailure sut = new ShortenFailure(new RandomTester(new SimpleSet()),
        exception);
    List<Transition> list1 = new ArrayList<Transition>();
    list1.add(new Transition("1", "a1", "2")); //0
    list1.add(new Transition("2", "a2", "3")); //1
    list1.add(new Transition("3", "a1", "3")); //2
View Full Code Here

  protected List<Transition> path;
  protected CoverageMetric transitions;

  @Before
  public void setUp()   {
    tester = new QuickTester(new SimpleSet());
    transitions = tester.addCoverageMetric(new TransitionCoverage());
    path = new ArrayList<Transition>();
    tester.addListener(new AbstractListener() {
      private Object lastState = "";
      public String getName()
View Full Code Here

  protected List<Transition> path;
  protected CoverageMetric transitions;

  public void setUp()
  {
    tester = new LookaheadTester(new SimpleSet());
    transitions = tester.addCoverageMetric(new TransitionCoverage());
    path = new ArrayList<Transition>();
    tester.addListener(new AbstractListener() {
      private Object lastState = "";
      public String getName()
View Full Code Here

    assertEquals(10, tester.getNewTransValue());
  }
 
  public void testGraph() throws FileNotFoundException
  {
    Tester test = new GreedyTester(new SimpleSet());
    GraphListener graph = (GraphListener) test.addListener("graph");
    test.buildGraph();
    graph.printGraphDot("simpleset.dot");
  }
View Full Code Here

    assertEquals(16, transitions.getCoverage());
    assertEquals(4, tester.getMaxLength());
  }
 
  public void testConstructor() {
    LookaheadTester tester = new LookaheadTester(new Model(new SimpleSet()));
    assertEquals("Lookahead Walk", tester.getName());
    assertEquals("At each state, this test generator looks ahead through all" +
        " the known paths, upto a fixed DEPTH, to find the path" +
        " that leads to an Action or a Transition that has not yet" +
        " been explored.  Can be exponentially slow if DEPTH is set" +
View Full Code Here

TOP

Related Classes of nz.ac.waikato.modeljunit.examples.SimpleSet

Copyright © 2018 www.massapicom. 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.