@Test public void test() { final Object o = "G"; final String s = " + data"; int count = 0; for (final InstrumentDefinition<?> definition : TestInstrumentDefinitions.getAllInstruments()) { assertEquals(definition.accept(VISITOR), definition.getClass().getSimpleName()); assertEquals(definition.accept(VISITOR, o), definition.getClass().getSimpleName() + s); count += 2; } // assertEquals("Have not tested all methods - need to make sure that the accept() method in the // definition points to the right method:", // InstrumentDefinitionVisitor.class.getMethods().length, count); }
private String getValue(final InstrumentDefinition<?> definition, final boolean withData) { String result = definition.getClass().getSimpleName(); if (withData) { result += " + data"; } return result; }