@Test public void testAssociationJSON() throws Exception { final JSON expected = new JSON(); expected.addValues("bar", Lists.newArrayList( new YearAndValue(1920, 23f), new YearAndValue(1930, 29f))); final Map<String, Object> actual = Server.getAssociationJson(db, CORPUS, DatabaseService.PPMI_TABLE, "foo", "bar"); assertEquals(expected.data.get("xs"), actual.get("xs")); assertEquals(((List<?>) expected.data.get("columns")).get(0), ((List<?>) actual.get("columns")).get(0)); }
static final Map<String, Object> getAssociationJson(final DatabaseService db, final String corpus, final String table, final String initialWord, final String... moreWords) throws Exception { final JSON data = new JSON(); for (final String word : moreWords) data.addValues(word, db.getYearAndAssociation(corpus, table, initialWord, word)); LOG.trace("finished association {} with {} in {}", new Object[] { table, initialWord, corpus }); return data.data; }
Server { static final Map<String, Object> getAssociationJson(final DatabaseService db, final String corpus, final String table, final String initialWord, final String... moreWords) throws Exception { final JSON data = new JSON(); for (final String word : moreWords) data.addValues(word, db.getYearAndAssociation(corpus, table, initialWord, word)); LOG.trace("finished association {} with {} in {}", new Object[] { table, initialWord, corpus }); return data.data; } }
Server { static final Map<String, Object> getAssociationJson(final DatabaseService db, final String corpus, final String table, final String initialWord, final String... moreWords) throws Exception { final JSON data = new JSON(); for (final String word : moreWords) data.addValues(word, db.getYearAndAssociation(corpus, table, initialWord, word)); LOG.trace("finished association {} with {} in {}", new Object[] { table, initialWord, corpus }); return data.data; }  }
Server { static final Map<String, Object> getAssociationJson(final DatabaseService db, final String corpus, final String table, final String initialWord, final String... moreWords) throws Exception { final JSON data = new JSON(); for (final String word : moreWords) data.addValues(word, db.getYearAndAssociation(corpus, table, initialWord, word)); LOG.trace("finished association {} with {} in {}", new Object[] { table, initialWord, corpus }); return data.data; }  static void startErrorServer(final Configuration config, final ArrayList<String> messageParts); static void startServer(final DatabaseService db, final Configuration config, boolean onlyExternal); static void stopServer(); }
Server { static final Map<String, Object> getAssociationJson(final DatabaseService db, final String corpus, final String table, final String initialWord, final String... moreWords) throws Exception { final JSON data = new JSON(); for (final String word : moreWords) data.addValues(word, db.getYearAndAssociation(corpus, table, initialWord, word)); LOG.trace("finished association {} with {} in {}", new Object[] { table, initialWord, corpus }); return data.data; }  static void startErrorServer(final Configuration config, final ArrayList<String> messageParts); static void startServer(final DatabaseService db, final Configuration config, boolean onlyExternal); static void stopServer();  }