Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseVertex


  /** Copying of a vertex with a label which is neither a string nor a VertexID is denied. */
  @Test(expected = IllegalArgumentException.class)
  public final void testVertexClone_fail4()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();vertex.addUserDatum(JUConstants.LABEL, true, UserData.SHARED);
    AbstractLearnerGraph.cloneCmpVertex(vertex, conf);
  }
View Full Code Here


  /** Normal copying successful. */
  @Test
  public final void testVertexClone1a()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();vertex.addUserDatum(JUConstants.LABEL, "name", UserData.SHARED);
    CmpVertex result = AbstractLearnerGraph.cloneCmpVertex(vertex, conf);
    Assert.assertEquals("name", result.getStringId());
    Assert.assertTrue(result.isAccept());Assert.assertFalse(result.isHighlight());Assert.assertNull(result.getColour());
    Assert.assertNull(result.getOrigState());Assert.assertEquals(JUConstants.intUNKNOWN,result.getDepth());
  }
View Full Code Here

  /** Normal copying successful. */
  @Test
  public final void testVertexClone1b()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();vertex.addUserDatum(JUConstants.LABEL, VertexID.parseID("name"), UserData.SHARED);
    CmpVertex result = AbstractLearnerGraph.cloneCmpVertex(vertex, conf);
    Assert.assertEquals("name", result.getStringId());
    Assert.assertTrue(result.isAccept());Assert.assertFalse(result.isHighlight());Assert.assertNull(result.getColour());
    Assert.assertNull(result.getOrigState());Assert.assertEquals(JUConstants.intUNKNOWN,result.getDepth());
  }
View Full Code Here

  /** Checking that attributes are preserved. */
  @Test
  public final void testVertexClone2()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();vertex.addUserDatum(JUConstants.LABEL, "name", UserData.SHARED);
    vertex.addUserDatum(JUConstants.HIGHLIGHT, 1, UserData.SHARED);
    vertex.addUserDatum(JUConstants.COLOUR, JUConstants.BLUE, UserData.SHARED);
    vertex.addUserDatum(JUConstants.ACCEPTED, false, UserData.SHARED);
    vertex.addUserDatum(JUConstants.ORIGSTATE, VertexID.parseID("test"), UserData.SHARED);
    vertex.addUserDatum(JUConstants.DEPTH, 12, UserData.SHARED);
   
    CmpVertex result = AbstractLearnerGraph.cloneCmpVertex(vertex, conf);
    Assert.assertEquals("name", result.getStringId());
    Assert.assertEquals(JUConstants.BLUE, result.getColour());
    Assert.assertFalse(result.isAccept());Assert.assertTrue(result.isHighlight());
    Assert.assertTrue(VertexID.parseID("test").equals(result.getOrigState()));Assert.assertEquals(12,result.getDepth());
   
    vertex.removeUserDatum(JUConstants.ACCEPTED);vertex.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    Assert.assertFalse(result.isAccept());
  }
View Full Code Here

  @Test
  public final void testCopyGraph0()
  {
    DirectedSparseGraph g=new DirectedSparseGraph();
    g.addVertex(new DirectedSparseVertex());
    g.addVertex(new DirectedSparseVertex());
    DirectedSparseGraph copy = DeterministicDirectedSparseGraph.copy(g);
    Assert.assertTrue(copy.getEdges().isEmpty() && copy.getVertices().isEmpty());
  }
View Full Code Here

  }
 
  @Test
  public void testGraphConstructionFail2()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("B"), UserData.SHARED);
    checkWithVertex(v, "multiple states with the same name", "testGraphConstructionFail2");
  }
View Full Code Here

  }
 
  @Test
  public void testGraphConstructionFail3()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("CONFL"), UserData.SHARED);
    checkWithVertex(v, "multiple states with the same name", "testGraphConstructionFail3");
  }
View Full Code Here

  }
 
  @Test
  public void testGraphConstructionFail4a()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("Q"), UserData.SHARED);v.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    checkWithVertex(v, "both labelled as initial states", "testGraphConstructionFail4a");
  }
View Full Code Here

  }
 
  @Test
  public void testGraphConstructionFail4b()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("Q"), UserData.SHARED);v.addUserDatum(JUConstants.INITIAL, new VertexID("aa"), UserData.SHARED);
    checkWithVertex(v, "invalid init property", "testGraphConstructionFail4b");
  }
View Full Code Here

  }
 
  @Test
  public void testGraphConstructionFail5a()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);v.addUserDatum(JUConstants.LABEL, new VertexID("Q"), UserData.SHARED);v.addUserDatum(JUConstants.INITIAL, "aa", UserData.SHARED);
    checkWithVertex(v, "invalid init property", "testGraphConstructionFail5a");
  }
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.impl.DirectedSparseVertex

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.