/** * Cannot use reserved attribute name. * @throws IOException Should not happen. */ @Test public void testInvalidAttributeName() throws IOException { final DotGraphIO<MultiAttributeData> io = DotGraphIO.getMultiAttributeGraphIO(); final Graph<MultiAttributeData> g = new TableGraph<>(); g.addConnection(Connection.create(new Point(0, 0), new Point(1, 1), MultiAttributeData.builder() .addAttribute("d", "invalid") .build())); exception.expect(IllegalArgumentException.class); exception.expectMessage(CoreMatchers.startsWith("Attribute key")); io.write(g, new StringWriter()); }
simpleMAGraph.addConnection(c, d, MultiAttributeData.builder() .addAttribute("key", "specialValue") .build()); .setLength(10d) .setMaxSpeed(100d) .addAttribute("hello", "world") .build()); TestUtil.testEnum(LengthDataIO.class);