Settings { public void addTable(final Table table) { final ConfigItemMapEntry configEntry = table.getConfigEntry(); this.addTableConfig(configEntry); } Settings(final List<ConfigBlock> rootBlocks, final ConfigItemSet viewSettings,
             final ConfigItemMapIndexed views, final Map<String, ConfigItemMapEntrySet> viewById,
             final ConfigItemMapEntrySet firstView, final ConfigItemMapNamed tablesMap,
             final ConfigItemSet configurationSettings); static Settings create(); void addTable(final Table table); void addTableConfig(final ConfigItemMapEntry configEntry); List<ConfigBlock> getRootBlocks(); void setActiveTable(final Table table); void setTables(final List<Table> tables); void setViewSetting(final String viewId, final String item, final String value);  }
@Test public void testAddTable() throws IOException { final Table table = PowerMock.createMock(Table.class); final ConfigItem item = new ConfigItem("n", "t", "v"); final ConfigItemMapEntrySingleton singleton = ConfigItemMapEntrySingleton.createSingleton("singleton", item); EasyMock.expect(table.getConfigEntry()).andReturn(singleton); PowerMock.replayAll(); final Settings s = this.createVoidSettings(); s.addTable(table); final ConfigBlock block = s.getRootBlocks().get(0); TestHelper.assertXMLUnsortedEquals( "<config:config-item-set config:name=\"ooo:view-settings\">" + "<config:config-item-map-indexed " + "config:name=\"Views\">" + "<config:config-item-map-entry>" + "<config:config-item " + "config:name=\"ViewId\" config:type=\"string\">View1</config:config-item>" + "<config:config-item-map-named config:name=\"Tables\">" + "<config:config-item-map-entry " + "config:name=\"singleton\">" + "<config:config-item config:name=\"n\" " + "config:type=\"t\">v</config:config-item>" + "</config:config-item-map-entry>" + "</config:config-item-map-named>" + "</config:config-item-map-entry>" + "</config:config-item-map-indexed>" + "</config:config-item-set>", block); }