@Test public void formatResponseStringWithSourceType() throws Exception { List<Metadata> metadataList = new ArrayList<Metadata>(); List<Metadata.Field> fields = new ArrayList<Metadata.Field>(); Metadata.Item itemName = new Metadata.Item("default", "table1"); Metadata metadata = new Metadata(itemName, fields); fields.add(new Metadata.Field("field1", EnumGpdbType.Float8Type, "double")); metadataList.add(metadata); response = MetadataResponseFormatter.formatResponse(metadataList, "path.file"); StringBuilder expected = new StringBuilder("{\"PXFMetadata\":[{"); expected.append("\"item\":{\"path\":\"default\",\"name\":\"table1\"},") .append("\"fields\":[") .append("{\"name\":\"field1\",\"type\":\"float8\",\"sourceType\":\"double\",\"complexType\":false}") .append("]}]}"); assertEquals(expected.toString(), convertResponseToString(response)); }
public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException { if (LOG.isDebugEnabled()) { MetadataResponseFormatter.printMetadata(metadataList, path); } return new MetadataResponse(metadataList); }
MetadataResponseFormatter { public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException { if (LOG.isDebugEnabled()) { MetadataResponseFormatter.printMetadata(metadataList, path); } return new MetadataResponse(metadataList); } }
MetadataResponseFormatter { public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException { if (LOG.isDebugEnabled()) { MetadataResponseFormatter.printMetadata(metadataList, path); } return new MetadataResponse(metadataList); }  }
MetadataResponseFormatter { public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException { if (LOG.isDebugEnabled()) { MetadataResponseFormatter.printMetadata(metadataList, path); } return new MetadataResponse(metadataList); }  static MetadataResponse formatResponse(List<Metadata> metadataList, String path); }
MetadataResponseFormatter { public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException { if (LOG.isDebugEnabled()) { MetadataResponseFormatter.printMetadata(metadataList, path); } return new MetadataResponse(metadataList); }  static MetadataResponse formatResponse(List<Metadata> metadataList, String path);  }