Package statechum

Examples of statechum.StringVertex


  }

  @Test
  public void testCreateLabelToStateMap1() // test with empty data
  {
    assertTrue(createLabelToStateMap(new LinkedList<String>(), new StringVertex("junk"), null).isEmpty());
    Map<String,CmpVertex> map = new HashMap<String,CmpVertex>();
    assertSame(map,createLabelToStateMap(new LinkedList<String>(), new StringVertex("junk"), map));assertTrue(map.isEmpty());
  }
View Full Code Here


 
  @Test
  public void testCreateLabelToStateMap2() // test for no changes
  {
    Map<String,CmpVertex> trans = new HashMap<String,CmpVertex>();
    trans.put("a", new StringVertex("A"));trans.put("b", new StringVertex("A"));trans.put("c", new StringVertex("B"));
    Map<String,CmpVertex> expected = new HashMap<String,CmpVertex>();expected.putAll(trans);
    assertSame(trans,createLabelToStateMap(new LinkedList<String>(), new StringVertex("junk"),trans));
    assertTrue(expected.equals(trans));
  }
View Full Code Here

 
  @Test
  public void testCreateLabelToStateMap3() // test for correct data being added
  {
    Map<String,CmpVertex> trans = new HashMap<String,CmpVertex>();
    trans.put("a", new StringVertex("A"));trans.put("b", new StringVertex("A"));trans.put("c", new StringVertex("B"));
    Map<String,CmpVertex> expected = new HashMap<String,CmpVertex>();expected.putAll(trans);expected.put("e", new StringVertex("A"));expected.put("g", new StringVertex("A"));
    assertSame(trans,createLabelToStateMap(Arrays.asList(new String[] {"g","e"}), new StringVertex("A"),trans));
    assertTrue(expected.equals(trans));
  }
View Full Code Here

 
  @Test
  public void testCreateLabelToStateMap4() // test for correct data being added
  {
    Map<String,CmpVertex> trans = new HashMap<String,CmpVertex>();
    trans.put("a", new StringVertex("A"));trans.put("b", new StringVertex("A"));trans.put("c", new StringVertex("B"));
    Map<String,CmpVertex> expected = new HashMap<String,CmpVertex>();expected.putAll(trans);expected.put("e", new StringVertex("D"));expected.put("f", new StringVertex("D"));
    assertSame(trans,createLabelToStateMap(Arrays.asList(new String[] {"f","e"}), new StringVertex("D"),trans));
    assertTrue(expected.equals(trans));
  }
View Full Code Here

 
  @Test
  public void testCreateLabelToStateMap5() // test for correct data being added
  {
    Map<String,CmpVertex> trans = new HashMap<String,CmpVertex>();
    trans.put("a", new StringVertex("A"));trans.put("b", new StringVertex("A"));trans.put("c", new StringVertex("B"));
    Map<String,CmpVertex> expected = new HashMap<String,CmpVertex>();expected.putAll(trans);expected.put("e", new StringVertex("B"));expected.put("g", new StringVertex("B"));
    assertSame(trans,createLabelToStateMap(Arrays.asList(new String[] {"g","e"}), new StringVertex("B"),trans));
    assertTrue(expected.equals(trans));
  }
View Full Code Here

 
  @Test
  public void testCreateLabelToStateMap6() // test for correct data being added when an empty collection is passed
  {
    Map<String,CmpVertex> trans = new HashMap<String,CmpVertex>();
    Map<String,CmpVertex> expected = new HashMap<String,CmpVertex>();expected.put("e",new StringVertex("A"));expected.put("b",new StringVertex("A"));
    assertSame(trans,createLabelToStateMap(Arrays.asList(new String[] {"b","e"}), new StringVertex("A"),trans));
    assertTrue(expected.equals(trans));
  }
View Full Code Here

  }

  @Test
  public void testCreateLabelToStateMap7() // test for correct data being added when null is passed
  {
    Map<String,CmpVertex> expected = new HashMap<String,CmpVertex>();expected.put("e",new StringVertex("A"));expected.put("b",new StringVertex("A"));
    assertTrue(expected.equals(createLabelToStateMap(Arrays.asList(new String[] {"b","e"}), new StringVertex("A"),null)));
  }
View Full Code Here

  }

  @Test
  public void testCreateLabelToStateMap8() // test for correct detection of nondeterminism
  {
    Map<String,CmpVertex> trans = new HashMap<String,CmpVertex>();trans.put("a", new StringVertex("A"));trans.put("b", new StringVertex("A"));trans.put("c", new StringVertex("B"));
    boolean exceptionThrown = false;
    try
    {
      createLabelToStateMap(Arrays.asList(new String[] {"b","e"}), new StringVertex("A"),trans);
    }
    catch(IllegalArgumentException e)
    {
      assertTrue("incorrect exception thrown",e.getMessage().contains("nondeterminism"));
      exceptionThrown = true;
View Full Code Here

  public void testCreateLabelToStateMap9() // test for correct detection of nondeterminism
  {
    boolean exceptionThrown = false;
    try
    {
      createLabelToStateMap(Arrays.asList(new String[] {"b","b"}), new StringVertex("A"),null);
    }
    catch(IllegalArgumentException e)
    {
      assertTrue("incorrect exception thrown",e.getMessage().contains("nondeterminism"));
      exceptionThrown = true;
View Full Code Here

  @Test
  public void testGraphConstruction1()
  {
    LearnerGraph expected = new LearnerGraph(confString);expected.initEmpty();
    LearnerGraph graph = new LearnerGraph(buildGraph("A--a-->B-b->C-c->A","testConstruction1"),config);
    CmpVertex A = new StringVertex("A"), B = new StringVertex("B"), C = new StringVertex("C");
    expected.transitionMatrix.put(A, createLabelToStateMap(Arrays.asList(new String[] {"a"}),B,null));
    expected.transitionMatrix.put(B, createLabelToStateMap(Arrays.asList(new String[] {"b"}),C,null));
    expected.transitionMatrix.put(C, createLabelToStateMap(Arrays.asList(new String[] {"c"}),A,null));
    expected.init = expected.findVertex("A");
   
View Full Code Here

TOP

Related Classes of statechum.StringVertex

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.