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

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


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


  /** Unlabelled copying denied. */
  @Test(expected = IllegalArgumentException.class)
  public final void testVertexClone_fail3()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();
    AbstractLearnerGraph.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().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

  /** FSMs used in testing of cloning. */
  private LearnerGraph testGraphJung,testGraphString,testGraphSame;

  static final protected OrigStatePair constructOrigPair(String a,String b)
  {
    DirectedSparseVertex aV = new DirectedSparseVertex(), bV = new DirectedSparseVertex();
    aV.addUserDatum(JUConstants.LABEL, a, UserData.SHARED);
    bV.addUserDatum(JUConstants.LABEL, b, UserData.SHARED);
    return new OrigStatePair(aV,bV);
  }
View Full Code Here

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

  /** Unlabelled copying denied. */
  @Test(expected = IllegalArgumentException.class)
  public final void testVertexClone_fail3()
  {
    Configuration conf = Configuration.getDefaultConfiguration().copy();conf.setAllowedToCloneNonCmpVertex(true);
    DirectedSparseVertex vertex = new DirectedSparseVertex();
    AbstractLearnerGraph.cloneCmpVertex(vertex, conf);
  }
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.