DatabaseInformations implements Serializable { public DatabaseInformations(int selectedRequestIndex) throws SQLException, NamingException { super(); this.selectedRequestIndex = selectedRequestIndex; final Connection connection = getConnection(); assert connection != null; try { database = Database.getDatabaseForConnection(connection); requestNames = database.getRequestNames(); final String request = database .getRequestByName(requestNames.get(selectedRequestIndex)); result = executeRequest(connection, request, null); } finally { connection.close(); } } DatabaseInformations(int selectedRequestIndex); static int parseRequestIndex(String requestIndex); int getNbColumns(); int getSelectedRequestIndex(); String getSelectedRequestName(); String[][] getResult(); List<String> getRequestNames(); static String explainPlanFor(String sqlRequest); @Override String toString();  }
@Test public void testDatabaseInformations() throws SQLException, NamingException { final int requestIndex = 0; final DatabaseInformations databaseInformations = new DatabaseInformations(requestIndex); assertSame("getSelectedRequestIndex", requestIndex, databaseInformations.getSelectedRequestIndex()); assertNotNull("getSelectedRequestName", databaseInformations.getSelectedRequestName()); assertNotNull("getNbColumns", databaseInformations.getNbColumns()); assertNotNull("getResult", databaseInformations.getResult()); assertNotNull("getRequestNames", databaseInformations.getRequestNames()); assertNotNull("toString", databaseInformations.toString()); }