test_class.declarator: logger = LoggerFactory.getLogger(HtmlSchemaParserTest.class)
test_class.modifier: private final static
test_class.original_string: private final static Logger logger = LoggerFactory.getLogger(HtmlSchemaParserTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: htmlSchemaGuesser
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HtmlSchemaParser htmlSchemaGuesser;
test_class.type: HtmlSchemaParser
test_class.var_name: htmlSchemaGuesser
test_class.declarator: htmlSerializer
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HtmlSerializer htmlSerializer;
test_class.type: HtmlSerializer
test_class.var_name: htmlSerializer
test_class.declarator: htmlFormatFamily
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HtmlFormatFamily htmlFormatFamily;
test_class.type: HtmlFormatFamily
test_class.var_name: htmlFormatFamily
test_class.declarator: unsupportedFormatFamily
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private UnsupportedFormatFamily unsupportedFormatFamily;
test_class.type: UnsupportedFormatFamily
test_class.var_name: unsupportedFormatFamily
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/schema/html/HtmlSerializerTest.java
test_class.identifier: HtmlSerializerTest
test_class.superclass: extends AbstractSchemaTestUtils
test_case.body: @Test
      public void html_serializer() throws Exception {
  
          final SchemaParser.Request request;
          final Schema result;
          try (InputStream inputStream = this.getClass().getResourceAsStream("sales-force.xls")) {
              // We do know the format and therefore we go directly to the HTML schema guessing
              request = getRequest(inputStream, "#2");
              request.getMetadata().setEncoding("UTF-16");
  
              result = htmlSchemaGuesser.parse(request);
          }
  
          try (InputStream inputStream = this.getClass().getResourceAsStream("sales-force.xls")) {
  
              request.getMetadata().getRowMetadata().setColumns(result.getSheetContents().get(0).getColumnMetadatas());
  
              InputStream jsonStream = htmlSerializer.serialize(inputStream, request.getMetadata(), -1);
  
              String json = IOUtils.toString(jsonStream, UTF_8);
  
              logger.debug("json: {}", json);
  
              ObjectMapper mapper = new ObjectMapper();
  
              CollectionType collectionType =
                      mapper.getTypeFactory().constructCollectionType(ArrayList.class, TreeMap.class);
  
              List<Map<String, String>> values = mapper.readValue(json, collectionType);
  
              logger.debug("values: {}", values);
  
              Map<String, String> row0 = values.get(0);
  
              Assertions.assertThat(row0).contains(MapEntry.entry("0000", "000001"), //
                      MapEntry.entry("0001", "aaa"), //
                      MapEntry.entry("0002", "France"), //
                      MapEntry.entry("0003", "x@talend.com"));
          }
      }
test_case.class_method_signature: HtmlSerializerTest.html_serializer()
test_case.full_signature: @Test public void html_serializer()
test_case.identifier: html_serializer
test_case.invocations: getResourceAsStream getClass getRequest setEncoding getMetadata parse getResourceAsStream getClass setColumns getRowMetadata getMetadata getColumnMetadatas get getSheetContents serialize getMetadata toString debug constructCollectionType getTypeFactory readValue debug get contains assertThat entry entry entry entry
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void html_serializer()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(HtmlSerializer.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(HtmlSerializer.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: executor
focal_class.modifier: @Resource(name = "serializer#html#executor")
      private
focal_class.original_string: @Resource(name = "serializer#html#executor")
      private TaskExecutor executor;
focal_class.type: TaskExecutor
focal_class.var_name: executor
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/schema/html/HtmlSerializer.java
focal_class.identifier: HtmlSerializer
focal_class.interfaces: implements Serializer
focal_class.class_method_signature: HtmlSerializer.serialize(InputStream rawContent, DataSetMetadata metadata, long limit)
focal_class.full_signature: @Override public InputStream serialize(InputStream rawContent, DataSetMetadata metadata, long limit)
focal_class.identifier: serialize
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream rawContent, DataSetMetadata metadata, long limit)
focal_class.return: InputStream
focal_class.signature: InputStream serialize(InputStream rawContent, DataSetMetadata metadata, long limit)
focal_class.class_method_signature: HtmlSerializer.deserialize(InputStream rawContent, DataSetMetadata dataSetMetadata, OutputStream jsonOutput,
              long limit)
focal_class.full_signature: private void deserialize(InputStream rawContent, DataSetMetadata dataSetMetadata, OutputStream jsonOutput,
              long limit)
focal_class.identifier: deserialize
focal_class.modifiers: private
focal_class.parameters: (InputStream rawContent, DataSetMetadata dataSetMetadata, OutputStream jsonOutput,
              long limit)
focal_class.return: void
focal_class.signature: void deserialize(InputStream rawContent, DataSetMetadata dataSetMetadata, OutputStream jsonOutput,
              long limit)
focal_method.body: @Override
      public InputStream serialize(InputStream rawContent, DataSetMetadata metadata, long limit) {
          try {
              PipedInputStream pipe = new PipedInputStream();
              PipedOutputStream jsonOutput = new PipedOutputStream(pipe);
  
              Runnable r = () -> deserialize(rawContent, metadata, jsonOutput, limit);
              executor.execute(r);
              return pipe;
          } catch (IOException e) {
              throw new TDPException(CommonErrorCodes.UNABLE_TO_SERIALIZE_TO_JSON, e);
          }
      }
focal_method.class_method_signature: HtmlSerializer.serialize(InputStream rawContent, DataSetMetadata metadata, long limit)
focal_method.full_signature: @Override public InputStream serialize(InputStream rawContent, DataSetMetadata metadata, long limit)
focal_method.identifier: serialize
focal_method.invocations: deserialize execute
focal_method.modifiers: @Override public
focal_method.parameters: (InputStream rawContent, DataSetMetadata metadata, long limit)
focal_method.return: InputStream
focal_method.signature: InputStream serialize(InputStream rawContent, DataSetMetadata metadata, long limit)