Package statechum.Helper

Examples of statechum.Helper.whatToRun


  @Test
  public void testLabelStatesAwayFromRoot4()
  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->C-a->A-b->B-a->D / C-b->C","testLabelStatesAwayFromRoot1",config, converter);
   
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        MarkovPassivePairSelection.labelStatesAwayFromRoot(graph,3);
      }
View Full Code Here


  @Test
  public void testIdentifyUncoveredTransitions1()
  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->D-b->C / A-c->B-b->C / B-u->E","testIdentifyUncoveredTransitions1a",config, converter);
    final LearnerGraph reference = FsmParser.buildLearnerGraph("A-a->D-b->C / A-c->B-b->C / B-u->E / B-x->B / T-b->T-u->T","testIdentifyUncoveredTransitions1b",config, converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        MarkovPassivePairSelection.identifyUncoveredTransitions(graph,reference);
      }
View Full Code Here

  @Test
  public void testIdentifyUncoveredTransitions6()
  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->D-b->C / A-c->B-b->C1 / B-u->E","testIdentifyUncoveredTransitions2a",config, converter);
    final LearnerGraph reference = FsmParser.buildLearnerGraph("A-a->D","testIdentifyUncoveredTransitions3",config, converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        MarkovPassivePairSelection.identifyUncoveredTransitions(graph,reference);
      }
View Full Code Here

  @Test
  public void testTrimUncoveredTransitions2()
  {
    final LearnerGraph graph = FsmParser.buildLearnerGraph("A-a->D-b->C / A-c->B-b->C1 / B-u->E","testIdentifyUncoveredTransitions2a",config, converter);
    final LearnerGraph reference = FsmParser.buildLearnerGraph("A-a->D","testIdentifyUncoveredTransitions3",config, converter);
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        MarkovPassivePairSelection.trimUncoveredTransitions(graph,reference);
      }
View Full Code Here

  @Test
  public void testConstructSurroundingTransitions9()
  {
    final LearnerGraph fsm = FsmParser.buildLearnerGraph("A-t->B-b->C", "testTracePath1",config,converter);
    final Collection<Map.Entry<Label,CmpVertex>> surroundingTransitions = MarkovPassivePairSelection.obtainSurroundingTransitions(fsm, MarkovClassifier.computeInverseGraph(fsm), fsm.findVertex("A"));
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run() throws NumberFormatException
      {
        surroundingTransitions.iterator().next().setValue(fsm.findVertex("A"));
      }
View Full Code Here

 
  @Test
  public void testUniquePaths1()
  {
    final LearnerGraph fsm = new LearnerGraph(config);fsm.initEmpty();
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run()
      {
        MarkovClassifier.calculateFractionOfStatesIdentifiedBySingletons(fsm);
      }
    }, IllegalArgumentException.class, "empty reference");
    Helper.checkForCorrectException(new whatToRun() {
      @Override
      public void run()
      {
        MarkovClassifier.calculateFractionOfIdentifiedStates(fsm,null);
      }
View Full Code Here

   
  /** Tests label interpretation: unknown label. */
  @Test
  public final void testLabelInterpretation_fail2()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ba.interpretInputLabel("d");
    }},IllegalArgumentException.class,"unrecognised label");
  }
View Full Code Here

 
  /** Tests parser of expressions. */
  @Test
  public final void testExpr12a()
  {
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ba.interpretString("");
    }},IllegalArgumentException.class,"unexpected end");
   
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ba.computeAlphabet("");
    }},IllegalArgumentException.class,"unexpected end");
  }
View Full Code Here

  @Test
  public final void testWriteAugment3()
  {
    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(removeTagFromString(xmlData,ELEM_KINDS.ELEM_AUGMENTPTA).getBytes()),false);
    loader.config = Configuration.getDefaultConfiguration();
    checkForCorrectException(new whatToRun() { public void run() {
      loader.readAugmentPTA(loader.expectNextElement(statechum.analysis.learning.observers.TestRecordProgressDecorator.junkTag));
    }},IllegalArgumentException.class,"cannot load augmentPTA data");
  }
View Full Code Here

    dumper.topElement.appendChild(augmentElement);dumper.close();
    xmlData = output.toString();

    final LearnerSimulator loader = new LearnerSimulator(new ByteArrayInputStream(xmlData.getBytes()),false);
    loader.config = Configuration.getDefaultConfiguration();
    checkForCorrectException(new whatToRun() { public void run() {
      loader.readAugmentPTA(loader.expectNextElement(ELEM_KINDS.ELEM_AUGMENTPTA.name()));
    }},IllegalArgumentException.class,"missing sequence");
  }
View Full Code Here

TOP

Related Classes of statechum.Helper.whatToRun

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.