Package nz.ac.waikato.modeljunit.examples

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


    assertEquals(enabled0, model.enabledGuards());
  }

  public void testFailureContinues()
  {
    SimpleSetWithAdaptor sut = new SimpleSetWithAdaptor(new StringSetBuggy());
    Model model = new Model(sut);
    model.addListener(new VerboseListener());
    int addS1 = model.getActionNumber("addS1");
    try {
      assertTrue(model.doAction(addS1));
View Full Code Here


    }
  }

  public void testFailure()
  {
    SimpleSetWithAdaptor sut = new SimpleSetWithAdaptor(new StringSetBuggy());
    Model model = new Model(sut);
    model.addListener(new StopOnFailureListener());
    int addS1 = model.getActionNumber("addS1");
    try {
      assertTrue(model.doAction(addS1));
      fail("Action delS2 (with sut=StringSetBuggy) should have failed");
    }
    catch (TestFailureException ex) {
      assertEquals("failure in action addS1 from state FF due to ",
          ex.getMessage().subSequence(0, 45));
      assertEquals("FF", ex.getState());
      assertEquals("addS1", ex.getActionName());
      assertEquals(sut, ex.getModel());
      assertEquals(sut.getClass().getName(), ex.getModelName());
      List<Transition> trs = ex.getSequence();
      assertEquals(0, trs.size());
    }
  }
View Full Code Here

TOP

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

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.