Plugin { public String getDocumentVersion() { String result = null; final String simpleName = this.getClass().getSimpleName(); final String[] split = simpleName.split("_"); if (split.length == 4) { result = split[3]; } return result; } Plugin(String documentType, String documentName); protected  Plugin(String documentType, String documentName, boolean validating); void init(); String getDocumentType(); String getDocumentName(); LoopDescriptor[] getLoopDescriptors(); LoopDescriptor query(String segment, String currentLoopStack, int currentLevel, Set<String> resultFlags); static int getCount(); @Override String toString(); void prepare(); boolean isValidating(); PluginControllerImpl createController(String standard, Tokenizer tokenizer); String getDocumentVersion(); PluginDiff compare(Plugin pluginB); static final String ANY_CONTEXT; static final String INITIAL_CONTEXT; static final String CURRENT; }
@Test public void canGetDocumentVersionFromPluginName() { assertNull(plugin.getDocumentVersion()); assertEquals("Four", new Plugin_Two_Three_Four().getDocumentVersion()); }