@Test public void queryTest() { tableXMLFormatter = new TableXMLFormatter(schemaExtractor, QUERY); String expected = "<schema>" + "<table name=\"users\">" + "<column name=\"username\" type=\"varchar\" notnull=\"true\"/>" + "<column name=\"email\" type=\"varchar\" notnull=\"true\"/>" + "</table>" + "</schema>"; String actual = tableXMLFormatter.getSchemaXml(); Assert.assertEquals(expected, actual); }
public String getSchemaXml() { String result= "<schema>"; Map<String, TableSchema> tableSchemas = schemaExtractor.getTablesFromQuery(query); for (TableSchema tableSchema : tableSchemas.values()) { result += getTableSchemaXml(tableSchema); } result += "</schema>"; return result; }
TableXMLFormatter { public String getSchemaXml() { String result= "<schema>"; Map<String, TableSchema> tableSchemas = schemaExtractor.getTablesFromQuery(query); for (TableSchema tableSchema : tableSchemas.values()) { result += getTableSchemaXml(tableSchema); } result += "</schema>"; return result; } }
TableXMLFormatter { public String getSchemaXml() { String result= "<schema>"; Map<String, TableSchema> tableSchemas = schemaExtractor.getTablesFromQuery(query); for (TableSchema tableSchema : tableSchemas.values()) { result += getTableSchemaXml(tableSchema); } result += "</schema>"; return result; } TableXMLFormatter(ISchemaExtractor schemaExtractor, String query); }
TableXMLFormatter { public String getSchemaXml() { String result= "<schema>"; Map<String, TableSchema> tableSchemas = schemaExtractor.getTablesFromQuery(query); for (TableSchema tableSchema : tableSchemas.values()) { result += getTableSchemaXml(tableSchema); } result += "</schema>"; return result; } TableXMLFormatter(ISchemaExtractor schemaExtractor, String query); String getSchemaXml(); }
TableXMLFormatter { public String getSchemaXml() { String result= "<schema>"; Map<String, TableSchema> tableSchemas = schemaExtractor.getTablesFromQuery(query); for (TableSchema tableSchema : tableSchemas.values()) { result += getTableSchemaXml(tableSchema); } result += "</schema>"; return result; } TableXMLFormatter(ISchemaExtractor schemaExtractor, String query); String getSchemaXml();  }