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

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


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


  /** Unlabelled states. */
  @Test
  public final void testGraphConstructionFail7()
  {
    DirectedSparseVertex v = new DirectedSparseVertex();
    //v.addUserDatum(JUConstants.INITIAL, false, UserData.SHARED);
    v.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    checkWithVertex(v, "is not labelled", "testGraphConstructionFail7")
  }
View Full Code Here

  /** Non-CmpVertex copying denied. */
  @Test(expected = IllegalArgumentException.class)
  public final void testVertexClone_fail2()
  {
    Configuration conf = Configuration.getDefaultConfiguration();conf.setAllowedToCloneNonCmpVertex(false);
    DirectedSparseVertex vertex = new DirectedSparseVertex();vertex.addUserDatum(JUConstants.LABEL, "name", UserData.SHARED);
    LearnerGraph.cloneCmpVertex(vertex, conf);
  }
View Full Code Here

  /** Unlabelled copying denied. */
  @Test(expected = IllegalArgumentException.class)
  public final void testVertexClone_fail3()
  {
    Configuration conf = Configuration.getDefaultConfiguration();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();
    LearnerGraph.cloneCmpVertex(vertex, conf);
  }
View Full Code Here

  /** 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();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();vertex.addUserDatum(JUConstants.LABEL, true, UserData.SHARED);
    LearnerGraph.cloneCmpVertex(vertex, conf);
  }
View Full Code Here

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

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

  /** Checking that attributes are preserved. */
  @Test
  public final void testVertexClone2()
  {
    Configuration conf = Configuration.getDefaultConfiguration();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);
   
    CmpVertex result = LearnerGraph.cloneCmpVertex(vertex, conf);
    Assert.assertEquals("name", result.getID().toString());
    Assert.assertEquals(JUConstants.BLUE, result.getColour());
    Assert.assertFalse(result.isAccept());Assert.assertTrue(result.isHighlight());
   
    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", "testGraphConstructionFail2");
  }
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.