/** 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());
}